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