Add a WebViewDidMoveToWindowObserver for WKWebView
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-03  Jiewen Tan  <jiewen_tan@apple.com>
2
3         Add a WebViewDidMoveToWindowObserver for WKWebView
4         https://bugs.webkit.org/show_bug.cgi?id=195223
5         <rdar://problem/48520161>
6
7         Reviewed by Darin Adler.
8
9         The load optimizer would only allow itself to optimize loads whenever the web view
10         who owns the page is (visible && focused), otherwises it will wait until the web view
11         becomes (visible && focused). Therefore, we need a way to notify the load optimizer
12         changes of statuses.
13
14         * UIProcess/API/Cocoa/WKWebView.mm:
15         (-[WKWebView didMoveToWindow]):
16         * UIProcess/Cocoa/WebViewImpl.mm:
17         (WebKit::WebViewImpl::viewDidMoveToWindow):
18         * UIProcess/WebPageProxy.cpp:
19         (WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
20         (WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
21         (WebKit::WebPageProxy::webViewDidMoveToWindow):
22         * UIProcess/WebPageProxy.h:
23         * UIProcess/WebViewDidMoveToWindowObserver.h: Added.
24         * WebKit.xcodeproj/project.pbxproj:
25
26 2019-03-03  Andy Estes  <aestes@apple.com>
27
28         [Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
29         https://bugs.webkit.org/show_bug.cgi?id=195219
30         <rdar://problem/48518082>
31
32         Reviewed by Darin Adler.
33
34         Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
35         WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.
36
37         In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.
38
39         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
40         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
41         m_webPageProxy with m_client.
42         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
43         (WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
44         IPC::MessageSender via m_client.
45         (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
46         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
47         m_webPageProxy with m_client.
48         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
49         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
50         MessageSender::send rather than going through m_webPageProxy.
51         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
52         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
53         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
54         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
55         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
56         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
57         changed m_webPageProxy to m_client.
58         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
59         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
60         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
61         m_webPageProxy with m_client.
62         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
63         (WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
64         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
65         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
66         with m_client.
67         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
68         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
69         * UIProcess/AuxiliaryProcessProxy.h:
70         (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
71         * UIProcess/WebPageProxy.cpp:
72         (WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
73         (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
74         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
75         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
76         (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
77         * UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
78         * UIProcess/ios/WebPageProxyIOS.mm:
79         (WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
80         (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
81         * UIProcess/mac/WebPageProxyMac.mm:
82         (WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
83         * WebKit.xcodeproj/project.pbxproj:
84
85 2019-03-03  Tim Horton  <timothy_horton@apple.com>
86
87         Remove some more unused 32-bit code
88         https://bugs.webkit.org/show_bug.cgi?id=195255
89
90         Reviewed by Darin Adler.
91
92         * Platform/Module.cpp:
93         (WebKit::Module::Module):
94         * Platform/Module.h:
95         * Platform/cf/ModuleCF.cpp:
96         (WebKit::Module::unload):
97         (WebKit::Module::bundleResourceMap): Deleted.
98         * PluginProcess/mac/PluginProcessMac.mm:
99         (WebKit::initializeShim):
100         (WebKit::PluginProcess::platformInitializeProcess):
101         (WebKit::shouldCallRealDebugger): Deleted.
102         (WebKit::isWindowActive): Deleted.
103         (WebKit::getCurrentEventButtonState): Deleted.
104         (WebKit::carbonWindowShown): Deleted.
105         (WebKit::carbonWindowHidden): Deleted.
106         (WebKit::openCFURLRef): Deleted.
107         (WebKit::isMallocTinyMemoryTag): Deleted.
108         (WebKit::shouldMapMemoryExecutable): Deleted.
109         * PluginProcess/mac/PluginProcessShim.h:
110         * PluginProcess/mac/PluginProcessShim.mm:
111         (WebKit::shimDebugger): Deleted.
112         (WebKit::shimGetCurrentEventButtonState): Deleted.
113         (WebKit::shimIsWindowActive): Deleted.
114         (WebKit::shimModalDialog): Deleted.
115         (WebKit::shimAlert): Deleted.
116         (WebKit::shimShowWindow): Deleted.
117         (WebKit::shimHideWindow): Deleted.
118         (WebKit::shimLSOpenCFURLRef): Deleted.
119         (WebKit::shimMachVMMap): Deleted.
120         * Shared/API/Cocoa/WKFoundation.h:
121         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
122         (WebKit::XPCServiceMain):
123         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
124         (WebKit::NetscapePluginModule::tryLoad):
125         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
126         (WebKit::getPluginArchitecture):
127         (WebKit::NetscapePluginModule::determineQuirks):
128         * Shared/Plugins/PluginQuirks.h:
129         * Shared/cf/ArgumentCodersCF.cpp:
130         (IPC::sizeForNumberType):
131         * Shared/mac/WebEventFactory.mm:
132         (WebKit::mouseButtonForEvent):
133         (WebKit::globalPointForEvent):
134         (WebKit::pointForEvent):
135         (WebKit::WebEventFactory::createWebMouseEvent):
136         * UIProcess/API/C/mac/WKPagePrivateMac.h:
137         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
138         (WKPageLoadFileReturningNavigation):
139         * UIProcess/Cocoa/WebViewImpl.mm:
140         (WebKit::WebViewImpl::pressureChangeWithEvent):
141         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
142         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
143         * UIProcess/mac/ServicesController.mm:
144         (WebKit::ServicesController::ServicesController):
145         * UIProcess/mac/WebContextMenuProxyMac.mm:
146         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
147         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
148         (WebKit::NPN_GetValue):
149         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
150         (WebKit::NetscapePlugin::NetscapePlugin):
151         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
152         (WebKit::NetscapePlugin::isWindowActive const): Deleted.
153         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
154         (WebKit::NetscapePlugin::setDrawingModel):
155         (WebKit::NetscapePlugin::setEventModel):
156         (WebKit::NetscapePlugin::platformPostInitialize):
157         (WebKit::NetscapePlugin::platformDestroy):
158         (WebKit::NetscapePlugin::platformGeometryDidChange):
159         (WebKit::NetscapePlugin::platformPaint):
160         (WebKit::NetscapePlugin::platformHandleMouseEvent):
161         (WebKit::NetscapePlugin::platformHandleWheelEvent):
162         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
163         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
164         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
165         (WebKit::NetscapePlugin::platformSetFocus):
166         (WebKit::NetscapePlugin::windowFocusChanged):
167         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
168         (WebKit::NetscapePlugin::sendComplexTextInput):
169         (): Deleted.
170         (WebKit::windowMap): Deleted.
171         (WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
172         (WebKit::NetscapePlugin::windowRef const): Deleted.
173         (WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
174         (WebKit::NetscapePlugin::buttonState): Deleted.
175         (WebKit::initializeEventRecord): Deleted.
176         (WebKit::anyMouseButtonIsDown): Deleted.
177         (WebKit::rightMouseButtonIsDown): Deleted.
178         (WebKit::modifiersForEvent): Deleted.
179         (WebKit::convertStringToKeyCodes): Deleted.
180         (WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
181         (WebKit::NetscapePlugin::nullEventTimerFired): Deleted.
182
183 2019-03-02  Zalan Bujtas  <zalan@apple.com>
184
185         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
186         https://bugs.webkit.org/show_bug.cgi?id=195252
187         <rdar://problem/48539446>
188
189         Reviewed by Simon Fraser.
190
191         * WebProcess/WebPage/ios/WebPageIOS.mm:
192         (WebKit::WebPage::handleSyntheticClick):
193
194 2019-03-02  Tim Horton  <timothy_horton@apple.com>
195
196         Move EditingRange <-> Range methods to EditingRange instead of WebPage
197         https://bugs.webkit.org/show_bug.cgi?id=195201
198
199         Reviewed by Sam Weinig.
200
201         * Shared/EditingRange.h:
202         * Shared/EditingRange.cpp:
203         Also, modernize the coders.
204
205         * Sources.txt:
206         * WebKit.xcodeproj/project.pbxproj:
207         * WebProcess/WebPage/WebPage.cpp:
208         (WebKit::WebPage::insertTextAsync):
209         (WebKit::WebPage::getMarkedRangeAsync):
210         (WebKit::WebPage::getSelectedRangeAsync):
211         (WebKit::WebPage::characterIndexForPointAsync):
212         (WebKit::WebPage::firstRectForCharacterRangeAsync):
213         (WebKit::WebPage::setCompositionAsync):
214         (WebKit::WebPage::rangeFromEditingRange): Deleted.
215         * WebProcess/WebPage/mac/WebPageMac.mm:
216         (WebKit::WebPage::insertDictatedTextAsync):
217         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
218
219 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
220
221         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
222         https://bugs.webkit.org/show_bug.cgi?id=195053
223         <rdar://problem/48134710>
224
225         Reviewed by Ryosuke Niwa.
226
227         Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
228         document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
229         UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
230         process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
231         items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
232         pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
233         immediately invoke the programmatic paste handler.
234
235         * Scripts/webkit/messages.py:
236         * UIProcess/API/gtk/PageClientImpl.cpp:
237         (WebKit::PageClientImpl::requestDOMPasteAccess):
238         * UIProcess/API/gtk/PageClientImpl.h:
239         * UIProcess/API/wpe/PageClientImpl.cpp:
240         (WebKit::PageClientImpl::requestDOMPasteAccess):
241         * UIProcess/API/wpe/PageClientImpl.h:
242         * UIProcess/PageClient.h:
243         * UIProcess/WebPageProxy.cpp:
244         (WebKit::WebPageProxy::requestDOMPasteAccess):
245         * UIProcess/WebPageProxy.h:
246         * UIProcess/WebPageProxy.messages.in:
247
248         Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
249
250         * UIProcess/ios/PageClientImplIOS.h:
251         * UIProcess/ios/PageClientImplIOS.mm:
252         (WebKit::PageClientImpl::requestDOMPasteAccess):
253         * UIProcess/ios/WKContentViewInteraction.h:
254         * UIProcess/ios/WKContentViewInteraction.mm:
255         (-[WKContentView cleanupInteraction]):
256         (-[WKContentView resignFirstResponderForWebView]):
257         (-[WKContentView _webTouchEventsRecognized:]):
258         (-[WKContentView _willHideMenu:]):
259         (-[WKContentView pasteForWebView:]):
260         (-[WKContentView _handleDOMPasteRequestWithResult:]):
261         (-[WKContentView _willPerformAction:sender:]):
262         (-[WKContentView _didPerformAction:sender:]):
263         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
264         (allPasteboardItemOriginsMatchOrigin):
265         (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
266         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
267
268         Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
269         this happens, we only grant access for the current paste command, rather than granting access for the user
270         gesture token.
271
272         * UIProcess/mac/PageClientImplMac.h:
273         * UIProcess/win/PageClientImpl.cpp:
274         (WebKit::PageClientImpl::requestDOMPasteAccess):
275         * UIProcess/win/PageClientImpl.h:
276         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
277         (WebKit::WebEditorClient::requestDOMPasteAccess):
278         * WebProcess/WebCoreSupport/WebEditorClient.h:
279         * WebProcess/WebPage/WebPage.cpp:
280         (WebKit::WebPage::requestDOMPasteAccess):
281         * WebProcess/WebPage/WebPage.h:
282
283 2019-02-27  Darin Adler  <darin@apple.com>
284
285         Fixed makeString(float) to do shortest-form serialization without first converting to double
286         https://bugs.webkit.org/show_bug.cgi?id=195142
287
288         Reviewed by Daniel Bates.
289
290         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.
291
292 2019-03-02  Adrian Perez de Castro  <aperez@igalia.com>
293
294         [WPE] Public API headers are missing autocleanup definitions
295         https://bugs.webkit.org/show_bug.cgi?id=195211
296
297         Reviewed by Philippe Normand.
298
299         * PlatformWPE.cmake: List new API headers as installable.
300         * UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
301         port, adapted to fit the WPE port.
302         * UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
303         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
304         from the equivalent header of the GTK port.
305         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
306         WebKitWebExtensionAutocleanups.h
307
308 2019-03-02  Michael Catanzaro  <mcatanzaro@igalia.com>
309
310         Remove unused WebPageProxy::m_navigationID
311         https://bugs.webkit.org/show_bug.cgi?id=195209
312
313         Reviewed by Darin Adler.
314
315         WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
316         debug LOG(). It must be a refactoring mistake.
317
318         * UIProcess/WebPageProxy.cpp:
319         (WebKit::WebPageProxy::didCommitLoadForFrame):
320         * UIProcess/WebPageProxy.h:
321
322 2019-03-01  Darin Adler  <darin@apple.com>
323
324         Finish removing String::format
325         https://bugs.webkit.org/show_bug.cgi?id=194893
326
327         Reviewed by Daniel Bates.
328
329         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
330         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
331         a problem where we passed an NSData * to format with a "%s"."
332
333 2019-03-01  Chris Dumez  <cdumez@apple.com>
334
335         Unreviewed Windows build fix after r242302.
336
337         * UIProcess/WebProcessPool.cpp:
338         (WebKit::WebProcessPool::ensureNetworkProcess):
339
340 2019-03-01  Alex Christensen  <achristensen@webkit.org>
341
342         NetworkDataTask redirection should not keep alive its NetworkSession
343         https://bugs.webkit.org/show_bug.cgi?id=194927
344
345         Reviewed by Darin Adler.
346
347         This should fix rdar://problem/47580502
348
349         * NetworkProcess/NetworkDataTask.h:
350         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
351         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
352
353 2019-03-01  Alex Christensen  <achristensen@webkit.org>
354
355         Revert r241223, r241235, and r241287
356         https://bugs.webkit.org/show_bug.cgi?id=194427
357         <rdar://48045861>
358
359         This caused crashes, and feature design has evolved away from needing the daemon in this form.
360
361         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
362         (WebKit::DaemonMain):
363         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
364         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
365         (WebKit::XPCServiceEventHandler):
366         (WebKit::XPCServiceMain):
367         (WebKit::XPCEventHandler): Deleted.
368         (WebKit::XPCInitializationHandler): Deleted.
369         * UIProcess/API/APIProcessPoolConfiguration.h:
370         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
371         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
372         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
373         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
374         * UIProcess/AuxiliaryProcessProxy.cpp:
375         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
376         * UIProcess/Launcher/ProcessLauncher.h:
377         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
378         (WebKit::serviceName):
379         (WebKit::ProcessLauncher::launchProcess):
380         * UIProcess/Network/NetworkProcessProxy.cpp:
381         (WebKit::NetworkProcessProxy::getLaunchOptions):
382         * UIProcess/WebProcessPool.cpp:
383         (WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
384         * UIProcess/WebProcessPool.h:
385
386 2019-03-01  Alex Christensen  <achristensen@webkit.org>
387
388         Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
389         https://bugs.webkit.org/show_bug.cgi?id=195229
390         <rdar://problem/48520362>
391
392         Reviewed by Chris Dumez.
393
394         Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
395         but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.
396
397         Functionality verified by manual testing.  See radar.
398         Added an API test that verifies the setter restrictions work as expected.
399
400         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
401         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
402         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
403         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
404         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
405         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
406         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
407         (WebKit::toPKPaymentRequest):
408         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
409         (WebKit::WebsiteDataStore::parameters):
410         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
411         (WebKit::WebsiteDataStore::WebsiteDataStore):
412         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
413         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
414         * UIProcess/WebsiteData/WebsiteDataStore.h:
415         (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
416         (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):
417
418 2019-03-01  Antoine Quint  <graouts@apple.com>
419
420         [iOS] Turn mouse event simulation on by default
421         https://bugs.webkit.org/show_bug.cgi?id=195218
422         <rdar://problem/48516794>
423
424         Reviewed by Dean Jackson.
425
426         * Shared/WebPreferences.yaml:
427
428 2019-03-01  Ross Kirsling  <ross.kirsling@sony.com>
429
430         EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
431         https://bugs.webkit.org/show_bug.cgi?id=194612
432
433         Reviewed by Alex Christensen.
434
435         This API test really shouldn't be verifying that the actual environment was successfully modified.
436
437         At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
438         simple functions -- one for string processing, one for environment processing -- the API test only needs to
439         worry about the former.
440
441         * Platform/unix/EnvironmentUtilities.cpp:
442         (WebKit::EnvironmentUtilities::stripEntriesEndingWith):
443         (WebKit::EnvironmentUtilities::removeValuesEndingWith):
444         (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
445         * Platform/unix/EnvironmentUtilities.h:
446         Replace old function with a pair of simpler ones.
447
448         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
449         (NetworkServiceInitializer):
450         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
451         (PluginServiceInitializer):
452         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
453         (WebContentServiceInitializer):
454         Update function name.
455
456 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
457
458         Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
459         https://bugs.webkit.org/show_bug.cgi?id=194844
460
461         Reviewed by Youenn Fablet.
462
463         Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
464         append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
465         a crash in Windows when running a Service Worker.
466
467         * UIProcess/API/APIWebsiteDataStore.cpp:
468         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
469         (API::WebsiteDataStore::defaultDataStoreConfiguration):
470         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
471         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
472         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
473         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
474         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
475         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
476         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
477         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
478
479 2019-03-01  John Wilander  <wilander@apple.com>
480
481         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
482         https://bugs.webkit.org/show_bug.cgi?id=195196
483         <rdar://problem/48006419>
484
485         Reviewed by Brent Fulgham.
486
487         Trackers abuse link query parameters to transport user identifiers cross-site.
488         This patch detects such navigations and applies further restrictions to
489         client-site cookies on the destination page.
490
491         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
492         (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
493         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
494             Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
495         * NetworkProcess/NetworkConnectionToWebProcess.h:
496         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
497         * NetworkProcess/NetworkProcess.cpp:
498         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
499             Reporting IPC message when a link decorated cross-site navigation happens.
500         (WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
501         * NetworkProcess/NetworkProcess.h:
502         * NetworkProcess/NetworkProcess.messages.in:
503         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
504         (WKWebsiteDataStoreStatisticsResetToConsistentState):
505             Added clearing of the new state between test runs.
506         * UIProcess/Network/NetworkProcessProxy.cpp:
507         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
508             Test infrastructure.
509         * UIProcess/Network/NetworkProcessProxy.h:
510         * UIProcess/WebPageProxy.cpp:
511         (WebKit::isNonUniqueNavigationWithLinkDecoration):
512             Convenience function.
513         (WebKit::WebPageProxy::didCommitLoadForFrame):
514             This function now reports to the network process when a link decorated
515             cross-site navigation happens.
516         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
517         (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
518             Test infrastructure.
519         * UIProcess/WebsiteData/WebsiteDataStore.h:
520         * WebProcess/WebPage/WebPage.cpp:
521         (WebKit::WebPage::close):
522             Name change of function called.
523
524 2019-03-01  Tim Horton  <timothy_horton@apple.com>
525
526         Remove unused code in WebKitLegacy
527         https://bugs.webkit.org/show_bug.cgi?id=189614
528
529         Reviewed by Simon Fraser.
530
531         * mac/MigrateHeadersFromWebKitLegacy.make:
532
533 2019-03-01  Tim Horton  <timothy_horton@apple.com>
534
535         Modernize WebKit::AttributedString a little bit
536         https://bugs.webkit.org/show_bug.cgi?id=195200
537
538         Reviewed by Wenson Hsieh.
539
540         * Shared/mac/AttributedString.h:
541         (WebKit::AttributedString::AttributedString):
542         (WebKit::AttributedString::operator NSAttributedString * const):
543         * Shared/mac/AttributedString.mm:
544         (IPC::ArgumentCoder<WebKit::AttributedString>::encode):
545         (IPC::ArgumentCoder<WebKit::AttributedString>::decode):
546         (WebKit::AttributedString::encode const): Deleted.
547         (WebKit::AttributedString::decode): Deleted.
548         * UIProcess/Cocoa/WebViewImpl.mm:
549         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
550         * WebProcess/WebPage/mac/WebPageMac.mm:
551         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
552         Modern coders, and a constructor and cast operator to/from NSAttributedString.
553         Also adopt those in a few places just for fun.
554
555 2019-03-01  Youenn Fablet  <youenn@apple.com>
556
557         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
558         https://bugs.webkit.org/show_bug.cgi?id=195213
559
560         Reviewed by Alex Christensen.
561
562         Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.
563
564         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
565         (WebKit::WebIDBConnectionToClient::putOrAdd):
566         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
567         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
568         * Scripts/webkit/messages.py:
569         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
570         (WebKit::WebIDBConnectionToServer::putOrAdd):
571
572 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
573
574         [WinCairo] Enable service worker
575         https://bugs.webkit.org/show_bug.cgi?id=188318
576
577         Reviewed by Youenn Fablet.
578
579         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
580         (WebKit::WebSWContextManagerConnection::terminateProcess):
581         * WebProcess/Storage/WebSWContextManagerConnection.h:
582         * config.h:
583
584 2019-03-01  Chris Dumez  <cdumez@apple.com>
585
586         Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
587         https://bugs.webkit.org/show_bug.cgi?id=195110
588
589         Reviewed by Ryosuke Niwa.
590
591         The test was attempting to disable PageCache via view preferences instead of using the
592         process pool configuration flag. This would fail to disable PageCache because the
593         usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
594         As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
595         objects would get destroyed, which would lead to flakiness.
596
597         This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
598         pages proxies when the usesPageCache preference is set to false.
599
600         * UIProcess/WebPageProxy.cpp:
601         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
602
603 2019-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
604
605         [ThreadedCompositor] Simply the compositing run loop worker thread
606         https://bugs.webkit.org/show_bug.cgi?id=195208
607
608         Reviewed by Don Olmstead.
609
610         We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
611         process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
612         so that the implementation is not specific to the generic WorkQueue implementation.
613
614         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
615         (WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
616         (WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
617         (WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
618         (WebKit::CompositingRunLoop::performTask): Use m_runLoop.
619         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
620         (WebKit::WorkQueuePool::singleton): Deleted.
621         (WebKit::WorkQueuePool::dispatch): Deleted.
622         (WebKit::WorkQueuePool::runLoop): Deleted.
623         (WebKit::WorkQueuePool::invalidate): Deleted.
624         (WebKit::WorkQueuePool::WorkQueuePool): Deleted.
625         (WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
626         (): Deleted.
627         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
628
629 2019-03-01  Justin Fan  <justin_fan@apple.com>
630
631         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
632         https://bugs.webkit.org/show_bug.cgi?id=195191
633
634         Rubber-stamped by Dean Jackson.
635
636         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
637
638         * Configurations/FeatureDefines.xcconfig:
639
640 2019-02-28  Chris Dumez  <cdumez@apple.com>
641
642         HTTPSUpgradeList.db database should be opened in readonly mode
643         https://bugs.webkit.org/show_bug.cgi?id=195194
644         <rdar://problem/47103889>
645
646         Reviewed by Youenn Fablet.
647
648         HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
649         modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.
650
651         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
652         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
653
654 2019-02-28  David Quesada  <david_quesada@apple.com>
655
656         Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
657         https://bugs.webkit.org/show_bug.cgi?id=195121
658         rdar://problem/48450302
659
660         Reviewed by Alex Christensen.
661
662         * UIProcess/API/Cocoa/WKNavigationAction.mm:
663         (-[WKNavigationAction _shouldPerformDownload]):
664         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
665
666 2019-02-28  Antoine Quint  <graouts@apple.com>
667
668         Disable Web Animations in Safari Technology Preview
669         https://bugs.webkit.org/show_bug.cgi?id=194748
670         <rdar://problem/48139481>
671
672         Reviewed by Dean Jackson.
673
674         The test runners already opt into that feature explicitly, so all that is needed is to turn
675         the default setting value to false.
676
677         * Shared/WebPreferences.yaml:
678
679 2019-02-28  Antoine Quint  <graouts@apple.com>
680
681         Enable the Pointer Events runtime flag by default
682         https://bugs.webkit.org/show_bug.cgi?id=195156
683
684         Reviewed by Dean Jackson.
685
686         * Shared/WebPreferences.yaml:
687
688 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
689
690         Revert r232263: it caused processes to crash because process was suspended with locked file
691         https://bugs.webkit.org/show_bug.cgi?id=195122
692         <rdar://problem/48444599>
693
694         Reviewed by Geoffrey Garen.
695
696         * NetworkProcess/NetworkProcess.cpp:
697         (WebKit::NetworkProcess::NetworkProcess):
698         * NetworkProcess/NetworkProcess.h:
699         * Shared/WebSQLiteDatabaseTracker.cpp:
700         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
701         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
702         * Shared/WebSQLiteDatabaseTracker.h:
703         * WebProcess/WebProcess.cpp:
704         (WebKit::m_webSQLiteDatabaseTracker):
705         (WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
706         * WebProcess/WebProcess.h:
707
708 2019-02-28  Per Arne Vollan  <pvollan@apple.com>
709
710         [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
711         https://bugs.webkit.org/show_bug.cgi?id=193683
712         <rdar://problem/47634345>
713
714         Reviewed by Brent Fulgham.
715
716         When a keyboard is attached/deattached or the application becomes foreground, send a message from
717         the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
718         cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
719         to be expensive.
720
721         * UIProcess/API/Cocoa/WKWebView.mm:
722         (hardwareKeyboardAvailabilityChangedCallback):
723         * UIProcess/WebPageProxy.h:
724         * UIProcess/WebProcessProxy.h:
725         (WebKit::WebProcessProxy::setKeyboardIsAttached):
726         (WebKit::WebProcessProxy::keyboardIsAttached const):
727         * UIProcess/ios/WKContentViewInteraction.mm:
728         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
729         * UIProcess/ios/WebPageProxyIOS.mm:
730         (WebKit::WebPageProxy::applicationWillEnterForeground):
731         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
732         * WebProcess/WebPage/WebPage.h:
733         * WebProcess/WebPage/WebPage.messages.in:
734         * WebProcess/WebPage/ios/WebPageIOS.mm:
735         (WebKit::WebPage::platformEditorState const):
736         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
737
738 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
739
740         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
741         https://bugs.webkit.org/show_bug.cgi?id=195159
742
743         Reviewed by Don Olmstead.
744
745         Use COORDINATED_GRAPHICS instead.
746
747         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
748         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
749         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
750         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
751         * Shared/CoordinatedGraphics/SimpleViewportController.h:
752         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
753         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
754         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
755         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
756         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
757         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
758         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
759         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
760         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
761         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
762         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
763         * WebProcess/WebPage/DrawingAreaImpl.cpp:
764         (WebKit::DrawingAreaImpl::updatePreferences):
765         * WebProcess/WebPage/WebPage.cpp:
766         (WebKit::WebPage::sendViewportAttributesChanged):
767         (WebKit::WebPage::viewportPropertiesDidChange):
768         * WebProcess/gtk/WebProcessMainGtk.cpp:
769
770 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
771
772         Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
773         https://bugs.webkit.org/show_bug.cgi?id=194958
774
775         Reviewed by Geoffrey Garen.
776
777         ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.
778
779         * UIProcess/API/APIProcessPoolConfiguration.cpp:
780         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
781         * UIProcess/API/APIWebsiteDataStore.cpp:
782         (API::WebsiteDataStore::createLegacy):
783         (API::indexedDBDatabaseDirectory):
784         * UIProcess/API/APIWebsiteDataStore.h:
785         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
786         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
787         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
788         * UIProcess/WebProcessPool.cpp:
789         (WebKit::legacyWebsiteDataStoreConfiguration):
790
791 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
792
793         [CoordinatedGraphics] Unify all LayerTreeHost classes
794         https://bugs.webkit.org/show_bug.cgi?id=195094
795
796         Reviewed by Žan Doberšek.
797
798         There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
799         ports.
800
801         * PlatformWin.cmake:
802         * SourcesGTK.txt:
803         * SourcesWPE.txt:
804         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
805         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
806         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
807         * WebProcess/WebPage/AcceleratedDrawingArea.h:
808         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
809         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
810         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
811         (WebKit::LayerTreeHost::LayerTreeHost):
812         (WebKit::LayerTreeHost::~LayerTreeHost):
813         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
814         (WebKit::LayerTreeHost::scheduleLayerFlush):
815         (WebKit::LayerTreeHost::cancelPendingLayerFlush):
816         (WebKit::LayerTreeHost::layerFlushTimerFired):
817         (WebKit::LayerTreeHost::setRootCompositingLayer):
818         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
819         (WebKit::LayerTreeHost::invalidate):
820         (WebKit::LayerTreeHost::scrollNonCompositedContents):
821         (WebKit::LayerTreeHost::forceRepaint):
822         (WebKit::LayerTreeHost::forceRepaintAsync):
823         (WebKit::LayerTreeHost::sizeDidChange):
824         (WebKit::LayerTreeHost::pauseRendering):
825         (WebKit::LayerTreeHost::resumeRendering):
826         (WebKit::LayerTreeHost::graphicsLayerFactory):
827         (WebKit::LayerTreeHost::contentsSizeChanged):
828         (WebKit::LayerTreeHost::didChangeViewportAttributes):
829         (WebKit::LayerTreeHost::didChangeViewport):
830         (WebKit::LayerTreeHost::setIsDiscardable):
831         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
832         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
833         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
834         (WebKit::LayerTreeHost::didFlushRootLayer):
835         (WebKit::LayerTreeHost::commitSceneState):
836         (WebKit::LayerTreeHost::frameComplete):
837         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
838         (WebKit::LayerTreeHost::didDestroyGLContext):
839         (WebKit::LayerTreeHost::willRenderFrame):
840         (WebKit::LayerTreeHost::didRenderFrame):
841         (WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
842         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
843         (WebKit::LayerTreeHost::renderNextFrame):
844         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
845         * WebProcess/WebPage/DrawingAreaImpl.cpp:
846         (WebKit::DrawingAreaImpl::setNeedsDisplay):
847         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
848         * WebProcess/WebPage/LayerTreeHost.cpp: Removed.
849         * WebProcess/WebPage/LayerTreeHost.h: Removed.
850         * WebPage/win/LayerTreeHost.h: Added.
851
852 2019-02-28  Justin Fan  <justin_fan@apple.com>
853
854         [Web GPU] Enable Web GPU only on 64-bit
855         https://bugs.webkit.org/show_bug.cgi?id=195139
856
857         Because Metal is only supported on 64 bit apps.
858
859         Unreviewed build fix.
860
861         * Configurations/FeatureDefines.xcconfig:
862
863 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
864
865         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
866
867         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
868         (WebKit::LocalAuthenticator::getAssertion):
869
870 2019-02-27  Michael Catanzaro  <mcatanzaro@igalia.com>
871
872         Unreviewed, fix -Wformat warning
873
874         * WebProcess/WebPage/WebPage.cpp:
875         (WebKit::WebPage::didCompletePageTransition):
876
877 2019-02-27  Brent Fulgham  <bfulgham@apple.com>
878
879         REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
880         https://bugs.webkit.org/show_bug.cgi?id=195072
881
882         Reviewed by Ryosuke Niwa.
883
884         ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
885         the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
886         a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
887         was disconnected), just like we do for other message send cases.
888
889         This patch switches from using the m_networkProcessConnection member (which might be null) to use the
890         'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
891
892         * WebProcess/WebProcess.cpp:
893         (WebKit::WebProcess::initializeWebProcess):
894
895 2019-02-27  Chris Dumez  <cdumez@apple.com>
896
897         Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
898         https://bugs.webkit.org/show_bug.cgi?id=194480
899
900         Reviewed by Brady Eidson.
901
902         The StorageManager would only start listening for IPC on a given connection when
903         StorageManager::processWillOpenConnection() is called. This gets called from
904         WebsiteDataStore::webProcessWillOpenConnection() which gets called from
905         WebProcessLifetimeTracker::webPageEnteringWebProcess().
906
907         webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
908         after process-swapping. This means that IPC comming from the *provisional* process
909         would not get processed and we would only start processing IPC on the provisional
910         process's connection when it would get committed.
911
912         To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
913         now have several processes. We also make sure that webPageEnteringWebProcess() gets
914         called for the provisional process as soon as we create the provisional page, instead
915         of waiting for it to get committed.
916
917         * UIProcess/ProvisionalPageProxy.cpp:
918         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
919         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
920         (WebKit::ProvisionalPageProxy::connectionWillOpen):
921         * UIProcess/ProvisionalPageProxy.h:
922         * UIProcess/WebPageProxy.cpp:
923         (WebKit::WebPageProxy::finishAttachingToWebProcess):
924         (WebKit::WebPageProxy::connectionWillOpen):
925         (WebKit::WebPageProxy::webProcessWillShutDown):
926         (WebKit::WebPageProxy::processDidTerminate):
927         * UIProcess/WebPageProxy.h:
928         (WebKit::WebPageProxy::webProcessLifetimeTracker):
929         * UIProcess/WebProcessLifetimeObserver.cpp:
930         (WebKit::WebProcessLifetimeObserver::addWebPage):
931         (WebKit::WebProcessLifetimeObserver::removeWebPage):
932         * UIProcess/WebProcessLifetimeObserver.h:
933         * UIProcess/WebProcessLifetimeTracker.cpp:
934         (WebKit::WebProcessLifetimeTracker::addObserver):
935         (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
936         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
937         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
938         (WebKit::WebProcessLifetimeTracker::processIsRunning):
939         * UIProcess/WebProcessLifetimeTracker.h:
940         * UIProcess/WebProcessProxy.cpp:
941         (WebKit::WebProcessProxy::connectionWillOpen):
942         * UIProcess/WebStorage/StorageManager.cpp:
943         (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
944         (WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
945         (WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
946         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
947         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
948         (WebKit::StorageManager::processWillOpenConnection):
949         (WebKit::StorageManager::processDidCloseConnection):
950         (WebKit::StorageManager::createSessionStorageMap):
951         (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
952         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
953         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
954         * UIProcess/WebStorage/StorageManager.h:
955         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
956         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
957         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
958
959 2019-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
960
961         [iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
962         https://bugs.webkit.org/show_bug.cgi?id=195118
963         <rdar://problem/43411940>
964
965         Reviewed by Tim Horton.
966
967         It's currently possible for websites to redirect focus into an editable element on the page by programmatically
968         requesting focus within the "blur" event handler. This is because our current heuristics:
969
970         (1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
971             the case where the page moves focus between different elements on the page.
972         (2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
973             the case where a focused element should show the keyboard when first responder is restored on a web view
974             (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
975             again).
976
977         In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
978         becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
979         by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
980         focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.
981
982         To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
983         before showing the keyboard due to activity state change or focused element change.
984
985         Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html
986
987         * UIProcess/ios/WKContentViewInteraction.h:
988         * UIProcess/ios/WKContentViewInteraction.mm:
989         (-[WKContentView setupInteraction]):
990         (-[WKContentView textInputTraits]):
991
992         Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
993         terminology used in WebKit.
994
995         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
996
997         Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
998         logic into a lambda function and using early returns. See above for more details.
999
1000         (-[WKContentView _elementDidBlur]):
1001         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
1002
1003 2019-02-27  John Wilander  <wilander@apple.com>
1004
1005         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
1006         https://bugs.webkit.org/show_bug.cgi?id=195071
1007         <rdar://problem/48417690>
1008
1009         Reviewed by Alex Christensen and Brent Fulgham.
1010
1011         This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
1012         and makes the necessary infrastructure changes to support that.
1013
1014         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
1015         HashSets since we never used the counts for anything. This change simplified
1016         the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.
1017
1018         The patch also makes WebCore::RegistrableDomain's String constructor private.
1019         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
1020         is introduced to better signal to users that creating a registrable domain
1021         object with a string may create an object that doesn't match a registrable
1022         domain in a valid HTTP-family URL.
1023
1024         Finally, this patch harmonizes parameter and variable naming, going from
1025         "origin" to "domain" and "mainFrame" to "topFrame."
1026
1027         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1028         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1029         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
1030         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
1031         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
1032         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
1033         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
1034         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
1035         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
1036         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
1037         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
1038         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
1039         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
1040         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
1041         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
1042         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
1043         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
1044         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
1045         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
1046         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
1047         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
1048         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
1049         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
1050         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1051         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1052         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1053         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
1054         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
1055         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1056         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
1057         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
1058         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1059         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1060         (WebKit::sortedPrevalentResourceTelemetry):
1061         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1062         * NetworkProcess/NetworkProcess.cpp:
1063         (WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
1064         (WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
1065         (WebKit::filterForRegistrableDomains):
1066         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1067         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
1068         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
1069         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
1070         * NetworkProcess/NetworkProcess.h:
1071         * NetworkProcess/NetworkProcess.messages.in:
1072         * NetworkProcess/NetworkSession.cpp:
1073         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1074         * NetworkProcess/NetworkSession.h:
1075         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1076         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1077         * Shared/WebCoreArgumentCoders.cpp:
1078         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1079         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1080         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1081         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1082         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1083         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
1084         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
1085         * UIProcess/Network/NetworkProcessProxy.cpp:
1086         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1087         (WebKit::NetworkProcessProxy::isPrevalentResource):
1088         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1089         (WebKit::NetworkProcessProxy::setPrevalentResource):
1090         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1091         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1092         (WebKit::NetworkProcessProxy::setLastSeen):
1093         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1094         (WebKit::NetworkProcessProxy::logUserInteraction):
1095         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1096         (WebKit::NetworkProcessProxy::clearUserInteraction):
1097         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
1098         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1099         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1100         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
1101         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1102         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1103         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1104         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1105         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1106         (WebKit::NetworkProcessProxy::isGrandfathered):
1107         (WebKit::NetworkProcessProxy::setGrandfathered):
1108         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
1109         (WebKit::NetworkProcessProxy::hasStorageAccess):
1110         (WebKit::NetworkProcessProxy::requestStorageAccess):
1111         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
1112         (WebKit::NetworkProcessProxy::grantStorageAccess):
1113         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
1114         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
1115         * UIProcess/Network/NetworkProcessProxy.h:
1116         * UIProcess/Network/NetworkProcessProxy.messages.in:
1117         * UIProcess/WebPageProxy.cpp:
1118         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1119         * UIProcess/WebPageProxy.h:
1120         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1121         (WebKit::WebsiteDataStore::isPrevalentResource):
1122         (WebKit::WebsiteDataStore::setPrevalentResource):
1123         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
1124         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
1125         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
1126         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
1127         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
1128         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
1129         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
1130         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
1131         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
1132         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
1133         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
1134         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
1135         (WebKit::WebsiteDataStore::clearPrevalentResource):
1136         (WebKit::WebsiteDataStore::setLastSeen):
1137         (WebKit::WebsiteDataStore::hasStorageAccess):
1138         (WebKit::WebsiteDataStore::requestStorageAccess):
1139         (WebKit::WebsiteDataStore::grantStorageAccess):
1140         (WebKit::WebsiteDataStore::logUserInteraction):
1141         (WebKit::WebsiteDataStore::hasHadUserInteraction):
1142         (WebKit::WebsiteDataStore::clearUserInteraction):
1143         (WebKit::WebsiteDataStore::setGrandfathered):
1144         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
1145         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
1146         * UIProcess/WebsiteData/WebsiteDataStore.h:
1147         * WebProcess/WebPage/WebPage.cpp:
1148         (WebKit::WebPage::hasStorageAccess):
1149         (WebKit::WebPage::requestStorageAccess):
1150
1151 2019-02-27  Keith Rollin  <krollin@apple.com>
1152
1153         Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
1154         https://bugs.webkit.org/show_bug.cgi?id=195109
1155         <rdar://problem/48442272>
1156
1157         Reviewed by Alexey Proskuryakov.
1158
1159         In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
1160         added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
1161         Z's in hexadecimal strings). While these UUIDs haven't caused any
1162         problems in practice over the last six years, they are indeed invalid,
1163         and were discovered via an Xcode-project processing tool that did not
1164         anticipate their format. Fix this by removing the files from the
1165         project and re-adding them.
1166
1167         * WebKit.xcodeproj/project.pbxproj:
1168
1169 2019-02-27  Youenn Fablet  <youenn@apple.com>
1170
1171         Remove UserMediaProcessManager processState map
1172         https://bugs.webkit.org/show_bug.cgi?id=195056
1173
1174         Reviewed by Eric Carlson.
1175
1176         Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
1177         To improve on this model, this patch does the following:
1178         - Move the process state to WebProcessProxy.
1179         - Remove the map and replace it by a set of all manager proxies.
1180
1181         This simplifies the handling.
1182         On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
1183         This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.
1184
1185         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1186         (WebKit::UserMediaPermissionRequestManagerProxy::forEach):
1187         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
1188         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1189         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
1190         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1191         * UIProcess/UserMediaProcessManager.cpp:
1192         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
1193         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1194         (WebKit::UserMediaProcessManager::endedCaptureSession):
1195         (WebKit::UserMediaProcessManager::setCaptureEnabled):
1196         (WebKit::UserMediaProcessManager::captureDevicesChanged):
1197         (WebKit::ProcessState::ProcessState): Deleted.
1198         (WebKit::ProcessState::hasVideoExtension const): Deleted.
1199         (WebKit::ProcessState::grantVideoExtension): Deleted.
1200         (WebKit::ProcessState::revokeVideoExtension): Deleted.
1201         (WebKit::ProcessState::hasAudioExtension const): Deleted.
1202         (WebKit::ProcessState::grantAudioExtension): Deleted.
1203         (WebKit::ProcessState::revokeAudioExtension): Deleted.
1204         (WebKit::stateMap): Deleted.
1205         (WebKit::processState): Deleted.
1206         (WebKit::ProcessState::addRequestManager): Deleted.
1207         (WebKit::ProcessState::removeRequestManager): Deleted.
1208         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
1209         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
1210         (WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
1211         * UIProcess/UserMediaProcessManager.h:
1212         * UIProcess/WebProcessProxy.h:
1213         (WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
1214         (WebKit::WebProcessProxy::hasVideoCaptureExtension const):
1215         (WebKit::WebProcessProxy::grantVideoCaptureExtension):
1216         (WebKit::WebProcessProxy::revokeVideoCaptureExtension):
1217         (WebKit::WebProcessProxy::hasAudioCaptureExtension const):
1218         (WebKit::WebProcessProxy::grantAudioCaptureExtension):
1219         (WebKit::WebProcessProxy::revokeAudioCaptureExtension):
1220         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1221         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
1222         (WebKit::UserMediaPermissionRequestManager::clear): Deleted.
1223         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
1224         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
1225         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1226         * WebProcess/WebPage/WebPage.cpp:
1227         (WebKit::WebPage::close):
1228         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
1229         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
1230         * WebProcess/WebPage/WebPage.h:
1231         * WebProcess/WebPage/WebPage.messages.in:
1232         * WebProcess/WebProcess.cpp:
1233         (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
1234         (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
1235         * WebProcess/WebProcess.h:
1236         * WebProcess/WebProcess.messages.in:
1237
1238 2019-02-27  Per Arne Vollan  <pvollan@apple.com>
1239
1240         [macOS] Disable permissive call logging in sandbox
1241         https://bugs.webkit.org/show_bug.cgi?id=194061
1242         <rdar://problem/47686253>
1243
1244         Reviewed by Brent Fulgham.
1245
1246         Strict call filtering should be reenabled.
1247
1248         * WebProcess/com.apple.WebProcess.sb.in:
1249
1250 2019-02-27  Chris Dumez  <cdumez@apple.com>
1251
1252         [HTTPSUpgrade] Use open source database until the feature is ready
1253         https://bugs.webkit.org/show_bug.cgi?id=195069
1254         <rdar://problem/47838224>
1255
1256         Reviewed by Geoffrey Garen.
1257
1258         * DerivedSources-input.xcfilelist:
1259         * DerivedSources.make:
1260
1261 2019-02-27  Antoine Quint  <graouts@apple.com>
1262
1263         Support Pointer Events on macOS
1264         https://bugs.webkit.org/show_bug.cgi?id=195008
1265         <rdar://problem/47454419>
1266
1267         Reviewed by Dean Jackson.
1268
1269         * Configurations/FeatureDefines.xcconfig:
1270
1271 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
1272
1273         Network Process is put to suspended when holding locked IndexedDB files
1274         https://bugs.webkit.org/show_bug.cgi?id=195024
1275         <rdar://problem/45194169>
1276
1277         Reviewed by Geoffrey Garen.
1278
1279         * NetworkProcess/NetworkProcess.cpp:
1280         (WebKit::NetworkProcess::idbServer):
1281         (WebKit::NetworkProcess::notifyHoldingLockedFiles):
1282         * NetworkProcess/NetworkProcess.h:
1283         * UIProcess/Network/NetworkProcessProxy.cpp:
1284         (WebKit::NetworkProcessProxy::didClose):
1285         (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
1286         * UIProcess/Network/NetworkProcessProxy.h:
1287         * UIProcess/Network/NetworkProcessProxy.messages.in:
1288
1289 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
1290
1291         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1292         https://bugs.webkit.org/show_bug.cgi?id=194973
1293
1294         Reviewed by Antti Koivisto.
1295
1296         This patch cleans up how the scrolling tree responds to scrolls.
1297
1298         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
1299         UI process scroll position.
1300
1301         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
1302         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
1303         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
1304         updates related layers on this node (counter-scrolling layers etc), and then tells the
1305         scrolling tree, which recurses through descendant nodes so they can adjust their layer
1306         positions.
1307
1308         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
1309         which does the above other than setting scrolledContentsLayer (since we're reacting to
1310         layer state changes, not producing them).
1311
1312         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
1313         ScrollingTree does the tree walk so classes don't have to implement
1314         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
1315         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
1316         need to cross frame boundaries).
1317
1318         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
1319         since the fixed state was computed with the "layout" scroll position, so we have to account
1320         for the scroll delta since the last committed position. It's possible we could improve this
1321         in future.
1322
1323         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1324         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1325         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1326         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
1327         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
1328         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1329         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1330         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
1331         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
1332         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1333         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
1334         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
1335         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
1336         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
1337         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
1338         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
1339         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
1340         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
1341         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
1342         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
1343         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
1344         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
1345         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
1346         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1347         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1348         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
1349         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
1350         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
1351         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
1352         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
1353         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
1354         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1355         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
1356         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
1357         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
1358         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
1359         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
1360         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
1361         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
1362         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
1363         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
1364         (WebKit::ScrollerPairMac::updateValues):
1365         (WebKit::ScrollerPairMac::valuesForOrientation):
1366         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
1367         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
1368         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
1369         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
1370         * UIProcess/ios/WKContentView.mm:
1371         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1372
1373 2019-02-27  Alex Christensen  <achristensen@webkit.org>
1374
1375         Silence log after r242122
1376         https://bugs.webkit.org/show_bug.cgi?id=195074
1377
1378         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1379         (WebKit::LocalStorageDatabaseTracker::databasePath const):
1380         m_localStorageDirectory can now be null for ephemeral sessions.
1381         This is not a failure to create a directory and needs no log.
1382         This fixes the WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog API test.
1383
1384 2019-02-27  Timothy Hatcher  <timothy@apple.com>
1385
1386         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
1387         https://bugs.webkit.org/show_bug.cgi?id=195086
1388         rdar://problem/48419124
1389
1390         Reviewed by Tim Horton.
1391
1392         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
1393         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
1394
1395 2019-02-26  Chris Dumez  <cdumez@apple.com>
1396
1397         [PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
1398         https://bugs.webkit.org/show_bug.cgi?id=195089
1399
1400         Reviewed by Geoffrey Garen.
1401
1402         Add a convenient mechanism to clear suspended pages while bypassing the WebProcess
1403         cache since we need to do this on memory pressure and when clearing website data.
1404
1405         * UIProcess/WebPageProxy.cpp:
1406         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1407         * UIProcess/WebProcessCache.cpp:
1408         (WebKit::WebProcessCache::addProcessIfPossible):
1409         (WebKit::WebProcessCache::addProcess):
1410         (WebKit::WebProcessCache::takeProcess):
1411         (WebKit::WebProcessCache::CachedProcess::~CachedProcess):
1412         * UIProcess/WebProcessCache.h:
1413         (WebKit::WebProcessCache::setIsDisabled): Deleted.
1414         * UIProcess/WebProcessPool.cpp:
1415         (WebKit::WebProcessPool::handleMemoryPressureWarning):
1416         (WebKit::WebProcessPool::hasSuspendedPageFor const):
1417         (WebKit::WebProcessPool::clearSuspendedPages):
1418         * UIProcess/WebProcessPool.h:
1419         * UIProcess/WebProcessProxy.cpp:
1420         (WebKit::WebProcessProxy::maybeShutDown):
1421         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
1422         * UIProcess/WebProcessProxy.h:
1423         (WebKit::WebProcessProxy::suspendedPageCount const):
1424         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1425         (WebKit::WebsiteDataStore::removeData):
1426
1427 2019-02-26  Alex Christensen  <achristensen@webkit.org>
1428
1429         Move ephemeral local storage from WebProcess to UIProcess
1430         https://bugs.webkit.org/show_bug.cgi?id=195074
1431         <rdar://problem/47937975>
1432
1433         Reviewed by Geoff Garen.
1434
1435         Before PSON, a page could navigate to another domain that navigates back and still have its local storage.
1436         Since PSON makes it unreliable to retain the state in the WebProcess, move it to the process with the rest of the local storage.
1437         If it's ephemeral, we obviously can't use the SQLite on-disk storage implementation, so use the same WebCore::StorageMap we used to in the WebProcess.
1438
1439         * UIProcess/WebStorage/StorageManager.cpp:
1440         (WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
1441         (WebKit::StorageManager::StorageManager):
1442         (WebKit::StorageManager::createLocalStorageMap):
1443         (WebKit::StorageManager::createTransientLocalStorageMap):
1444         (WebKit::StorageManager::createSessionStorageMap):
1445         (WebKit::StorageManager::destroyStorageMap):
1446         (WebKit::StorageManager::getValues):
1447         (WebKit::StorageManager::setItem):
1448         (WebKit::StorageManager::removeItem):
1449         (WebKit::StorageManager::clear):
1450         * UIProcess/WebStorage/StorageManager.h:
1451         * UIProcess/WebStorage/StorageManager.messages.in:
1452         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1453         (WebKit::WebsiteDataStore::WebsiteDataStore):
1454         * WebProcess/WebStorage/StorageAreaMap.cpp:
1455         (WebKit::StorageAreaMap::StorageAreaMap):
1456         (WebKit::StorageAreaMap::setItem):
1457         (WebKit::StorageAreaMap::removeItem):
1458         (WebKit::StorageAreaMap::clear):
1459         (WebKit::StorageAreaMap::loadValuesIfNeeded):
1460         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1461         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
1462         (WebKit::StorageNamespaceImpl::storageArea):
1463         (WebKit::StorageNamespaceImpl::copy):
1464         (): Deleted.
1465         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): Deleted.
1466         * WebProcess/WebStorage/StorageNamespaceImpl.h:
1467
1468 2019-02-20  Jer Noble  <jer.noble@apple.com>
1469
1470         [Cocoa] Media elements will restart network buffering just before suspending
1471         https://bugs.webkit.org/show_bug.cgi?id=193691
1472
1473         Reviewed by Eric Carlson.
1474
1475         When the WebProcess receives a notification that the process is about to become
1476         suspended, it tells the MemoryPressureHandler to release all critical memory. This
1477         has the side effect of causing AVFoundation-backed media elements to dump their
1478         in-memory caches and start downloading media data again. Instead, media elements
1479         should all stop buffering media data during suspension. Add new testing SPI to
1480         simulate suspension and resume messages.
1481
1482         * UIProcess/API/Cocoa/WKWebView.mm:
1483         (-[WKWebView _processWillSuspendImminentlyForTesting]):
1484         (-[WKWebView _processDidResumeForTesting]):
1485         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1486         * UIProcess/WebProcessProxy.h:
1487         * UIProcess/ios/WKInkPickerView.mm:
1488         * WebProcess/WebPage/WebPage.cpp:
1489         (WebKit::WebPage::suspendAllMediaBuffering):
1490         (WebKit::WebPage::resumeAllMediaBuffering):
1491         * WebProcess/WebPage/WebPage.h:
1492         * WebProcess/WebProcess.cpp:
1493         (WebKit::WebProcess::actualPrepareToSuspend):
1494         (WebKit::WebProcess::cancelPrepareToSuspend):
1495         (WebKit::WebProcess::processDidResume):
1496         (WebKit::WebProcess::suspendAllMediaBuffering):
1497         (WebKit::WebProcess::resumeAllMediaBuffering):
1498         * WebProcess/WebProcess.h:
1499
1500 2019-02-26  Youenn Fablet  <youenn@apple.com>
1501
1502         Move service worker response validation from the service worker client to the service worker itself
1503         https://bugs.webkit.org/show_bug.cgi?id=194716
1504
1505         Reviewed by Geoffrey Garen.
1506
1507         Removed response validation as it is now done in service worker side.
1508
1509         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1510         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
1511         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1512
1513 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1514
1515         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
1516         https://bugs.webkit.org/show_bug.cgi?id=195066
1517         <rdar://problem/48411682>
1518
1519         Reviewed by Tim Horton.
1520
1521         * WebProcess/WebCoreSupport/WebChromeClient.h:
1522         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1523         (WebKit::WebChromeClient::clearContentChangeObservers): Deleted.
1524
1525 2019-02-26  Per Arne Vollan  <pvollan@apple.com>
1526
1527         [iOS] Sandbox should allow mach lookups related to media capturing
1528         https://bugs.webkit.org/show_bug.cgi?id=194951
1529
1530         Reviewed by Eric Carlson.
1531
1532         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1533
1534 2019-02-26  Brent Fulgham  <bfulgham@apple.com>
1535
1536         Update NetworkSession to use Session Cleanup when available
1537         https://bugs.webkit.org/show_bug.cgi?id=195019
1538         <rdar://problem/45149868>
1539
1540         Reviewed by Alex Christensen.
1541
1542         If the build environment supports Session Cleanup, initialize it.
1543
1544         No test changes since this doesn't do anything on the test systems at present.
1545
1546         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1547         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1548
1549 2019-02-26  Chris Dumez  <cdumez@apple.com>
1550
1551         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
1552         https://bugs.webkit.org/show_bug.cgi?id=195054
1553         <rdar://problem/48330549>
1554
1555         Reviewed by Geoff Garen.
1556
1557         We attempt to restore the scroll position twice, on first layout and then on load completion.
1558         Before PSON, the scroll position would fail to get restored on first layout but would succeed
1559         on load completion because the view is tall enough by then. With PSON however, we would
1560         fail to restore the scroll position on load completion because the view would not be tall
1561         enough yet by this point. The reason is that the dynamic resources would not be in the memory cache
1562         and would then get reloaded abd finish loading *after* the load event.
1563
1564         To address the issue, we now make sure to not purge the memory cache on process suspension on
1565         iOS if there is currently a SuspendedPageProxy in the UIProcess for this process.
1566
1567         * UIProcess/SuspendedPageProxy.cpp:
1568         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1569         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1570         * UIProcess/WebProcessProxy.cpp:
1571         (WebKit::WebProcessProxy::incrementSuspendedPageCount):
1572         (WebKit::WebProcessProxy::decrementSuspendedPageCount):
1573         * UIProcess/WebProcessProxy.h:
1574         * WebProcess/WebProcess.cpp:
1575         (WebKit::WebProcess::initializeWebProcess):
1576         (WebKit::WebProcess::setHasSuspendedPageProxy):
1577         * WebProcess/WebProcess.h:
1578         * WebProcess/WebProcess.messages.in:
1579
1580 2019-02-26  Ryosuke Niwa  <rniwa@webkit.org>
1581
1582         [iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
1583         https://bugs.webkit.org/show_bug.cgi?id=195037
1584         <rdar://problem/48154508>
1585
1586         Reviewed by Antti Koivisto.
1587
1588         Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
1589         as this has been an issue when I was able to reproduce the issue locally.
1590
1591         Also added release logging to help diagnose the issue in the future.
1592
1593         * WebProcess/WebPage/WebPage.cpp:
1594         (WebKit::WebPage::freezeLayerTree):
1595         (WebKit::WebPage::unfreezeLayerTree):
1596         (WebKit::WebPage::didCompletePageTransition):
1597         * WebProcess/WebProcess.cpp:
1598         (WebKit::WebProcess::freezeAllLayerTrees):
1599         (WebKit::WebProcess::unfreezeAllLayerTrees):
1600
1601 2019-02-26  Youenn Fablet  <youenn@apple.com>
1602
1603         Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
1604         https://bugs.webkit.org/show_bug.cgi?id=195051
1605
1606         Reviewed by Eric Carlson.
1607
1608         Before the patch, WebPageProxy::m_userMediaPermissionRequestManager was created
1609         in some methods to reset its state when main document is changing, view is becoming visible...
1610         This code is unnecessary if the page did not create it already using JS APIs such as getUserMedia/enumerateDevices/ondevicechange.
1611         This patch skips processing in the other cases if WebPageProxy::m_userMediaPermissionRequestManager is null.
1612
1613         * UIProcess/WebPageProxy.cpp:
1614         (WebKit::WebPageProxy::close): No need to nullify it since it will be done in resetState shortly after.
1615         (WebKit::WebPageProxy::didChangeMainDocument):
1616         (WebKit::WebPageProxy::viewIsBecomingVisible):
1617         (WebKit::WebPageProxy::clearUserMediaState):
1618         (WebKit::WebPageProxy::updatePlayingMediaDidChange): m_userMediaPermissionRequestManager should not be null here
1619         since there is or was some capturing done for the page.
1620
1621 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1622
1623         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
1624         https://bugs.webkit.org/show_bug.cgi?id=195023
1625         <rdar://problem/48381885>
1626
1627         Reviewed by Tim Horton.
1628
1629         * WebProcess/WebPage/ios/WebPageIOS.mm:
1630         (WebKit::WebPage::handleSyntheticClick):
1631
1632 2019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
1633
1634         [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
1635         https://bugs.webkit.org/show_bug.cgi?id=191652
1636
1637         Reviewed by Alex Christensen.
1638
1639         Test: http/tests/security/401-logout/401-logout.php
1640
1641         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1642         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
1643         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
1644         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1645
1646 2019-02-26  Youenn Fablet  <youenn@apple.com>
1647
1648         WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
1649         https://bugs.webkit.org/show_bug.cgi?id=195028
1650         <rdar://problem/48243733>
1651
1652         Reviewed by Eric Carlson.
1653
1654         Covered by API test.
1655
1656         * UIProcess/WebPageProxy.cpp:
1657         (WebKit::WebPageProxy::resetState):
1658
1659 2019-02-26  Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
1660
1661         [WPE] Add API for webview background color configuration
1662         https://bugs.webkit.org/show_bug.cgi?id=192305
1663
1664         Reviewed by Michael Catanzaro.
1665
1666         In the case of WPE we need to send the background color to the web process to be used as the background color of
1667         the page. This patch adapts the GTK+ implementation to do the same, since it's a lot simpler. The patch also
1668         removes the SetDrawsBackground message in favor of the new SetBackgroundColor message that receives an optional
1669         color.
1670
1671         * PlatformWPE.cmake: Add new WPE API for WebKitColor boxed type.
1672         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1673         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Remove background rendering and opacity handling.
1674         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1675         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1676         (WebKit::ThreadedCompositor::renderLayerTree): Remove drawsBakground and always clear the context with
1677         transparent color.
1678         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1679         * Shared/WebPageCreationParameters.cpp:
1680         (WebKit::WebPageCreationParameters::encode const): Replace drawsBackground with backgroundColor.
1681         (WebKit::WebPageCreationParameters::decode): Ditto.
1682         * Shared/WebPageCreationParameters.h:
1683         * SourcesWPE.txt:
1684         * UIProcess/API/glib/WebKitWebView.cpp:
1685         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
1686         (webkit_web_view_set_background_color):
1687         (webkit_web_view_get_background_color):
1688         * UIProcess/API/wpe/WebKitColor.cpp: Added.
1689         (webkit_color_copy):
1690         (webkit_color_free):
1691         (webkitColorToWebCoreColor):
1692         (webkitColorFillFromWebCoreColor):
1693         (webkit_color_parse):
1694         * UIProcess/API/wpe/WebKitColor.h: Added.
1695         * UIProcess/API/wpe/WebKitColorPrivate.h: Added.
1696         * UIProcess/API/wpe/WebKitWebView.h: Implement webkit_web_view_set_background_color API.
1697         * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Ditto.
1698         (webkit_web_view_set_background_color):
1699         (webkit_web_view_get_background_color):
1700         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Add new symbols.
1701         * UIProcess/WebPageProxy.cpp:
1702         (WebKit::WebPageProxy::setDrawsBackground): Set a transparent background color when false is passed.
1703         (WebKit::WebPageProxy::setBackgroundColor): Send background color to the WebProcess.
1704         (WebKit::WebPageProxy::creationParameters): Replace drawsBackground with backgroundColor.
1705         * UIProcess/WebPageProxy.h:
1706         (WebKit::WebPageProxy::drawsBackground const):
1707         (WebKit::WebPageProxy::backgroundColor const):
1708         * UIProcess/cairo/BackingStoreCairo.cpp:
1709         (WebKit::BackingStore::incorporateUpdate): Remove GTK+ code to handle background color.
1710         * UIProcess/gtk/AcceleratedBackingStore.cpp:
1711         * UIProcess/gtk/AcceleratedBackingStore.h: Make paint() pure virtual and remove the implementation.
1712         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1713         (WebKit::AcceleratedBackingStoreWayland::paint): Dot not call AcceleratedBackingStore::paint() now that is pure virtual.
1714         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
1715         (WebKit::AcceleratedBackingStoreX11::paint): Ditto.
1716         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1717         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use background color as provided by the
1718         UIProcess when creating the FrameView.
1719         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1720         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1721         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1722         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1723         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1724         (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable):
1725         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1726         * WebProcess/WebPage/DrawingArea.h:
1727         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1728         (WebKit::DrawingAreaImpl::display): Remove special case for transparent background.
1729         * WebProcess/WebPage/LayerTreeHost.h:
1730         * WebProcess/WebPage/WebPage.cpp:
1731         (WebKit::WebPage::setBackgroundColor): New API for background color configuration. Proxies to FrameView and DrawingArea.
1732         * WebProcess/WebPage/WebPage.h:
1733         (WebKit::WebPage::backgroundColor const): Read-only access to the current background color.
1734         * WebProcess/WebPage/WebPage.messages.in: Replace SetDrawsBackground message with SetBackgroundColor.
1735
1736 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
1737
1738         scalableNativeWebpageParameters() is not preserved on new page navigation.
1739         https://bugs.webkit.org/show_bug.cgi?id=194892
1740         <rdar://problem/47538280>
1741
1742         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
1743         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
1744         configuration until we derive the right values from viewport meta-tag.
1745
1746         Reviewed by Wenson Hsieh.
1747
1748         * WebProcess/WebPage/ios/WebPageIOS.mm:
1749         (WebKit::WebPage::resetViewportDefaultConfiguration): Use nativeWebpageParameters() instance method to
1750             get the appropriate default configuration.
1751
1752 2019-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1753
1754         [iOS] Adjust initial scale zooming heuristics when changing view scale
1755         https://bugs.webkit.org/show_bug.cgi?id=194995
1756
1757         Reviewed by Tim Horton.
1758
1759         Currently, we only zoom to the new initial scale iff we're exactly at initial scale before changing the view
1760         scale. This was done so that if a user zoomed in really far and then increased the view scale, we wouldn't end
1761         up zooming out as a result. However, this leads to confusing behavior in the case where the user has manually
1762         changed the zoom scale to something close to (but not exactly) initial scale, and then attempts to zoom in
1763         further using view scale. In this case, we'll end up keeping page scale the same, so it looks like nothing is
1764         happening.
1765
1766         To fix this, we tweak our heuristics for determining whether to jump to initial scale; if the view scale is
1767         increasing and the new initial scale is greater than the current scale, zoom to initial scale. Likewise, if the
1768         view scale is decreasing and the new initial scale is less than the current scale, zoom to initial scale.
1769
1770         Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
1771
1772         * WebProcess/WebPage/ios/WebPageIOS.mm:
1773         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
1774
1775 2019-02-25  John Wilander  <wilander@apple.com>
1776
1777         Introduce and adopt new class RegistrableDomain for eTLD+1
1778         https://bugs.webkit.org/show_bug.cgi?id=194791
1779         <rdar://problem/48179240>
1780
1781         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
1782
1783         A new API test was added. Plenty of existing layout tests under
1784         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
1785
1786         This patch introduces and adopts a new class called WebCore::RegistrableDomain
1787         which represents a domain's eTLD+1 (effective top level domain plus one) and is
1788         the basis for the term "site," as in same-site. Other popular names include
1789         high-level domain, primary domain, and top privately controlled/owned domain.
1790         Effective top level domains are enumerated on the Public Suffix List
1791         (https://publicsuffix.org).
1792
1793         This class just uses the full domain for when the Public Suffix List cannot help
1794         finding the registrable domain and for WebKit ports that haven't enabled
1795         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
1796         for the null or unique origin (this matches how these origins were handled
1797         before).
1798
1799         The implementation is a wrapper around a String and the functions and class
1800         members that now make use of this new class used to handle regular String
1801         objects which didn't help much in terms of type safety or guarantees that the
1802         string had already been converted to an eTLD+1.
1803
1804         We've at least two bad bugs in the Storage Access API because of confusion
1805         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
1806         will prohibit such bugs in the future.
1807
1808         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
1809         WebCore::RegistrableDomain for partitioning in a later patch.
1810
1811         This patch also enhances parameter naming by:
1812         - Removing parts that refer to "primary" as in primaryDomain.
1813         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
1814         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
1815         - Using the term "domain" consistently instead of e.g. "host."
1816
1817         A follow-up patch will continue backwards in call chains to create
1818         WebCore::RegistrableDomain objects as early as possible instead of using strings.
1819         I did not do that work here in the interest of patch size.
1820
1821         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1822         (WebKit::domainsToString):
1823         (WebKit::pruneResources):
1824         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1825         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
1826         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
1827         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentDueToDebugMode):
1828         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
1829         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
1830         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
1831         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
1832         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
1833         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
1834         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
1835         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
1836         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
1837         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
1838         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
1839         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
1840         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
1841         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
1842         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
1843         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
1844         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
1845         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
1846         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
1847         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
1848         (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
1849         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
1850         (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
1851         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
1852         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
1853         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
1854         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
1855         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
1856         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
1857         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForRegistrableDomain):
1858         (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
1859         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
1860         (WebKit::debugLogDomainsInBatches):
1861         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
1862         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
1863         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
1864         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
1865         (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
1866         (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
1867         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
1868         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain): Deleted.
1869         (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Deleted.
1870         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1871         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1872         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1873         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1874         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
1875         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
1876         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1877         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1878         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
1879         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
1880         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
1881         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
1882         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
1883         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
1884         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
1885         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1886         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1887         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1888         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1889         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1890         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1891         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1892         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1893         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
1894         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
1895         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
1896         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1897         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1898         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1899         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1900         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1901         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1902         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
1903         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
1904         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
1905         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
1906         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
1907         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
1908         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
1909         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
1910         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1911         (WebKit::WebResourceLoadStatisticsStore::registrableDomainsWithWebsiteData):
1912         (WebKit::isolatedPrimaryDomain): Deleted.
1913         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
1914         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
1915         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1916         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1917         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1918         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
1919         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
1920         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
1921         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
1922         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
1923         * NetworkProcess/NetworkConnectionToWebProcess.h:
1924         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1925         * NetworkProcess/NetworkProcess.cpp:
1926         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
1927         (WebKit::NetworkProcess::isGrandfathered):
1928         (WebKit::NetworkProcess::isPrevalentResource):
1929         (WebKit::NetworkProcess::isVeryPrevalentResource):
1930         (WebKit::NetworkProcess::setGrandfathered):
1931         (WebKit::NetworkProcess::setPrevalentResource):
1932         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
1933         (WebKit::NetworkProcess::setVeryPrevalentResource):
1934         (WebKit::NetworkProcess::clearPrevalentResource):
1935         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
1936         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
1937         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
1938         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
1939         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
1940         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
1941         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
1942         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
1943         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
1944         (WebKit::NetworkProcess::setLastSeen):
1945         (WebKit::NetworkProcess::hasStorageAccessForFrame):
1946         (WebKit::NetworkProcess::hasStorageAccess):
1947         (WebKit::NetworkProcess::requestStorageAccess):
1948         (WebKit::NetworkProcess::requestStorageAccessGranted):
1949         (WebKit::NetworkProcess::grantStorageAccess):
1950         (WebKit::NetworkProcess::logFrameNavigation):
1951         (WebKit::NetworkProcess::logUserInteraction):
1952         (WebKit::NetworkProcess::hadUserInteraction):
1953         (WebKit::NetworkProcess::clearUserInteraction):
1954         (WebKit::NetworkProcess::removePrevalentDomains):
1955         (WebKit::filterForRegistrableDomains):
1956         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1957         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
1958         (WebKit::filterForTopLevelDomains): Deleted.
1959         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
1960         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
1961         * NetworkProcess/NetworkProcess.h:
1962         * NetworkProcess/NetworkProcess.messages.in:
1963         * NetworkProcess/NetworkResourceLoader.cpp:
1964         (WebKit::logCookieInformationInternal):
1965         * NetworkProcess/NetworkSession.cpp:
1966         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1967         (WebKit::NetworkSession::registrableDomainsWithWebsiteData):
1968         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
1969         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
1970         * NetworkProcess/NetworkSession.h:
1971         * Shared/WebCoreArgumentCoders.cpp:
1972         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1973         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1974         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
1975         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
1976         * UIProcess/Network/NetworkProcessProxy.cpp:
1977         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1978         (WebKit::NetworkProcessProxy::isPrevalentResource):
1979         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1980         (WebKit::NetworkProcessProxy::setPrevalentResource):
1981         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1982         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1983         (WebKit::NetworkProcessProxy::setLastSeen):
1984         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1985         (WebKit::NetworkProcessProxy::logUserInteraction):
1986         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1987         (WebKit::NetworkProcessProxy::clearUserInteraction):
1988         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
1989         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1990         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1991         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
1992         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1993         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1994         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1995         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1996         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1997         (WebKit::NetworkProcessProxy::isGrandfathered):
1998         (WebKit::NetworkProcessProxy::setGrandfathered):
1999         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
2000         (WebKit::NetworkProcessProxy::hasStorageAccess):
2001         (WebKit::NetworkProcessProxy::requestStorageAccess):
2002         (WebKit::NetworkProcessProxy::grantStorageAccess):
2003         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
2004         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
2005         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
2006         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
2007         * UIProcess/Network/NetworkProcessProxy.h:
2008         * UIProcess/Network/NetworkProcessProxy.messages.in:
2009         * UIProcess/WebPageProxy.cpp:
2010         (WebKit::WebPageProxy::logFrameNavigation):
2011         (WebKit::WebPageProxy::requestStorageAccessConfirm):
2012         * UIProcess/WebProcessProxy.cpp:
2013         (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed):
2014         (WebKit::WebProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
2015         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
2016         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
2017         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
2018         * UIProcess/WebProcessProxy.h:
2019         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2020         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2021         (WebKit::WebsiteDataStore::isPrevalentResource):
2022         (WebKit::WebsiteDataStore::setPrevalentResource):
2023         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2024         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2025         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2026         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
2027         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2028         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
2029         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2030         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2031         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2032         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2033         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2034         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2035         (WebKit::WebsiteDataStore::clearPrevalentResource):
2036         (WebKit::WebsiteDataStore::setLastSeen):
2037         (WebKit::WebsiteDataStore::hasStorageAccess):
2038         (WebKit::WebsiteDataStore::requestStorageAccess):
2039         (WebKit::WebsiteDataStore::grantStorageAccess):
2040         (WebKit::WebsiteDataStore::logUserInteraction):
2041         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2042         (WebKit::WebsiteDataStore::clearUserInteraction):
2043         (WebKit::WebsiteDataStore::setGrandfathered):
2044         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Deleted.
2045         * UIProcess/WebsiteData/WebsiteDataStore.h:
2046         * WebProcess/WebPage/WebPage.cpp:
2047         (WebKit::WebPage::hasStorageAccess):
2048         (WebKit::WebPage::requestStorageAccess):
2049         * WebProcess/WebProcess.cpp:
2050         (WebKit::m_nonVisibleProcessCleanupTimer):
2051         (WebKit::WebProcess::initializeWebProcess):
2052
2053 2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
2054
2055         [WPE] Bump WPEBackend-fdo requirement to API version 1.0
2056         https://bugs.webkit.org/show_bug.cgi?id=195001
2057
2058         Reviewed by Carlos Garcia Campos.
2059
2060         API version 1.0 always includes the functionality previously guarded with
2061         WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
2062         unconditionally.
2063
2064         * UIProcess/API/wpe/WPEView.cpp:
2065         (WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
2066         (WKWPE::m_backend): Ditto.
2067         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
2068         (WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
2069         library name, remove call to wpe_fdo_initialize_for_egl_display().
2070         (WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
2071         here, to bail out early in case initialization fails.
2072         * UIProcess/glib/WebProcessPoolGLib.cpp:
2073         (WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
2074         WPE_BACKEND_CHECK_VERSION().
2075
2076 2019-02-25  Per Arne Vollan  <pvollan@apple.com>
2077
2078         A prewarmed Web process should have a process assertion.
2079         https://bugs.webkit.org/show_bug.cgi?id=195006
2080
2081         Reviewed by Geoffrey Garen.
2082
2083         To make sure the prewarm message is handled in the Web process before the process is suspended,
2084         the process should have a process assertion. This can be fixed by sending the prewarm message
2085         inside WebProcessPool::initializeNewWebProcess, since all message sent inside this method are
2086         guaranteed to be handled before the WebContent process is suspended.
2087
2088         This patch is based on Chris Dumez' idea and obervation of the issue.
2089
2090         * UIProcess/WebProcessPool.cpp:
2091         (WebKit::WebProcessPool::createNewWebProcess):
2092         (WebKit::WebProcessPool::initializeNewWebProcess):
2093         * UIProcess/WebProcessPool.h:
2094
2095 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2096
2097         [GTK] Enable PSON
2098         https://bugs.webkit.org/show_bug.cgi?id=194979
2099
2100         Reviewed by Žan Doberšek.
2101
2102         It is expected that this may introduce unexpected regressions, so it's appropriate to do
2103         this at the start of a new release cycle.
2104
2105         * Shared/WebPreferencesDefaultValues.h:
2106
2107 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2108
2109         [WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
2110         https://bugs.webkit.org/show_bug.cgi?id=194614
2111
2112         Reviewed by Carlos Garcia Campos.
2113
2114         This environment variable is now enabled for WPE, not just for GTK.
2115
2116         It is now possible to use this environment variable to enable complex text, not just to
2117         disable it.
2118
2119         WebProcessPool::setAlwaysUsesComplexTextCodePath is fixed to be respected even when this
2120         environment variable is set, although WPE and GTK will never do so.
2121
2122         * UIProcess/glib/WebProcessPoolGLib.cpp:
2123         (WebKit::WebProcessPool::platformInitialize):
2124         (WebKit::WebProcessPool::platformInitializeWebProcess):
2125
2126 2019-02-24  Zalan Bujtas  <zalan@apple.com>
2127
2128         Introduce ContentChangeObserver class
2129         https://bugs.webkit.org/show_bug.cgi?id=194977
2130         <rdar://problem/48338115>
2131
2132         Reviewed by Simon Fraser.
2133
2134         * WebProcess/WebPage/ios/WebPageIOS.mm:
2135         (WebKit::WebPage::handleSyntheticClick):
2136         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2137
2138 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
2139
2140         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
2141         https://bugs.webkit.org/show_bug.cgi?id=194984
2142
2143         Reviewed by Sam Weinig.
2144
2145         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
2146
2147         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
2148         current layout viewport rect. Instead, set the layout viewport on the root
2149         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
2150         
2151         Add a WK2 Scrolling log channel.
2152
2153         * Platform/Logging.h:
2154         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2155         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2156         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2157         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
2158         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2159         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2160         (WebKit::RemoteScrollingTree::fixedPositionRect): Deleted.
2161         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
2162         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2163         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
2164         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted.
2165         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2166         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2167         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
2168         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
2169         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
2170         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2171         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2172         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
2173         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2174         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2175         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange):
2176         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
2177         * UIProcess/ios/WKContentView.mm:
2178         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2179
2180 2019-02-20  Darin Adler  <darin@apple.com>
2181
2182         Finish removing String::format
2183         https://bugs.webkit.org/show_bug.cgi?id=194893
2184
2185         Reviewed by Daniel Bates.
2186
2187         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2188         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
2189         a problem where we passed an NSData * to format with a "%s"."
2190
2191 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2192
2193         [WPE] Install MemoryPressureHandler in UIProcess
2194         https://bugs.webkit.org/show_bug.cgi?id=194617
2195
2196         Reviewed by Žan Doberšek.
2197
2198         Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
2199         too.
2200
2201         We need @no-unify to avoid changing the unified source bundles under API/, which are
2202         notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)
2203
2204         * SourcesWPE.txt:
2205         * UIProcess/WebMemoryPressureHandler.cpp:
2206         (WebKit::installMemoryPressureHandler):
2207         * UIProcess/glib/WebProcessPoolGLib.cpp:
2208         (WebKit::WebProcessPool::platformInitialize):
2209
2210 2019-02-23  Chris Dumez  <cdumez@apple.com>
2211
2212         Give DrawingAreas their own identifiers
2213         https://bugs.webkit.org/show_bug.cgi?id=194969
2214         <rdar://problem/48154508>
2215
2216         Unreviewed, fix API test debug assertion failures after r241988.
2217         We do not support sending an ObjectIdentifier that is 0 via IPC so update WebPageProxy::CreateNewPage
2218         IPC to return an Optional<WebPageCreationParameters> instead of a WebPageCreationParameters. It returns
2219         nullopt when there this no UIClient or the client did not create the page, instead of returning a
2220         default-initialized WebPageCreationParameters.
2221
2222         * UIProcess/WebPageProxy.cpp:
2223         (WebKit::WebPageProxy::createNewPage):
2224         * UIProcess/WebPageProxy.messages.in:
2225         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2226         (WebKit::WebChromeClient::createWindow):
2227
2228 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
2229
2230         Remove remnants of iOS WK1 scrolling tree code
2231         https://bugs.webkit.org/show_bug.cgi?id=194980
2232
2233         Reviewed by Sam Weinig.
2234
2235         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.
2236
2237         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
2238         removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).
2239
2240         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2241         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2242         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2243         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
2244         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2245         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
2246         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
2247         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
2248         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
2249         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
2250         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
2251         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
2252         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
2253         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
2254         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
2255         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2256
2257 2019-02-23  Keith Miller  <keith_miller@apple.com>
2258
2259         Add new mac target numbers
2260         https://bugs.webkit.org/show_bug.cgi?id=194955
2261
2262         Reviewed by Tim Horton.
2263
2264         * Configurations/Base.xcconfig:
2265         * Configurations/DebugRelease.xcconfig:
2266
2267 2019-02-22  Chris Dumez  <cdumez@apple.com>
2268
2269         Give DrawingAreas their own identifiers
2270         https://bugs.webkit.org/show_bug.cgi?id=194969
2271         <rdar://problem/48154508>
2272
2273         Reviewed by Geoffrey Garen.
2274
2275         Give DrawingAreas their own identifiers instead of using the pageID. It will make the IPC more robust now that a
2276         WebPageProxy can have several drawing areas with PSON.
2277
2278         * Shared/DrawingAreaInfo.h:
2279         * Shared/WebPageCreationParameters.cpp:
2280         (WebKit::WebPageCreationParameters::encode const):
2281         (WebKit::WebPageCreationParameters::decode):
2282         * Shared/WebPageCreationParameters.h:
2283         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2284         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
2285         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2286         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
2287         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
2288         * UIProcess/DrawingAreaProxy.cpp:
2289         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2290         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
2291         (WebKit::DrawingAreaProxy::messageSenderConnection const):
2292         (WebKit::DrawingAreaProxy::sendMessage):
2293         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
2294         * UIProcess/DrawingAreaProxy.h:
2295         (WebKit::DrawingAreaProxy::identifier const):
2296         (WebKit::DrawingAreaProxy::process const):
2297         * UIProcess/DrawingAreaProxyImpl.cpp:
2298         (WebKit::DrawingAreaProxyImpl::update):
2299         * UIProcess/ProvisionalPageProxy.cpp:
2300         (WebKit::ProvisionalPageProxy::initializeWebPage):
2301         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2302         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2303         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2304         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
2305         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2306         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
2307         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
2308         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2309         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2310         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2311         * UIProcess/WebPageProxy.cpp:
2312         (WebKit::WebPageProxy::initializeWebPage):
2313         (WebKit::WebPageProxy::createNewPage):
2314         (WebKit::WebPageProxy::creationParameters):
2315         * UIProcess/WebPageProxy.h:
2316         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2317         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
2318         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
2319         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2320         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2321         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
2322         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
2323         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2324         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2325         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
2326         (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
2327         (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
2328         * WebProcess/WebPage/DrawingArea.cpp:
2329         (WebKit::DrawingArea::DrawingArea):
2330         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
2331         * WebProcess/WebPage/DrawingArea.h:
2332         (WebKit::DrawingArea::identifier const):
2333         (WebKit::DrawingArea::send):
2334         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2335         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2336         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
2337         (WebKit::DrawingAreaImpl::display):
2338         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2339         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2340         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
2341         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2342         * WebProcess/WebPage/WebPage.cpp:
2343         (WebKit::WebPage::reinitializeWebPage):
2344         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2345         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2346         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
2347         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
2348         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2349         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
2350         (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
2351
2352 2019-02-22  Andy Estes  <aestes@apple.com>
2353
2354         [Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
2355         https://bugs.webkit.org/show_bug.cgi?id=194971
2356         <rdar://problem/35786264>
2357
2358         Reviewed by Tim Horton.
2359
2360         sandbox_extension_issue_file is not actually deprecated.
2361
2362         * Shared/mac/SandboxExtensionMac.mm:
2363         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
2364
2365 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2366
2367         [iOS] Callout menu overlaps in-page controls when editing a comment in github.com's issue tracker
2368         https://bugs.webkit.org/show_bug.cgi?id=194873
2369         <rdar://problem/46701974>
2370
2371         Reviewed by Tim Horton.
2372
2373         On the topic of supporting web-based rich text editors on iOS, one problematic area has always been handling
2374         conflicts between platform UI (i.e., the system callout menu) and in-page text editing controls. This issue
2375         comes up in websites that don't use the "hidden contenteditable" approach to rich text editing, but also show
2376         additional controls in a toolbar or contextual menu above the selection. In these cases, what often happens is
2377         that system controls overlap controls in the page.
2378
2379         Luckily, the iOS callout menu (i.e. the private UICalloutBar) is capable of presenting with a list of "evasion
2380         rects" to avoid; if the callout bar would normally intersect with one of these rects, then a different
2381         orientation that does not intersect with one of these rects is chosen instead. Currently, the only rect added
2382         here by UIKit when presenting the callout menu is the bounding rect of the on-screen keyboard, but after
2383         <rdar://problem/48128337>, we now have a generalized mechanism for offering additional evasion rects before
2384         UIKit presents the callout menu.
2385
2386         This patch adopts the mechanism introduced in <rdar://problem/48128337>, and introduces a heuristic for
2387         determining the approximate location of controls in the page which might overlap the callout menu. This
2388         heuristic works by hit-testing for clickable (but non-editable) nodes above the bounds of the selection, which
2389         are additionally not hit-tested by advancing outwards from any of the other edges of the selection bounds.
2390         Additionally, any hit-tested nodes whose bounding rects are very large (relative to the content view size) are
2391         ignored (this deals with scenarios where the body or a large container element has a click handler). We then add
2392         the bounding rects of each of the nodes that fit this criteria to the list of rects for UIKit to avoid when
2393         presenting the system callout menu.
2394
2395         The result is that WebKit will, by default, avoid overlapping anything that looks like controls in the page when
2396         showing a callout menu in editable content. In practice, this fixes overlapping controls on most websites that
2397         roll their own context menu or toolbar in their rich text editor.
2398
2399         Test: editing/selection/ios/avoid-showing-callout-menu-over-controls.html
2400
2401         * Platform/spi/ios/UIKitSPI.h:
2402         * UIProcess/WebPageProxy.h:
2403         * UIProcess/ios/WKContentViewInteraction.mm:
2404         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2405         (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
2406         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2407
2408         Drive-by: handle null completion handler arguments more gracefully, by raising an NSException and bailing before
2409         attempting to invoke a nil block.
2410
2411         * UIProcess/ios/WebPageProxyIOS.mm:
2412         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
2413
2414         See above for more detail.
2415
2416         * WebProcess/WebPage/WebPage.h:
2417         * WebProcess/WebPage/WebPage.messages.in:
2418         * WebProcess/WebPage/ios/WebPageIOS.mm:
2419         (WebKit::WebPage::requestEvasionRectsAboveSelection):
2420
2421 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
2422
2423         Unreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.
2424
2425         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2426
2427 2019-02-22  Chris Dumez  <cdumez@apple.com>
2428
2429         Regression(PSON) Unable to preview password-protected documents on iCloud.com
2430         https://bugs.webkit.org/show_bug.cgi?id=194954
2431         <rdar://problem/48127957>
2432
2433         Reviewed by Alex Christensen.
2434
2435         Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related
2436         IPC on iOS.
2437
2438         * UIProcess/ProvisionalPageProxy.cpp:
2439         (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
2440         (WebKit::ProvisionalPageProxy::didReceiveMessage):
2441         * UIProcess/ProvisionalPageProxy.h:
2442         * UIProcess/WebPageProxy.h:
2443         * UIProcess/ios/WebPageProxyIOS.mm:
2444         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
2445         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
2446
2447 2019-02-22  Per Arne Vollan  <pvollan@apple.com>
2448
2449         [iOS] Sandbox should allow mach lookups related to media capturing
2450         https://bugs.webkit.org/show_bug.cgi?id=194951
2451         <rdar://problem/48013875>
2452
2453         Reviewed by Brent Fulgham.
2454
2455         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2456
2457 2019-02-22  Alexander Mikhaylenko  <exalm7659@gmail.com>
2458
2459         [GTK] Navigation gesture improvements
2460         https://bugs.webkit.org/show_bug.cgi?id=194943
2461
2462         Reviewed by Michael Catanzaro.
2463
2464         Cancel the gesture if progress is less than 0.5 and velocity is not high enough.
2465
2466         Allow to continue the gesture during animation. Introduce finished state to be used
2467         when showing snapshot after the animation ends.
2468
2469         Fix duration calculation, also slow it down so that the initial velocity matches
2470         what it was during the gesture.
2471
2472         * UIProcess/ViewGestureController.h: Add shouldCancel() and State::Finishing to SwipeProgressTracker.
2473         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
2474         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
2475         Fix velocity calculation, allow scrolling during State::Animating.
2476         (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): Added.
2477         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): Use shouldCancel() and fix duration calculation.
2478         (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation): Set state to State::Finishing when the animation ends.
2479
2480 2019-02-22  Chris Dumez  <cdumez@apple.com>
2481
2482         REGRESSION(PSON) Scroll position is sometimes not restored on history navigation
2483         https://bugs.webkit.org/show_bug.cgi?id=194924
2484         <rdar://problem/48216125>
2485
2486         Reviewed by Geoffrey Garen.
2487
2488         When process-swapping, we would create a new WebPage in the new process, which would
2489         call restoreSessionInternal() to restore the HistoryItems based on the UIProcess's
2490         backforward list. The issue is that this session restoring would send HistoryItem
2491         updates back to the UIProcess. Without PSON, this would be unnecessary but harmless.
2492         With PSON though, this may end up overwriting values set by the previous process,
2493         such as the scroll position.
2494
2495         Address the issue by temporarily disabling the HistoryItem update notifications to
2496         the UIProcess while restoring a session.
2497
2498         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
2499         (-[WKBackForwardListItem _scrollPosition]):
2500         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
2501         * WebProcess/WebPage/WebPage.cpp:
2502         (WebKit::WebPage::restoreSessionInternal):
2503
2504 2019-02-21  Adrian Perez de Castro  <aperez@igalia.com>
2505
2506         [WPE][GTK] No API documentation generated for WebKitUserContentFilterStore
2507         https://bugs.webkit.org/show_bug.cgi?id=194908
2508
2509         Reviewed by Carlos Garcia Campos.
2510
2511         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add entry for webkit_user_content_filter_store_get_type().
2512         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add entry for WebKitUserContentFilterStore.
2513         * UIProcess/API/wpe/docs/wpe-docs.sgml: Ditto.
2514
2515 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2516
2517         wpewebkit-2.23.90 Failing to build on Fedora
2518         https://bugs.webkit.org/show_bug.cgi?id=194922
2519
2520         Unreviewed. Fix path to WebKitUserContentFilterStore.h in WPE_API_INSTALLED_HEADERS.
2521
2522         * PlatformWPE.cmake:
2523
2524 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
2525
2526         Hardcode Visual Viewports on everywhere except iOS WK1
2527         https://bugs.webkit.org/show_bug.cgi?id=194928
2528
2529         Reviewed by Zalan Bujtas.
2530
2531         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
2532         change the default value of the Setting to 'true', and hardcode WebView on iOS to
2533         set it to false. The setting has shipped for several years and there's no need to turn
2534         it off now.
2535
2536         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
2537         Visual Viewports are not enabled.
2538         
2539         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
2540         that only runs in WK2
2541
2542         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2543         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2544         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2545         * Shared/WebPreferences.yaml:
2546         * UIProcess/API/Cocoa/WKPreferences.mm:
2547         (-[WKPreferences _visualViewportEnabled]): Deleted.
2548         (-[WKPreferences _setVisualViewportEnabled:]): Deleted.
2549         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2550         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2551         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2552         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2553         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
2554         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2555         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
2556         * UIProcess/WebPageProxy.h:
2557         * UIProcess/ios/WKContentView.mm:
2558         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2559         * UIProcess/ios/WebPageProxyIOS.mm:
2560         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
2561         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2562         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2563         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2564         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2565         * WebProcess/WebPage/ios/WebPageIOS.mm:
2566         (WebKit::WebPage::getFocusedElementInformation):
2567         (WebKit::WebPage::dynamicViewportSizeUpdate):
2568         (WebKit::WebPage::updateVisibleContentRects):
2569
2570 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2571
2572         [GTK] Epiphany searching for plugins even if plugins are disabled
2573         https://bugs.webkit.org/show_bug.cgi?id=194352
2574
2575         Reviewed by Michael Catanzaro.
2576
2577         Check pluginsEnabled setting before trying to get plugins from UI process.
2578
2579         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2580         (WebKit::WebPluginInfoProvider::populatePluginCache):
2581
2582 2019-02-21  Darin Adler  <darin@apple.com>
2583
2584         Some refinements for Node and Document
2585         https://bugs.webkit.org/show_bug.cgi?id=194764
2586
2587         Reviewed by Ryosuke Niwa.
2588
2589         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
2590         (webkit_dom_document_get_override_style): Changed to return nullptr directly instead of
2591         calling a bunch of WebCore code first. No real value in checking arguments or doing any work.
2592
2593         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2594         (WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument const): Deleted.
2595         No need to override the function inherited from the base class, nor to keep track of the
2596         unnecessary task of implementing this some day.
2597         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
2598
2599 2019-02-21  Ryosuke Niwa  <rniwa@webkit.org>
2600
2601         Discard cached processes when clearing website data store
2602         https://bugs.webkit.org/show_bug.cgi?id=194894
2603
2604         Reviewed by Chris Dumez.
2605
2606         Clear the process cache when clearing the website data store so that there is no way to infer
2607         which site the user had visited by observing for which sites WebContent processes had been cached.
2608
2609         There is one sublty in WebsiteDataStore::removeData that we have to delay the clearing of
2610         the web process cache until the next run loop because SuspendedPageProxy::~SuspendedPageProxy
2611         invokes WebProcessProxy::maybeShutDown in the next run loop. We also have to disable the process
2612         cache during this time as it would otherwise trigger the responsiveness check of WebContent process
2613         can take arbitrarily long time.
2614
2615         * UIProcess/API/Cocoa/WKProcessPool.mm:
2616         (-[WKProcessPool _processCacheCapacity]): Added for testing.
2617         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2618         * UIProcess/WebProcessCache.cpp:
2619         (WebKit::WebProcessCache::addProcess): Avoid adding web processes to the cache while the suspended
2620         pages are being cleared.
2621         * UIProcess/WebProcessCache.h:
2622         (WebKit::WebProcessCache::disabled const): Added.
2623         (WebKit::WebProcessCache::setDisabled): Added.
2624         * UIProcess/WebProcessPool.cpp:
2625         (WebKit::WebProcessPool::handleMemoryPressureWarning):
2626         (WebKit::WebProcessPool::clearSuspendedPages): Added.
2627         * UIProcess/WebProcessPool.h:
2628         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2629         (WebKit::WebsiteDataStore::removeData):
2630
2631 2019-02-21  Alex Christensen  <achristensen@webkit.org>
2632
2633         Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView
2634         https://bugs.webkit.org/show_bug.cgi?id=194914
2635         <rdar://problem/47586889>
2636
2637         Reviewed by Geoffrey Garen.
2638
2639         * UIProcess/API/APIUIClient.h:
2640         (API::UIClient::didShowSafeBrowsingWarning):
2641         (API::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
2642         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2643         * UIProcess/Cocoa/UIDelegate.h:
2644         * UIProcess/Cocoa/UIDelegate.mm:
2645         (WebKit::UIDelegate::setDelegate):
2646         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
2647         * UIProcess/WebPageProxy.cpp:
2648         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2649
2650 2019-02-21  Tim Horton  <timothy_horton@apple.com>
2651
2652         Turn a high-value UI-side-compositing assertion into a release assert
2653         https://bugs.webkit.org/show_bug.cgi?id=194887
2654
2655         Reviewed by Simon Fraser.
2656
2657         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2658         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2659         There is absolutely no situation in which this assert should fire
2660         if WebKit is behaving correctly, and it will basically always result
2661         in a UI process crash (or at least confusion), so make it a release assert.
2662         This would have saved us a lot of stress in bug 194845.
2663
2664 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
2665
2666         [MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
2667         https://bugs.webkit.org/show_bug.cgi?id=194913
2668
2669         Reviewed by Brent Fulgham.
2670
2671         MSVC has problems with the scoping of `this` within a nested lambda. To work around the
2672         behavior the enclosing lambda's wrapping of `this` is used within the nested lambda.
2673
2674         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2675         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
2676         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2677         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
2678
2679 2019-02-21  Chris Dumez  <cdumez@apple.com>
2680
2681         Fix API test crashes after r241855.
2682
2683         Reviewed by Ryosuke Niwa.
2684
2685         * UIProcess/WebProcessCache.cpp:
2686         (WebKit::WebProcessCache::addProcessIfPossible):
2687
2688 2019-02-21  Alex Christensen  <achristensen@webkit.org>
2689
2690         API::HTTPCookieStore should expose setCookies()
2691         https://bugs.webkit.org/show_bug.cgi?id=194861
2692
2693         Reviewed by Brent Fulgham.
2694
2695         Pass a Vector<Cookie> instead of just one cookie at a time.
2696         This will add the ability to set multiple cookies without an IPC roundtrip per cookie.
2697
2698         * NetworkProcess/Cookies/WebCookieManager.cpp:
2699         (WebKit::WebCookieManager::setCookie):
2700         * NetworkProcess/Cookies/WebCookieManager.h:
2701         * NetworkProcess/Cookies/WebCookieManager.messages.in:
2702         * UIProcess/API/APIHTTPCookieStore.cpp:
2703         (API::HTTPCookieStore::setCookies):
2704         (API::HTTPCookieStore::setCookie): Deleted.
2705         * UIProcess/API/APIHTTPCookieStore.h:
2706         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2707         (-[WKHTTPCookieStore setCookie:completionHandler:]):
2708         * UIProcess/WebCookieManagerProxy.cpp:
2709         (WebKit::WebCookieManagerProxy::setCookies):
2710         (WebKit::WebCookieManagerProxy::setCookie): Deleted.
2711         * UIProcess/WebCookieManagerProxy.h:
2712
2713 2019-02-21  Antoine Quint  <graouts@apple.com>
2714
2715         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
2716         https://bugs.webkit.org/show_bug.cgi?id=194531
2717         <rdar://problem/47714562>
2718
2719         Reviewed by Tim Horton.
2720
2721         Follow-up commit to ensure this SPI is only called on newer versions of iOS.
2722
2723         * UIProcess/ios/WKContentViewInteraction.mm:
2724         (-[WKContentView cancelPointersForGestureRecognizer:]):
2725
2726 2019-02-21  Tim Horton  <timothy_horton@apple.com>
2727
2728         Crash under RemoteLayerTreePropertyApplier::applyProperties when reattaching to old process
2729         https://bugs.webkit.org/show_bug.cgi?id=194845
2730         <rdar://problem/47944579>
2731
2732         Reviewed by Antti Koivisto.
2733
2734         New test: ProcessSwap.PageOverlayLayerPersistence
2735
2736         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2737         (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
2738         Keep track of all properties that have ever changed on a layer, so we
2739         can re-send them if a layer moves between contexts.
2740
2741         * WebProcess/WebPage/DrawingArea.cpp:
2742         (WebKit::DrawingArea::~DrawingArea):
2743         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
2744         * WebProcess/WebPage/DrawingArea.h:
2745         (WebKit::DrawingArea::layerHostDidFlushLayers):
2746         Make it possible to tear down DrawingArea's MessageReceiver before it is destroyed,
2747         so that we can keep two DrawingAreas alive in a single process for a short time.
2748
2749         (WebKit::DrawingArea::adoptLayersFromDrawingArea):
2750         Add adoptLayersFromDrawingArea; see below for its only useful implementation.
2751
2752         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
2753         (WebKit::GraphicsLayerCARemote::GraphicsLayerCARemote):
2754         (WebKit::GraphicsLayerCARemote::~GraphicsLayerCARemote):
2755         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
2756         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
2757         (WebKit::GraphicsLayerCARemote::moveToContext):
2758         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
2759         Make it possible to move a GraphicsLayerCARemote between RemoteLayerTreeContexts.
2760
2761         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2762         (WebKit::PlatformCALayerRemote::create):
2763         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
2764         (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
2765         (WebKit::PlatformCALayerRemote::moveToContext):
2766         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
2767         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
2768         (WebKit::PlatformCALayerRemoteCustom::create):
2769         (WebKit::PlatformCALayerRemoteCustom::clone const):
2770         Make it possible to move a PlatformCALayerRemote between RemoteLayerTreeContexts.
2771
2772         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
2773         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
2774         (WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
2775         (WebKit::RemoteLayerTreeContext::adoptLayersFromContext):
2776         (WebKit::RemoteLayerTreeContext::layerDidEnterContext):
2777         (WebKit::RemoteLayerTreeContext::layerWillLeaveContext):
2778         (WebKit::RemoteLayerTreeContext::graphicsLayerDidEnterContext):
2779         (WebKit::RemoteLayerTreeContext::graphicsLayerWillLeaveContext):
2780         (WebKit::RemoteLayerTreeContext::layerWasCreated): Deleted.
2781         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed): Deleted.
2782         Keep track of all GraphicsLayerCARemote instances in the context, like we
2783         do for PlatformCALayerRemote, so that we can update their context backpointers if needed.
2784
2785         Also make it possible to move all outstanding layers to a new context.
2786
2787         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2788         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2789         (WebKit::RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea):
2790         * WebProcess/WebPage/WebPage.cpp:
2791         (WebKit::WebPage::reinitializeWebPage):
2792         When doing a DrawingArea swap, transition all layers from the old context
2793         to the new one. In order to do this, we temporarily keep both DrawingAreas
2794         alive, but make use of the new mechanism to remove the old one's MessageReceiver
2795         before installing the new one, so that destroying the old one later doesn't
2796         remove it (avoiding re-introducing bug 189481).
2797
2798 2019-02-21  Chris Dumez  <cdumez@apple.com>
2799
2800         Unreviewed API test fix after r241855.
2801
2802         * UIProcess/WebProcessProxy.cpp:
2803         (WebKit::WebProcessProxy::~WebProcessProxy):
2804
2805 2019-02-21  Antoine Quint  <graouts@apple.com>
2806
2807         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
2808         https://bugs.webkit.org/show_bug.cgi?id=194531
2809         <rdar://problem/47714562>
2810
2811         Reviewed by Dean Jackson.
2812
2813         * Platform/spi/ios/UIKitSPI.h:
2814         * UIProcess/ios/WKContentViewInteraction.mm:
2815         (-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
2816         to respondsToSelector until the SPI has shipped for OpenSource builds to work.
2817
2818 2019-02-20  Antti Koivisto  <antti@apple.com>
2819
2820         Make programmatic frame scrolling work on iOS
2821         https://bugs.webkit.org/show_bug.cgi?id=194886
2822
2823         Reviewed by Simon Fraser.
2824
2825         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2826         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2827
2828         Don't move based on the layout scroll position. This just overrides the user scroll position.
2829         Remove ScrolledContentsLayer checks, we only need to deal with the ScrollContainerLayer here.
2830
2831         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition):
2832
2833         Scroll the UIScrollView correctly. This is called as a result of setting the RequestedScrollPosition property.
2834         Remove scroll origin code, it doesn't look correct (and is untested).
2835
2836 2019-02-20  Chris Dumez  <cdumez@apple.com>
2837
2838         [PSON] Make sure hung processes are not kept alive by suspended pages or process caching
2839         https://bugs.webkit.org/show_bug.cgi?id=194881
2840         <rdar://problem/48249014>
2841
2842         Reviewed by Geoffrey Garen.
2843
2844         After we construct a SuspendedPageProxy and before we send the IPC to the WebProcess to
2845         ask it to suspend, start a 10 seconds timer. If the process does not answer the request
2846         to suspend before the timer fires, we destroy the SuspendedPageProxy so that we do not
2847         keep a hung process around.
2848
2849         For the WebProcessCache, we now call WebProcessProxy::isResponsive() on the process
2850         before adding it to the cache. Internally, this relies on an IPC handshake with the
2851         WebProcess. If the process is not responsive, we do not add it to the cache and we
2852         shut it down. If it is responsive then we proceed normally with adding it to the
2853         cache.
2854
2855         * UIProcess/SuspendedPageProxy.cpp:
2856         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2857         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
2858         (WebKit::SuspendedPageProxy::suspensionTimedOut):
2859         * UIProcess/SuspendedPageProxy.h:
2860         * UIProcess/WebProcessCache.cpp:
2861         (WebKit::WebProcessCache::addProcessIfPossible):
2862         (WebKit::WebProcessCache::addProcess):
2863         * UIProcess/WebProcessCache.h:
2864         * UIProcess/WebProcessProxy.cpp:
2865         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2866         (WebKit::WebProcessProxy::maybeShutDown):
2867         (WebKit::WebProcessProxy::isResponsive):
2868         * UIProcess/WebProcessProxy.h:
2869
2870 2019-02-20  Chris Dumez  <cdumez@apple.com>
2871
2872         Unreviewed build fix after r241823.
2873
2874         * UIProcess/SuspendedPageProxy.h:
2875
2876 2019-02-20  Alex Christensen  <achristensen@webkit.org>
2877
2878         Unreviewed, rolling out r241838.
2879
2880         Broke API tests
2881
2882         Reverted changeset:
2883
2884         "Resolve WebsiteDataStore/HTTPCookieStore ref cycle"
2885         https://bugs.webkit.org/show_bug.cgi?id=194868
2886         https://trac.webkit.org/changeset/241838
2887
2888 2019-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2889
2890         REGRESSION: [ iOS ] Layout Test editing/input/ios/rtl-keyboard-input-on-focus.html is a Timeout
2891         https://bugs.webkit.org/show_bug.cgi?id=194601
2892         <rdar://problem/48080316>
2893
2894         Reviewed by Tim Horton.
2895
2896         Following r241311, if a web view becomes first responder and is then moved offscreen (or obscured, hidden, or in
2897         the case of WebKitTestRunner, its UIWindow loses its status as keyWindow), we end up holding on to the input
2898         view update deferral token indefinitely, waiting for the current focused element to be blurred or refocused.
2899
2900         This also manifests other user-facing bugs, the most common of which is the keyboard occasionally remaining
2901         onscreen after typing a URL in the unified field in MobileSafari and hitting Return, in the case where there is
2902         no autofocused element on the page.
2903
2904         To fix this, when becoming the first responder, additionally install a callback to detect when the page is
2905         finished handling the activity state change, and invalidate the input deferral token then. This retains the
2906         behavior where calling -becomeFirstResponder on the web view while a different view is focused will keep the
2907         keyboard stable, since the focused element message from the web process should be dispatched when handling the
2908         activity state change within the web process.
2909
2910         Of course, the web process may not be responsive at all while the web view is still in the view hierarchy, in
2911         which case we may still end up deferring input view updates indefinitely. In this case, we maintain a separate
2912         watchdog timer with a short delay, after which we unconditionally invalidate the token.
2913
2914         * UIProcess/WebPageProxy.cpp:
2915         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
2916
2917         Move the implementation of installActivityStateChangeCompletionHandler into cross-platform code.
2918
2919         * UIProcess/WebPageProxy.h:
2920         * UIProcess/ios/WKContentView.mm:
2921         * UIProcess/ios/WKContentViewInteraction.mm:
2922         (-[WKContentView cleanupInteraction]):
2923         (-[WKContentView _cancelPreviousResetInputViewDeferralRequest]):
2924         (-[WKContentView _scheduleResetInputViewDeferralAfterBecomingFirstResponder]):
2925         (-[WKContentView _resetInputViewDeferral]):
2926         (-[WKContentView becomeFirstResponderForWebView]):
2927         (-[WKContentView resignFirstResponderForWebView]):
2928         (-[WKContentView _commitPotentialTapFailed]):
2929         (-[WKContentView _didNotHandleTapAsClick:]):
2930         (-[WKContentView _didCompleteSyntheticClick]):
2931
2932         Funnel all existing calls that reset _inputViewDeferralToken to nullptr, such that they go through a helper
2933         method instead that also cancels any scheduled requests to clear the token.
2934
2935         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2936         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
2937
2938         Respond to all pending callbacks after handling the activity state change.
2939
2940 2019-02-20  Chris Dumez  <cdumez@apple.com>
2941
2942         Regression(PSON) "Reload without content extensions" does not work when the main resource is blocked
2943         https://bugs.webkit.org/show_bug.cgi?id=194872
2944         <rdar://problem/47924500>
2945
2946         Reviewed by Alex Christensen.
2947
2948         [WKWebView _reloadWithoutContentBlockers] relies on a ReloadOption flag that is passed to WebCore
2949         instead of using WebsitePolicies.contentBlockersEnabled flag. If the reload causes a process swap
2950         due to PSON, then the new process does not know about this ReloadOption and fails to honor it.
2951
2952         Since the modern way to do this is WebsitePolicies, and since WebsitePolicies are properly
2953         propagated cross-process in case of process swap, this patch updates _reloadWithoutContentBlockers
2954         to set a flag on the Navigation which we use to later set the WebsitePolicies.contentBlockersEnabled
2955         flag in WebPageProxy::receivedNavigationPolicyDecision().
2956
2957         * UIProcess/API/APINavigation.h:
2958         (API::Navigation::setUserContentExtensionsEnabled):
2959         (API::Navigation::userContentExtensionsEnabled const):
2960         * UIProcess/WebPageProxy.cpp:
2961         (WebKit::WebPageProxy::reload):
2962         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2963
2964 2019-02-20  Truitt Savell  <tsavell@apple.com>
2965
2966         Unreviewed, rolling out r241817.
2967
2968         Caused 4 API failures
2969
2970         Reverted changeset:
2971
2972         "[GTK] Epiphany searching for plugins even if plugins are
2973         disabled"
2974         https://bugs.webkit.org/show_bug.cgi?id=194352
2975         https://trac.webkit.org/changeset/241817
2976
2977 2019-02-20  Andy Estes  <aestes@apple.com>
2978
2979         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
2980         https://bugs.webkit.org/show_bug.cgi?id=194869
2981
2982         Rubber-stamped by Jer Noble.
2983
2984         * WebKit.xcodeproj/project.pbxproj:
2985
2986 2019-02-20  Alex Christensen  <achristensen@webkit.org>
2987
2988         Resolve WebsiteDataStore/HTTPCookieStore ref cycle
2989         https://bugs.webkit.org/show_bug.cgi?id=194868
2990
2991         Reviewed by Geoffrey Garen.
2992
2993         * UIProcess/API/APIHTTPCookieStore.cpp:
2994         (API::HTTPCookieStore::HTTPCookieStore):
2995         (API::HTTPCookieStore::cookies):
2996         (API::HTTPCookieStore::setCookie):
2997         (API::HTTPCookieStore::deleteCookie):
2998         (API::HTTPCookieStore::registerObserver):
2999         (API::HTTPCookieStore::unregisterObserver):
3000         (API::HTTPCookieStore::cookieManagerDestroyed):
3001         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
3002         (API::HTTPCookieStore::ref const):
3003         (API::HTTPCookieStore::deref const):
3004         * UIProcess/API/APIHTTPCookieStore.h:
3005
3006 2019-02-20  Per Arne Vollan  <pvollan@apple.com>
3007
3008         [iOS] Open sandbox for specific call.
3009         https://bugs.webkit.org/show_bug.cgi?id=194860
3010         <rdar://problem/48166729>
3011
3012         Reviewed by Brent Fulgham.
3013
3014         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3015
3016 2019-02-20  Alex Christensen  <achristensen@webkit.org>
3017
3018         Move API::HTTPCookieStore ownership from API::WebsiteDataStore to WebKit::WebsiteDataStore
3019         https://bugs.webkit.org/show_bug.cgi?id=194842
3020
3021         Reviewed by Geoff Garen.
3022
3023         We need a way to get from WebKit::WebsiteDataStore to API::HTTPCookieStore.  It can't be done before this.
3024         This made an existing reference cycle easier to see, and we should fix it in a followup patch.
3025
3026         * UIProcess/API/APIWebsiteDataStore.cpp:
3027         (API::WebsiteDataStore::httpCookieStore):
3028         * UIProcess/API/APIWebsiteDataStore.h:
3029         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3030         (WebKit::WebsiteDataStore::cookieStore):
3031         * UIProcess/WebsiteData/WebsiteDataStore.h:
3032
3033 2019-02-20  Chris Dumez  <cdumez@apple.com>
3034
3035         Regression(PSON) Crash under WebKit::WebPageProxy::decidePolicyForNavigationActionSync
3036         https://bugs.webkit.org/show_bug.cgi?id=194857
3037         <rdar://problem/47759323>
3038
3039         Reviewed by Alex Christensen.
3040
3041         The ProvisionalPageProxy was blindly forwarding the DecidePolicyForNavigationActionSync
3042         synchronous IPC to the WebPageProxy, without passing it the process the IPC came from.
3043         As a result, WebPageProxy::decidePolicyForNavigationActionSync() would try to look up
3044         a WebFrameProxy using the provided frameID from the wrong process and we would end up
3045         hitting a RELEASE_ASSERT().
3046
3047         * UIProcess/ProvisionalPageProxy.cpp:
3048         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
3049         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3050         * UIProcess/ProvisionalPageProxy.h:
3051         * UIProcess/WebPageProxy.cpp:
3052         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3053         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
3054         * UIProcess/WebPageProxy.h:
3055
3056 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
3057
3058         [MSVC] Fix compilation errors with lambdas in Service Workers
3059         https://bugs.webkit.org/show_bug.cgi?id=194841
3060
3061         Reviewed by Alex Christensen.
3062
3063         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3064         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
3065
3066 2019-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3067
3068         [GTK] Epiphany searching for plugins even if plugins are disabled
3069         https://bugs.webkit.org/show_bug.cgi?id=194352
3070
3071         Reviewed by Michael Catanzaro.
3072
3073         Check pluginsEnabled setting before trying to get plugins from UI process.
3074
3075         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3076         (WebKit::WebPluginInfoProvider::populatePluginCache):
3077
3078 2019-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3079
3080         [WPE] Send client host fd and library name as web process creation parameters
3081         https://bugs.webkit.org/show_bug.cgi?id=194494
3082
3083         Reviewed by Žan Doberšek.
3084
3085         Instead of using command line arguments. The code is simpler and we don't need wpe specific code in process
3086         launcher glib implementation.
3087
3088         * Shared/WebProcessCreationParameters.cpp:
3089         (WebKit::WebProcessCreationParameters::encode const):
3090         (WebKit::WebProcessCreationParameters::decode):
3091         * Shared/WebProcessCreationParameters.h:
3092         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3093         (WebKit::ProcessLauncher::launchProcess):
3094         * UIProcess/glib/WebProcessPoolGLib.cpp:
3095         (WebKit::WebProcessPool::platformInitializeWebProcess):
3096         * WebProcess/glib/WebProcessGLib.cpp:
3097         (WebKit::WebProcess::platformInitializeWebProcess):
3098         * WebProcess/wpe/WebProcessMainWPE.cpp:
3099
3100 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
3101
3102         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
3103         https://bugs.webkit.org/show_bug.cgi?id=167941
3104
3105         Reviewed by Carlos Garcia Campos.
3106
3107         Adds new API to manage a collection of content extensions on disk (including compilation
3108         of new ones) using WebKitUserContentFilterStore; the associated WebKitUserContentFilter
3109         type (which represents a compiled content extension); and the functions needed to enable
3110         and disable them for a given WebKitUserContentManager.
3111
3112         The WebKitUserContentFilterStore public API is expressed in abstract terms of "saving"
3113         filters into the store (which involves compiling the JSON source rule set); and "loading"
3114         them back as main operations. This way we do not disclose to users of the API any detail
3115         about compilation, nor how contents are laid out on disk, and the documentation explicitly
3116         tells about only using the provided functions to manipulate the on-disk contents. This
3117         way we allow ourselves some leeway if the implementation needs changing in the future.
3118
3119         * PlatformGTK.cmake: Added WebKitUserContentFilterStore.h to the list of public API headers.
3120         * PlatformWPE.cmake: Ditto.
3121         * SourcesGTK.txt: Added WebKitUserContentFilterStore.cpp
3122         * SourcesWPE.txt: Ditto.
3123         * UIProcess/API/glib/WebKitError.cpp: Add definition of webkit_user_content_filter_error_quark().
3124         * UIProcess/API/glib/WebKitUserContent.cpp: Added WebKitUserContentFilter.
3125         (_WebKitUserContentFilter::_WebKitUserContentFilter):
3126         (webkit_user_content_filter_ref):
3127         (webkit_user_content_filter_unref):
3128         (webkit_user_content_filter_get_identifier):
3129         (webkitUserContentFilterCreate):
3130         (webkitUserContentFilterGetContentRuleList):
3131         * UIProcess/API/glib/WebKitUserContentFilterStore.cpp: Added.
3132         (toGError): Utility function to convert content extension error codes to GError.
3133         (webkit_user_content_filter_store_class_init):
3134         (webkit_user_content_filter_store_new):
3135         (webkit_user_content_filter_store_get_path):
3136         (webkitUserContentFilterStoreSaveBytes): Common function used as final step for all the
3137         functions which save (compile) JSON rule sets into the store, to avoid duplicating code.
3138         (webkit_user_content_filter_store_save):
3139         (webkit_user_content_filter_store_save_finish):
3140         (webkit_user_content_filter_store_save_from_file):
3141         (webkit_user_content_filter_store_save_from_file_finish):
3142         (webkit_user_content_filter_store_remove):
3143         (webkit_user_content_filter_store_remove_finish):
3144         (webkit_user_content_filter_store_load):
3145         (webkit_user_content_filter_store_lookup_finish):
3146         (webkit_user_content_filter_store_fetch_identifiers):
3147         (webkit_user_content_filter_store_fetch_identifiers_finish):
3148         * UIProcess/API/glib/WebKitUserContentManager.cpp: Added definitions for the new API
3149         functions to add and remove filters from an user content manager.
3150         (webkit_user_content_manager_add_filter):
3151         (webkit_user_content_manager_remove_filter):
3152         (webkit_user_content_manager_remove_all_filters):
3153         * UIProcess/API/glib/WebKitUserContentPrivate.h: Added declarations for
3154         webkitUserContentFilterCreate() and webkitUserContentFilterGetContentRuleList().
3155         * UIProcess/API/gtk/WebKitAutocleanups.h: Added autocleanups for WebKitUserContentFilter
3156         and WebKitUserContentFilterStore.
3157         * UIProcess/API/gtk/WebKitError.h: Added declarations for WEBKIT_USER_CONTENT_FILTER_ERROR
3158         plus the associated webkit_user_content_filter_error_quark() function and
3159         WebKitUserContentFilterErrror enum.
3160         * UIProcess/API/gtk/WebKitUserContent.h: Added declarations for WebKitUserContentFilter
3161         and its associated functions.
3162         * UIProcess/API/gtk/WebKitUserContentFilterStore.h: Added.
3163         * UIProcess/API/gtk/WebKitUserContentManager.h: Added declarations for the functions to
3164         add and remove filters from the user content manager.
3165         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new API functions and types to
3166         be included in the documentation.
3167         * UIProcess/API/gtk/webkit2.h: Added inclusion of WebKitUserContentFilterStore.h
3168         * UIProcess/API/wpe/WebKitError.h: Same as for the GTK port header.
3169         * UIProcess/API/wpe/WebKitUserContent.h: Same as for the GTK port header.
3170         * UIProcess/API/wpe/WebKitUserContentFilterStore.h: Added.
3171         * UIProcess/API/wpe/WebKitUserContentManager.h: Same as for the GTK port header.
3172         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added new API functions and types to be
3173         included in the documentation.
3174         * UIProcess/API/wpe/webkit.h: Added inclusion of WebKitUserContentFilterStore.h
3175
3176 2019-02-19  Antti Koivisto  <antti@apple.com>
3177
3178         Pass rootContentsLayer to Mac remote layer tree
3179         https://bugs.webkit.org/show_bug.cgi?id=194828
3180
3181         Reviewed by Simon Fraser.
3182
3183         Make this code path work again.
3184
3185         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3186         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
3187         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
3188         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3189         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3190
3191 2019-02-19  Alex Christensen  <achristensen@webkit.org>
3192
3193         Reduce use of LegacySync IPC messages
3194         https://bugs.webkit.org/show_bug.cgi?id=194783
3195
3196         Reviewed by Geoffrey Garen.
3197
3198         * UIProcess/WebProcessPool.cpp:
3199         (WebKit::WebProcessPool::handleSynchronousMessage):
3200         * UIProcess/WebProcessPool.h:
3201         * UIProcess/WebProcessPool.messages.in:
3202         * UIProcess/WebProcessProxy.cpp:
3203         (WebKit::WebProcessProxy::getPlugins):
3204         (WebKit::WebProcessProxy::shouldTerminate):
3205         * UIProcess/WebProcessProxy.h:
3206         * UIProcess/WebProcessProxy.messages.in:
3207         * WebProcess/Plugins/PluginProcessConnection.cpp:
3208         (WebKit::PluginProcessConnection::setException):
3209         * WebProcess/Plugins/PluginProcessConnection.h:
3210         * WebProcess/Plugins/PluginProcessConnection.messages.in:
3211         * WebProcess/Plugins/PluginProxy.cpp:
3212         (WebKit::PluginProxy::didCreatePlugin):
3213         (WebKit::PluginProxy::didFailToCreatePlugin):
3214         (WebKit::PluginProxy::proxiesForURL):
3215         (WebKit::PluginProxy::cookiesForURL):
3216         (WebKit::PluginProxy::getAuthenticationInfo):
3217         (WebKit::PluginProxy::getPluginElementNPObject):
3218         (WebKit::PluginProxy::evaluate):
3219         (WebKit::PluginProxy::createPluginContainer):
3220         * WebProcess/Plugins/PluginProxy.h:
3221         * WebProcess/Plugins/PluginProxy.messages.in:
3222
3223 2019-02-19  Alex Christensen  <achristensen@webkit.org>
3224
3225         Remove assertion introduced in r229683
3226         https://bugs.webkit.org/show_bug.cgi?id=194825
3227         <rdar://problem/47628258>
3228
3229         Reviewed by Geoffrey Garen.
3230
3231         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3232         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
3233         If we reach this code and the form's original Document's Frame has been destroyed,
3234         we have already been told to submit the form so do so, just like we do if the WebPage
3235         has been destroyed.  This is a rare edge case having to do with the timing of Frame
3236         destruction and decidePolicyForNavigationAction response, which unfortunately does not
3237         reproduce with a test case unless the timing of IPC is just right.
3238
3239 2019-02-19  Antoine Quint  <graouts@apple.com>
3240
3241         [iOS] "touch-action: none" should not prevent text selection or tapping on a link
3242         https://bugs.webkit.org/show_bug.cgi?id=194812
3243         <rdar://problem/47901131>
3244
3245         Reviewed by Dean Jackson.
3246
3247         We shouldn't prevent all gestures to be disabled when "touch-action: none" is set and instead follow the same code path we would use should
3248         "pan-x", "pan-y" or "pinch-zoom" be used.
3249
3250         * UIProcess/ios/WKContentViewInteraction.mm:
3251         (-[WKContentView _handleTouchActionsForTouchEvent:]):
3252
3253 2019-02-18  Alex Christensen  <achristensen@webkit.org>
3254
3255         Revert functional part of r241451
3256         https://bugs.webkit.org/show_bug.cgi?id=194510
3257
3258         * UIProcess/WebPageProxy.cpp:
3259         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3260         It caused crashes and assertions on Linux and Cocoa without safe browsing, which
3261         means it's fundamentally flawed in some way.  The testing piping was fine.
3262
3263 2019-02-18  Chris Dumez  <cdumez@apple.com>
3264
3265         REGRESSION (PSON): Can't access optumbank.com from myuhc.com
3266         https://bugs.webkit.org/show_bug.cgi?id=194797
3267         <rdar://problem/48055151>
3268
3269         Reviewed by Geoffrey Garen.
3270
3271         The issue was caused by us mistakenly process-swapping for a same-site server side redirect.
3272         The reason we were getting it wrong is because the logic in
3273         WebProcessPool::processForNavigationInternal() was expecting page.process() to be the source
3274         process and page.pageLoadState().url() to be the source URL. Those assumptions are incorrect
3275         when a server-side redirect occurs in a provisional process. In such case, the source process
3276         is the ProvisionalPageProxy's process and the source URL is the provisional URL, not the
3277         committed one.
3278
3279         * UIProcess/ProvisionalPageProxy.cpp:
3280         (WebKit::ProvisionalPageProxy::didPerformServerRedirect):
3281         (WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3282         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3283         * UIProcess/ProvisionalPageProxy.h:
3284         Make sure the provisional page forwards IPC related to server-side redirects to the page so
3285         that the client gets informed.
3286
3287         * UIProcess/WebPageProxy.cpp:
3288         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3289         (WebKit::WebPageProxy::didPerformServerRedirect):
3290         (WebKit::WebPageProxy::didPerformServerRedirectShared):
3291         * UIProcess/WebPageProxy.h:
3292         * UIProcess/WebProcessPool.cpp:
3293         (WebKit::WebProcessPool::processForNavigation):
3294         (WebKit::WebProcessPool::processForNavigationInternal):
3295         * UIProcess/WebProcessPool.h:
3296
3297 2019-02-16  Darin Adler  <darin@apple.com>
3298
3299         Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
3300         https://bugs.webkit.org/show_bug.cgi?id=194752
3301
3302         Reviewed by Daniel Bates.
3303
3304         * Platform/IPC/win/ConnectionWin.cpp:
3305         (IPC::Connection::createServerAndClientIdentifiers): Use makeString instead of
3306         String::format.
3307         * Shared/win/WebEventFactory.cpp:
3308         (WebKit::keyIdentifierFromEvent): Ditto.
3309
3310         * UIProcess/API/APINavigation.cpp:
3311         (API::Navigation::loggingString const): Use hex instead of String::format.
3312         * UIProcess/SuspendedPageProxy.cpp:
3313         (WebKit::SuspendedPageProxy::loggingString const): Ditto.
3314
3315         * UIProcess/WebBackForwardList.cpp:
3316         (WebKit::WebBackForwardList::loggingString): Added a "0x".
3317
3318         * UIProcess/gtk/InputMethodFilter.cpp:
3319         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting): Use makeString and hex
3320         instead of String::format and "%x".
3321         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
3322         Ditto.
3323
3324 2019-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3325
3326         [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
3327         https://bugs.webkit.org/show_bug.cgi?id=194670
3328         <rdar://problem/39066529>
3329
3330         Reviewed by Tim Horton.
3331
3332         Remove all IPC plumbing for getTypesByFidelityForItemAtIndex, now that the types in fidelity order have been
3333         rolled into PasteboardItemInfo.
3334
3335         Additionally, remove support for subresource URL replacement. This feature was originally added with the
3336         intention that private clients (i.e. Mail) would intercept pasted or dropped images and replace their URLs.
3337         However, since <rdar://problem/43216836>, our strategy for this scenario has changed, such that WebKit now
3338         handles the drop/paste, and later delivers the image data to the client via NSFileWrappers in the UI process.
3339         At this time, there are no adopters of this SPI, and no adopters of the V2 injected bundle editing client. As
3340         such, we can simply revert all of this to its state prior to the introduction of the replacement URL SPI, with
3341         the exception to changes in WKBundlePageEditorClient.h, wherein there is a nonzero (but likely tiny) chance of
3342         completely breaking binary compatability with any third parties on macOS which may have tried to adopt
3343         subresource URL replacement.
3344
3345         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3346         (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex): Deleted.
3347         * UIProcess/WebPasteboardProxy.h:
3348         * UIProcess/WebPasteboardProxy.messages.in:
3349         * UIProcess/ios/WKContentViewInteraction.mm:
3350         (-[WKContentView canPerformActionForWebView:withSender:]):
3351
3352         Return YES for -paste: in the case where:
3353         1. The pasteboard contains items that are explicitly marked as attachments.
3354         2. The selection is richly contenteditable.
3355         3. Attachment elements are enabled.
3356
3357         Among other things, this allows the callout bar on iOS to show the "Paste" action.
3358
3359         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
3360         (API::InjectedBundle::EditorClient::performTwoStepDrop):
3361         (API::InjectedBundle::EditorClient::replacementURLForResource): Deleted.
3362         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
3363         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3364         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
3365         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
3366         (WebKit::InjectedBundlePageEditorClient::replacementURLForResource): Deleted.
3367         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: