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