Introduce a ThreadSafeRefCounted parameter to ensure being destroyed on the main...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-04-04  Youenn Fablet  <youenn@apple.com>
2
3         Introduce a ThreadSafeRefCounted parameter to ensure being destroyed on the main thread
4         https://bugs.webkit.org/show_bug.cgi?id=183988
5
6         Reviewed by Darin Adler.
7
8         No change of behavior, TrackPrivate remains destroyed on the main thread.
9
10         * platform/graphics/TrackPrivateBase.h:
11         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
12         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
13         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
14
15 2018-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
16
17         Unreviewed. Fix the build with libsoup < 2.49.91 after r230251.
18
19         Stop using ResourceHandle in SoupNetworkSession.
20
21         * platform/network/soup/SoupNetworkSession.cpp:
22         (WebCore::SoupNetworkSession::SoupNetworkSession):
23         (WebCore::authenticateCallback): Deleted.
24         (WebCore::requestStartedCallback): Deleted.
25
26 2018-04-03  Alex Christensen  <achristensen@webkit.org>
27
28         Remove unused libsoup ResourceHandle implementation
29         https://bugs.webkit.org/show_bug.cgi?id=184048
30
31         Reviewed by Michael Catanzaro.
32
33         This code is unused since r228901 so let's remove it!
34
35         * platform/network/ResourceHandle.h:
36         * platform/network/ResourceHandleInternal.h:
37         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
38         * platform/network/soup/ResourceHandleSoup.cpp:
39         (WebCore::ResourceHandle::~ResourceHandle):
40         (WebCore::ResourceHandleInternal::soupSession):
41         (WebCore::ResourceHandle::cancelledOrClientless):
42         (WebCore::ResourceHandle::ensureReadBuffer):
43         (WebCore::ResourceHandle::currentStreamPosition const):
44         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
45         (WebCore::ResourceHandle::didStartRequest):
46         (WebCore::ResourceHandle::start):
47         (WebCore::ResourceHandle::releaseForDownload):
48         (WebCore::ResourceHandle::sendPendingRequest):
49         (WebCore::ResourceHandle::cancel):
50         (WebCore::ResourceHandle::shouldUseCredentialStorage):
51         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
52         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
53         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
54         (WebCore::ResourceHandle::receivedCredential):
55         (WebCore::ResourceHandle::receivedCancellation):
56         (WebCore::ResourceHandle::receivedChallengeRejection):
57         (WebCore::ResourceHandle::platformSetDefersLoading):
58         (WebCore::sessionFromContext): Deleted.
59         (WebCore::ResourceHandle::create): Deleted.
60         (WebCore::ResourceHandle::ResourceHandle): Deleted.
61         (WebCore::isAuthenticationFailureStatusCode): Deleted.
62         (WebCore::tlsErrorsChangedCallback): Deleted.
63         (WebCore::gotHeadersCallback): Deleted.
64         (WebCore::applyAuthenticationToRequest): Deleted.
65         (WebCore::restartedCallback): Deleted.
66         (WebCore::shouldRedirect): Deleted.
67         (WebCore::shouldRedirectAsGET): Deleted.
68         (WebCore::continueAfterWillSendRequest): Deleted.
69         (WebCore::doRedirect): Deleted.
70         (WebCore::redirectSkipCallback): Deleted.
71         (WebCore::wroteBodyDataCallback): Deleted.
72         (WebCore::cleanupSoupRequestOperation): Deleted.
73         (WebCore::nextMultipartResponsePartCallback): Deleted.
74         (WebCore::sendRequestCallback): Deleted.
75         (WebCore::continueAfterDidReceiveResponse): Deleted.
76         (WebCore::startingCallback): Deleted.
77         (WebCore::networkEventCallback): Deleted.
78         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
79         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
80         (WebCore::ResourceHandle::timeoutFired): Deleted.
81         (WebCore::waitingToSendRequest): Deleted.
82         (WebCore::readCallback): Deleted.
83
84 2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>
85
86         Add missing WEBCORE_EXPORTs (for Windows shared library build)
87         https://bugs.webkit.org/show_bug.cgi?id=184279
88
89         Reviewed by Alex Christensen.
90
91         * dom/Element.h:
92         * dom/Node.h:
93         * editing/FrameSelection.h:
94         * html/DOMURL.h:
95         * html/HTMLFormElement.h:
96         * html/canvas/CanvasRenderingContext.h:
97         * platform/graphics/GraphicsContext.h:
98         * platform/graphics/PlatformDisplay.h:
99         * platform/graphics/cairo/CairoOperations.h:
100         * platform/graphics/cairo/GraphicsContextImplCairo.h:
101         * platform/graphics/texmap/TextureMapperLayer.h:
102         * platform/network/HTTPHeaderMap.h:
103         * platform/network/ResourceRequestBase.h:
104         * platform/network/ResourceResponseBase.h:
105         * platform/network/curl/AuthenticationChallenge.h:
106         * platform/network/curl/CurlFormDataStream.h:
107         * platform/network/curl/CurlRequest.h:
108         * platform/network/curl/CurlSSLHandle.h:
109         * platform/network/curl/ResourceError.h:
110         * platform/network/curl/ResourceResponse.h:
111
112 2018-04-03  Youenn Fablet  <youenn@apple.com>
113
114         RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
115         https://bugs.webkit.org/show_bug.cgi?id=184281
116         rdar://problem/39153262
117
118         Reviewed by Jer Noble.
119
120         Covered by manual testing by going to WebRTC web sites.
121
122         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
123         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
124
125 2018-04-03  Filip Pizlo  <fpizlo@apple.com>
126
127         GC shouldn't do object distancing
128         https://bugs.webkit.org/show_bug.cgi?id=184195
129
130         Reviewed by Saam Barati.
131
132         No new tests because no change in behavior.
133
134         * Sources.txt:
135         * WebCore.xcodeproj/project.pbxproj:
136         * bindings/js/JSDOMGlobalObject.cpp:
137         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
138         * bindings/js/JSDOMGlobalObject.h:
139         * bindings/js/JSDOMWindowBase.cpp:
140         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
141         * dom/Document.cpp:
142         (WebCore::Document::threadLocalCache): Deleted.
143         * dom/Document.h:
144         * page/OriginThreadLocalCache.cpp: Removed.
145         * page/OriginThreadLocalCache.h: Removed.
146
147 2018-04-03  Brent Fulgham  <bfulgham@apple.com>
148
149         Guard against keychain/certificate access outside the network process
150         https://bugs.webkit.org/show_bug.cgi?id=184214
151         <rdar://problem/38734795>
152
153         Reviewed by Youenn Fablet.
154
155         Use the ProcessPrivilege assertions to guard against accessing the Keychain from
156         a non-Networking process.
157
158         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
159         (WebCore::LocalAuthenticator::makeCredential): Assert if we access the keychain from
160         a proces other than the Network or UI process.
161         (WebCore::LocalAuthenticator::getAssertion): Ditto.
162         (WebCore::LocalAuthenticator::issueClientCertificate const): Ditto.
163         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
164         (WebCore::createAndStoreMasterKey): Ditto.
165         (WebCore::findMasterKey): Ditto.
166         (WebCore::deleteDefaultWebCryptoMasterKey): Ditto.
167         * platform/mac/SSLKeyGeneratorMac.mm:
168         (WebCore::signedPublicKeyAndChallengeString): Ditto.
169         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
170         (WebCore::createPrivateStorageSession): Ditto.
171         * platform/network/mac/ResourceHandleMac.mm:
172         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto.
173
174 2018-04-03  Youenn Fablet  <youenn@apple.com>
175
176         NetworkResourceLoader does not need to expose all redirect response headers
177         https://bugs.webkit.org/show_bug.cgi?id=184114
178         <rdar://problem/39010557>
179
180         Reviewed by Ryosuke Niwa.
181
182         No JS observable change of behavior.
183         Behavior change is observable for injected bundles since they will no longer get access to the full response.
184         List of response headers correspond to the one currently being used/exposed for redirections.
185
186         Test: http/wpt/loading/redirect-headers.html
187
188         * page/RuntimeEnabledFeatures.h:
189         (WebCore::RuntimeEnabledFeatures::setRestrictedHTTPResponseAccess):
190         (WebCore::RuntimeEnabledFeatures::restrictedHTTPResponseAccess const):
191         * platform/network/ResourceResponseBase.cpp:
192         (WebCore::isSafeToKeepRedirectionHeader):
193         (WebCore::ResourceResponseBase::sanitizeRedirectionHTTPHeaderFields):
194         * platform/network/ResourceResponseBase.h:
195
196 2018-04-03  Andy Estes  <aestes@apple.com>
197
198         [Mac] Prioritize file promises over filenames during drag and drop
199         https://bugs.webkit.org/show_bug.cgi?id=184237
200         <rdar://problem/38278076>
201
202         Reviewed by Wenson Hsieh.
203
204         When performing a drag operation where the pasteboard contains both a file path and a file
205         promise, we have historically preferred to accept the file path. Some versions of Photos.app
206         will provide both a low-resolution thumbnail as a file path and its high-resolution
207         counterpart as a file promise when dragging a photo, and our current logic leads us to
208         choose the low-quality thumbnail.
209
210         This patch changes our logic to prefer file promises over file paths. This matches the
211         behavior of Finder and ensures we accept high-resolution assets from Photos.app.
212
213         Covered by existing file promise drag tests. beginDragWithFilePromises() was updated to
214         write a bogus file path to the pasteboard along with the legitimate file promise.
215
216         * platform/mac/DragDataMac.mm:
217         (WebCore::DragData::asFilenames const):
218         * platform/mac/PasteboardMac.mm:
219         (WebCore::Pasteboard::read):
220         (WebCore::Pasteboard::readFilePaths):
221         * platform/mac/PlatformPasteboardMac.mm:
222         (WebCore::PlatformPasteboard::numberOfFiles const):
223
224 2018-04-03  Mark Lam  <mark.lam@apple.com>
225
226         Fix mis-application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION macro.
227         https://bugs.webkit.org/show_bug.cgi?id=184276
228         <rdar://problem/39109543>
229
230         Rubber-stamped by Michael Saboff.
231
232         * bindings/scripts/CodeGeneratorJS.pm:
233         (GenerateImplementation):
234         * bindings/scripts/test/JS/JSInterfaceName.cpp:
235         (WebCore::toJSNewlyCreated):
236         * bindings/scripts/test/JS/JSMapLike.cpp:
237         (WebCore::toJSNewlyCreated):
238         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
239         (WebCore::toJSNewlyCreated):
240         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
241         (WebCore::toJSNewlyCreated):
242         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
243         (WebCore::toJSNewlyCreated):
244         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
245         (WebCore::toJSNewlyCreated):
246         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
247         (WebCore::toJSNewlyCreated):
248         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
249         (WebCore::toJSNewlyCreated):
250         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
251         (WebCore::toJSNewlyCreated):
252         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
253         (WebCore::toJSNewlyCreated):
254         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
255         (WebCore::toJSNewlyCreated):
256         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
257         (WebCore::toJSNewlyCreated):
258         * bindings/scripts/test/JS/JSTestException.cpp:
259         (WebCore::toJSNewlyCreated):
260         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
261         (WebCore::toJSNewlyCreated):
262         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
263         (WebCore::toJSNewlyCreated):
264         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
265         (WebCore::toJSNewlyCreated):
266         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
267         (WebCore::toJSNewlyCreated):
268         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
269         (WebCore::toJSNewlyCreated):
270         * bindings/scripts/test/JS/JSTestIterable.cpp:
271         (WebCore::toJSNewlyCreated):
272         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
273         (WebCore::toJSNewlyCreated):
274         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
275         (WebCore::toJSNewlyCreated):
276         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
277         (WebCore::toJSNewlyCreated):
278         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
279         (WebCore::toJSNewlyCreated):
280         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
281         (WebCore::toJSNewlyCreated):
282         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
283         (WebCore::toJSNewlyCreated):
284         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
285         (WebCore::toJSNewlyCreated):
286         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
287         (WebCore::toJSNewlyCreated):
288         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
289         (WebCore::toJSNewlyCreated):
290         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
291         (WebCore::toJSNewlyCreated):
292         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
293         (WebCore::toJSNewlyCreated):
294         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
295         (WebCore::toJSNewlyCreated):
296         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
297         (WebCore::toJSNewlyCreated):
298         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
299         (WebCore::toJSNewlyCreated):
300         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
301         (WebCore::toJSNewlyCreated):
302         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
303         (WebCore::toJSNewlyCreated):
304         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
305         (WebCore::toJSNewlyCreated):
306         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
307         (WebCore::toJSNewlyCreated):
308         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
309         (WebCore::toJSNewlyCreated):
310         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
311         (WebCore::toJSNewlyCreated):
312         * bindings/scripts/test/JS/JSTestNode.cpp:
313         (WebCore::toJSNewlyCreated):
314         * bindings/scripts/test/JS/JSTestObj.cpp:
315         (WebCore::toJSNewlyCreated):
316         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
317         (WebCore::toJSNewlyCreated):
318         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
319         (WebCore::toJSNewlyCreated):
320         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
321         (WebCore::toJSNewlyCreated):
322         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
323         (WebCore::toJSNewlyCreated):
324         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
325         (WebCore::toJSNewlyCreated):
326         * bindings/scripts/test/JS/JSTestSerialization.cpp:
327         (WebCore::toJSNewlyCreated):
328         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
329         (WebCore::toJSNewlyCreated):
330         * bindings/scripts/test/JS/JSTestStringifier.cpp:
331         (WebCore::toJSNewlyCreated):
332         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
333         (WebCore::toJSNewlyCreated):
334         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
335         (WebCore::toJSNewlyCreated):
336         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
337         (WebCore::toJSNewlyCreated):
338         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
339         (WebCore::toJSNewlyCreated):
340         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
341         (WebCore::toJSNewlyCreated):
342         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
343         (WebCore::toJSNewlyCreated):
344         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
345         (WebCore::toJSNewlyCreated):
346
347 2018-04-03  Yousuke Kimoto  <yousuke.kimoto@sony.com>
348
349         [CMake] gperf path should be given when WebCore/css/makevalues.pl is executed
350         https://bugs.webkit.org/show_bug.cgi?id=184224
351
352         Reviewed by Konstantin Tokarev.
353
354         When a building evironment doens't include a path to gperf,
355         WebCore/css/makevalue.pl failes due to failing to execute gperf,
356         so the full path to gperf should be given like WebCore/css/makeprop.pl.
357
358         No new tests, no Web-facing behavior change.
359
360         * CMakeLists.txt: gperf path is given to css/makevalues.pl.
361         * css/makevalues.pl: Add an argument to handle a given gperf path.
362
363 2018-04-03  Chris Dumez  <cdumez@apple.com>
364
365         Drop MainFrame class
366         https://bugs.webkit.org/show_bug.cgi?id=184191
367
368         Reviewed by Darin Adler.
369
370         Drop MainFrame class and move contents into Page / Frame since there is a 1:1
371         relationship between the Page and the MainFrame.
372
373         This is ground work for introducing LocalFrame / RemoteFrame concepts.
374
375         * Modules/applepay/ApplePaySession.cpp:
376         (WebCore::ApplePaySession::create):
377         (WebCore::ApplePaySession::supportsVersion):
378         (WebCore::ApplePaySession::canMakePayments):
379         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
380         (WebCore::ApplePaySession::openPaymentSetup):
381         (WebCore::ApplePaySession::paymentCoordinator const):
382         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
383         (WebCore::paymentCoordinator):
384         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
385         * Modules/mediastream/UserMediaRequest.cpp:
386         * Modules/plugins/QuickTimePluginReplacement.mm:
387         * Sources.txt:
388         * WebCore.xcodeproj/project.pbxproj:
389         * accessibility/AccessibilityObject.cpp:
390         (WebCore::AccessibilityObject::mainFrame const):
391         (WebCore::AccessibilityObject::visiblePositionForBounds const):
392         * accessibility/AccessibilityObject.h:
393         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
394         * bindings/js/ScriptController.cpp:
395         * bindings/js/ScriptState.cpp:
396         * contentextensions/ContentExtensionsBackend.cpp:
397         * css/MediaQueryEvaluator.cpp:
398         (WebCore::displayModeEvaluate):
399         * dom/DOMImplementation.cpp:
400         * dom/Document.cpp:
401         * dom/DocumentMarkerController.cpp:
402         * dom/Element.cpp:
403         (WebCore::Element::removedFromAncestor):
404         * dom/EventDispatcher.cpp:
405         * dom/ScriptedAnimationController.cpp:
406         * editing/Editor.cpp:
407         (WebCore::Editor::scanSelectionForTelephoneNumbers):
408         * editing/EditorCommand.cpp:
409         * editing/SelectionRectGatherer.cpp:
410         (WebCore::SelectionRectGatherer::Notifier::~Notifier):
411         * editing/cocoa/WebContentReaderCocoa.mm:
412         * editing/markup.cpp:
413         * history/CachedFrame.cpp:
414         * history/CachedPage.cpp:
415         * history/PageCache.cpp:
416         (WebCore::destroyRenderTree):
417         * html/HTMLMediaElement.cpp:
418         * html/HTMLPlugInImageElement.cpp:
419         * html/ImageDocument.cpp:
420         * html/MediaElementSession.cpp:
421         (WebCore::isMainContentForPurposesOfAutoplay):
422         * html/canvas/WebGLRenderingContextBase.cpp:
423         * inspector/InspectorClient.cpp:
424         * inspector/InspectorController.cpp:
425         * inspector/InspectorFrontendClientLocal.cpp:
426         * inspector/InspectorFrontendHost.cpp:
427         * inspector/InspectorInstrumentation.cpp:
428         * inspector/InspectorOverlay.cpp:
429         * inspector/PageScriptDebugServer.cpp:
430         * inspector/agents/InspectorApplicationCacheAgent.cpp:
431         * inspector/agents/InspectorCanvasAgent.cpp:
432         * inspector/agents/InspectorDOMAgent.cpp:
433         * inspector/agents/InspectorPageAgent.cpp:
434         (WebCore::InspectorPageAgent::mainFrame):
435         * inspector/agents/InspectorPageAgent.h:
436         * inspector/agents/page/PageDebuggerAgent.cpp:
437         * inspector/agents/page/PageRuntimeAgent.cpp:
438         * loader/DocumentLoader.cpp:
439         * loader/DocumentWriter.cpp:
440         * loader/FrameLoader.cpp:
441         (WebCore::FrameLoader::loadWithDocumentLoader):
442         (WebCore::FrameLoader::setState):
443         * loader/HistoryController.cpp:
444         * loader/NavigationDisabler.h:
445         * loader/ProgressTracker.cpp:
446         * loader/ResourceLoadObserver.cpp:
447         * loader/ResourceLoader.cpp:
448         * loader/SubframeLoader.cpp:
449         * loader/SubresourceLoader.cpp:
450         * loader/appcache/ApplicationCacheHost.cpp:
451         * loader/archive/mhtml/MHTMLArchive.cpp:
452         * loader/cache/CachedResource.cpp:
453         * loader/cache/CachedResourceLoader.cpp:
454         * page/AutoscrollController.cpp:
455         * page/Chrome.cpp:
456         * page/ContextMenuController.cpp:
457         * page/DOMWindow.cpp:
458         * page/DebugPageOverlays.cpp:
459         (WebCore::MouseWheelRegionOverlay::updateRegion):
460         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
461         (WebCore::RegionOverlay::create):
462         (WebCore::RegionOverlay::RegionOverlay):
463         (WebCore::RegionOverlay::~RegionOverlay):
464         (WebCore::DebugPageOverlays::ensureRegionOverlayForPage):
465         (WebCore::DebugPageOverlays::showRegionOverlay):
466         (WebCore::DebugPageOverlays::hideRegionOverlay):
467         (WebCore::DebugPageOverlays::regionChanged):
468         (WebCore::DebugPageOverlays::regionOverlayForPage const):
469         (WebCore::DebugPageOverlays::updateOverlayRegionVisibility):
470         (WebCore::DebugPageOverlays::settingsChanged):
471         * page/DebugPageOverlays.h:
472         (WebCore::DebugPageOverlays::hasOverlaysForPage const):
473         (WebCore::DebugPageOverlays::hasOverlays):
474         (WebCore::DebugPageOverlays::didLayout):
475         (WebCore::DebugPageOverlays::didChangeEventHandlers):
476         * page/DragController.cpp:
477         (WebCore::DragController::performDragOperation):
478         (WebCore::DragController::tryDHTMLDrag):
479         (WebCore::DragController::beginDrag):
480         (WebCore::DragController::doSystemDrag):
481         * page/EventHandler.cpp:
482         (WebCore::EventHandler::handleMousePressEvent):
483         (WebCore::EventHandler::mouseMoved):
484         (WebCore::EventHandler::handleMouseReleaseEvent):
485         (WebCore::EventHandler::handleWheelEvent):
486         (WebCore::EventHandler::clearLatchedState):
487         (WebCore::EventHandler::defaultWheelEventHandler):
488         * page/FocusController.cpp:
489         * page/Frame.cpp:
490         (WebCore::Frame::Frame):
491         (WebCore::Frame::dropChildren):
492         (WebCore::Frame::selfOnlyRef):
493         (WebCore::Frame::selfOnlyDeref):
494         * page/Frame.h:
495         (WebCore::Frame::mainFrame const):
496         * page/FrameTree.cpp:
497         * page/FrameView.cpp:
498         (WebCore::FrameView::setFrameRect):
499         (WebCore::FrameView::setContentsSize):
500         (WebCore::FrameView::didChangeScrollOffset):
501         (WebCore::FrameView::setViewExposedRect):
502         * page/History.cpp:
503         * page/MainFrame.cpp: Removed.
504         * page/MainFrame.h: Removed.
505         * page/MemoryRelease.cpp:
506         * page/Page.cpp:
507         (WebCore::Page::Page):
508         (WebCore::m_applicationManifest):
509         (WebCore::Page::setDeviceScaleFactor):
510         (WebCore::Page::latchingState):
511         (WebCore::Page::pushNewLatchingState):
512         (WebCore::Page::resetLatchingState):
513         (WebCore::Page::popLatchingState):
514         (WebCore::Page::removeLatchingStateForTarget):
515         (WebCore::Page::setPaymentCoordinator):
516         * page/Page.h:
517         (WebCore::Page::mainFrame):
518         (WebCore::Page::mainFrame const):
519         (WebCore::Page::wheelEventDeltaFilter):
520         (WebCore::Page::pageOverlayController):
521         (WebCore::Page::servicesOverlayController):
522         (WebCore::Page::paymentCoordinator const):
523         (WebCore::Page::applicationManifest const):
524         (WebCore::Page::performanceLogging const):
525         * page/PageConsoleClient.cpp:
526         * page/PageDebuggable.cpp:
527         * page/PageGroup.cpp:
528         * page/PageGroupLoadDeferrer.cpp:
529         * page/PageOverlay.cpp:
530         (WebCore::PageOverlay::controller const):
531         * page/PageOverlayController.cpp:
532         (WebCore::PageOverlayController::PageOverlayController):
533         (WebCore::PageOverlayController::createRootLayersIfNeeded):
534         (WebCore::PageOverlayController::layerWithDocumentOverlays):
535         (WebCore::PageOverlayController::layerWithViewOverlays):
536         (WebCore::PageOverlayController::installPageOverlay):
537         (WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
538         (WebCore::PageOverlayController::didChangeViewExposedRect):
539         (WebCore::PageOverlayController::updateSettingsForLayer):
540         (WebCore::PageOverlayController::deviceScaleFactor const):
541         (WebCore::PageOverlayController::notifyFlushRequired):
542         (WebCore::PageOverlayController::tiledBackingUsageChanged):
543         * page/PageOverlayController.h:
544         * page/PageSerializer.cpp:
545         * page/PerformanceLogging.cpp:
546         (WebCore::PerformanceLogging::PerformanceLogging):
547         (WebCore::PerformanceLogging::didReachPointOfInterest):
548         * page/PerformanceLogging.h:
549         * page/PerformanceMonitor.cpp:
550         * page/ResourceUsageOverlay.cpp:
551         (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay):
552         (WebCore::ResourceUsageOverlay::initialize):
553         * page/SettingsBase.cpp:
554         * page/SpatialNavigation.cpp:
555         * page/UserContentProvider.cpp:
556         * page/ios/FrameIOS.mm:
557         * page/mac/DragControllerMac.mm:
558         * page/mac/EventHandlerMac.mm:
559         (WebCore::latchingIsLockedToPlatformFrame):
560         (WebCore::latchingIsLockedToAncestorOfThisFrame):
561         (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
562         (WebCore::EventHandler::platformPrepareForWheelEvents):
563         (WebCore::EventHandler::platformRecordWheelEvent):
564         (WebCore::EventHandler::platformCompleteWheelEvent):
565         (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent):
566         * page/mac/PageMac.mm:
567         * page/mac/ServicesOverlayController.h:
568         (WebCore::ServicesOverlayController::page const):
569         * page/mac/ServicesOverlayController.mm:
570         (WebCore::ServicesOverlayController::Highlight::Highlight):
571         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
572         (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const):
573         (WebCore::ServicesOverlayController::ServicesOverlayController):
574         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
575         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
576         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const):
577         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
578         (WebCore::ServicesOverlayController::buildSelectionHighlight):
579         (WebCore::ServicesOverlayController::hasRelevantSelectionServices):
580         (WebCore::ServicesOverlayController::createOverlayIfNeeded):
581         (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame):
582         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
583         (WebCore::ServicesOverlayController::mouseEvent):
584         (WebCore::ServicesOverlayController::handleClick):
585         (WebCore::ServicesOverlayController::mainFrame const):
586         * page/scrolling/AsyncScrollingCoordinator.cpp:
587         * page/scrolling/ScrollingCoordinator.cpp:
588         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
589         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
590         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
591         * plugins/DOMMimeType.cpp:
592         * plugins/PluginInfoProvider.cpp:
593         (WebCore::PluginInfoProvider::refresh):
594         * rendering/RenderBox.cpp:
595         * rendering/RenderLayer.cpp:
596         * rendering/RenderLayerBacking.cpp:
597         * rendering/RenderLayerCompositor.cpp:
598         (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const):
599         (WebCore::RenderLayerCompositor::updateCompositingLayers):
600         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
601         (WebCore::RenderLayerCompositor::attachRootLayer):
602         (WebCore::RenderLayerCompositor::detachRootLayer):
603         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
604         * rendering/RenderObject.cpp:
605         * replay/UserInputBridge.cpp:
606         * storage/StorageEventDispatcher.cpp:
607         * style/StyleTreeResolver.cpp:
608         (WebCore::Style::suspendMemoryCacheClientCalls):
609         * svg/SVGSVGElement.cpp:
610         * svg/graphics/SVGImage.cpp:
611         * testing/InternalSettings.cpp:
612         * testing/Internals.cpp:
613         (WebCore::Internals::Internals):
614         (WebCore::Internals::installMockPageOverlay):
615         (WebCore::Internals::pageOverlayLayerTreeAsText const):
616         * testing/MockPageOverlay.cpp:
617         * testing/MockPageOverlay.h:
618         * testing/MockPageOverlayClient.cpp:
619         (WebCore::MockPageOverlayClient::installOverlay):
620         (WebCore::MockPageOverlayClient::layerTreeAsText):
621         * testing/MockPageOverlayClient.h:
622         * testing/MockPaymentCoordinator.cpp:
623         (WebCore::MockPaymentCoordinator::MockPaymentCoordinator):
624         (WebCore::MockPaymentCoordinator::showPaymentUI):
625         (WebCore::MockPaymentCoordinator::completeMerchantValidation):
626         (WebCore::MockPaymentCoordinator::changeShippingOption):
627         (WebCore::MockPaymentCoordinator::changePaymentMethod):
628         (WebCore::MockPaymentCoordinator::acceptPayment):
629         (WebCore::MockPaymentCoordinator::cancelPayment):
630         * testing/MockPaymentCoordinator.h:
631         * workers/service/context/ServiceWorkerThreadProxy.cpp:
632
633 2018-04-03  Sihui Liu  <sihui_liu@apple.com>
634
635         The referer header is not set after redirect
636         https://bugs.webkit.org/show_bug.cgi?id=182644
637         <rdar://problem/37479048>
638
639         Reviewed by Youenn Fablet.
640
641         Update referrer policy and recompute referrer in redirection check, so Referer header would be set after it's removed from cross-origin request.
642
643         Add support for Referrer-Policy header, so referrer policy would be changed based on redirect response. 
644
645         * Sources.txt:
646         * WebCore.xcodeproj/project.pbxproj:
647         * dom/Document.cpp:
648         (WebCore::Document::processReferrerPolicy):
649         * loader/CrossOriginAccessControl.cpp:
650         (WebCore::updateRequestReferrer):
651         * loader/CrossOriginAccessControl.h:
652         * loader/ResourceLoader.h:
653         (WebCore::ResourceLoader::setReferrerPolicy):
654         (WebCore::ResourceLoader::referrerPolicy const):
655         * loader/SubresourceLoader.cpp:
656         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
657         (WebCore::SubresourceLoader::updateReferrerPolicy):
658         * loader/SubresourceLoader.h:
659         * loader/cache/CachedResourceRequest.cpp:
660         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
661         (WebCore::CachedResourceRequest::updateForAccessControl):
662         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
663         * platform/ReferrerPolicy.cpp: Added.
664         (WebCore::parseReferrerPolicy):
665         * platform/ReferrerPolicy.h:
666         * platform/network/HTTPHeaderNames.in:
667
668 2018-04-03  Chris Dumez  <cdumez@apple.com>
669
670         Make SecurityOrigin safe to create and use from any thread
671         https://bugs.webkit.org/show_bug.cgi?id=184216
672
673         Reviewed by Youenn Fablet.
674
675         We found that we have a decent amount of code constructing and using SecurityOrigin
676         objects from non-main threads. Unfortunately, this was not safe, mostly due to
677         SecurityOrigin's reliance on the SchemeRegistry.
678
679         This patch makes it safe to construct a SecurityOrigin on any thread A and use
680         it later on the same thread A. However, developers still need to call isolatedCopy()
681         if they want to pass such object to another thread B.
682
683         * page/SecurityOrigin.cpp:
684         (WebCore::SecurityOrigin::canDisplay const):
685         * page/SecurityOrigin.h:
686         * page/SecurityPolicy.cpp:
687         (WebCore::originAccessMapLock):
688         (WebCore::originAccessMap):
689         (WebCore::SecurityPolicy::isAccessWhiteListed):
690         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
691         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
692         (WebCore::SecurityPolicy::resetOriginAccessWhitelists):
693         * platform/SchemeRegistry.cpp:
694         (WebCore::schemeRegistryLock):
695         (WebCore::allBuiltinSchemes):
696         (WebCore::builtinLocalURLSchemes):
697         (WebCore::localURLSchemes):
698         (WebCore::displayIsolatedURLSchemes):
699         (WebCore::builtinSecureSchemes):
700         (WebCore::secureSchemes):
701         (WebCore::builtinSchemesWithUniqueOrigins):
702         (WebCore::schemesWithUniqueOrigins):
703         (WebCore::builtinEmptyDocumentSchemes):
704         (WebCore::emptyDocumentSchemes):
705         (WebCore::schemesForbiddenFromDomainRelaxation):
706         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
707         (WebCore::canDisplayOnlyIfCanRequestSchemes):
708         (WebCore::notAllowingJavascriptURLsSchemes):
709         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
710         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
711         (WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing):
712         (WebCore::schemesAllowingDatabaseAccessInPrivateBrowsing):
713         (WebCore::builtinCORSEnabledSchemes):
714         (WebCore::CORSEnabledSchemes):
715         (WebCore::ContentSecurityPolicyBypassingSchemes):
716         (WebCore::cachePartitioningSchemes):
717         (WebCore::serviceWorkerSchemes):
718         (WebCore::alwaysRevalidatedSchemes):
719         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
720         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
721         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
722         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
723         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
724         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
725         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
726         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
727         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
728         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
729         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
730         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
731         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
732         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
733         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
734         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
735         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
736         * platform/SchemeRegistry.h:
737
738 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
739
740         [SOUP] Stop using ResourceHandle to load GResources
741         https://bugs.webkit.org/show_bug.cgi?id=184259
742
743         Reviewed by Sergio Villar Senin.
744
745         GResources are loaded in the WebProcess using ResourceHandle because soup handles them transparently. But now
746         that we no longer use ResourceHandle, we can add a simple loader for GResources, similar to the one used for
747         data URLS, since loading a GResource is a matter of calling g_resources_lookup_data() in the end.
748
749         * SourcesGTK.txt:
750         * SourcesWPE.txt:
751         * loader/ResourceLoader.cpp:
752         (WebCore::ResourceLoader::start): Check if resource to load is a GResource and call loadGResource().
753         * loader/ResourceLoader.h:
754         * loader/soup/ResourceLoaderSoup.cpp: Added.
755         (WebCore::ResourceLoader::loadGResource): Load the GResource in a GTask thread.
756         * platform/SharedBuffer.cpp:
757         (WebCore::SharedBuffer::DataSegment::data const):
758         (WebCore::SharedBuffer::DataSegment::size const):
759         * platform/SharedBuffer.h:
760         * platform/glib/SharedBufferGlib.cpp:
761         (WebCore::SharedBuffer::SharedBuffer):
762         (WebCore::SharedBuffer::create):
763
764 2018-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>
765
766         [Enchant] Clean up TextCheckerEnchant
767         https://bugs.webkit.org/show_bug.cgi?id=184233
768
769         Reviewed by Michael Catanzaro.
770
771         Several cleanups and improvements:
772
773         * platform/text/enchant/TextCheckerEnchant.cpp:
774         (WebCore::TextCheckerEnchant::singleton): Make TextCheckerEnchant a singleton since it's always used as a
775         singleton.
776         (WebCore::TextCheckerEnchant::EnchantDictDeleter::operator() const):
777         (WebCore::TextCheckerEnchant::TextCheckerEnchant):
778         (WebCore::TextCheckerEnchant::ignoreWord): Convert to utf8 once instead of on every loop iteration.
779         (WebCore::TextCheckerEnchant::learnWord): Ditton.
780         (WebCore::TextCheckerEnchant::checkSpellingOfWord): m_enchantDictionaries is now a Vector of std::unique_ptr.
781         (WebCore::TextCheckerEnchant::getGuessesForWord): Convert to utf8 once instead of on every loop iteration.
782         (WebCore::TextCheckerEnchant::updateSpellCheckingLanguages): Get only the first language instead of building a
783         vector to get its first item. Use WTFMove to replace m_enchantDictionaries with the new Vector.
784         (WebCore::TextCheckerEnchant::loadedSpellCheckingLanguages const): Use a lambda to get the list of languages
785         already converted to String and iterate only once.
786         (WebCore::TextCheckerEnchant::availableSpellCheckingLanguages const): Ditto.
787         (WebCore::enchantDictDescribeCallback): Deleted.
788         (WebCore::TextCheckerEnchant::~TextCheckerEnchant): Deleted.
789         (WebCore::TextCheckerEnchant::freeEnchantBrokerDictionaries): Deleted.
790         * platform/text/enchant/TextCheckerEnchant.h:
791
792 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
793
794         [GTK] Segfaults in enchant_broker_free_dict()
795         https://bugs.webkit.org/show_bug.cgi?id=183738
796
797         Reviewed by Michael Catanzaro.
798
799         Check enchant_broker_request_dict() didn't return nullptr before adding it to the m_enchantDictionaries vector.
800
801         * platform/text/enchant/TextCheckerEnchant.cpp:
802         (WebCore::TextCheckerEnchant::updateSpellCheckingLanguages):
803
804 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
805
806         [GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
807         https://bugs.webkit.org/show_bug.cgi?id=183346
808
809         Reviewed by Michael Catanzaro.
810
811         This might happen if a request is cancelled right after the password request starts and before it finishes. We
812         should cancel the password search when the network request is cancelled, not only when the NetworkStorageSession
813         is destroyed.
814
815         * platform/network/NetworkStorageSession.h:
816         * platform/network/soup/NetworkStorageSessionSoup.cpp:
817         (WebCore::NetworkStorageSession::~NetworkStorageSession):
818         (WebCore::SecretServiceSearchData::SecretServiceSearchData): Helper struct to keep the request cancellable and
819         completion handler.
820         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage): Create a SecretServiceSearchData for the
821         request.
822         * platform/network/soup/ResourceHandleSoup.cpp:
823         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Pass the request cancellable to
824         NetworkStorageSession::getCredentialFromPersistentStorage().
825
826 2018-04-02  Eric Carlson  <eric.carlson@apple.com>
827
828         [Extra zoom mode] Replace video with a placeholder image during fullscreen transition
829         https://bugs.webkit.org/show_bug.cgi?id=184188
830         <rdar://problem/38940307>
831
832         Reviewed by Youenn Fablet.
833
834         * html/HTMLMediaElement.cpp:
835         (WebCore::HTMLMediaElement::willExitFullscreen):
836         * html/HTMLMediaElement.h:
837         * platform/cocoa/VideoFullscreenChangeObserver.h:
838         * platform/cocoa/VideoFullscreenModelVideoElement.h:
839         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
840         (VideoFullscreenModelVideoElement::willExitFullscreen):
841         * platform/graphics/MediaPlayer.cpp:
842         (WebCore::MediaPlayer::updateVideoFullscreenInlineImage):
843         * platform/graphics/MediaPlayer.h:
844         * platform/graphics/MediaPlayerPrivate.h:
845         (WebCore::MediaPlayerPrivateInterface::updateVideoFullscreenInlineImage):
846         * platform/graphics/VideoFullscreenLayerManager.h:
847         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
848         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
849         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
850         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
851         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
852         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
853         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
854         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
855         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
856         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
857         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
858         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
859         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h:
860         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
861         (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
862         (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage):
863         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
864         * platform/ios/VideoFullscreenInterfaceAVKit.h:
865         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
866         (VideoFullscreenInterfaceAVKit::exitFullscreen):
867         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
868         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
869         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
870         (VideoFullscreenControllerContext::willExitFullscreen):
871
872 2018-04-02  Eric Carlson  <eric.carlson@apple.com>
873
874         Define AVKit softlink macro
875         https://bugs.webkit.org/show_bug.cgi?id=184241
876
877         Reviewed by Jer Noble.
878
879         No new tests, no functional change.
880
881         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
882         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
883         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
884         * platform/ios/WebAVPlayerController.mm:
885         * platform/mac/PlaybackSessionInterfaceMac.mm:
886         * platform/mac/VideoFullscreenInterfaceMac.mm:
887
888 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
889
890         [Extra zoom mode] Update date picker UI to latest specifications
891         https://bugs.webkit.org/show_bug.cgi?id=184234
892         <rdar://problem/38804760>
893
894         Reviewed by Timothy Hatcher.
895
896         Tweak localizable strings. Day, month and year labels should be fully capitalized, and there needs to be a
897         string for the "Set" button title.
898
899         * English.lproj/Localizable.strings:
900         * platform/LocalizedStrings.cpp:
901         (WebCore::datePickerSetButtonTitle):
902         (WebCore::datePickerDayLabelTitle):
903         (WebCore::datePickerMonthLabelTitle):
904         (WebCore::datePickerYearLabelTitle):
905         * platform/LocalizedStrings.h:
906
907 2018-04-02  Ryosuke Niwa  <rniwa@webkit.org>
908
909         REGRESSION(r228260):WebHTMLView beeps at every keydown for Chinese/Japanese/Korean Input Method
910         https://bugs.webkit.org/show_bug.cgi?id=184231
911
912         Reviewed by Alexey Proskuryakov.
913
914         The bug was caused by EventHandler::internalKeyEvent calling setDefaultHandled and expecting it to stay true
915         after dispatching the event even though m_defaultHandled is always cleared after r228260. This results in
916         EventHandler::internalKeyEvent returning false, and resulting in a beep.
917
918         Unfortunately, no new tests since there is no facility to detect this case in layout tests, and we can't
919         easily emulate or trigger a real input method in API tests.
920
921         * page/EventHandler.cpp:
922         (WebCore::EventHandler::internalKeyEvent):
923
924 2018-04-02  Jer Noble  <jer.noble@apple.com>
925
926         AudioBufferSourceNode start method causes OfflineAudioContext to start running
927         https://bugs.webkit.org/show_bug.cgi?id=181939
928         <rdar://problem/36755393>
929
930         Reviewed by Eric Carlson.
931
932         Test: webaudio/offlineaudiocontext-restriction.html
933
934         Don't respect playback restrictions for offline AudioContexts.
935
936         * Modules/webaudio/AudioContext.cpp:
937         (WebCore::AudioContext::constructCommon):
938         * Modules/webaudio/AudioContext.h:
939         (WebCore::AudioContext::isOfflineContext const):
940         (WebCore::AudioContext::userGestureRequiredForAudioStart const):
941         (WebCore::AudioContext::pageConsentRequiredForAudioStart const):
942         (WebCore::AudioContext::isOfflineContext): Deleted.
943
944 2018-04-02  Alejandro G. Castro  <alex@igalia.com>
945
946         [GTK] Make libwebrtc backend buildable for GTK  port
947         https://bugs.webkit.org/show_bug.cgi?id=178860
948
949         Reviewed by Youenn Fablet.
950
951         This is the first step to add webrtc support to the GTK port using
952         the libwebrtc backend.
953
954         No new tests, no new feature added, it should be tested by current
955         tests.
956
957         * CMakeLists.txt: Add the new files to the compilation and set the
958         new includes in the libwebrtc library.
959         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
960         Reorder the includes alphabetically and add some that are missing.
961         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
962         Ditto.
963         * Sources.txt: Add new file to the compilation.
964         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
965         Added. Initial implementation for GTK and WPE.
966         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h:
967         Added. Ditto.
968         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
969         Added. Ditto.
970         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h:
971         Added. Ditto.
972         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
973         Added. Ditto.
974         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:
975         Added. Ditto.
976         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
977         Added. Ditto.
978         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
979         Added. Ditto.
980         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Added includes
981         for the compilation.
982         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Added, inherit from
983         the LibWebRTCProvider to adapt for glib.
984
985 2018-04-01  Yusuke Suzuki  <utatane.tea@gmail.com>
986
987         Use WTF::Lock instead of GMutex
988         https://bugs.webkit.org/show_bug.cgi?id=184227
989
990         Reviewed by Saam Barati.
991
992         Prefer WTF::Lock over GMutex since these locks are just protecting WebKit C++ fields.
993
994         No behavior change.
995
996         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
997         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
998         (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
999         (WebCore::AudioSourceProviderGStreamer::provideInput):
1000         (WebCore::AudioSourceProviderGStreamer::handleAudioBuffer):
1001         (WebCore::AudioSourceProviderGStreamer::clearAdapters):
1002         * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
1003         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1004         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1005         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1006         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
1007         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1008         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1009         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
1010         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
1011         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
1012         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
1013         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1014         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1015         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1016
1017 2018-03-31  Brent Fulgham  <bfulgham@apple.com>
1018
1019         Show punycode if URL contains hyphen character
1020         https://bugs.webkit.org/show_bug.cgi?id=184221
1021         <rdar://problem/38044633>
1022
1023         Reviewed by Darin Adler.
1024
1025         Revise our "lookalike character" logic to include the hyphen,
1026         non-breaking hyphen, and minus sign.
1027
1028         Test: fast/url/host.html
1029
1030         * platform/mac/WebCoreNSURLExtras.mm:
1031         (WebCore::isLookalikeCharacter):
1032
1033 2018-03-31  Filip Pizlo  <fpizlo@apple.com>
1034
1035         JSObject shouldn't do index masking
1036         https://bugs.webkit.org/show_bug.cgi?id=184194
1037
1038         Reviewed by Yusuke Suzuki.
1039
1040         No new tests because no new behavior.
1041
1042         * bindings/js/JSDOMConvertSequences.h:
1043         (WebCore::Detail::NumericSequenceConverter::convertArray):
1044         (WebCore::Detail::SequenceConverter::convertArray):
1045
1046 2018-03-30  Chris Dumez  <cdumez@apple.com>
1047
1048         REGRESSION (r229828): Facebook login popup is blank
1049         https://bugs.webkit.org/show_bug.cgi?id=184206
1050         <rdar://problem/39057006>
1051
1052         Reviewed by Wenson Hsieh.
1053
1054         Since r229828, we freeze the layer tree during the navigation policy check.
1055         We freeze in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
1056         and unfreeze in WebFrameLoaderClient::didDecidePolicyForNavigationAction().
1057
1058         WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() gets called
1059         from PolicyChecker::checkNavigationPolicy() which has 3 call sites in
1060         FrameLoader and one in DocumentLoader for redirects. The call sites in
1061         FrameLoader were taking care of calling didDecidePolicyForNavigationAction()
1062         on the FrameLoaderClient in their completion handler, but the DocumentLoader
1063         call site was failing to do so. As a result, the layer tree would stay frozen.
1064
1065         To make this a lot less error prone, I moved the call to
1066         WebFrameLoaderClient::didDecidePolicyForNavigationAction() to
1067         PolicyChecker::checkNavigationPolicy(), inside the completion handler passed
1068         to WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(). This way,
1069         even if new code starts calling PolicyChecker::checkNavigationPolicy(), we
1070         do not need to worry about letting the client know when the policy decision
1071         is made.
1072
1073         No new tests, covered by existing redirection tests with the
1074         new assertion I added.
1075
1076         * loader/FrameLoader.cpp:
1077         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
1078         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1079         * loader/PolicyChecker.cpp:
1080         (WebCore::PolicyChecker::checkNavigationPolicy):
1081
1082 2018-03-30  Devin Rousso  <webkit@devinrousso.com>
1083
1084         Web Inspector: tint all pixels drawn by shader program when hovering ShaderProgramTreeElement
1085         https://bugs.webkit.org/show_bug.cgi?id=175223
1086
1087         Reviewed by Matt Baker.
1088
1089         Test: inspector/canvas/setShaderProgramHighlighted.html
1090
1091         * html/canvas/InspectorShaderProgram.h:
1092         (WebCore::InspectorShaderProgram::highlighted):
1093         (WebCore::InspectorShaderProgram::setHighlighted):
1094
1095         * html/canvas/WebGLRenderingContextBase.cpp:
1096         (WebCore::InspectorScopedShaderProgramHighlight::InspectorScopedShaderProgramHighlight):
1097         (WebCore::InspectorScopedShaderProgramHighlight::~InspectorScopedShaderProgramHighlight):
1098         (WebCore::InspectorScopedShaderProgramHighlight::showHighlight):
1099         (WebCore::InspectorScopedShaderProgramHighlight::hideHighlight):
1100         (WebCore::InspectorScopedShaderProgramHighlight::saveBlendValue):
1101         (WebCore::InspectorScopedShaderProgramHighlight::hasBufferBinding):
1102         (WebCore::InspectorScopedShaderProgramHighlight::hasFramebufferParameterAttachment):
1103         (WebCore::WebGLRenderingContextBase::drawArrays):
1104         (WebCore::WebGLRenderingContextBase::drawElements):
1105         If the current shader program has been marked as highlighted, apply a blend right before
1106         `drawArrays` and `drawElements` is called, tinting the resulting pixels so that they are
1107         visually distinguished from pixels drawn by other shader programs.
1108
1109         * inspector/InspectorCanvasAgent.h:
1110         * inspector/InspectorCanvasAgent.cpp:
1111         (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
1112         (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
1113
1114         * inspector/InspectorInstrumentation.h:
1115         * inspector/InspectorInstrumentation.cpp:
1116         (WebCore::InspectorInstrumentation::isShaderProgramHighlighted):
1117         (WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl):
1118
1119 2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1120
1121         [Extra zoom mode] Adopt list view controller UI for numeric input types
1122         https://bugs.webkit.org/show_bug.cgi?id=184184
1123         <rdar://problem/37238916>
1124
1125         Reviewed by Timothy Hatcher.
1126
1127         Add a localized string for the OK button shown on number pads in extra zoomed form controls.
1128
1129         * English.lproj/Localizable.strings:
1130         * platform/LocalizedStrings.cpp:
1131         (WebCore::numberPadOKButtonTitle):
1132         * platform/LocalizedStrings.h:
1133
1134 2018-03-30  Ryosuke Niwa  <rniwa@webkit.org>
1135
1136         Copying a list from Microsoft Word to TinyMCE fails when mso-list is the first property
1137         https://bugs.webkit.org/show_bug.cgi?id=182938
1138         <rdar://problem/37683007>
1139
1140         Reviewed by Wenson Hsieh.
1141
1142         Made the logic to detect Microsoft Word's mso-list CSS property more generic by detecting
1143         inline styles which start with "mso-list:" and one which line-break right before it: "\nmso-list:"
1144
1145         Tests: PasteHTML.PreservesMSOList
1146
1147         * editing/markup.cpp:
1148         (WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
1149
1150 2018-03-30  Youenn Fablet  <youenn@apple.com>
1151
1152         NetworkLoadChecker should upgrade redirects if needed
1153         https://bugs.webkit.org/show_bug.cgi?id=184098
1154
1155         Reviewed by Chris Dumez.
1156
1157         Test: imported/w3c/web-platform-tests/beacon/upgrade-beacon.https.html
1158
1159         * page/csp/ContentSecurityPolicy.h:
1160
1161 2018-03-30  Daniel Bates  <dabates@apple.com>
1162
1163         ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
1164         https://bugs.webkit.org/show_bug.cgi?id=184161
1165
1166         Reviewed by Per Arne Vollan.
1167
1168         Fixes an assertion failure when quiting an app that uses a Legacy WebKit web view
1169         after dragging-and-dropping a PDF embedded using an HTML image element into the
1170         same web view.
1171
1172         When performing a drag-and-drop of a PDF document image (WebCore::PDFDocumentImage) we create a WebArchive
1173         from the main frame's WebHTMLView and promise AppKit that will provide a Rich Text Format (RTF) document
1174         from this archive if needed. For some reason, on app termination AppKit requests that the WebHTMLView
1175         fullfill its RTF document promise for the WebArchive created at the start of the drag operation. WebKit
1176         expects that the created WebArchive is either for an inline image (e.g. <img>) or an image document that
1177         has a supported image resource MIME type (by querying MIMETypeRegistry::isSupportedImageResourceMIMEType())
1178         and checks for these cases in this order. PDF/PostScript are not listed in the set of supported image
1179         resource MIME types. So, the first check fails and WebKit assumes that the WebArchive was created from
1180         an image document of a supported image resource MIME type. However, the WebArchive was created from a
1181         WebHTMLView and has MIME type text/html. Therefore the assertion fails. We need to add PDF and PostScript
1182         to the set of supported image resource MIME types so that WebKit does not fall back to the WebHTMLView
1183         code path. Historically, PDF and PostScript were in the set supported image resource MIME types. Over time
1184         the set of MIME types for image resouces (images loaded as a document) became identical to the set of MIME
1185         types for images loaded inline (e.g. <img>) and this set omitted the MIME types for PDF and PostScript.
1186
1187         Additionally it is sufficient to implement MIMETypeRegistry::isSupportedImageResourceMIMEType() in terms
1188         of MIMETypeRegistry::isSupportedImageMIMEType() and MIMETypeRegistry::isPDFOrPostScriptMIMEType() instead
1189         of allocating a dedicated HashSet for the supported image resource MIME types (as we currently do).
1190
1191         * dom/DOMImplementation.cpp:
1192         (WebCore::DOMImplementation::createDocument): Assert that PDF is a supported image MIME type before
1193         instantiating an ImageDocument.
1194         * platform/MIMETypeRegistry.cpp:
1195         (WebCore::initializeSupportedImageMIMETypes): Remove unnecessary allocation of a HashSet for the support
1196         image resource MIME types.
1197         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Write in terms of MIMETypeRegistry::isSupportedImageMIMEType()
1198         and MIMETypeRegistry::isPDFOrPostScriptMIMEType().
1199         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
1200         * platform/MIMETypeRegistry.h:
1201
1202 2018-03-29  Antoine Quint  <graouts@apple.com>
1203
1204         [Web Animations] CSSTransition objects should have fill: backwards to allow seeking prior to start time
1205         https://bugs.webkit.org/show_bug.cgi?id=184129
1206
1207         Reviewed by Dean Jackson.
1208
1209         In order to allow a CSS Transition to be seeked prior to its start time, it needs to have its fill mode set
1210         to backwards. Adding code to set the fill mode in CSSTransition::initialize() yields early timing model
1211         invalidation and we could get in a situation where stylesWouldYieldNewCSSTransitionsBlendingKeyframes()
1212         was called before we had a chance to create blending keyframes for a CSS transitions, since the call
1213         to create blending keyframes is made after the call to initialize(), so we now cater for this case.
1214
1215         * animation/CSSTransition.cpp:
1216         (WebCore::CSSTransition::initialize):
1217         * animation/CSSTransition.h:
1218         * animation/KeyframeEffectReadOnly.cpp:
1219         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const):
1220
1221 2018-03-30  Daniel Bates  <dabates@apple.com>
1222
1223         Remove unused MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
1224         https://bugs.webkit.org/show_bug.cgi?id=184154
1225
1226         Reviewed by Per Arne Vollan.
1227
1228         * platform/MIMETypeRegistry.cpp:
1229         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Deleted.
1230         * platform/MIMETypeRegistry.h:
1231
1232 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
1233
1234         Unreviewed, rolling out r230102.
1235
1236         Caused assertion failures on JSC bots.
1237
1238         Reverted changeset:
1239
1240         "A stack overflow in the parsing of a builtin (called by
1241         createExecutable) cause a crash instead of a catchable js
1242         exception"
1243         https://bugs.webkit.org/show_bug.cgi?id=184074
1244         https://trac.webkit.org/changeset/230102
1245
1246 2018-03-30  Robin Morisset  <rmorisset@apple.com>
1247
1248         A stack overflow in the parsing of a builtin (called by createExecutable) cause a crash instead of a catchable js exception
1249         https://bugs.webkit.org/show_bug.cgi?id=184074
1250         <rdar://problem/37165897>
1251
1252         Reviewed by Keith Miller.
1253
1254         I had to slightly change the type of some bindings between JSC and WebCore. No functional change intended on the WebCore side.
1255
1256         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1257         (WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable):
1258         (WebCore::JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable):
1259         (WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
1260         (WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
1261         (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
1262         * bindings/scripts/CodeGeneratorJS.pm:
1263         (GenerateConstructorHelperMethods):
1264         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1265         (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeExecutable):
1266         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1267         (WebCore::JSTestJSBuiltinConstructorConstructor::initializeExecutable):
1268
1269 2018-03-29  Antoine Quint  <graouts@apple.com>
1270
1271         [Web Animations] Correctly obtain the timing function for a given keyframe
1272         https://bugs.webkit.org/show_bug.cgi?id=184146
1273
1274         Reviewed by Dean Jackson.
1275
1276         The way we would get the timing function for a given KeyframeValue stored in a KeyframeList was really suboptimal.
1277         When keyframes were created, we would set the animated element's style on each keyframe, and set keyframe-specific
1278         properties and values on top. When figuring out the timing function for a KeyframeValue, we would look at its render
1279         style, go through its list of animations, which could include animations that are irrelevant to this specific keyframe
1280         list since all animations from the animated element are referenced, and we would have to look up the correct animation
1281         by name and get the timing function, even though the timing function stored on the animation was now specific to this
1282         particular keyframe.
1283
1284         We now simply set a m_timingFunction member on a KeyframeValue, which is null if no explicit animation-timing-function
1285         was provided for this keyframe in CSS, and otherwise set to a valid TimingFunction.
1286
1287         This fixes our behavior for a 4 existing animation tests when opted into the CSS Animations and CSS Transitions as
1288         Web Animations feature.
1289
1290         * animation/KeyframeEffectReadOnly.cpp:
1291         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
1292         * css/StyleResolver.cpp:
1293         (WebCore::StyleResolver::keyframeStylesForAnimation):
1294         * page/animation/KeyframeAnimation.cpp:
1295         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty const):
1296         * platform/animation/TimingFunction.cpp:
1297         (WebCore::TimingFunction::createFromCSSText):
1298         (WebCore::TimingFunction::createFromCSSValue):
1299         * platform/animation/TimingFunction.h:
1300         * rendering/RenderLayerBacking.cpp:
1301         (WebCore::RenderLayerBacking::startAnimation):
1302         * rendering/style/KeyframeList.cpp:
1303         (WebCore::KeyframeValue::timingFunction const): Deleted.
1304         * rendering/style/KeyframeList.h:
1305         (WebCore::KeyframeValue::timingFunction const):
1306         (WebCore::KeyframeValue::setTimingFunction):
1307
1308 2018-03-29  Ryosuke Niwa  <rniwa@webkit.org>
1309
1310         Copying a list from Microsoft Word to TinyMCE fails when mso-list is on tags other than P
1311         https://bugs.webkit.org/show_bug.cgi?id=182954
1312         <rdar://problem/37713141>
1313
1314         Reviewed by Wenson Hsieh.
1315
1316         Fixed the bug by relaxing the restriction that we only preserve mso-list on p.
1317
1318         Tests: PasteHTML.PreservesMSOListOnH4
1319
1320         * editing/markup.cpp:
1321         (WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
1322
1323 2018-03-29  JF Bastien  <jfbastien@apple.com>
1324
1325         Use Forward.h instead of forward-declaring WTF::String
1326         https://bugs.webkit.org/show_bug.cgi?id=184172
1327         <rdar://problem/39026146>
1328
1329         Reviewed by Yusuke Suzuki.
1330
1331         As part of #184164 I'm changing WTF::String, and the forward
1332         declarations are just wrong because I'm making it templated. We
1333         should use Forward.h anyways, so do that instead.
1334
1335         * css/makeprop.pl:
1336         * platform/cocoa/PlaybackSessionInterface.h:
1337         * platform/ios/Device.h:
1338         * platform/ios/PlaybackSessionInterfaceAVKit.h:
1339         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1340         * platform/win/PathWalker.h:
1341         * testing/js/WebCoreTestSupport.h:
1342
1343 2018-03-29  Ross Kirsling  <ross.kirsling@sony.com>
1344
1345         MSVC __forceinline slows down JSC release build fivefold after r229391
1346         https://bugs.webkit.org/show_bug.cgi?id=184062
1347
1348         Reviewed by Alex Christensen.
1349
1350         * platform/graphics/FormatConverter.cpp:
1351         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
1352
1353 2018-03-29  Ryan Haddad  <ryanhaddad@apple.com>
1354
1355         Unreviewed, rolling out r230087.
1356
1357         Introduced LayoutTest failures.
1358
1359         Reverted changeset:
1360
1361         "FrameSelection::appearanceUpdateTimerFired should be robust
1362         against layout passes underneath it"
1363         https://bugs.webkit.org/show_bug.cgi?id=183395
1364         https://trac.webkit.org/changeset/230087
1365
1366 2018-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1367
1368         FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
1369         https://bugs.webkit.org/show_bug.cgi?id=183395
1370         <rdar://problem/38055732>
1371
1372         Reviewed by Zalan Bujtas.
1373
1374         In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
1375         FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
1376         mitigation by wrapping the Frame in a Ref when firing the appearance update timer, and ensuring that layout is
1377         really up to date before calling updateAppearanceAfterLayoutOrStyleChange() from the timer.
1378
1379         Test: editing/selection/iframe-update-selection-appearance.html
1380
1381         * editing/FrameSelection.cpp:
1382         (WebCore::FrameSelection::appearanceUpdateTimerFired):
1383
1384 2018-03-29  Daniel Bates  <dabates@apple.com>
1385
1386         Substitute ArchiveFactory::isArchiveMIMEType() for ArchiveFactory::isArchiveMimeType().
1387
1388         * loader/DocumentLoader.cpp:
1389         (WebCore::DocumentLoader::commitLoad):
1390         * loader/archive/ArchiveFactory.cpp:
1391         (WebCore::ArchiveFactory::isArchiveMIMEType):
1392         (WebCore::ArchiveFactory::isArchiveMimeType): Deleted.
1393         * loader/archive/ArchiveFactory.h:
1394         * platform/MIMETypeRegistry.h:
1395
1396 2018-03-29  Daniel Bates  <dabates@apple.com>
1397
1398         MIMETypeRegistry should return const HashSets
1399         https://bugs.webkit.org/show_bug.cgi?id=184150
1400
1401         Reviewed by Per Arne Vollan.
1402
1403         Only getSupportedNonImageMIMETypes() needs to return a non-const HashSet so that
1404         LegacyWebKit can modify the set of non-image MIME types.
1405
1406         * platform/MIMETypeRegistry.cpp:
1407         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
1408         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
1409         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
1410         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
1411         (WebCore::MIMETypeRegistry::getPDFMIMETypes):
1412         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
1413         * platform/MIMETypeRegistry.h:
1414
1415 2018-03-29  Brady Eidson  <beidson@apple.com>
1416
1417         Update Service Worker feature status.
1418         https://bugs.webkit.org/show_bug.cgi?id=184139
1419
1420         Reviewed by Chris Dumez.
1421
1422         * features.json:
1423
1424 2018-03-29  Chris Dumez  <cdumez@apple.com>
1425
1426         Drop DOMWindow::frames() / DOMWindow::window() methods
1427         https://bugs.webkit.org/show_bug.cgi?id=184112
1428
1429         Reviewed by Daniel Bates.
1430
1431         Drop DOMWindow::frames() / DOMWindow::window() methods as they are just aliases for DOMWindow::self().
1432
1433         * page/DOMWindow.h:
1434         * page/DOMWindow.idl:
1435
1436 2018-03-29  Commit Queue  <commit-queue@webkit.org>
1437
1438         Unreviewed, rolling out r230062.
1439         https://bugs.webkit.org/show_bug.cgi?id=184128
1440
1441         Broke mac port. web content process crashes while loading any
1442         web page (Requested by rniwa on #webkit).
1443
1444         Reverted changeset:
1445
1446         "MSVC __forceinline slows down JSC release build fivefold
1447         after r229391"
1448         https://bugs.webkit.org/show_bug.cgi?id=184062
1449         https://trac.webkit.org/changeset/230062
1450
1451 2018-03-28  Antoine Quint  <graouts@apple.com>
1452
1453         [Web Animations] Implement more CSSPropertyBlendingClient methods
1454         https://bugs.webkit.org/show_bug.cgi?id=184077
1455
1456         Reviewed by Dean Jackson.
1457
1458         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
1459         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
1460         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
1461         CSS Transitions as Web Animations feature.
1462
1463         We also ensure we only run a CSSAnimationController assertion in FrameView::didDestroyRenderTree() if
1464         we're not using the CSS Animations and CSS Transitions as Web Animations feature.
1465
1466         * animation/KeyframeEffectReadOnly.cpp:
1467         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
1468         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
1469         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
1470         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
1471         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
1472         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
1473         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
1474         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
1475         * animation/KeyframeEffectReadOnly.h:
1476         * page/FrameView.cpp:
1477         (WebCore::FrameView::didDestroyRenderTree):
1478
1479 2018-03-28  Chris Dumez  <cdumez@apple.com>
1480
1481         Align XMLHttpRequest's open() / send() / abort() with the latest specification
1482         https://bugs.webkit.org/show_bug.cgi?id=184108
1483
1484         Reviewed by Youenn Fablet.
1485
1486         Align XMLHttpRequest's open() / send() / abort() with the latest specification:
1487         - https://xhr.spec.whatwg.org
1488
1489         No new tests, rebaselined existing layout tests.
1490
1491         * xml/XMLHttpRequest.cpp:
1492         (WebCore::XMLHttpRequest::open):
1493         Align with https://xhr.spec.whatwg.org/#the-open()-method:
1494         - Change the order of some steps to match the order in the spec. In particular,
1495           open() no longer resets the state to UNSENT or abort any existing load when it
1496           fails early due to being passed a bad method.
1497
1498         (WebCore::XMLHttpRequest::createRequest):
1499         Align with https://xhr.spec.whatwg.org/#the-send()-method:
1500         - Use the simpler "upload listener flag" logic from the spec instead of our more
1501           complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
1502           objects on a background thread when XHR is used inside Web Workers, which was
1503           not thread-safe.
1504         - Set the upload complete flag when the request has no body as per step 9.
1505         - After firing the loadstartEvent, return early if the state is no longer OPEN or
1506           if the send flag is unset, as per step 11.3.
1507
1508         (WebCore::XMLHttpRequest::abort):
1509         Align with https://xhr.spec.whatwg.org/#the-abort()-method:
1510         - Only set the state to UNSENT if the state is still DONE after firing the error
1511           events, as per step 3.
1512
1513         (WebCore::XMLHttpRequest::didSendData):
1514         Use new "upload listener flag".
1515
1516         (WebCore::XMLHttpRequest::dispatchErrorEvents):
1517         Align with https://xhr.spec.whatwg.org/#request-error-steps:
1518         - Stop firing a progress event in case of error as this is not as per specification
1519           and Firefox does not fire those either.
1520
1521         * xml/XMLHttpRequest.h:
1522
1523 2018-03-28  Timothy Hatcher  <timothy@apple.com>
1524
1525         Consolidate NSColor to WebCore::Color conversion and fix system colors.
1526
1527         https://bugs.webkit.org/show_bug.cgi?id=184096
1528         rdar://problem/38918925
1529
1530         Reviewed by Tim Horton.
1531
1532         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1533         (CreateCGColorIfDifferent): Use CGColor property on NSColor, don't manually create new CGColor.
1534         * platform/graphics/mac/ColorMac.h:
1535         * platform/graphics/mac/ColorMac.mm:
1536         (WebCore::makeRGBAFromNSColor): Move pattern code from RenderThemeMac's convertNSColorToColor.
1537         Also use nextafter for proper RGBA float conversion.
1538         * platform/mac/PlatformPasteboardMac.mm:
1539         (WebCore::PlatformPasteboard::color): Use colorFromNSColor.
1540         * rendering/RenderThemeMac.mm:
1541         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Use colorFromNSColor.
1542         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
1543         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
1544         (WebCore::RenderThemeMac::systemColor const): Ditto.
1545         (WebCore::paintAttachmentTitleBackground): Ditto.
1546         (WebCore::convertNSColorToColor): Deleted.
1547
1548 2018-03-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
1549
1550         The SVGAnimatedProperty wrappers have to be detached from the referenced values before the SVGAnimatedType is deleted
1551         https://bugs.webkit.org/show_bug.cgi?id=183972
1552
1553         Reviewed by Daniel Bates.
1554
1555         If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers
1556         of the animated properties have to be detached from the items in the list
1557         before it's deleted.
1558
1559         * svg/SVGAnimateElementBase.cpp:
1560         (WebCore::SVGAnimateElementBase::clearAnimatedType):
1561
1562 2018-03-28  Ross Kirsling  <ross.kirsling@sony.com>
1563
1564         MSVC __forceinline slows down JSC release build fivefold after r229391
1565         https://bugs.webkit.org/show_bug.cgi?id=184062
1566
1567         Reviewed by Alex Christensen.
1568
1569         * platform/graphics/FormatConverter.cpp:
1570         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
1571
1572 2018-03-28  Zalan Bujtas  <zalan@apple.com>
1573
1574         Make it possible to override the screen size
1575         https://bugs.webkit.org/show_bug.cgi?id=184111
1576         <rdar://problem/38972181>
1577
1578         Reviewed by Tim Horton.
1579
1580         We just call screenSize() atm.
1581
1582         * page/Chrome.cpp:
1583         (WebCore::Chrome::overrideScreenSize const):
1584         * page/Chrome.h:
1585         * page/ChromeClient.h:
1586         * platform/HostWindow.h:
1587         * platform/PlatformScreen.h:
1588         * platform/ios/PlatformScreenIOS.mm:
1589         (WebCore::screenRect):
1590         (WebCore::overrideScreenSize):
1591
1592 2018-03-28  Timothy Hatcher  <timothy@apple.com>
1593
1594         Include the 'text' color keyword as a system color.
1595
1596         https://bugs.webkit.org/show_bug.cgi?id=184113
1597         rdar://problem/38779267
1598
1599         Reviewed by Tim Horton.
1600
1601         * css/StyleColor.cpp:
1602         (WebCore::StyleColor::isColorKeyword): Don't check CSSValueMenu, it is a system color and is included.
1603         (WebCore::StyleColor::isSystemColor): Include CSSValueText. Check CSSValueWebkitFocusRingColor in the range,
1604         since it is immediately after CSSValueAppleSystemYellow.
1605
1606 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1607
1608         [iOS] Multiple select appearance doesn't update when selecting or deselecting rows in the picker view
1609         https://bugs.webkit.org/show_bug.cgi?id=184110
1610         <rdar://problem/38796648>
1611
1612         Reviewed by Tim Horton.
1613
1614         HTMLSelectElement::optionSelectedByUser is invoked upon user interaction with a select menu. This currently
1615         takes two separate codepaths, depending on whether or not the menu list appearance is being used to render the
1616         select. If a menu list appearance is used, we call selectOption(), which updates validity, updates the element
1617         renderer, and then dispatches a `change` event if needed.
1618
1619         However, if updateSelectedState() is used, we only update form validity and then dispatch the `change` event
1620         without updating the renderer, leaving it stale.
1621
1622         Test: fast/forms/ios/ipad/multiple-select-updates-renderer.html
1623
1624         * html/HTMLSelectElement.cpp:
1625         (WebCore::HTMLSelectElement::optionSelectedByUser):
1626
1627         Update the renderer after updating the DOM to reflect the selected option.
1628
1629 2018-03-28  Daniel Bates  <dabates@apple.com>
1630
1631         Substitute "strong password confirmation auto fill" for "strong confirmation password auto fill"
1632         <rdar://problem/36518856>
1633
1634         * English.lproj/Localizable.strings:
1635         * platform/LocalizedStrings.cpp:
1636         (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
1637
1638 2018-03-28  Daniel Bates  <dabates@apple.com>
1639
1640         WebSocket cookie incorrectly stored
1641         https://bugs.webkit.org/show_bug.cgi?id=184100
1642         <rdar://problem/37928715>
1643
1644         Reviewed by Brent Fulgham.
1645
1646         A cookie received in a WebSocket response should be stored with respect to the
1647         origin of the WebSocket server in order for it to be sent in a subsequent request.
1648
1649         Also removed a FIXME about implementing support for the long since
1650         deprecated Set-Cookie2 header.
1651
1652         Test: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
1653
1654         * Modules/websockets/WebSocketChannel.cpp:
1655         (WebCore::WebSocketChannel::processBuffer):
1656         * Modules/websockets/WebSocketHandshake.h:
1657
1658 2018-03-28  Chris Dumez  <cdumez@apple.com>
1659
1660         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
1661         https://bugs.webkit.org/show_bug.cgi?id=183962
1662         <rdar://problem/38817833>
1663
1664         Reviewed by Brady Eidson.
1665
1666         Pass extra bits of information to the UIProcess via NavigationAction:
1667         - Is it a cross origin navigation caused by window.open()
1668         - Does the navigated frame have an opener
1669
1670         This information is useful to determine on UIProcess side if we want
1671         to swap WebProcess.
1672
1673         * loader/FrameLoadRequest.h:
1674         (WebCore::FrameLoadRequest::setIsCrossOriginWindowOpenNavigation):
1675         (WebCore::FrameLoadRequest::isCrossOriginWindowOpenNavigation const):
1676         * loader/FrameLoader.cpp:
1677         (WebCore::FrameLoader::loadURL):
1678         * loader/NavigationAction.h:
1679         (WebCore::NavigationAction::setIsCrossOriginWindowOpenNavigation):
1680         (WebCore::NavigationAction::isCrossOriginWindowOpenNavigation const):
1681         (WebCore::NavigationAction::setOpener):
1682         (WebCore::NavigationAction::opener const):
1683         * page/DOMWindow.cpp:
1684         (WebCore::DOMWindow::createWindow):
1685
1686 2018-03-28  Chris Dumez  <cdumez@apple.com>
1687
1688         Thread safety issue in IDBFactory' shouldThrowSecurityException()
1689         https://bugs.webkit.org/show_bug.cgi?id=184064
1690
1691         Reviewed by Ryosuke Niwa.
1692
1693         shouldThrowSecurityException() gets called on a non-main thread but
1694         it ended up using the SchemeRegistry via SecurityOrigin::canAccessDatabase()
1695         which calls SecurityOrigin::isLocal().
1696
1697         Since using the SchemeRegistry from the background thread is not safe
1698         (we recently added locks which we're trying to remove), and since SecurityOrigin
1699         methods are often called from background threads, this patch make SecurityOrigin::isLocal()
1700         safe to call from a background thread. To achieve this, we now query the SchemeRegistry
1701         in the SecurityOrigin constructor instead as SecurityOrigin objects are expected to be
1702         constructed on the main thread.
1703
1704         * page/SecurityOrigin.cpp:
1705         (WebCore::SecurityOrigin::SecurityOrigin):
1706         (WebCore::SecurityOrigin::isLocal const): Deleted.
1707         * page/SecurityOrigin.h:
1708         (WebCore::SecurityOrigin::isLocal const):
1709
1710 2018-03-28  Ryan Haddad  <ryanhaddad@apple.com>
1711
1712         Unreviewed, rolling out r230033.
1713
1714         The LayoutTests modified in this change fail an assertion on
1715         WK1.
1716
1717         Reverted changeset:
1718
1719         "[Web Animations] Implement more CSSPropertyBlendingClient
1720         methods"
1721         https://bugs.webkit.org/show_bug.cgi?id=184077
1722         https://trac.webkit.org/changeset/230033
1723
1724 2018-03-28  Chris Dumez  <cdumez@apple.com>
1725
1726         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread
1727         https://bugs.webkit.org/show_bug.cgi?id=184068
1728
1729         Reviewed by Youenn Fablet.
1730
1731         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread,
1732         which is not safe. We now use SecurityOriginData since we only need an origin String and
1733         it is safe to construct a SecurityOriginData on any thread.
1734
1735         * Modules/websockets/WebSocket.cpp:
1736         (WebCore::WebSocket::didReceiveMessage):
1737
1738 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1739
1740         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
1741         https://bugs.webkit.org/show_bug.cgi?id=184092
1742         <rdar://problem/38939917>
1743
1744         Reviewed by Tim Horton.
1745
1746         In r228697, we introduced a new set of boosted text autosizing constants tuned for extra zoom mode, which are
1747         currently hard-coded as default values in SettingsBase. However, we've since identified cases where clients may
1748         want to opt in or out of boosted text autosizing values and just use the existing values.
1749
1750         This replaces settings to adjust text autosizing constants with a flag to enable or disable boosted text
1751         autosizing; when changed, we update all three text autosizing parameters to their default or boosted values, and
1752         then trigger style recalculation.
1753
1754         Test: TextAutosizingBoost.ChangeAutosizingBoostAtRuntime
1755
1756         * page/Settings.yaml:
1757         * page/SettingsBase.cpp:
1758         (WebCore::SettingsBase::shouldEnableTextAutosizingBoostChanged):
1759         (WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient): Deleted.
1760         (WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient): Deleted.
1761         (WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease): Deleted.
1762
1763         Changed these to constant values instead of helper functions, and also introduced boosted text autosizing
1764         constants for use in extra zoom mode.
1765
1766         * page/SettingsBase.h:
1767         (WebCore::SettingsBase::oneLineTextMultiplierCoefficient const):
1768         (WebCore::SettingsBase::multiLineTextMultiplierCoefficient const):
1769         (WebCore::SettingsBase::maxTextAutosizingScaleIncrease const):
1770         * rendering/RenderThemeIOS.mm:
1771         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
1772
1773         Tweak the stylesheet to make `-webkit-text-size-adjust: auto` overridable by web content. Adding the !important
1774         is breaking many websites that positioned text such that it is positioned within layout viewport bounds without
1775         text autosizing.
1776
1777 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1778
1779         Avoid uninitialized mach ports
1780         https://bugs.webkit.org/show_bug.cgi?id=184090
1781         <rdar://problem/37261129>
1782
1783         Reviewed by Chris Dumez.
1784
1785         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
1786         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
1787         there is a potential for us to try to use invalid ports.
1788
1789         We should always check return values, and ensure that the mach port variables we seek to initialize are
1790         kept in a valid state.
1791
1792         No new tests, no Web-facing behavior change.
1793
1794         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1795         (WebCore::attachToAppleGraphicsControl): Initialize masterPort to a default value.
1796
1797 2018-03-28  Antoine Quint  <graouts@apple.com>
1798
1799         [Web Animations] Implement more CSSPropertyBlendingClient methods
1800         https://bugs.webkit.org/show_bug.cgi?id=184077
1801
1802         Reviewed by Dean Jackson.
1803
1804         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
1805         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
1806         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
1807         CSS Transitions as Web Animations feature.
1808
1809         * animation/KeyframeEffectReadOnly.cpp:
1810         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
1811         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
1812         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
1813         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
1814         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
1815         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
1816         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
1817         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
1818         * animation/KeyframeEffectReadOnly.h:
1819
1820 2018-03-28  Antoine Quint  <graouts@apple.com>
1821
1822         [Web Animations] Comparing two matching FramesTimingFunction objects fails
1823         https://bugs.webkit.org/show_bug.cgi?id=184078
1824
1825         Reviewed by Jon Lee.
1826
1827         Fix a stupid mistake in the == operator for FramesTimingFunction. Without a correct check, we would mistakenly interrupt and
1828         restart any transition with a frames() timing function when we check that the Animation objects are similar.
1829
1830         * platform/animation/TimingFunction.h:
1831
1832 2018-03-28  Miguel Gomez  <magomez@igalia.com>
1833
1834         [GTK][WPE] Remove UpdateAtlas
1835         https://bugs.webkit.org/show_bug.cgi?id=184042
1836
1837         Reviewed by Žan Doberšek.
1838
1839         Remove UpdateAtlas and AreaAllocator classes. Instead of using UpdateAtlas as a cache
1840         of buffers to render tiles with cairo, allocate a new buffer for each tile instead.
1841
1842         Covered by existent tests.
1843
1844         * loader/EmptyClients.h:
1845         * page/ChromeClient.h:
1846         * platform/TextureMapper.cmake:
1847         * platform/graphics/texmap/coordinated/AreaAllocator.cpp: Removed.
1848         * platform/graphics/texmap/coordinated/AreaAllocator.h: Removed.
1849         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1850         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
1851         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1852         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1853         * platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
1854         (): Deleted.
1855         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Removed.
1856         * platform/graphics/texmap/coordinated/UpdateAtlas.h: Removed.
1857         * testing/Internals.cpp:
1858         (WebCore::Internals::resetToConsistentState):
1859
1860 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1861
1862         Unreviewed, rolling out r230008.
1863
1864         Lots of HTTP test failures
1865
1866         Reverted changeset:
1867
1868         "Remove unused libsoup ResourceHandle implementation"
1869         https://bugs.webkit.org/show_bug.cgi?id=184048
1870         https://trac.webkit.org/changeset/230008
1871
1872 2018-03-27  Chris Dumez  <cdumez@apple.com>
1873
1874         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
1875         https://bugs.webkit.org/show_bug.cgi?id=184029
1876
1877         Reviewed by Youenn Fablet.
1878
1879         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
1880         by having it use SecurityOriginData (which is safe to construct on non-main threads) instead of
1881         SecurityOrigin (which isn't).
1882
1883         ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() is already called from non-main thread in
1884         FetchLoader, XHR and WebSocket when used in workers. This wasn't safe.
1885
1886         * loader/DocumentWriter.cpp:
1887         (WebCore::DocumentWriter::begin):
1888         * page/csp/ContentSecurityPolicy.cpp:
1889         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
1890         (WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests):
1891         (WebCore::ContentSecurityPolicy::takeNavigationRequestsToUpgrade):
1892         (WebCore::ContentSecurityPolicy::setInsecureNavigationRequestsToUpgrade):
1893         * page/csp/ContentSecurityPolicy.h:
1894
1895 2018-03-27  Daniel Bates  <dabates@apple.com>
1896
1897         Attempt to fix media control layout tests after <https://trac.webkit.org/changeset/230006/>
1898         (https://bugs.webkit.org/show_bug.cgi?id=179983)
1899
1900         Exempt elements in user agent shadow DOM from having to perform a potentially CORS-
1901         enabled fetch for a mask image to try to fix the following tests from timing out:
1902             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
1903             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
1904
1905         * style/StylePendingResources.cpp:
1906         (WebCore::Style::loadPendingImage):
1907
1908 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
1909
1910         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
1911         https://bugs.webkit.org/show_bug.cgi?id=183923
1912         <rdar://problem/38756869>
1913
1914         Reviewed by Brent Fulgham.
1915
1916         The test is timing out when we do not interact directly with the WindowServer, causing
1917         OpenGL to fall back to software rendering. In this mode, any call to CGLChoosePixelFormat
1918         requesting an accelerated pixel format will fail because it cannot determine which GPU is
1919         connected to the display.
1920
1921         OpenGL treats all GPUs as if they were offline when used in a process (like the WebContent
1922         process) that does not directly control the display.
1923
1924         We can get correct behavior if we tell OpenGL which GPU is currently connected to the
1925         display, and if we instruct CGLChoosePixelFormat to create an offline renderer pixel format
1926         by including the 'kCGLPFAAllowOfflineRenderers' flag in its arguments.
1927
1928         We can use CGLSetVirtualScreen with an OpenGL display mask that tells the OpenGL framework
1929         which GPU it should use.
1930
1931         See https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7
1932         for details on how the virtual screen is found from the OpenGL display mask.
1933
1934         No new tests, covered by existing tests.
1935
1936         * WebCore.xcodeproj/project.pbxproj:
1937         * platform/graphics/GraphicsContext3D.h:
1938         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1939         (WebCore::setPixelFormat):
1940         (WebCore::identifyAndSetCurrentGPU):
1941         (WebCore::GraphicsContext3D::GraphicsContext3D):
1942         (WebCore::GraphicsContext3D::setOpenGLDisplayMask):
1943         (WebCore::GraphicsContext3D::allowOfflineRenderers):
1944
1945 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
1946
1947         [WebAuthN] Implement authenticatorGetAssertion
1948         https://bugs.webkit.org/show_bug.cgi?id=183881
1949         <rdar://problem/37258628>
1950
1951         Reviewed by Brent Fulgham.
1952
1953         This patch does the following few things:
1954         1) It implements the spec: https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
1955         2) It tweaks encoding/decoding of PublicKeyCredentialRequestOptions such that options can be passed
1956         between UI and Web processes.
1957         3) It refines the way how LocalAuthenticator::makeCredential find intersection between
1958         excludeCredentialDescriptorList and existing credentials in the authenticator, such that it is faster.
1959         Basically, it takes the CredentialID from the list and treat it as an ASCII string and put it into a
1960         HashSet<String>. It should not matter if a duplicated CredentialID is added. If the hash set is not
1961         empty, the algorithm then queries Keychain for all CredentialIDs related to the current RP ID once.
1962         For every queried CredentialID, the algorithm then treats it as an ASCII string as well and look for
1963         a match in the hash set to produce the intersetction. The new way is also employed in
1964         LocalAuthenticator::getAssertion as well.
1965         4) It abstracts the way to produce authData and thus reorders a bit of code in
1966         LocalAuthenticator::makeCredential.
1967
1968         Covered by API tests.
1969
1970         * Modules/webauthn/AuthenticatorManager.cpp:
1971         (WebCore::AuthenticatorManager::create const):
1972         (WebCore::AuthenticatorManager::discoverFromExternalSource const):
1973         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1974         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
1975         (WebCore::PublicKeyCredentialRequestOptions::encode const):
1976         (WebCore::PublicKeyCredentialRequestOptions::decode):
1977         * Modules/webauthn/cocoa/LocalAuthenticator.h:
1978         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
1979         (WebCore::LocalAuthenticatorInternal::buildAuthData):
1980         (WebCore::LocalAuthenticatorInternal::produceHashSet):
1981         (WebCore::LocalAuthenticator::makeCredential):
1982         (WebCore::LocalAuthenticator::getAssertion):
1983         (WebCore::LocalAuthenticator::issueClientCertificate const):
1984         * WebCore.xcodeproj/project.pbxproj:
1985
1986 2018-03-27  Chris Dumez  <cdumez@apple.com>
1987
1988         Avoid constructing SecurityOrigin objects from non-main threads
1989         https://bugs.webkit.org/show_bug.cgi?id=184024
1990
1991         Reviewed by Youenn Fablet.
1992
1993         Avoid constructing SecurityOrigin objects from non-main threads as much as possible
1994         as it is not safe. This patch gets rid of most offending cases but not all of them
1995         yet, which is why I haven't added a ASSERT(isMainThread()) to the SecurityOrigin
1996         constructor yet.
1997
1998         For example, ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() currently
1999         gets called from non-main threads and construct a SecurityOrigin. Fixing this
2000         will require some refactoring that would have made this patch much larger.
2001
2002         * loader/DocumentLoader.cpp:
2003         (WebCore::DocumentLoader::matchRegistration):
2004         * page/EventSource.cpp:
2005         (WebCore::EventSource::didReceiveResponse):
2006         * page/SecurityOrigin.cpp:
2007         (WebCore::SecurityOrigin::SecurityOrigin):
2008         * page/SecurityOrigin.h:
2009         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
2010         * testing/Internals.cpp:
2011         (WebCore::Internals::hasServiceWorkerRegistration):
2012         * workers/DedicatedWorkerGlobalScope.cpp:
2013         (WebCore::DedicatedWorkerGlobalScope::create):
2014         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2015         * workers/DedicatedWorkerGlobalScope.h:
2016         * workers/DedicatedWorkerThread.cpp:
2017         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2018         * workers/DedicatedWorkerThread.h:
2019         * workers/WorkerGlobalScope.cpp:
2020         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2021         * workers/WorkerGlobalScope.h:
2022         * workers/WorkerLocation.cpp:
2023         (WebCore::WorkerLocation::origin const):
2024         * workers/WorkerThread.cpp:
2025         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2026         (WebCore::WorkerThread::workerThread):
2027         * workers/WorkerThread.h:
2028         * workers/service/SWClientConnection.h:
2029         * workers/service/ServiceWorkerContainer.cpp:
2030         (WebCore::ServiceWorkerContainer::getRegistration):
2031         (WebCore::ServiceWorkerContainer::getRegistrations):
2032         * workers/service/ServiceWorkerGlobalScope.cpp:
2033         (WebCore::ServiceWorkerGlobalScope::create):
2034         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
2035         * workers/service/ServiceWorkerGlobalScope.h:
2036         * workers/service/ServiceWorkerProvider.cpp:
2037         (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
2038         * workers/service/ServiceWorkerProvider.h:
2039         * workers/service/context/ServiceWorkerThread.cpp:
2040         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
2041         (WebCore::fireMessageEvent):
2042         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
2043         * workers/service/context/ServiceWorkerThread.h:
2044
2045 2018-03-27  Alex Christensen  <achristensen@webkit.org>
2046
2047         Remove unused libsoup ResourceHandle implementation
2048         https://bugs.webkit.org/show_bug.cgi?id=184048
2049
2050         Reviewed by Michael Catanzaro.
2051
2052         This code is unused since r228901 so let's remove it!
2053
2054         * platform/network/ResourceHandle.h:
2055         * platform/network/ResourceHandleInternal.h:
2056         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2057         * platform/network/soup/ResourceHandleSoup.cpp:
2058         (WebCore::ResourceHandle::~ResourceHandle):
2059         (WebCore::ResourceHandleInternal::soupSession):
2060         (WebCore::ResourceHandle::cancelledOrClientless):
2061         (WebCore::ResourceHandle::ensureReadBuffer):
2062         (WebCore::ResourceHandle::currentStreamPosition const):
2063         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
2064         (WebCore::ResourceHandle::didStartRequest):
2065         (WebCore::ResourceHandle::start):
2066         (WebCore::ResourceHandle::releaseForDownload):
2067         (WebCore::ResourceHandle::sendPendingRequest):
2068         (WebCore::ResourceHandle::cancel):
2069         (WebCore::ResourceHandle::shouldUseCredentialStorage):
2070         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
2071         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2072         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
2073         (WebCore::ResourceHandle::receivedCredential):
2074         (WebCore::ResourceHandle::receivedCancellation):
2075         (WebCore::ResourceHandle::receivedChallengeRejection):
2076         (WebCore::ResourceHandle::platformSetDefersLoading):
2077         (WebCore::sessionFromContext): Deleted.
2078         (WebCore::ResourceHandle::create): Deleted.
2079         (WebCore::ResourceHandle::ResourceHandle): Deleted.
2080         (WebCore::isAuthenticationFailureStatusCode): Deleted.
2081         (WebCore::tlsErrorsChangedCallback): Deleted.
2082         (WebCore::gotHeadersCallback): Deleted.
2083         (WebCore::applyAuthenticationToRequest): Deleted.
2084         (WebCore::restartedCallback): Deleted.
2085         (WebCore::shouldRedirect): Deleted.
2086         (WebCore::shouldRedirectAsGET): Deleted.
2087         (WebCore::continueAfterWillSendRequest): Deleted.
2088         (WebCore::doRedirect): Deleted.
2089         (WebCore::redirectSkipCallback): Deleted.
2090         (WebCore::wroteBodyDataCallback): Deleted.
2091         (WebCore::cleanupSoupRequestOperation): Deleted.
2092         (WebCore::nextMultipartResponsePartCallback): Deleted.
2093         (WebCore::sendRequestCallback): Deleted.
2094         (WebCore::continueAfterDidReceiveResponse): Deleted.
2095         (WebCore::startingCallback): Deleted.
2096         (WebCore::networkEventCallback): Deleted.
2097         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
2098         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
2099         (WebCore::ResourceHandle::timeoutFired): Deleted.
2100         (WebCore::waitingToSendRequest): Deleted.
2101         (WebCore::readCallback): Deleted.
2102
2103 2018-03-27  Chris Dumez  <cdumez@apple.com>
2104
2105         Move online state detection from the WebProcess to the NetworkProcess
2106         https://bugs.webkit.org/show_bug.cgi?id=183989
2107         <rdar://problem/37093299>
2108
2109         Reviewed by Youenn Fablet.
2110
2111         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
2112         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
2113         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
2114         its connected WebProcesses via IPC.
2115
2116         * inspector/agents/InspectorApplicationCacheAgent.cpp:
2117         (WebCore::InspectorApplicationCacheAgent::networkStateChanged):
2118         * loader/LoaderStrategy.h:
2119         * page/Navigator.cpp:
2120         (WebCore::Navigator::onLine const):
2121         * page/Page.cpp:
2122         * platform/network/NetworkStateNotifier.h:
2123         * workers/Worker.cpp:
2124         (WebCore::Worker::Worker):
2125         (WebCore::Worker::notifyFinished):
2126         * workers/service/context/ServiceWorkerThread.cpp:
2127         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2128         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2129         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
2130
2131 2018-03-27  Daniel Bates  <dabates@apple.com>
2132
2133         CSS mask images should be retrieved using potentially CORS-enabled fetch
2134         https://bugs.webkit.org/show_bug.cgi?id=179983
2135         <rdar://problem/35678149>
2136
2137         Reviewed by Brent Fulgham.
2138
2139         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor’s Draft, 23 December 2017)
2140         we should fetch CSS mask images using a potentially CORS-enabled fetch.
2141
2142         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
2143         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
2144         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
2145         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
2146         closely align with the behavior in the spec.
2147
2148         Test: http/tests/security/css-mask-image.html
2149
2150         * page/Settings.yaml: Add a setting for toggle "Anonymous" mode fetching of mask images (defaults: true).
2151         We need this setting to avoid breaking the developer convenience feature that some modern media controls
2152         layout tests employ to load assets from the filesystem as opposed to using the hardcoded data URLs baked
2153         into the WebKit binary.
2154         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
2155         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
2156         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
2157         (WebCore::Style::loadPendingImage): Ditto.
2158         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
2159         a mask image or shape-outside image.
2160
2161 2018-03-27  Zalan Bujtas  <zalan@apple.com>
2162
2163         RenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type check.
2164         https://bugs.webkit.org/show_bug.cgi?id=184032
2165         <rdar://problem/38384984>
2166
2167         Reviewed by Antti Koivisto.
2168
2169         We cannot rely on the correctness of the render tree structure when querying for parent/child/next and previous
2170         sibling since some features (multicolumn/spanners) move subtrees out of their original position (which is highly
2171         undesired and should not be encouraged at all though).
2172         It should also be noted that these functions are not equivalent of typeOfChildren<RenderBox> and the following usage
2173             for (auto* boxChild = firstChildBox(); boxChild; boxChild = boxChild->nextSiblingBox())
2174         can lead to unexpected result.
2175  
2176         Test: fast/multicol/parent-box-when-spanner-is-present.html
2177
2178         * rendering/RenderBox.h:
2179         (WebCore::RenderBox::parentBox const):
2180         (WebCore::RenderBox::firstChildBox const):
2181         (WebCore::RenderBox::lastChildBox const):
2182         (WebCore::RenderBox::previousSiblingBox const):
2183         (WebCore::RenderBox::nextSiblingBox const):
2184         * rendering/RenderListItem.cpp:
2185         (WebCore::RenderListItem::positionListMarker):
2186         * rendering/RenderListMarker.cpp:
2187         (WebCore::RenderListMarker::layout):
2188         * rendering/RenderMultiColumnSet.cpp:
2189         (WebCore::RenderMultiColumnSet::updateLogicalWidth):
2190
2191 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
2192
2193         Further refine cookie read/write logging
2194         https://bugs.webkit.org/show_bug.cgi?id=184044
2195         <rdar://problem/38915610>
2196
2197         Reviewed by Chris Dumez.
2198
2199         Export 'shouldBlockCookies' so that it can be accessed by the WebKit framework.
2200
2201         * platform/network/NetworkStorageSession.h:
2202
2203 2018-03-27  Antoine Quint  <graouts@apple.com>
2204
2205         [Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
2206         https://bugs.webkit.org/show_bug.cgi?id=184038
2207
2208         Reviewed by Dean Jackson.
2209
2210         Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.
2211
2212         * testing/InternalSettings.cpp:
2213         (WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
2214         * testing/InternalSettings.h:
2215         * testing/InternalSettings.idl:
2216
2217 2018-03-27  Thibault Saunier  <tsaunier@igalia.com>
2218
2219         [GStreamer] Enhance debugging in the BasePlayer
2220         https://bugs.webkit.org/show_bug.cgi?id=184035
2221
2222         Reviewed by Philippe Normand.
2223
2224         No behaviour changes so no test were added/enabled.
2225
2226         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2227         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
2228         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2229         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
2230         (WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
2231         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
2232         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
2233         (WebCore::MediaPlayerPrivateGStreamerBase::muted const):
2234         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2235         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2236         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
2237         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
2238         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
2239         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
2240         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
2241
2242 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
2243
2244         Make AVFoundationEnabled preference available on iOS
2245         https://bugs.webkit.org/show_bug.cgi?id=183876
2246         <rdar://problem/38726459>
2247
2248         Reviewed by Youenn Fablet.
2249
2250         Test: AVFoundationPref API test.
2251
2252         * html/HTMLAudioElement.idl: There is no need for a runtime setting to enable/disable audio,
2253         there is already settings.mediaEnabled.
2254         * html/HTMLMediaElement.cpp:
2255         (WebCore::HTMLMediaElement::prepareForLoad): Fail if there are no media engines registered.
2256         (WebCore::HTMLMediaElement::noneSupported): Return early if m_error has already been set.
2257         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove a typo.
2258
2259         * page/RuntimeEnabledFeatures.cpp:
2260         (WebCore::RuntimeEnabledFeatures::audioEnabled const): Deleted.
2261         * page/RuntimeEnabledFeatures.h:
2262
2263 2018-03-27  Fujii Hironori  <Hironori.Fujii@sony.com>
2264
2265         [GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed
2266         https://bugs.webkit.org/show_bug.cgi?id=176799
2267
2268         Reviewed by Carlos Garcia Campos.
2269
2270         The length of a surrogate-pair UTF-16 character is 2 even though
2271         the number of characters is 1. An incorrect string length was
2272         passed to enchant_dict_check if the string contains a
2273         surrogate-pair character because the length was calculated by
2274         applying UTF-16 character position to UTF-8 string.
2275
2276         No new tests (Covered by existing tests).
2277
2278         * platform/text/enchant/TextCheckerEnchant.cpp:
2279         (WebCore::TextCheckerEnchant::checkSpellingOfWord): Changed the
2280         type of an argument `word` from CString to String. Convert a
2281         substring of the argument into UTF-8.
2282         (WebCore::TextCheckerEnchant::checkSpellingOfString): Pass the
2283         original UTF-16 string to checkSpellingOfWord instead of a
2284         converted UTF-8 string.
2285         * platform/text/enchant/TextCheckerEnchant.h: Changed the type of
2286         an argument `word` from CString to String.
2287
2288 2018-03-26  Ms2ger  <Ms2ger@igalia.com>
2289
2290         Remove an unnecessary const_cast from BitmapTextureGL::updateContents().
2291         https://bugs.webkit.org/show_bug.cgi?id=184007
2292
2293         Reviewed by Žan Doberšek.
2294
2295         No new tests.
2296
2297         * platform/graphics/texmap/BitmapTextureGL.cpp:
2298         (WebCore::BitmapTextureGL::updateContents):
2299
2300 2018-03-23  Antoine Quint  <graouts@apple.com>
2301
2302         [Web Animations] Make imported/mozilla/css-animations/test_animation-currenttime.html pass reliably
2303         https://bugs.webkit.org/show_bug.cgi?id=183819
2304
2305         Reviewed by Dean Jackson.
2306
2307         The current time for a CSS Animation exposed via the API should be clamped between 0 and the animation duration.
2308
2309         * animation/CSSAnimation.cpp:
2310         (WebCore::CSSAnimation::bindingsCurrentTime const):
2311         * animation/CSSAnimation.h:
2312         * animation/WebAnimation.h:
2313
2314 2018-03-23  Antoine Quint  <graouts@apple.com>
2315
2316         [Web Animations] Correctly handle timing functions specified by CSS Animations and CSS Transitions
2317         https://bugs.webkit.org/show_bug.cgi?id=183935
2318
2319         Reviewed by Dean Jackson.
2320
2321         We were incorrectly reflecting the animation-timing-function and transition-timing-function values on the generated
2322         DeclarativeAnimation effect timing "easing" property. In fact, those values should only be represented on the keyframes.
2323
2324         In the case of a CSS Animation, the animation-timing-function property set on the element's style serves as the default
2325         value used for all keyframes, and individual keyframes can specify an overriding animation-timing-function. For a CSS
2326         Transition, the transition-timing-function property set on the element's style serves as the timing function of the
2327         from keyframe.
2328
2329         To correctly reflect this, we provide a new timingFunctionForKeyframeAtIndex() function on KeyframeEffectReadOnly
2330         which will return the right TimingFunction object at a given index, regardless of the animation type. In the case
2331         of getKeyframes(), we manually return "linear" for the "to" keyframe since timingFunctionForKeyframeAtIndex()
2332         would otherwise return the same timing function as the "from" keyframe. This avoids creating an extra
2333         LinearTimingFunction object.
2334
2335         As a result, a number of Mozilla imported tests progress since we have correct information on the "easing" property
2336         of objects returned by getKeyframes() and the "progress" reported by getComputedTiming() now always uses a linear
2337         timing function.
2338
2339         * animation/DeclarativeAnimation.cpp:
2340         (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): The timing function of the backing Animation should
2341         not be reflected on the effect's timing object.
2342         * animation/KeyframeEffectReadOnly.cpp:
2343         (WebCore::KeyframeEffectReadOnly::getKeyframes): Return the correct timing function for a keyframe, and use a "linear"
2344         value for the "to" keyframe of a CSS Transition.
2345         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
2346         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
2347         * animation/KeyframeEffectReadOnly.h:
2348
2349 2018-03-26  Chris Dumez  <cdumez@apple.com>
2350
2351         Use SecurityOriginData more consistently in Service Worker code
2352         https://bugs.webkit.org/show_bug.cgi?id=183969
2353
2354         Reviewed by Darin Adler.
2355
2356         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
2357         SecurityOrigin objects unnecessarily.
2358
2359         I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
2360         code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
2361         in some cases as callers can now use SecurityOrigin::data() instead of
2362         SecurityOriginData::fromSecurityOrigin().
2363
2364         No new tests, no Web-facing behavior change.
2365
2366         * Modules/cache/DOMCacheStorage.cpp:
2367         (WebCore::DOMCacheStorage::origin const):
2368         * Modules/encryptedmedia/CDM.cpp:
2369         (WebCore::CDM::storageDirectory const):
2370         * Modules/encryptedmedia/MediaKeySession.cpp:
2371         (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
2372         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2373         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
2374         * Modules/indexeddb/IDBFactory.cpp:
2375         (WebCore::IDBFactory::openInternal):
2376         (WebCore::IDBFactory::deleteDatabase):
2377         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2378         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
2379         * Modules/webdatabase/Database.cpp:
2380         (WebCore::Database::securityOrigin):
2381         * Modules/webdatabase/DatabaseContext.cpp:
2382         (WebCore::DatabaseContext::securityOrigin const):
2383         * Modules/webdatabase/DatabaseContext.h:
2384         * Modules/webdatabase/DatabaseManager.cpp:
2385         (WebCore::DatabaseManager::fullPathForDatabase):
2386         (WebCore::DatabaseManager::detailsForNameAndOrigin):
2387         * html/HTMLMediaElement.cpp:
2388         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
2389         * inspector/agents/InspectorDOMStorageAgent.cpp:
2390         (WebCore::InspectorDOMStorageAgent::findStorageArea):
2391         * loader/appcache/ApplicationCacheStorage.cpp:
2392         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
2393         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
2394         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
2395         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
2396         (WebCore::ApplicationCacheStorage::store):
2397         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
2398         * page/DOMWindow.cpp:
2399         (WebCore:: const):
2400         * page/SecurityOrigin.cpp:
2401         (WebCore::SecurityOrigin::SecurityOrigin):
2402         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
2403         (WebCore::SecurityOrigin::canAccess const):
2404         (WebCore::SecurityOrigin::canDisplay const):
2405         (WebCore::SecurityOrigin::domainForCachePartition const):
2406         (WebCore::SecurityOrigin::isLocal const):
2407         (WebCore::SecurityOrigin::toString const):
2408         (WebCore::SecurityOrigin::toRawString const):
2409         (WebCore::SecurityOrigin::create):
2410         (WebCore::SecurityOrigin::isSameSchemeHostPort const):
2411         * page/SecurityOrigin.h:
2412         (WebCore::SecurityOrigin::protocol const):
2413         (WebCore::SecurityOrigin::host const):
2414         (WebCore::SecurityOrigin::port const):
2415         (WebCore::SecurityOrigin::data const):
2416         (WebCore::SecurityOrigin::isHTTPFamily const):
2417         * page/SecurityOriginData.cpp:
2418         (WebCore::SecurityOriginData::toString const):
2419         (WebCore::SecurityOriginData::fromFrame):
2420         * page/SecurityOriginData.h:
2421         (WebCore::SecurityOriginData::fromURL):
2422         * storage/StorageNamespaceProvider.cpp:
2423         (WebCore::StorageNamespaceProvider::localStorageArea):
2424         * testing/Internals.cpp:
2425         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
2426         * workers/service/ServiceWorkerContainer.cpp:
2427         (WebCore::ServiceWorkerContainer::addRegistration):
2428         (WebCore::ServiceWorkerContainer::removeRegistration):
2429         (WebCore::ServiceWorkerContainer::updateRegistration):
2430         * workers/service/ServiceWorkerRegistrationKey.cpp:
2431         (WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
2432         * workers/service/ServiceWorkerRegistrationKey.h:
2433         * workers/service/server/SWOriginStore.cpp:
2434         (WebCore::SWOriginStore::add):
2435         (WebCore::SWOriginStore::remove):
2436         (WebCore::SWOriginStore::clear):
2437         * workers/service/server/SWOriginStore.h:
2438         * workers/service/server/SWServer.cpp:
2439         (WebCore::SWServer::addRegistration):
2440         (WebCore::SWServer::removeRegistration):
2441         (WebCore::SWServer::clear):
2442         (WebCore::SWServer::tryInstallContextData):
2443         (WebCore::SWServer::serverToContextConnectionCreated):
2444         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
2445         (WebCore::SWServer::unregisterServiceWorkerClient):
2446         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
2447         * workers/service/server/SWServer.h:
2448         * workers/service/server/SWServerToContextConnection.cpp:
2449         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
2450         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
2451         (WebCore::SWServerToContextConnection::connectionForOrigin):
2452         * workers/service/server/SWServerToContextConnection.h:
2453         (WebCore::SWServerToContextConnection::securityOrigin const):
2454         * workers/service/server/SWServerWorker.cpp:
2455         (WebCore::SWServerWorker::origin const):
2456         (WebCore::SWServerWorker::securityOrigin const):
2457         * workers/service/server/SWServerWorker.h:
2458
2459 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
2460
2461         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
2462         https://bugs.webkit.org/show_bug.cgi?id=183911
2463         <rdar://problem/38762306>
2464
2465         Reviewed by Youenn Fablet.
2466
2467         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
2468         should never call Cookie API directly. That should only happen in the Networking or
2469         UIProcess. 
2470
2471         Add a new static flag to NetworkStorageSession that indicates if the current process has
2472         permission to interact with the Cookie API.
2473
2474         No new tests since there is no change in behavior.
2475
2476         * platform/network/NetworkStorageSession.cpp:
2477         (WebCore::NetworkStorageSession::NetworkStorageSession):
2478         (WebCore::NetworkStorageSession::processMayUseCookieAPI): Added.
2479         (WebCore::NetworkStorageSession::permitProcessToUseCookieAPI): Added. This also adds
2480         the appropriate flag to the ProcessPrivileges data for the current process.
2481         * platform/network/NetworkStorageSession.h:
2482         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2483         (WebCore::createCFStorageSessionForIdentifier): Do not create cookie storage if the current
2484         process is prohibited from interacting with the Cookie API.
2485         (WebCore::NetworkStorageSession::NetworkStorageSession): Add assertions.
2486         (WebCore::NetworkStorageSession::switchToNewTestingSession): Do not create cookie storage if
2487         the current process is prohibited from interacting with the Cookie API.
2488         (WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
2489         (WebCore::NetworkStorageSession::ensureSession): Ditto.
2490         (WebCore::NetworkStorageSession::cookieStorage const): Ditto.
2491         * platform/network/cocoa/CookieStorageObserver.mm:
2492         (WebCore::CookieStorageObserver::CookieStorageObserver): Assert if accessed from untrusted process.
2493         (WebCore::CookieStorageObserver::startObserving): Ditto.
2494         (WebCore::CookieStorageObserver::stopObserving): Ditto.
2495         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2496         (WebCore::NetworkStorageSession::setCookie):
2497         (WebCore::NetworkStorageSession::setCookies):
2498         (WebCore::NetworkStorageSession::deleteCookie):
2499         (WebCore::nsCookiesToCookieVector):
2500         (WebCore::NetworkStorageSession::getAllCookies):
2501         (WebCore::NetworkStorageSession::getCookies):
2502         (WebCore::NetworkStorageSession::flushCookieStore):
2503         (WebCore::NetworkStorageSession::nsCookieStorage const):
2504         (WebCore::createPrivateStorageSession):
2505         * platform/network/mac/CookieJarMac.mm:
2506         (WebCore::httpCookies):
2507         (WebCore::deleteHTTPCookie):
2508         (WebCore::httpCookiesForURL):
2509         (WebCore::filterCookies):
2510         (WebCore::applyPartitionToCookies):
2511         (WebCore::cookiesInPartitionForURL):
2512         (WebCore::cookiesForSession):
2513         (WebCore::setHTTPCookiesForURL):
2514         (WebCore::deleteAllHTTPCookies):
2515         (WebCore::setCookiesFromDOM):
2516         (WebCore::httpCookieAcceptPolicy):
2517         (WebCore::deleteCookie):
2518         (WebCore::deleteCookiesForHostnames):
2519         (WebCore::deleteAllCookiesModifiedSince):
2520
2521 2018-03-26  Alex Christensen  <achristensen@webkit.org>
2522
2523         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
2524         https://bugs.webkit.org/show_bug.cgi?id=183965
2525
2526         Reviewed by Chris Dumez.
2527
2528         It turns out that ResourceHandleClient::willCacheResponseAsync didn't do anything and the logic in
2529         ResourceHandleClient::willCacheResponse was not being called.  This makes it so there is one code
2530         path and it executes the logic in ResourceHandleClient::willCacheResponse.
2531
2532         * loader/EmptyFrameLoaderClient.h:
2533         * loader/FrameLoaderClient.h:
2534         * loader/ResourceLoader.h:
2535         * loader/SubresourceLoader.h:
2536         * loader/cocoa/SubresourceLoaderCocoa.mm:
2537         (WebCore::SubresourceLoader::willCacheResponseAsync):
2538         (WebCore::SubresourceLoader::willCacheResponse): Deleted.
2539         * loader/mac/ResourceLoaderMac.mm:
2540         (WebCore::ResourceLoader::willCacheResponseAsync):
2541         (WebCore::ResourceLoader::willCacheResponse): Deleted.
2542         * platform/network/ResourceHandle.h:
2543         * platform/network/ResourceHandleClient.cpp:
2544         (WebCore::ResourceHandleClient::willCacheResponseAsync): Deleted.
2545         * platform/network/ResourceHandleClient.h:
2546         (WebCore::ResourceHandleClient::willCacheResponseAsync):
2547         (WebCore::ResourceHandleClient::shouldCacheResponse):
2548         (WebCore::ResourceHandleClient::willCacheResponse): Deleted.
2549         * platform/network/cf/ResourceHandleCFNet.cpp:
2550         (WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
2551         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
2552         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2553         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
2554         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillCacheResponse): Deleted.
2555         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
2556         * platform/network/mac/ResourceHandleMac.mm:
2557         (WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
2558         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
2559         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2560         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
2561         (-[WebCoreResourceHandleAsOperationQueueDelegate continueWillCacheResponse:]): Deleted.
2562
2563 2018-03-26  Miguel Gomez  <magomez@igalia.com>
2564
2565         [GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
2566         https://bugs.webkit.org/show_bug.cgi?id=184004
2567
2568         Reviewed by Žan Doberšek.
2569
2570         Do not upload the original buffer. Upload the result of creating a subImage buffer
2571         if it was required.
2572
2573         Covered by existent tests.
2574
2575         * platform/graphics/texmap/BitmapTextureGL.cpp:
2576         (WebCore::BitmapTextureGL::updateContents):
2577
2578 2018-03-25  Zan Dobersek  <zdobersek@igalia.com>
2579
2580         [TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
2581         https://bugs.webkit.org/show_bug.cgi?id=183985
2582
2583         Reviewed by Michael Catanzaro.
2584
2585         Clean up TextureMapperPlatformLayer and TextureMapperBackingStore
2586         headers and implementation files. Remove dubious whitespace, use #pragma
2587         once, clean up constructors, destructors, method definitions and remove
2588         unnecessary includes in favor of forward declarations where possible.
2589
2590         The TextureMapperPlatformLayer::swapBuffers() method is removed as it
2591         wasn't called or overridden anywhere.
2592
2593         No new tests -- no change in functionality.
2594
2595         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
2596         * platform/graphics/texmap/TextureMapperBackingStore.h:
2597         (WebCore::TextureMapperBackingStore::drawRepaintCounter):
2598         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
2599         (WebCore::TextureMapperPlatformLayer::setClient):
2600         (WebCore::TextureMapperPlatformLayer::TextureMapperPlatformLayer): Deleted.
2601         (WebCore::TextureMapperPlatformLayer::swapBuffers): Deleted.
2602
2603 2018-03-25  Dan Bernstein  <mitz@apple.com>
2604
2605         [Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
2606         https://bugs.webkit.org/show_bug.cgi?id=183999
2607
2608         Reviewed by Sam Weinig.
2609
2610         * Configurations/WebCore.xcconfig: Removed build settings.
2611         * Configurations/WebCoreTestSupport.xcconfig: Removed location of phony WebKitLegacy from
2612           frameworks search path.
2613         * Configurations/WebKitLegacyStub.iOS.tbd: Removed.
2614         * WebCore.xcodeproj/project.pbxproj: Removed script build phase from the Derived Sources target.
2615
2616 2018-03-25  Commit Queue  <commit-queue@webkit.org>
2617
2618         Unreviewed, rolling out r229954.
2619         https://bugs.webkit.org/show_bug.cgi?id=184000
2620
2621         Caused many layout tests to crash on Apple High Sierra,
2622         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
2623         by dydz on #webkit).
2624
2625         Reverted changeset:
2626
2627         "Use SecurityOriginData more consistently in Service Worker
2628         code"
2629         https://bugs.webkit.org/show_bug.cgi?id=183969
2630         https://trac.webkit.org/changeset/229954
2631
2632 2018-03-23  Alex Christensen  <achristensen@webkit.org>
2633
2634         Use completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync
2635         https://bugs.webkit.org/show_bug.cgi?id=183966
2636
2637         Reviewed by Chris Dumez.
2638
2639         No change in behavior.
2640
2641         * loader/ResourceLoader.cpp:
2642         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
2643         * loader/ResourceLoader.h:
2644         * platform/network/BlobResourceHandle.cpp:
2645         * platform/network/PingHandle.h:
2646         * platform/network/ResourceHandle.h:
2647         * platform/network/ResourceHandleClient.h:
2648         * platform/network/SynchronousLoaderClient.cpp:
2649         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
2650         * platform/network/SynchronousLoaderClient.h:
2651         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
2652         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2653         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
2654         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
2655         * platform/network/mac/ResourceHandleMac.mm:
2656         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
2657         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
2658         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
2659         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2660         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
2661         (-[WebCoreResourceHandleAsOperationQueueDelegate continueCanAuthenticateAgainstProtectionSpace:]): Deleted.
2662
2663 2018-03-24  Chris Dumez  <cdumez@apple.com>
2664
2665         Use SecurityOriginData more consistently in Service Worker code
2666         https://bugs.webkit.org/show_bug.cgi?id=183969
2667
2668         Reviewed by Darin Adler.
2669
2670         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
2671         SecurityOrigin objects unnecessarily.
2672
2673         I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
2674         code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
2675         in some cases as callers can now use SecurityOrigin::data() instead of
2676         SecurityOriginData::fromSecurityOrigin().
2677
2678         No new tests, no Web-facing behavior change.
2679
2680         * Modules/cache/DOMCacheStorage.cpp:
2681         (WebCore::DOMCacheStorage::origin const):
2682         * Modules/encryptedmedia/CDM.cpp:
2683         (WebCore::CDM::storageDirectory const):
2684         * Modules/encryptedmedia/MediaKeySession.cpp:
2685         (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
2686         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2687         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
2688         * Modules/indexeddb/IDBFactory.cpp:
2689         (WebCore::IDBFactory::openInternal):
2690         (WebCore::IDBFactory::deleteDatabase):
2691         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2692         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
2693         * Modules/webdatabase/Database.cpp:
2694         (WebCore::Database::securityOrigin):
2695         * Modules/webdatabase/DatabaseContext.cpp:
2696         (WebCore::DatabaseContext::securityOrigin const):
2697         * Modules/webdatabase/DatabaseContext.h:
2698         * Modules/webdatabase/DatabaseManager.cpp:
2699         (WebCore::DatabaseManager::fullPathForDatabase):
2700         (WebCore::DatabaseManager::detailsForNameAndOrigin):
2701         * html/HTMLMediaElement.cpp:
2702         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
2703         * inspector/agents/InspectorDOMStorageAgent.cpp:
2704         (WebCore::InspectorDOMStorageAgent::findStorageArea):
2705         * loader/appcache/ApplicationCacheStorage.cpp:
2706         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
2707         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
2708         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
2709         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
2710         (WebCore::ApplicationCacheStorage::store):
2711         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
2712         * page/DOMWindow.cpp:
2713         (WebCore:: const):
2714         * page/SecurityOrigin.cpp:
2715         (WebCore::SecurityOrigin::SecurityOrigin):
2716         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
2717         (WebCore::SecurityOrigin::canAccess const):
2718         (WebCore::SecurityOrigin::canDisplay const):
2719         (WebCore::SecurityOrigin::domainForCachePartition const):
2720         (WebCore::SecurityOrigin::isLocal const):
2721         (WebCore::SecurityOrigin::toString const):
2722         (WebCore::SecurityOrigin::toRawString const):
2723         (WebCore::SecurityOrigin::create):
2724         (WebCore::SecurityOrigin::isSameSchemeHostPort const):
2725         * page/SecurityOrigin.h:
2726         (WebCore::SecurityOrigin::protocol const):
2727         (WebCore::SecurityOrigin::host const):
2728         (WebCore::SecurityOrigin::port const):
2729         (WebCore::SecurityOrigin::data const):
2730         (WebCore::SecurityOrigin::isHTTPFamily const):
2731         * page/SecurityOriginData.cpp:
2732         (WebCore::SecurityOriginData::toString const):
2733         (WebCore::SecurityOriginData::fromFrame):
2734         * page/SecurityOriginData.h:
2735         (WebCore::SecurityOriginData::fromURL):
2736         * storage/StorageNamespaceProvider.cpp:
2737         (WebCore::StorageNamespaceProvider::localStorageArea):
2738         * testing/Internals.cpp:
2739         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
2740         * workers/service/ServiceWorkerContainer.cpp:
2741         (WebCore::ServiceWorkerContainer::addRegistration):
2742         (WebCore::ServiceWorkerContainer::removeRegistration):
2743         (WebCore::ServiceWorkerContainer::updateRegistration):
2744         * workers/service/ServiceWorkerRegistrationKey.cpp:
2745         (WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
2746         * workers/service/ServiceWorkerRegistrationKey.h:
2747         * workers/service/server/SWOriginStore.cpp:
2748         (WebCore::SWOriginStore::add):
2749         (WebCore::SWOriginStore::remove):
2750         (WebCore::SWOriginStore::clear):
2751         * workers/service/server/SWOriginStore.h:
2752         * workers/service/server/SWServer.cpp:
2753         (WebCore::SWServer::addRegistration):
2754         (WebCore::SWServer::removeRegistration):
2755         (WebCore::SWServer::clear):
2756         (WebCore::SWServer::tryInstallContextData):
2757         (WebCore::SWServer::serverToContextConnectionCreated):
2758         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
2759         (WebCore::SWServer::unregisterServiceWorkerClient):
2760         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
2761         * workers/service/server/SWServer.h:
2762         * workers/service/server/SWServerToContextConnection.cpp:
2763         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
2764         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
2765         (WebCore::SWServerToContextConnection::connectionForOrigin):
2766         * workers/service/server/SWServerToContextConnection.h:
2767         (WebCore::SWServerToContextConnection::securityOrigin const):
2768         * workers/service/server/SWServerWorker.cpp:
2769         (WebCore::SWServerWorker::origin const):
2770         (WebCore::SWServerWorker::securityOrigin const):
2771         * workers/service/server/SWServerWorker.h:
2772
2773 2018-03-24  Commit Queue  <commit-queue@webkit.org>
2774
2775         Unreviewed, rolling out r229792.
2776         https://bugs.webkit.org/show_bug.cgi?id=183980
2777
2778         not actually necessary (Requested by thorton on #webkit).
2779
2780         Reverted changeset:
2781
2782         "Fix the build"
2783         https://trac.webkit.org/changeset/229792
2784
2785 2018-03-23  Tim Horton  <timothy_horton@apple.com>
2786
2787         Fix the geolocation build
2788         https://bugs.webkit.org/show_bug.cgi?id=183975
2789
2790         * Modules/geolocation/ios/GeolocationPositionIOS.mm:
2791         (WebCore::GeolocationPosition::GeolocationPosition):
2792
2793 2018-03-23  Tim Horton  <timothy_horton@apple.com>
2794
2795         Fix the build with no pasteboard
2796         https://bugs.webkit.org/show_bug.cgi?id=183973
2797
2798         Reviewed by Dan Bernstein.
2799
2800         * Configurations/FeatureDefines.xcconfig:
2801         * platform/ios/PlatformPasteboardIOS.mm:
2802
2803 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2804
2805         [Extra zoom mode] Fix some localizable strings after r229878
2806         https://bugs.webkit.org/show_bug.cgi?id=183963
2807
2808         Reviewed by Tim Horton.
2809
2810         The WEB_UI_STRING macro was incorrectly used for certain localized strings pertaining to extra zoom mode. To
2811         correct this, make the "Done" string use WEB_UI_STRING with actual UI-facing text; since day, year and month
2812         labels in the date picker are less generalizable to other UI, leave these as unique keys, but change them to
2813         use WEB_UI_STRING_KEY instead.
2814
2815         Additionally, remove now-unused localizable strings for the text input view controller.
2816
2817         * English.lproj/Localizable.strings:
2818         * platform/LocalizedStrings.cpp:
2819         (WebCore::formControlDoneButtonTitle):
2820         (WebCore::datePickerDayLabelTitle):
2821         (WebCore::datePickerMonthLabelTitle):
2822         (WebCore::datePickerYearLabelTitle):
2823
2824 2018-03-23  Chris Dumez  <cdumez@apple.com>
2825
2826         NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
2827         https://bugs.webkit.org/show_bug.cgi?id=183760
2828         <rdar://problem/37093299>
2829
2830         Reviewed by Ryosuke Niwa.
2831
2832         Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
2833         SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
2834         expects its key parameter to be a regular expression and it can match several
2835         keys. It is also unnecessary in our case since we already have an exact key.
2836         We now call the more efficient SCDynamicStoreCopyValue() instead, which is
2837         the right thing to call when we have an exact key.
2838
2839         This change was suggested by the SC team.
2840
2841         This was tested manually as there is no easy way to write an automated test
2842         for this.
2843
2844         In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
2845         to avoid calling it once per WebProcess.
2846
2847         * platform/network/mac/NetworkStateNotifierMac.cpp:
2848         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2849
2850 2018-03-23  Daniel Bates  <dabates@apple.com>
2851
2852         Unreviewed, rolling out r229868.
2853
2854         Caused media controls tests to timeout. Will investigate
2855         offline.
2856
2857         Reverted changeset:
2858
2859         "CSS mask images should be retrieved using potentially CORS-
2860         enabled fetch"
2861         https://bugs.webkit.org/show_bug.cgi?id=179983
2862         https://trac.webkit.org/changeset/229868
2863
2864 2018-03-23  Mark Lam  <mark.lam@apple.com>
2865
2866         Add pointer profiling hooks to the CSS JIT.
2867         https://bugs.webkit.org/show_bug.cgi?id=183947
2868         <rdar://problem/38803593>
2869
2870         Reviewed by JF Bastien.
2871
2872         No new tests needed.  Covered by existing tests.
2873
2874         * bindings/scripts/CodeGeneratorJS.pm:
2875         (GenerateImplementation):
2876         - Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().
2877
2878         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2879         (WebCore::toJSNewlyCreated):
2880         * bindings/scripts/test/JS/JSMapLike.cpp:
2881         (WebCore::toJSNewlyCreated):
2882         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2883         (WebCore::toJSNewlyCreated):
2884         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2885         (WebCore::toJSNewlyCreated):
2886         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2887         (WebCore::toJSNewlyCreated):
2888         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2889         (WebCore::toJSNewlyCreated):
2890         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2891         (WebCore::toJSNewlyCreated):
2892         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2893         (WebCore::toJSNewlyCreated):
2894         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2895         (WebCore::toJSNewlyCreated):
2896         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2897         (WebCore::toJSNewlyCreated):
2898         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2899         (WebCore::toJSNewlyCreated):
2900         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2901         (WebCore::toJSNewlyCreated):
2902         * bindings/scripts/test/JS/JSTestException.cpp:
2903         (WebCore::toJSNewlyCreated):
2904         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2905         (WebCore::toJSNewlyCreated):
2906         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2907         (WebCore::toJSNewlyCreated):
2908         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2909         (WebCore::toJSNewlyCreated):
2910         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2911         (WebCore::toJSNewlyCreated):
2912         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2913         (WebCore::toJSNewlyCreated):
2914         * bindings/scripts/test/JS/JSTestIterable.cpp:
2915         (WebCore::toJSNewlyCreated):
2916         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2917         (WebCore::toJSNewlyCreated):
2918         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2919         (WebCore::toJSNewlyCreated):
2920         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2921         (WebCore::toJSNewlyCreated):
2922         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2923         (WebCore::toJSNewlyCreated):
2924         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2925         (WebCore::toJSNewlyCreated):
2926         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2927         (WebCore::toJSNewlyCreated):
2928         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2929         (WebCore::toJSNewlyCreated):
2930         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2931         (WebCore::toJSNewlyCreated):
2932         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2933         (WebCore::toJSNewlyCreated):
2934         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2935         (WebCore::toJSNewlyCreated):
2936         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2937         (WebCore::toJSNewlyCreated):
2938         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2939         (WebCore::toJSNewlyCreated):
2940         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2941         (WebCore::toJSNewlyCreated):
2942         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2943         (WebCore::toJSNewlyCreated):
2944         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2945         (WebCore::toJSNewlyCreated):
2946         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2947         (WebCore::toJSNewlyCreated):
2948         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2949         (WebCore::toJSNewlyCreated):
2950         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2951         (WebCore::toJSNewlyCreated):
2952         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2953         (WebCore::toJSNewlyCreated):
2954         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2955         (WebCore::toJSNewlyCreated):
2956         * bindings/scripts/test/JS/JSTestNode.cpp:
2957         (WebCore::toJSNewlyCreated):
2958         * bindings/scripts/test/JS/JSTestObj.cpp:
2959         (WebCore::toJSNewlyCreated):
2960         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2961         (WebCore::toJSNewlyCreated):
2962         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2963         (WebCore::toJSNewlyCreated):
2964         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2965         (WebCore::toJSNewlyCreated):
2966         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2967         (WebCore::toJSNewlyCreated):
2968         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2969         (WebCore::toJSNewlyCreated):
2970         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2971         (WebCore::toJSNewlyCreated):
2972         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2973         (WebCore::toJSNewlyCreated):
2974         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2975         (WebCore::toJSNewlyCreated):
2976         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2977         (WebCore::toJSNewlyCreated):
2978         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2979         (WebCore::toJSNewlyCreated):
2980         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2981         (WebCore::toJSNewlyCreated):
2982         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2983         (WebCore::toJSNewlyCreated):
2984         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2985         (WebCore::toJSNewlyCreated):
2986         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2987         (WebCore::toJSNewlyCreated):
2988         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2989         (WebCore::toJSNewlyCreated):
2990         * css/ElementRuleCollector.cpp:
2991         (WebCore::ElementRuleCollector::ruleMatches):
2992         * cssjit/SelectorCompiler.cpp:
2993         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2994         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2995         * cssjit/SelectorCompiler.h:
2996         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
2997         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
2998         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
2999         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
3000         * dom/SelectorQuery.cpp:
3001         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
3002         (WebCore::SelectorDataList::execute const):
3003
3004 2018-03-23  Sihui Liu  <sihui_liu@apple.com>
3005
3006         Local storage getItem() for an empty string returned UNDEFINED value.
3007         https://bugs.webkit.org/show_bug.cgi?id=69138
3008         <rdar://problem/13410974>
3009
3010         Reviewed by Brady Eidson.
3011
3012         * platform/sql/SQLiteStatement.cpp:
3013         (WebCore::SQLiteStatement::getColumnBlobAsString):
3014
3015 2018-03-23  Chris Dumez  <cdumez@apple.com>
3016
3017         Promptly terminate service worker processes when they are no longer needed
3018         https://bugs.webkit.org/show_bug.cgi?id=183873
3019         <rdar://problem/38676995>
3020
3021         Reviewed by Youenn Fablet.
3022
3023         The StorageProcess now keeps track of service worker clients for each security
3024         origin. When there is no longer any clients for a given security origin, the
3025         StorageProcess asks the service worker process for the given origin to terminate
3026         and severs its connection to it.
3027
3028         Change is covered by API test.
3029
3030         * workers/service/server/SWServer.cpp:
3031         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
3032         Pass the security origin since this is called when a service worker process
3033         crashes. When a service worker process for origin A crashes, we only want
3034         to mark service workers in origin A as terminated, not ALL of them.
3035
3036         (WebCore::SWServer::registerServiceWorkerClient):
3037         (WebCore::SWServer::unregisterServiceWorkerClient):
3038         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
3039         Tweak logic so that we only relaunch a service worker process if we still
3040         have clients for its security origin.
3041
3042         * workers/service/server/SWServer.h:
3043         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay):
3044         Add a way to disable the service worker termination delay to facilitate
3045         testing.
3046
3047         * workers/service/server/SWServerToContextConnection.h:
3048
3049 2018-03-23  Brady Eidson  <beidson@apple.com>
3050
3051         Go to back/forward list items after a process-swapped navigation.
3052         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
3053
3054         Reviewed by Andy Estes.
3055
3056         Covered by new API test.
3057
3058         Most of the changes to WebCore are teaching HistoryItem navigations to know when they should
3059         do a policy check or not.
3060
3061         * WebCore.xcodeproj/project.pbxproj:
3062
3063         * history/BackForwardController.cpp:
3064         (WebCore::BackForwardController::goBackOrForward):
3065         (WebCore::BackForwardController::goBack):
3066         (WebCore::BackForwardController::goForward):
3067
3068         * history/HistoryItem.cpp:
3069         (WebCore::HistoryItem::setStateObject): Actually push state object changes to the UIProcess.
3070           This was a long standing bug that made it difficult to effectively test this change.
3071
3072         * loader/FrameLoader.cpp:
3073         (WebCore::FrameLoader::loadURLIntoChildFrame):
3074         (WebCore::FrameLoader::loadDifferentDocumentItem):
3075         (WebCore::FrameLoader::loadItem):
3076         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
3077         * loader/FrameLoader.h:
3078         * loader/FrameLoaderTypes.h:
3079
3080         * loader/HistoryController.cpp:
3081         (WebCore::HistoryController::goToItem):
3082         (WebCore::HistoryController::setDefersLoading):
3083         (WebCore::HistoryController::recursiveGoToItem):
3084         * loader/HistoryController.h:
3085
3086         * loader/NavigationPolicyCheck.h:
3087
3088         * page/Page.cpp:
3089         (WebCore::Page::goToItem):
3090         * page/Page.h:
3091
3092 2018-03-23  John Wilander  <wilander@apple.com>
3093
3094         Resource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
3095         https://bugs.webkit.org/show_bug.cgi?id=183950
3096         <rdar://problem/38806275>
3097
3098         Reviewed by Brent Fulgham.
3099
3100         * loader/ResourceLoadStatistics.cpp:
3101         (WebCore::ResourceLoadStatistics::decode):
3102             Now isVeryPrevalentResource is decoded to the correct field.
3103
3104 2018-03-23  Youenn Fablet  <youenn@apple.com>
3105
3106         WebProcessPool should not ask to register all clients for each service worker process creation
3107         https://bugs.webkit.org/show_bug.cgi?id=183941
3108
3109         Reviewed by Chris Dumez.
3110
3111         Covered by existing unit tests.
3112         Register all Documents of a process no matter its session ID when asked to.
3113         Make sure that whenever a WebProcess is asked to do so, any further Document will be registered
3114         by calling setMayHaveRegisteredServiceWorkers().
3115         This ensures that a WebProcess created before any service worker but empty at the time a service worker is created
3116         will actually register all its future clients.
3117
3118         Add some assertions to ensure that a client is not registered twice.
3119
3120         * workers/service/ServiceWorkerProvider.cpp:
3121         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
3122         * workers/service/ServiceWorkerProvider.h:
3123         * workers/service/server/SWServer.cpp:
3124         (WebCore::SWServer::registerServiceWorkerClient):
3125
3126 2018-03-23  Eric Carlson  <eric.carlson@apple.com>
3127
3128         HTMLElement factory doesn't need to call MediaPlayer::isAvailable
3129         https://bugs.webkit.org/show_bug.cgi?id=183946
3130         <rdar://problem/38802687>
3131
3132         Reviewed by Youenn Fablet.
3133
3134         Test: media/media-disabled.html
3135
3136         * dom/make_names.pl:
3137         (printConstructorInterior):
3138         * page/Settings.yaml:
3139         * page/SettingsDefaultValues.h:
3140
3141 2018-03-23  David Kilzer  <ddkilzer@apple.com>
3142
3143         Stop using dispatch_set_target_queue()
3144         <https://webkit.org/b/183908>
3145         <rdar://problem/33553533>
3146
3147         Reviewed by Daniel Bates.
3148
3149         No new tests since no change in behavior.
3150
3151         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3152         (WebCore::globaVideoCaptureSerialQueue): Remove use of
3153         dispatch_set_target_queue() by changing dispatch_queue_create()
3154         to dispatch_queue_create_with_target().
3155
3156 2018-03-23  Youenn Fablet  <youenn@apple.com>
3157
3158         Use libwebrtc ObjectiveC H264 encoder and decoder
3159         https://bugs.webkit.org/show_bug.cgi?id=183912
3160
3161         Reviewed by Eric Carlson.
3162
3163         No observable change of behavior.
3164         Made use of libwebrtc WebKit utilities.
3165         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
3166
3167         * Configurations/WebCore.xcconfig:
3168         * SourcesCocoa.txt:
3169         * WebCore.xcodeproj/project.pbxproj:
3170         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
3171         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
3172         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
3173         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
3174         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
3175         (WebCore::LibWebRTCProviderCocoa::setActive):
3176         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
3177         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
3178         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
3179         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
3180         * testing/Internals.cpp: Removed commented out include.
3181
3182 2018-03-23  Youenn Fablet  <youenn@apple.com>
3183
3184         DocumentThreadableLoader should send credentials after redirections and preflight if fetch option credentials is include
3185         https://bugs.webkit.org/show_bug.cgi?id=183928
3186
3187         Reviewed by Chris Dumez.
3188
3189         Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html
3190                imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html
3191
3192         In case mode is include, keep sending credentials even after redirection with preflight.
3193
3194         * loader/DocumentThreadableLoader.cpp:
3195         (WebCore::DocumentThreadableLoader::redirectReceived):
3196
3197 2018-03-23  Tim Horton  <timothy_horton@apple.com>
3198
3199         Fix the build after r229858
3200
3201         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3202
3203 2018-03-23  Youenn Fablet  <youenn@apple.com>
3204
3205         Allow fully whitelisted plug-ins to match non HTTP URLs
3206         https://bugs.webkit.org/show_bug.cgi?id=183938
3207         rdar://problem/38534312
3208
3209         Reviewed by Chris Dumez.
3210
3211         Covered by manual testing and unit testing.
3212
3213         * platform/URL.cpp:
3214         (WebCore::URL::isMatchingDomain const):
3215
3216 2018-03-23  Youenn Fablet  <youenn@apple.com>
3217
3218         ActiveDOMObject should assert that they are destroyed in the thread they are created
3219         https://bugs.webkit.org/show_bug.cgi?id=183671
3220
3221         Reviewed by Chris Dumez.
3222
3223         No change of behavior.
3224         Moved MessagePort assertion to ActiveDOMObject.
3225
3226         * dom/ActiveDOMObject.cpp:
3227         (WebCore::ActiveDOMObject::~ActiveDOMObject):
3228         * dom/ActiveDOMObject.h:
3229         * dom/MessagePort.cpp:
3230         (WebCore::MessagePort::~MessagePort):
3231         * dom/MessagePort.h:
3232
3233 2018-03-23  Youenn Fablet  <youenn@apple.com>
3234
3235         Safari WebKitWebRTCAudioModule crash during <video> tag update when audio track present in MediaStream
3236         https://bugs.webkit.org/show_bug.cgi?id=181180
3237         <rdar://problem/36302375>
3238
3239         Reviewed by Eric Carlson.
3240
3241         Test: webrtc/video-update-often.html
3242
3243         AudioTrackPrivateMediaStreamCocoa needs to be destroyed in the main thread since it owns a Ref to its MediaStreamTrackPrivate.
3244         We can still ref it on a background thread but we always deref it on the main thread.
3245
3246         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3247         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3248         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
3249
3250 2018-03-23  Sergio Villar Senin  <svillar@igalia.com>
3251
3252         [css-grid] Fix auto repeat tracks computation with definite min sizes
3253         https://bugs.webkit.org/show_bug.cgi?id=183933
3254
3255         Reviewed by Javier Fernandez.
3256
3257         Indefinitely sized containers use the specified definite min-size (if any) as available
3258         space in order to compute the number of auto repeat tracks to create. A bug in that code was
3259         causing the grid to be one track larger than expected. That was only happening in the case
3260         of the free space being a multiple of the total size of the autorepeat tracks.
3261
3262         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html
3263
3264         * rendering/RenderGrid.cpp:
3265         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
3266
3267 2018-03-23  Miguel Gomez  <magomez@igalia.com>
3268
3269         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
3270         https://bugs.webkit.org/show_bug.cgi?id=183892
3271
3272         Reviewed by Žan Doberšek.
3273
3274         Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
3275         the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
3276         conversion during the painting. This way we don't need to swap the R and B components on the CPU.
3277         Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
3278         remove the UpdateContentsFlag as we never need to modify the original image data.
3279
3280         Covered by existent tests.
3281
3282         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3283         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
3284         * platform/graphics/texmap/BitmapTexture.cpp:
3285         (WebCore::BitmapTexture::updateContents):
3286         * platform/graphics/texmap/BitmapTexture.h:
3287         * platform/graphics/texmap/BitmapTextureGL.cpp:
3288         (WebCore::BitmapTextureGL::BitmapTextureGL):
3289         (WebCore::BitmapTextureGL::didReset):
3290         (WebCore::BitmapTextureGL::updateContents):
3291         (WebCore::BitmapTextureGL::applyFilters):
3292         (WebCore::swizzleBGRAToRGBA): Deleted.
3293         (WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
3294         * platform/graphics/texmap/BitmapTextureGL.h:
3295         (WebCore::BitmapTextureGL::colorConvertFlags const):
3296         * platform/graphics/texmap/BitmapTexturePool.cpp:
3297         (WebCore::BitmapTexturePool::acquireTexture):
3298         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
3299         * platform/graphics/texmap/BitmapTexturePool.h:
3300         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3301         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
3302         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
3303         (WebCore::TextureMapperContextAttributes::get):
3304         * platform/graphics/texmap/TextureMapperContextAttributes.h:
3305         * platform/graphics/texmap/TextureMapperGL.cpp:
3306         (WebCore::TextureMapperGL::drawNumber):
3307         (WebCore::TextureMapperGL::drawTexture):
3308         * platform/graphics/texmap/TextureMapperGL.h:
3309         * platform/graphics/texmap/TextureMapperLayer.cpp:
3310         (WebCore::TextureMapperLayer::paintIntoSurface):
3311         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
3312         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
3313         * platform/graphics/texmap/TextureMapperTile.cpp:
3314         (WebCore::TextureMapperTile::updateContents):
3315         * platform/graphics/texmap/TextureMapperTile.h:
3316         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
3317         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
3318         (WebCore::TextureMapperTiledBackingStore::updateContents):
3319         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
3320
3321 2018-03-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3322
3323         [WTF] Add standard containers with FastAllocator specialization
3324         https://bugs.webkit.org/show_bug.cgi?id=183789
3325
3326         Reviewed by Darin Adler.
3327
3328         * Modules/indexeddb/IDBKeyData.h:
3329         * Modules/mediasource/SampleMap.h:
3330         * Modules/mediasource/SourceBuffer.cpp:
3331         * Modules/webauthn/cbor/CBORValue.h:
3332         It did not use FastAllocator for its container.
3333
3334         * page/WheelEventTestTrigger.h:
3335         * platform/audio/PlatformMediaSessionManager.h:
3336         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
3337         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3338         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3339         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3340         * platform/graphics/cv/VideoTextureCopierCV.cpp:
3341         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
3342         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3343         * platform/wpe/PlatformPasteboardWPE.cpp:
3344         * rendering/OrderIterator.h:
3345
3346 2018-03-23  Antoine Quint  <graouts@apple.com>
3347
3348         [Web Animations] infinite repeat counts aren't reflected for CSS Animations
3349         https://bugs.webkit.org/show_bug.cgi?id=183932
3350
3351         Reviewed by Dean Jackson.
3352
3353         The "infinite" value for animation-repeat-count is reflected as a special value which resolves to -1. We need to check
3354         for this special value before setting the iterations count on the AnimationEffectTimingReadOnly object.
3355
3356         * animation/CSSAnimation.cpp:
3357         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
3358
3359 2018-03-22  Antoine Quint  <graouts@apple.com>
3360
3361         [Web Animations] Correctly cancel animations when a parent gets a "display: none" style or when an element is removed
3362         https://bugs.webkit.org/show_bug.cgi?id=183919
3363
3364         Reviewed by Dean Jackson.
3365
3366         The old CSSAnimationController provided a cancelAnimations(Element&) method that allowed for animations for a given element
3367         to be canceled when a parent element in the hierarchy gets a "display: none" style or if an element with animations is removed.
3368         We add a similar cancelAnimationsForElement(Element&) method on AnimationTimeline and update CSSAnimationController::cancelAnimations()
3369         call sites to use AnimationTimeline::cancelAnimationsForElement() when the flag to use Web Animations is on.
3370
3371         * animation/AnimationTimeline.cpp:
3372         (WebCore::AnimationTimeline::cancelAnimationsForElement): Iterate over all animations for the provided element and call cancel() on them.
3373         * animation/AnimationTimeline.h:
3374         * animation/DocumentTimeline.cpp:
3375         (WebCore::DocumentTimeline::animatedStyleForRenderer): Drive-by fix while I was reviewed call sites to animationsForElement() to make
3376         sure we don't create extra RefPtr<> objects.
3377         * dom/Element.cpp:
3378         (WebCore::Element::removedFromAncestor): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when an
3379         element is removed.
3380         * dom/PseudoElement.cpp:
3381         (WebCore::PseudoElement::clearHostElement): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when
3382         a pseudo-element is removed.
3383         * rendering/updating/RenderTreeUpdater.cpp:
3384         (WebCore::RenderTreeUpdater::tearDownRenderers): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on
3385         for all children elements when an element gets a "display: none" style.
3386
3387 2018-03-23  Antoine Quint  <graouts@apple.com>
3388
3389         [Web Animations] Animated transform styles are ignored when calling getComputedStyle()
3390         https://bugs.webkit.org/show_bug.cgi?id=183918
3391
3392         Reviewed by Dean Jackson.
3393
3394         Strictly looking at whether the renderer has a transform is a bad idea when determining whether a
3395         transform is applied for an element. Looking at the RenderStyle is preferable because in the case
3396         of animations running on the compositor, such as a transform-only animation or transition, the
3397         renderer doesn't necessarily have a transform style on it, since we don't blend properties in
3398         software as the animation progresses. Instead, all of the blending is performed by the compositor,
3399         and only the computed style object has the software-blended transform style on it.
3400
3401         We do need to account for inline renderers though as these do not support transforms.
3402
3403         * css/CSSComputedStyleDeclaration.cpp:
3404         (WebCore::computedTransform):
3405
3406 2018-03-22  Antoine Quint  <graouts@apple.com>
3407
3408         [Web Animations] Support "transition: all" for CSS Transitions as Web Animations
3409         https://bugs.webkit.org/show_bug.cgi?id=183917
3410
3411         Reviewed by Dean Jackson.