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