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