21e4bb2453b6368a91be7f337682209028c90613
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-01-30  Keith Rollin  <krollin@apple.com>
2
3         Add default constructor for NetworkActivityTracker
4         https://bugs.webkit.org/show_bug.cgi?id=194058
5         <rdar://problem/47685457>
6
7         Reviewed by Chris Dumez.
8
9         ResourceNetworkActivityTracker has a default constructor. It also has
10         a NetworkActivityTracker data member, which does not have a default
11         constructor. This will cause some compilers to complain -- they can't
12         default-create a ResourceNetworkActivityTracker because they can't
13         default-create its data members. Address this by adding a default
14         constructor for NetworkActivityTracker.
15
16         * NetworkProcess/NetworkActivityTracker.h:
17
18 2019-01-30  Daniel Steffen  <dsteffen@apple.com>
19
20         <rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers
21         https://bugs.webkit.org/show_bug.cgi?id=193992
22
23         Reviewed by Geoffrey Garen.
24
25         The denap SPI is deprecated.
26         The new way of staying out of AppNap is through a voucher.
27
28         * Platform/IPC/mac/ConnectionMac.mm:
29         (IPC::readFromMachPort):
30         * Platform/IPC/mac/ImportanceAssertion.h:
31         (IPC::ImportanceAssertion::ImportanceAssertion):
32         (IPC::ImportanceAssertion::~ImportanceAssertion):
33
34 2019-01-30  Chris Dumez  <cdumez@apple.com>
35
36         Fix crashes when trying to ref the CallbackAggregator in NetworkProcess
37         https://bugs.webkit.org/show_bug.cgi?id=194054
38
39         Reviewed by Brent Fulgham.
40
41         The callback aggregators should be ThreadSafeRefCounted since they are passed to other threads.
42
43         * NetworkProcess/NetworkProcess.cpp:
44         (WebKit::NetworkProcess::fetchWebsiteData):
45         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
46         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
47
48 2019-01-30  Daniel Bates  <dabates@apple.com>
49
50         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
51         https://bugs.webkit.org/show_bug.cgi?id=192824
52         <rdar://problem/47100332>
53
54         Reviewed by Wenson Hsieh.
55
56         Use the same code path for key events to editable elements and non-editable elements.
57
58         Currently we have different code paths for hardware key events depending on whether the active element
59         is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
60         presses this differentiation was a necessary workaround for UIKit's event processing precedence of
61         interpreting key events for system text editing commands and app commands before dispatching unhandled
62         key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
63         WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
64         is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
65         empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
66         that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
67
68         As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
69         key events use the same code path.
70
71         * UIProcess/ios/WKContentViewInteraction.h:
72         * UIProcess/ios/WKContentViewInteraction.mm:
73         (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
74         (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
75         when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
76         keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
77         element (by returning NO in -_requiresKeyboardWhenFirstResponder).
78         (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
79         so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
80         hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
81         automatic keyboard UI.
82         (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
83         now that we require a keyboard when first responder even if the focused element is non-editable.
84         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
85         as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
86         its chance to interpret the UIEvent, we intercepted, for app key commands.
87         (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
88         (e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
89         responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
90         no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
91         * UIProcess/ios/forms/WKFormSelectPopover.mm:
92         (-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
93         type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
94         editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
95         editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
96         when the popover is presented.
97
98 2019-01-30  Per Arne Vollan  <pvollan@apple.com>
99
100         [macOS] Sandbox fails to compile on 10.12
101         https://bugs.webkit.org/show_bug.cgi?id=194035
102         <rdar://problem/47651260>
103
104         Reviewed by Brent Fulgham.
105
106         This was caused by the commit <https://trac.webkit.org/changeset/239994>, which is only valid for
107         10.14 and later.
108
109         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
110         * WebProcess/com.apple.WebProcess.sb.in:
111
112 2019-01-29  Conrad Shultz  <conrad_shultz@apple.com>
113
114         Ensure image picker sourceType is set before cameraDevice
115         https://bugs.webkit.org/show_bug.cgi?id=193998
116
117         Reviewed by Beth Dakin.
118
119         * UIProcess/ios/forms/WKFileUploadPanel.mm:
120         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
121
122 2019-01-30  Chris Dumez  <cdumez@apple.com>
123
124         Regression(PSON) Load hang can occur on history navigation
125         https://bugs.webkit.org/show_bug.cgi?id=194030
126         <rdar://problem/47656939>
127
128         Reviewed by Antti Koivisto.
129
130         We do not support having more than one WebPage in a WebProcess with the same page ID. As a result,
131         if we decide to reuse an existing process on process-swap, we need to make sure that we either use
132         its suspended page (when possible, meaning that it is for the right HistoryItem / page) or we need
133         make sure we drop the existing suspended page for this process / pagePID combination, so that the
134         WebPage on WebProcess side gets closed before we attempt to do the new load.
135
136         We were doing this correctly in 2 places in WebProcessPool::processForNavigationInternal() but failed
137         to do so in a third place, when doing back to a HistoryItem which does not have a SuspendedPage but
138         whose process is still alive (presumably because it is kept alive by another suspended page). This
139         patch fixes this third place to remove any suspended page in the process for the current page before
140         reusing the process. An assertion was also added to the call site in
141         WebPageProxy::receivedNavigationPolicyDecision() to make sure we catch this more easily in the
142         future.
143
144         * UIProcess/WebPageProxy.cpp:
145         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
146         * UIProcess/WebProcessPool.cpp:
147         (WebKit::WebProcessPool::processForNavigationInternal):
148         (WebKit::WebProcessPool::removeAllSuspendedPagesForPage):
149         (WebKit::WebProcessPool::hasSuspendedPageFor const):
150         * UIProcess/WebProcessPool.h:
151
152 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
153
154         [GTK][Wayland] REGRESSION(r240712): Clear the GL context if it's the current one on dispose
155         https://bugs.webkit.org/show_bug.cgi?id=194024
156
157         Reviewed by Michael Catanzaro.
158
159         Fixes a crash in gdk_gl_context_dispose().
160
161         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
162         (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
163
164 2019-01-30  Antti Koivisto  <antti@apple.com>
165
166         Crash in WebKit::RemoteLayerTreePropertyApplier::updateChildren
167         https://bugs.webkit.org/show_bug.cgi?id=193897
168         <rdar://problem/47427750>
169
170         Reviewed by Simon Fraser.
171
172         There has been some null pointer crashes where we fail to find a remote layer tree node that matches
173         the transaction properties.
174
175         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
176         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
177
178         Null check the nodes.
179
180 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
181
182         Add some basic geometry information to the scrolling tree
183         https://bugs.webkit.org/show_bug.cgi?id=194002
184
185         Reviewed by Antti Koivisto.
186
187         Add a comment explaining why we don't need to encode/decode ParentRelativeScrollableRect.
188
189         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
190         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
191
192 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
193
194         [GTK] gdk_cairo_draw_from_gl() in AcceleratedBackingStoreWayland fails in GtkInspector's magnifier
195         https://bugs.webkit.org/show_bug.cgi?id=193903
196
197         Reviewed by Michael Catanzaro.
198
199         The problem is that the GL context used by WaylandCompositor can't share resources with the one used by GTK+
200         when painting with gdk_cairo_draw_from_gl(). Accelerated compositing in Wayland works only because
201         WaylandCompositor makes the context current only once on initialization. So, when we render the first frame on
202         accelerated compositing mode, GTK+ is rendering in non-GL mode, and switches to the GL mode when
203         gdk_cairo_draw_from_gl() is called. Since GTK+ didn't have a GL context yet, the first frame is always rendered
204         by GTK+ using the software fallback (glReadPixels). The thing is that the first time gdk_cairo_draw_from_gl() is
205         called, GTK+ creates a GL context for painting that is made current, and it will remain the current one
206         forever. The first frame fails to render with "GL_INVALID_OPERATION in glBindTexture(non-gen name)" because the
207         texture created in WaylandCompositor GL context can't be accessed from GTK+ GL context. The following frames are
208         handled with the GTK+ GL context. I would say this works by casuality and it could be the cause of other
209         accelerated compositing issues in Wayland.
210
211         We need to create our own GdkGLContext for the WebView, and use that in the WaylandCompositor. When the
212         GdkGLContext is created, the GTK+ GL context for painting is used as a shared context, ensuring that resources
213         created in the new context will be accessible from the painting one.
214
215         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
216         (webkitWebViewBaseMakeGLContextCurrent): Call AcceleratedBackingStore::makeContextCurrent().
217         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
218         * UIProcess/WebPageProxy.h:
219         * UIProcess/gtk/AcceleratedBackingStore.h:
220         (WebKit::AcceleratedBackingStore::makeContextCurrent): New virtual method only implemented by Wayland backend.
221         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
222         (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Try to create a GL context with
223         gdk_window_create_gl_context(), falling back to a WebCore::GLContext if it fails or GTK+ version is not new enough.
224         (WebKit::AcceleratedBackingStoreWayland::makeContextCurrent): Make the GL context current.
225         (WebKit::AcceleratedBackingStoreWayland::paint): Check if we have a GdkGLContext before trying to use gdk_cairo_draw_from_gl().
226         (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL const): Deleted.
227         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
228         * UIProcess/gtk/WaylandCompositor.cpp:
229         (WebKit::WaylandCompositor::Surface::Surface): Move the texture creation to setWebPage(), since we need the
230         WebView GL context.
231         (WebKit::WaylandCompositor::Surface::~Surface): Move the code to destroy GL resources to setWebPage().
232         (WebKit::WaylandCompositor::Surface::setWebPage): Create the texture when a new page is set and destroy GL
233         resources when unset.
234         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): Make WebView GL context current.
235         (WebKit::WaylandCompositor::Surface::commit): Ditto.
236         (WebKit::WaylandCompositor::initializeEGL): Use a temporary GLContext.
237         * UIProcess/gtk/WaylandCompositor.h:
238         * UIProcess/gtk/WebPageProxyGtk.cpp:
239         (WebKit::WebPageProxy::makeGLContextCurrent): Call webkitWebViewBaseMakeGLContextCurrent().
240
241 2019-01-29  Ryosuke Niwa  <rniwa@webkit.org>
242
243         iOS: Nullptr crash in WebPage::getPositionInformation dereferencing an input element for data list
244         https://bugs.webkit.org/show_bug.cgi?id=193996
245
246         Reviewed by Wenson Hsieh.
247
248         Added a missing nullptr check.
249
250         * WebProcess/WebPage/ios/WebPageIOS.mm:
251         (WebKit::WebPage::getPositionInformation):
252
253 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
254
255         Add nodes to the scrolling tree in z-index order.
256         https://bugs.webkit.org/show_bug.cgi?id=192529
257         <rdar://problem/47402708>
258
259         Reviewed by Dean Jackson.
260
261         FrameHosting nodes have layers, so need to update them.
262
263         * Platform/Logging.cpp:
264         (WebKit::initializeLogChannelsIfNecessary):
265         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
266         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
267
268 2019-01-29  Alex Christensen  <achristensen@webkit.org>
269
270         Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
271         https://bugs.webkit.org/show_bug.cgi?id=193974
272
273         Reviewed by Tim Horton.
274
275         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
276         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
277         (WebKit::NetworkBlobRegistry::registerBlobURL):
278         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
279         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
280         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
281         (WebKit::NetworkBlobRegistry::blobSize):
282         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
283         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
284         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
285         (WebKit::NetworkConnectionToWebProcess::didClose):
286         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
287         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
288         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
289         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
290         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
291         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
292         (WebKit::NetworkConnectionToWebProcess::blobSize):
293         * NetworkProcess/NetworkProcess.cpp:
294         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
295         * NetworkProcess/NetworkProcess.h:
296
297 2019-01-29  Youenn Fablet  <youenn@apple.com>
298
299         Adopt new SPI to evaluate server certificate trust
300         https://bugs.webkit.org/show_bug.cgi?id=193355
301
302         Reviewed by Alex Christensen.
303
304         Use new SPI provided in NSURLSession to evaluate server certificates.
305         If successful, let loading proceed as usual.
306         Otherwise, go to the UIProcess to ask for a decision on continuing the load or not.
307
308         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
309         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
310         (canNSURLSessionTrustEvaluate):
311         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
312         (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
313
314 2019-01-29  Tim Horton  <timothy_horton@apple.com>
315
316         Fix the build
317
318         * UIProcess/ios/WKDrawingCoordinator.h:
319         * UIProcess/ios/WKDrawingCoordinator.mm:
320         * UIProcess/ios/WKDrawingView.mm:
321
322 2019-01-29  Alex Christensen  <achristensen@webkit.org>
323
324         Remove unused NetworkProcessProxy::writeBlobToFilePath
325         https://bugs.webkit.org/show_bug.cgi?id=193990
326
327         Reviewed by Wenson Hsieh.
328
329         This code was only used in code that was introduced in r235202
330         but that has since been refactored to not use blobs.  Its tests still pass.
331         This removes the only UIProcess-controlled code that uses NetworkBlobRegistry::singleton.
332
333         * NetworkProcess/NetworkProcess.cpp:
334         (WebKit::NetworkProcess::writeBlobToFilePath): Deleted.
335         * NetworkProcess/NetworkProcess.h:
336         * NetworkProcess/NetworkProcess.messages.in:
337         * UIProcess/Cocoa/WebViewImpl.mm:
338         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
339         * UIProcess/Network/NetworkProcessProxy.cpp:
340         (WebKit::NetworkProcessProxy::writeBlobToFilePath): Deleted.
341         * UIProcess/Network/NetworkProcessProxy.h:
342         * UIProcess/WebPageProxy.cpp:
343         (WebKit::WebPageProxy::writeBlobToFilePath): Deleted.
344         * UIProcess/WebPageProxy.h:
345
346 2019-01-29  Devin Rousso  <drousso@apple.com>
347
348         Web Inspector: expose a way of determining if a detached frontend is for a remote target
349         https://bugs.webkit.org/show_bug.cgi?id=193951
350         <rdar://problem/47621366>
351
352         Reviewed by Joseph Pecoraro.
353
354         * UIProcess/WebInspectorProxy.h:
355         (WebKit::WebInspectorProxy::InspectionTargetType): Added.
356         (WebKit::WebInspectorProxy::createFrontendWindow):
357         * UIProcess/mac/WebInspectorProxyMac.mm:
358         (WebKit::WebInspectorProxy::createFrontendWindow):
359         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
360         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
361         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
362
363         * UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
364         * UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.
365         (-[WKInspectorWindow isRemote]): Added.
366
367         * Shared/API/Cocoa/_WKNSWindowExtras.mm:
368         (-[NSWindow _web_isWebInspectorWindow]):
369
370         * PlatformMac.cmake:
371         * SourcesCocoa.txt:
372         * UnifiedSources-input.xcfilelist:
373         * WebKit.xcodeproj/project.pbxproj:
374
375 2019-01-29  Alex Christensen  <achristensen@webkit.org>
376
377         Rename ChildProcess to AuxiliaryProcess
378         https://bugs.webkit.org/show_bug.cgi?id=193943
379
380         Reviewed by Andy Estes.
381
382         "Child" implies that there is a parent, but I'm about to introduce a type of NetworkProcess that
383         doesn't always have a parent, and may have many UIProcesses that it is the auxiliary for.
384
385         * CMakeLists.txt:
386         * DerivedSources-input.xcfilelist:
387         * DerivedSources-output.xcfilelist:
388         * DerivedSources.make:
389         * NetworkProcess/Cookies/WebCookieManager.cpp:
390         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
391         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
392         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
393         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
394         * NetworkProcess/NetworkProcess.cpp:
395         (WebKit::callExitSoon):
396         (WebKit::NetworkProcess::NetworkProcess):
397         (WebKit::NetworkProcess::didReceiveMessage):
398         (WebKit::NetworkProcess::initializeConnection):
399         (WebKit::NetworkProcess::terminate):
400         (WebKit::NetworkProcess::initializeProcess):
401         (WebKit::NetworkProcess::initializeProcessName):
402         (WebKit::NetworkProcess::initializeSandbox):
403         * NetworkProcess/NetworkProcess.h:
404         * NetworkProcess/NetworkProcessSupplement.h:
405         * NetworkProcess/cache/NetworkCacheStorage.cpp:
406         (WebKit::NetworkCache::Storage::deleteOldVersions):
407         * NetworkProcess/ios/NetworkProcessIOS.mm:
408         (WebKit::NetworkProcess::initializeProcess):
409         (WebKit::NetworkProcess::initializeProcessName):
410         (WebKit::NetworkProcess::initializeSandbox):
411         * NetworkProcess/mac/NetworkProcessMac.mm:
412         (WebKit::NetworkProcess::initializeProcess):
413         (WebKit::NetworkProcess::initializeProcessName):
414         (WebKit::NetworkProcess::initializeSandbox):
415         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
416         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
417         (WebKit::NetworkProcessMainUnix):
418         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
419         * NetworkProcess/watchos/NetworkProximityManager.h:
420         * NetworkProcess/watchos/NetworkProximityManager.mm:
421         (WebKit::NetworkProximityManager::NetworkProximityManager):
422         * NetworkProcess/win/NetworkProcessMainWin.cpp:
423         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
424         (WebKit::NetworkProcessMainWin):
425         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
426         * PlatformGTK.cmake:
427         * PlatformMac.cmake:
428         * PlatformWin.cmake:
429         * PluginProcess/PluginProcess.cpp:
430         (WebKit::PluginProcess::initializeProcess):
431         (WebKit::PluginProcess::initializeConnection):
432         (WebKit::PluginProcess::didReceiveMessage):
433         (WebKit::PluginProcess::initializeProcessName):
434         (WebKit::PluginProcess::initializeSandbox):
435         * PluginProcess/PluginProcess.h:
436         * PluginProcess/mac/PluginProcessMac.mm:
437         (WebKit::PluginProcess::platformInitializeProcess):
438         (WebKit::PluginProcess::initializeProcessName):
439         (WebKit::PluginProcess::initializeSandbox):
440         (WebKit::PluginProcess::stopRunLoop):
441         * PluginProcess/unix/PluginProcessMainUnix.cpp:
442         (WebKit::PluginProcessMainUnix):
443         * PluginProcess/unix/PluginProcessUnix.cpp:
444         (WebKit::PluginProcess::platformInitializeProcess):
445         * Shared/Authentication/AuthenticationManager.cpp:
446         (WebKit::AuthenticationManager::AuthenticationManager):
447         * Shared/Authentication/AuthenticationManager.h:
448         * Shared/AuxiliaryProcess.cpp: Copied from Source/WebKit/Shared/ChildProcess.cpp.
449         (WebKit::AuxiliaryProcess::AuxiliaryProcess):
450         (WebKit::AuxiliaryProcess::~AuxiliaryProcess):
451         (WebKit::AuxiliaryProcess::didClose):
452         (WebKit::AuxiliaryProcess::initialize):
453         (WebKit::AuxiliaryProcess::setProcessSuppressionEnabled):
454         (WebKit::AuxiliaryProcess::initializeProcess):
455         (WebKit::AuxiliaryProcess::initializeProcessName):
456         (WebKit::AuxiliaryProcess::initializeConnection):
457         (WebKit::AuxiliaryProcess::addMessageReceiver):
458         (WebKit::AuxiliaryProcess::removeMessageReceiver):
459         (WebKit::AuxiliaryProcess::disableTermination):
460         (WebKit::AuxiliaryProcess::enableTermination):
461         (WebKit::AuxiliaryProcess::messageSenderConnection):
462         (WebKit::AuxiliaryProcess::messageSenderDestinationID):
463         (WebKit::AuxiliaryProcess::terminationTimerFired):
464         (WebKit::AuxiliaryProcess::stopRunLoop):
465         (WebKit::AuxiliaryProcess::platformStopRunLoop):
466         (WebKit::AuxiliaryProcess::terminate):
467         (WebKit::AuxiliaryProcess::shutDown):
468         (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
469         (WebKit::AuxiliaryProcess::platformInitialize):
470         (WebKit::AuxiliaryProcess::initializeSandbox):
471         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
472         (WebKit::AuxiliaryProcess::didReceiveMemoryPressureEvent):
473         (WebKit::ChildProcess::ChildProcess): Deleted.
474         (WebKit::ChildProcess::~ChildProcess): Deleted.
475         (WebKit::ChildProcess::didClose): Deleted.
476         (WebKit::ChildProcess::initialize): Deleted.
477         (WebKit::ChildProcess::setProcessSuppressionEnabled): Deleted.
478         (WebKit::ChildProcess::initializeProcess): Deleted.
479         (WebKit::ChildProcess::initializeProcessName): Deleted.
480         (WebKit::ChildProcess::initializeConnection): Deleted.
481         (WebKit::ChildProcess::addMessageReceiver): Deleted.
482         (WebKit::ChildProcess::removeMessageReceiver): Deleted.
483         (WebKit::ChildProcess::disableTermination): Deleted.
484         (WebKit::ChildProcess::enableTermination): Deleted.
485         (WebKit::ChildProcess::messageSenderConnection): Deleted.
486         (WebKit::ChildProcess::messageSenderDestinationID): Deleted.
487         (WebKit::ChildProcess::terminationTimerFired): Deleted.
488         (WebKit::ChildProcess::stopRunLoop): Deleted.
489         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
490         (WebKit::ChildProcess::terminate): Deleted.
491         (WebKit::ChildProcess::shutDown): Deleted.
492         (WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted.
493         (WebKit::ChildProcess::platformInitialize): Deleted.
494         (WebKit::ChildProcess::initializeSandbox): Deleted.
495         (WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
496         (WebKit::ChildProcess::didReceiveMemoryPressureEvent): Deleted.
497         * Shared/AuxiliaryProcess.h: Copied from Source/WebKit/Shared/ChildProcess.h.
498         (WebKit::ChildProcess::parentProcessConnection const): Deleted.
499         (WebKit::ChildProcess::messageReceiverMap): Deleted.
500         (WebKit::ChildProcess::setTerminationTimeout): Deleted.
501         (WebKit::ChildProcess::shouldOverrideQuarantine): Deleted.
502         * Shared/AuxiliaryProcess.messages.in: Copied from Source/WebKit/Shared/ChildProcess.messages.in.
503         * Shared/AuxiliaryProcessSupplement.h: Copied from Source/WebKit/Shared/ChildProcessSupplement.h.
504         (WebKit::AuxiliaryProcessSupplement::~AuxiliaryProcessSupplement):
505         (WebKit::ChildProcessSupplement::~ChildProcessSupplement): Deleted.
506         (WebKit::ChildProcessSupplement::initializeConnection): Deleted.
507         * Shared/ChildProcess.cpp: Removed.
508         * Shared/ChildProcess.h: Removed.
509         * Shared/ChildProcess.messages.in: Removed.
510         * Shared/ChildProcessSupplement.h: Removed.
511         * Shared/Cocoa/AuxiliaryProcessCocoa.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
512         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
513         (WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
514         * Shared/Cocoa/ChildProcessCocoa.mm: Removed.
515         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
516         (WebKit::initializeAuxiliaryProcess):
517         (WebKit::XPCServiceInitializer):
518         (WebKit::initializeChildProcess): Deleted.
519         * Shared/WebSQLiteDatabaseTracker.cpp:
520         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
521         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
522         (WebKit::m_childProcessType): Deleted.
523         * Shared/WebSQLiteDatabaseTracker.h:
524         * Shared/ios/AuxiliaryProcessIOS.mm: Copied from Source/WebKit/Shared/ios/ChildProcessIOS.mm.
525         (WebKit::AuxiliaryProcess::platformInitialize):
526         (WebKit::AuxiliaryProcess::initializeSandbox):
527         (WebKit::AuxiliaryProcess::setQOS):
528         (WebKit::AuxiliaryProcess::platformStopRunLoop):
529         (WebKit::ChildProcess::platformInitialize): Deleted.
530         (WebKit::ChildProcess::initializeSandbox): Deleted.
531         (WebKit::ChildProcess::setQOS): Deleted.
532         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
533         * Shared/ios/ChildProcessIOS.mm: Removed.
534         * Shared/mac/AuxiliaryProcessMac.mm: Copied from Source/WebKit/Shared/mac/ChildProcessMac.mm.
535         (WebKit::SandboxInfo::SandboxInfo):
536         (WebKit::AuxiliaryProcess::launchServicesCheckIn):
537         (WebKit::AuxiliaryProcess::platformInitialize):
538         (WebKit::processStorageClass):
539         (WebKit::sandboxDirectory):
540         (WebKit::applySandbox):
541         (WebKit::initializeSandboxParameters):
542         (WebKit::AuxiliaryProcess::initializeSandbox):
543         (WebKit::AuxiliaryProcess::stopNSAppRunLoop):
544         (WebKit::AuxiliaryProcess::stopNSRunLoop):
545         (WebKit::AuxiliaryProcess::platformStopRunLoop):
546         (WebKit::AuxiliaryProcess::setQOS):
547         (WebKit::AuxiliaryProcess::isSystemWebKit):
548         (WebKit::ChildProcess::launchServicesCheckIn): Deleted.
549         (WebKit::ChildProcess::platformInitialize): Deleted.
550         (WebKit::ChildProcess::initializeSandbox): Deleted.
551         (WebKit::ChildProcess::stopNSAppRunLoop): Deleted.
552         (WebKit::ChildProcess::stopNSRunLoop): Deleted.
553         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
554         (WebKit::ChildProcess::setQOS): Deleted.
555         (WebKit::ChildProcess::isSystemWebKit): Deleted.
556         * Shared/mac/ChildProcessMac.mm: Removed.
557         * Shared/mac/SecItemShim.cpp:
558         (WebKit::globalNetworkProcess):
559         (WebKit::sendSecItemRequest):
560         (WebKit::initializeSecItemShim):
561         * Shared/mac/SecItemShim.h:
562         * Shared/unix/AuxiliaryProcessMain.cpp: Copied from Source/WebKit/Shared/unix/ChildProcessMain.cpp.
563         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
564         (WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
565         * Shared/unix/AuxiliaryProcessMain.h: Copied from Source/WebKit/Shared/unix/ChildProcessMain.h.
566         (WebKit::AuxiliaryProcessMainBase::takeInitializationParameters):
567         (WebKit::initializeAuxiliaryProcess):
568         (WebKit::AuxiliaryProcessMain):
569         (WebKit::ChildProcessMainBase::platformInitialize): Deleted.
570         (WebKit::ChildProcessMainBase::platformFinalize): Deleted.
571         (WebKit::ChildProcessMainBase::takeInitializationParameters): Deleted.
572         (WebKit::initializeChildProcess): Deleted.
573         (WebKit::ChildProcessMain): Deleted.
574         * Shared/unix/ChildProcessMain.cpp: Removed.
575         * Shared/unix/ChildProcessMain.h: Removed.
576         * Shared/win/AuxiliaryProcessMainWin.cpp: Copied from Source/WebKit/Shared/win/ChildProcessMainWin.cpp.
577         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
578         (WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
579         * Shared/win/ChildProcessMainWin.cpp: Removed.
580         * Sources.txt:
581         * SourcesCocoa.txt:
582         * SourcesGTK.txt:
583         * SourcesWPE.txt:
584         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
585         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
586         * UIProcess/AuxiliaryProcessProxy.cpp: Copied from Source/WebKit/UIProcess/ChildProcessProxy.cpp.
587         (WebKit::AuxiliaryProcessProxy::AuxiliaryProcessProxy):
588         (WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
589         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
590         (WebKit::AuxiliaryProcessProxy::connect):
591         (WebKit::AuxiliaryProcessProxy::terminate):
592         (WebKit::AuxiliaryProcessProxy::state const):
593         (WebKit::AuxiliaryProcessProxy::sendMessage):
594         (WebKit::AuxiliaryProcessProxy::addMessageReceiver):
595         (WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
596         (WebKit::AuxiliaryProcessProxy::dispatchMessage):
597         (WebKit::AuxiliaryProcessProxy::dispatchSyncMessage):
598         (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
599         (WebKit::AuxiliaryProcessProxy::shutDownProcess):
600         (WebKit::AuxiliaryProcessProxy::setProcessSuppressionEnabled):
601         (WebKit::AuxiliaryProcessProxy::connectionWillOpen):
602         (WebKit::ChildProcessProxy::ChildProcessProxy): Deleted.
603         (WebKit::ChildProcessProxy::~ChildProcessProxy): Deleted.
604         (WebKit::ChildProcessProxy::getLaunchOptions): Deleted.
605         (WebKit::ChildProcessProxy::connect): Deleted.
606         (WebKit::ChildProcessProxy::terminate): Deleted.
607         (WebKit::ChildProcessProxy::state const): Deleted.
608         (WebKit::ChildProcessProxy::sendMessage): Deleted.
609         (WebKit::ChildProcessProxy::addMessageReceiver): Deleted.
610         (WebKit::ChildProcessProxy::removeMessageReceiver): Deleted.
611         (WebKit::ChildProcessProxy::dispatchMessage): Deleted.
612         (WebKit::ChildProcessProxy::dispatchSyncMessage): Deleted.
613         (WebKit::ChildProcessProxy::didFinishLaunching): Deleted.
614         (WebKit::ChildProcessProxy::shutDownProcess): Deleted.
615         (WebKit::ChildProcessProxy::setProcessSuppressionEnabled): Deleted.
616         (WebKit::ChildProcessProxy::connectionWillOpen): Deleted.
617         * UIProcess/AuxiliaryProcessProxy.h: Copied from Source/WebKit/UIProcess/ChildProcessProxy.h.
618         (WebKit::AuxiliaryProcessProxy::send):
619         (WebKit::AuxiliaryProcessProxy::sendSync):
620         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
621         (WebKit::ChildProcessProxy::send): Deleted.
622         (WebKit::ChildProcessProxy::sendSync): Deleted.
623         (WebKit::ChildProcessProxy::connection const): Deleted.
624         (WebKit::ChildProcessProxy::hasConnection const): Deleted.
625         (WebKit::ChildProcessProxy::processIdentifier const): Deleted.
626         (WebKit::ChildProcessProxy::canSendMessage const): Deleted.
627         (WebKit::ChildProcessProxy::coreProcessIdentifier const): Deleted.
628         (WebKit::ChildProcessProxy::platformGetLaunchOptions): Deleted.
629         (WebKit::ChildProcessProxy::sendWithAsyncReply): Deleted.
630         * UIProcess/ChildProcessProxy.cpp: Removed.
631         * UIProcess/ChildProcessProxy.h: Removed.
632         * UIProcess/Downloads/DownloadProxyMap.cpp:
633         (WebKit::DownloadProxyMap::DownloadProxyMap):
634         * UIProcess/Downloads/DownloadProxyMap.h:
635         * UIProcess/Network/NetworkProcessProxy.cpp:
636         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
637         (WebKit::NetworkProcessProxy::getLaunchOptions):
638         (WebKit::NetworkProcessProxy::createDownloadProxy):
639         (WebKit::NetworkProcessProxy::didFinishLaunching):
640         * UIProcess/Network/NetworkProcessProxy.h:
641         * UIProcess/Plugins/PluginProcessProxy.cpp:
642         (WebKit::PluginProcessProxy::getLaunchOptions):
643         (WebKit::PluginProcessProxy::sendMemoryPressureEvent):
644         * UIProcess/Plugins/PluginProcessProxy.h:
645         * UIProcess/ServiceWorkerProcessProxy.h:
646         * UIProcess/WebPageProxy.cpp:
647         (WebKit::WebPageProxy::finishAttachingToWebProcess):
648         * UIProcess/WebProcessPool.cpp:
649         (WebKit::WebProcessPool::sendMemoryPressureEvent):
650         (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle):
651         * UIProcess/WebProcessProxy.cpp:
652         (WebKit::WebProcessProxy::WebProcessProxy):
653         (WebKit::WebProcessProxy::getLaunchOptions):
654         (WebKit::WebProcessProxy::didFinishLaunching):
655         (WebKit::WebProcessProxy::maybeShutDown):
656         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
657         (WebKit::WebProcessProxy::shouldTerminate):
658         (WebKit::WebProcessProxy::requestTermination):
659         (WebKit::WebProcessProxy::canTerminateChildProcess): Deleted.
660         * UIProcess/WebProcessProxy.h:
661         * UnifiedSources-input.xcfilelist:
662         * WebKit.xcodeproj/project.pbxproj:
663         * WebProcess/WebProcess.cpp:
664         (WebKit::WebProcess::initializeProcess):
665         (WebKit::WebProcess::initializeConnection):
666         (WebKit::WebProcess::terminate):
667         (WebKit::WebProcess::didReceiveMessage):
668         (WebKit::WebProcess::initializeProcessName):
669         (WebKit::WebProcess::initializeSandbox):
670         (WebKit::WebProcess::platformInitializeProcess):
671         * WebProcess/WebProcess.h:
672         * WebProcess/WebProcessSupplement.h:
673         * WebProcess/cocoa/WebProcessCocoa.mm:
674         (WebKit::WebProcess::initializeProcessName):
675         (WebKit::WebProcess::platformInitializeProcess):
676         (WebKit::WebProcess::stopRunLoop):
677         (WebKit::WebProcess::initializeSandbox):
678         * WebProcess/gtk/WebProcessMainGtk.cpp:
679         (WebKit::WebProcessMainUnix):
680         * WebProcess/win/WebProcessMainWin.cpp:
681         (WebKit::WebProcessMainWin):
682         * WebProcess/wpe/WebProcessMainWPE.cpp:
683         (WebKit::WebProcessMainUnix):
684
685 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
686
687         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
688         https://bugs.webkit.org/show_bug.cgi?id=193907
689
690         Reviewed by Frédéric Wang.
691
692         Remove encode/decode of removedNodes.
693
694         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
695         (WebKit::RemoteScrollingCoordinatorTransaction::encode const):
696         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
697         (WebKit::dump):
698
699 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
700
701         StorageAccess API calls should be direct to the Network Process
702         https://bugs.webkit.org/show_bug.cgi?id=193924
703         <rdar://problem/47611249>
704
705         Reviewed by Alex Christensen.
706
707         Now that the ResourceLoadStatistics data lives in the Network Process, calls to Storage Access
708         API should happen directly between the WebContent and Network processes.
709
710         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
711         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
712         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
713         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
714         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
715         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
716         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
717         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
718         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
719         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
720         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
721         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
722         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
723         * NetworkProcess/NetworkConnectionToWebProcess.h:
724         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
725         * NetworkProcess/NetworkProcess.cpp:
726         (WebKit::NetworkProcess::requestStorageAccess):
727         (WebKit::NetworkProcess::requestStorageAccessGranted):
728         * NetworkProcess/NetworkProcess.h:
729         * UIProcess/Network/NetworkProcessProxy.cpp:
730         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
731         * UIProcess/Network/NetworkProcessProxy.h:
732         * UIProcess/Network/NetworkProcessProxy.messages.in:
733         * UIProcess/WebPageProxy.cpp:
734         (WebKit::WebPageProxy::requestStorageAccessConfirm):
735         (WebKit::WebPageProxy::hasStorageAccess): Deleted.
736         (WebKit::WebPageProxy::requestStorageAccess): Deleted.
737         * UIProcess/WebPageProxy.h:
738         * UIProcess/WebPageProxy.messages.in:
739         * WebProcess/WebPage/WebPage.cpp:
740         (WebKit::WebPage::hasStorageAccess):
741         (WebKit::WebPage::requestStorageAccess):
742         (WebKit::nextRequestStorageAccessContextId): Deleted.
743         (WebKit::WebPage::storageAccessResponse): Deleted.
744         * WebProcess/WebPage/WebPage.h:
745         * WebProcess/WebPage/WebPage.messages.in:
746
747 2019-01-29  Chris Dumez  <cdumez@apple.com>
748
749         Regression (r240046): [PSON] Spurious changes to [WKWebView url] and [WKWebView loading] after [WKWebView loadRequest]
750         https://bugs.webkit.org/show_bug.cgi?id=193967
751         <rdar://problem/47635348>
752
753         Reviewed by Alex Christensen.
754
755         Update WebPageProxy::receivedPolicyDecision() to no longer clear the pending URL when we send PolicyAction::Ignore to
756         the old process when the load is continuing in a new process due to PSON.
757
758         * UIProcess/WebPageProxy.cpp:
759         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
760         (WebKit::WebPageProxy::receivedPolicyDecision):
761         * UIProcess/WebPageProxy.h:
762
763 2019-01-29  Keith Rollin  <krollin@apple.com>
764
765         Add .xcfilelists to Run Script build phases
766         https://bugs.webkit.org/show_bug.cgi?id=193792
767         <rdar://problem/47201785>
768
769         Reviewed by Alex Christensen.
770
771         As part of supporting XCBuild, update the necessary Run Script build
772         phases in their Xcode projects to refer to their associated
773         .xcfilelist files.
774
775         Note that the addition of these files bumps the Xcode project version
776         number to something that's Xcode 10 compatible. This change means that
777         older versions of the Xcode IDE can't read these projects. Nor can it
778         fully load workspaces that refer to these projects (the updated
779         projects are shown as non-expandable placeholders). `xcodebuild` can
780         still build these projects; it's just that the IDE can't open them.
781
782         Make special accommodations for incorporating .xcfilelists from
783         WebKitAdditions.
784
785         * Configurations/Base.xcconfig:
786         * Configurations/DebugRelease.xcconfig:
787         * WebKit.xcodeproj/project.pbxproj:
788
789 2019-01-29  Antti Koivisto  <antti@apple.com>
790
791         REGRESSION (PSON): Flash on link navigation on Mac
792         https://bugs.webkit.org/show_bug.cgi?id=193961
793         <rdar://problem/47482507>
794
795         Reviewed by Chris Dumez.
796
797         The target page sends EnterAcceleratedCompositingMode message too early, before we have a valid layer tree.
798
799         * WebProcess/WebPage/DrawingArea.h:
800         (WebKit::DrawingArea::attach): Deleted.
801
802         Not needed anymore.
803
804         * WebProcess/WebPage/WebPage.cpp:
805         (WebKit::WebPage::reinitializeWebPage):
806         (WebKit::WebPage::didCompletePageTransition):
807         (WebKit::m_shouldAttachDrawingAreaOnPageTransition): Deleted.
808
809         Move message sending logic fully to TiledCoreAnimationDrawingArea.
810         Unfreezing the layer tree is sufficient to trigger the message.
811
812         * WebProcess/WebPage/WebPage.h:
813         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
814         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
815         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
816
817         There is no need to treat process swap case differently.
818
819         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
820
821         Send this after the first successful layer flush with the root layer set.
822
823         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
824         (WebKit::TiledCoreAnimationDrawingArea::attach): Deleted.
825
826 2019-01-29  Timothy Hatcher  <timothy@apple.com>
827
828         Add back some includes that got removed at some point.
829         https://bugs.webkit.org/show_bug.cgi?id=193942
830
831         Reviewed by Tim Horton.
832
833         * UIProcess/API/Cocoa/WKWebView.mm:
834         * UIProcess/API/Cocoa/WKWebViewInternal.h:
835         * UIProcess/ios/PageClientImplIOS.h:
836         * UIProcess/ios/PageClientImplIOS.mm:
837
838 2019-01-29  Chris Dumez  <cdumez@apple.com>
839
840         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
841         https://bugs.webkit.org/show_bug.cgi?id=193848
842
843         Reviewed by Youenn Fablet.
844
845         * Platform/IPC/Connection.cpp:
846         (IPC::Connection::Connection):
847         * UIProcess/ChildProcessProxy.h:
848         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
849         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
850         * UIProcess/WebBackForwardList.cpp:
851         (WebKit::WebBackForwardList::restoreFromState):
852         * UIProcess/WebProcessPool.cpp:
853         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
854         (WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
855
856 2019-01-29  Chris Dumez  <cdumez@apple.com>
857
858         REGRESSION (PSON): Twitter link gets stuck at t.co after navigating back in tab
859         https://bugs.webkit.org/show_bug.cgi?id=193932
860         <rdar://problem/47598947>
861
862         Reviewed by Brady Eidson.
863
864         When doing a client side redirect from origin A to origin B, we would swap process and
865         create a SuspendedPageProxy and save it on the source BackForwardListItem. The issue is
866         that the BackForwardList is locked for such redirect so we end up updating the current
867         BackForwardListItem with origin B's URL while origin A's suspended page remained on
868         the item. When going to another URL in the same origin A, we would not create a suspended
869         page since no process-swap would occur. When pressing the back button, we would go back
870         to the previous BackForwardListItem and use its SuspendedPageProxy, which is for the
871         wrong URL (The pre-client redirect one).
872
873         To address the issue, we no longer create a SuspendedPageProxy for cross-site client side
874         redirects. There will be no way no go back to this suspended page anyway since the
875         back/forward list item will be updated with the redirection URL.
876
877         * UIProcess/WebPageProxy.cpp:
878         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
879
880 2019-01-29  Chris Dumez  <cdumez@apple.com>
881
882         Regression(r240046) VoiceOver is no longer working after a process swap
883         https://bugs.webkit.org/show_bug.cgi?id=193953
884         <rdar://problem/47612398>
885
886         Reviewed by Alex Christensen.
887
888         ProvisionalPageProxy used to forward the RegisterWebProcessAccessibilityToken IPC from
889         the provisional WebProcess to the WebPageProxy right away. This in turn would notify
890         the PageClient whose logic would rely on WebPageProxy::process(), which returns the
891         committed process instead of the provisional one.
892
893         To address the issue, the ProvisionalPageProxy now stores the token sent by the
894         provisional WebProcess and we only call registerWebProcessAccessibilityToken()
895         on the WebPageProxy *after* we've swapped to the provisional process.
896
897         * UIProcess/ProvisionalPageProxy.cpp:
898         (WebKit::ProvisionalPageProxy::registerWebProcessAccessibilityToken):
899         (WebKit::ProvisionalPageProxy::didReceiveMessage):
900         * UIProcess/ProvisionalPageProxy.h:
901         (WebKit::ProvisionalPageProxy::takeAccessibilityToken):
902         * UIProcess/WebPageProxy.cpp:
903         (WebKit::WebPageProxy::commitProvisionalPage):
904
905 2019-01-28  Ryosuke Niwa  <rniwa@webkit.org>
906
907         User agent string override for navigator.userAgent should be site specific quirks
908         https://bugs.webkit.org/show_bug.cgi?id=193950
909
910         Reviewed by Brent Fulgham.
911
912         Renamed the various member variables, functions, properties and selectors.
913
914         * Shared/WebsitePoliciesData.cpp:
915         (WebKit::WebsitePoliciesData::encode const):
916         (WebKit::WebsitePoliciesData::decode):
917         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
918         * Shared/WebsitePoliciesData.h:
919         * UIProcess/API/APIWebsitePolicies.cpp:
920         (API::WebsitePolicies::data):
921         * UIProcess/API/APIWebsitePolicies.h:
922         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
923         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
924         (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgent.
925         (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgent.
926
927 2019-01-28  Commit Queue  <commit-queue@webkit.org>
928
929         Unreviewed, rolling out r240630.
930         https://bugs.webkit.org/show_bug.cgi?id=193958
931
932         Broke Apple internal builds (Requested by rniwa on #webkit).
933
934         Reverted changeset:
935
936         "Add back some includes that got removed at some point."
937         https://bugs.webkit.org/show_bug.cgi?id=193942
938         https://trac.webkit.org/changeset/240630
939
940 2019-01-28  Devin Rousso  <drousso@apple.com>
941
942         Web Inspector: provide a way to edit page WebRTC settings on a remote target
943         https://bugs.webkit.org/show_bug.cgi?id=193863
944         <rdar://problem/47572764>
945
946         Reviewed by Joseph Pecoraro.
947
948         * Shared/WebPreferences.yaml:
949         Add page-level settings for WebRTC preferences.
950
951 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
952
953         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
954         https://bugs.webkit.org/show_bug.cgi?id=193941
955
956         Reviewed by Alex Christensen.
957
958         * Shared/linux/WebMemorySamplerLinux.cpp:
959
960 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
961
962         [Win] WebCore/platform/Process.h is conflicting with process.h
963         https://bugs.webkit.org/show_bug.cgi?id=193944
964
965         Reviewed by Ross Kirsling.
966
967         * Shared/ChildProcess.h:
968         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
969         * Shared/unix/ChildProcessMain.cpp:
970         * UIProcess/API/APINavigation.h:
971         * UIProcess/ChildProcessProxy.h:
972         * UIProcess/Launcher/ProcessLauncher.h:
973         * UIProcess/WebProcessPool.cpp:
974         * UIProcess/WebProcessProxy.h:
975
976 2019-01-28  Jon Lee  <jonlee@apple.com>
977
978         Update Screen Capture preference
979         https://bugs.webkit.org/show_bug.cgi?id=193947
980         rdar://problem/47620199
981
982         Reviewed by Youenn Fablet.
983
984         * Shared/WebPreferences.yaml:
985
986 2019-01-28  Andy Estes  <aestes@apple.com>
987
988         [watchOS] Enable Parental Controls content filtering
989         https://bugs.webkit.org/show_bug.cgi?id=193939
990         <rdar://problem/46641912>
991
992         Reviewed by Ryosuke Niwa.
993
994         * Configurations/FeatureDefines.xcconfig:
995
996 2019-01-28  David Kilzer  <ddkilzer@apple.com>
997
998         REGRESSION (r236481): Move soft-linking of LocalAuthentication.framework out of LocalAuthenticationSoftLink.h
999         <https://webkit.org/b/193884>
1000
1001         Reviewed by Jiewen Tan.
1002
1003         * SourcesCocoa.txt:
1004         * UnifiedSources-input.xcfilelist:
1005         * WebKit.xcodeproj/project.pbxproj:
1006         - Add LocalAuthenticationSoftLink.mm to the project.
1007
1008         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
1009         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h.
1010         - Move soft-linking implementation to
1011           LocalAuthenticationSoftLink.mm.
1012
1013 2019-01-28  Timothy Hatcher  <timothy@apple.com>
1014
1015         Add back some includes that got removed at some point.
1016         https://bugs.webkit.org/show_bug.cgi?id=193942
1017
1018         Reviewed by Tim Horton.
1019
1020         * UIProcess/API/Cocoa/WKWebView.mm:
1021         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1022         * UIProcess/ios/PageClientImplIOS.h:
1023         * UIProcess/ios/PageClientImplIOS.mm:
1024
1025 2019-01-28  Timothy Hatcher  <timothy@apple.com>
1026
1027         Make it easier for non-Apple ports to enable dark mode CSS support.
1028         https://bugs.webkit.org/show_bug.cgi?id=193882
1029
1030         Reviewed by Megan Gardner.
1031
1032         Make modern WebKit code for dark mode usable by other ports, to match
1033         the WebCore parts that have been cross-platform all along.
1034
1035         * Shared/WebPageCreationParameters.cpp:
1036         (WebKit::WebPageCreationParameters::encode const):
1037         (WebKit::WebPageCreationParameters::decode):
1038         * Shared/WebPageCreationParameters.h:
1039         * UIProcess/PageClient.h:
1040         (WebKit::PageClient::effectiveAppearanceIsDark const):
1041         * UIProcess/WebPageProxy.cpp:
1042         (WebKit::WebPageProxy::creationParameters):
1043         (WebKit::WebPageProxy::useDarkAppearance const):
1044         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
1045         * UIProcess/WebPageProxy.h:
1046         * WebProcess/WebPage/WebPage.cpp:
1047         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1048         (WebKit::WebPage::setUseDarkAppearance):
1049         * WebProcess/WebPage/WebPage.h:
1050         * WebProcess/WebPage/WebPage.messages.in:
1051
1052 2019-01-28  Andy Estes  <aestes@apple.com>
1053
1054         [Cocoa] Add SPI to _WKUserContentExtensionStore to retrieve its underlying WKContentRuleListStore
1055         https://bugs.webkit.org/show_bug.cgi?id=193927
1056
1057         Reviewed by Tim Horton.
1058
1059         This is useful for clients migrating from _WKUserContentExtensionStore to the modern
1060         WKContentRuleList* APIs.
1061
1062         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1063         (-[_WKUserContentExtensionStore _contentRuleListStore]):
1064         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
1065
1066 2019-01-28  David Kilzer  <ddkilzer@apple.com>
1067
1068         Move soft-linking of ManagedConfiguration.framework out of ManagedConfigurationSPI.h
1069         <https://webkit.org/b/193868>
1070
1071         Reviewed by Daniel Bates.
1072
1073         * Platform/spi/ios/ManagedConfigurationSPI.h:
1074         - Remove soft-linking code from header.
1075         - Add PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC) guard.
1076
1077         * UIProcess/ios/WKContentViewInteraction.mm:
1078         (-[WKContentView canPerformActionForWebView:withSender:]):
1079         (-[WKContentView _defineForWebView:]):
1080         - Add soft-linking code formerly in ManagedConfigurationSPI.h.
1081         - Change MCFeatureDefinitionLookupAllowed to use soft-link
1082           function getMCFeatureDefinitionLookupAllowed() to remove the
1083           #define.
1084
1085 2019-01-28  Per Arne Vollan  <pvollan@apple.com>
1086
1087         REGRESSION (r240348): Loading netflix home page panics device
1088         https://bugs.webkit.org/show_bug.cgi?id=193936
1089
1090         Reviewed by Alexey Proskuryakov.
1091
1092         Temporarily enable permissive call filtering.
1093
1094         * WebProcess/com.apple.WebProcess.sb.in:
1095
1096 2019-01-28  Joseph Pecoraro  <pecoraro@apple.com>
1097
1098         [iOS] Attempting to open a Keynote document to iCloud.com from iCloud Files causes crash
1099         https://bugs.webkit.org/show_bug.cgi?id=193456
1100         <rdar://problem/47275642>
1101
1102         Reviewed by Brent Fulgham.
1103
1104         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1105         Allow access to iconservices.
1106
1107 2019-01-28  Daniel Bates  <dabates@apple.com>
1108
1109         [iOS] Make Window virtual key code computation match Mac
1110         https://bugs.webkit.org/show_bug.cgi?id=193452
1111
1112         Reviewed by Ryosuke Niwa.
1113
1114         Compute the Windows virtual key code from the WebEvent.
1115
1116         * Shared/ios/WebIOSEventFactory.mm:
1117         (WebIOSEventFactory::createWebKeyboardEvent):
1118
1119 2019-01-28  Brent Fulgham  <bfulgham@apple.com>
1120
1121         REGRESSION (r240498): Storage Access API prompts result is not remembered
1122         https://bugs.webkit.org/show_bug.cgi?id=193922
1123         <rdar://problem/47608767>
1124
1125         Reviewed by Chris Dumez.
1126
1127         The refactoring in r240498 bypassed bookkeeping in ResourceLoadStatisticsMemoryStore
1128         that kept track of whether a successful user prompt had been encountered. This
1129         patch corrects this codepath so the user is not prompted repeatedly after approving
1130         use of the Storage Access API.
1131
1132         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1133         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Switch from Move operator to
1134         const reference to allow the method to be called by the NetworkProcess.
1135         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1136         * NetworkProcess/NetworkProcess.cpp:
1137         (WebKit::NetworkProcess::grantStorageAccess): Request access through the WebResourceLoadStatistics
1138         object, rather than jumping directly to the NetworkStorageSession.
1139
1140 2019-01-28  Chris Dumez  <cdumez@apple.com>
1141
1142         Regression(PSON) Crash under WebPageProxy::didStartProgress()
1143         https://bugs.webkit.org/show_bug.cgi?id=193915
1144         <rdar://problem/47560907>
1145
1146         Reviewed by Alex Christensen.
1147
1148         * UIProcess/WebPageProxy.cpp:
1149         (WebKit::WebPageProxy::close):
1150         Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
1151         IPC after this or even worse, commit the provisional page.
1152
1153         (WebKit::WebPageProxy::didStartProgress):
1154         Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
1155         closed.
1156
1157 2019-01-28  Antoine Quint  <graouts@apple.com>
1158
1159         Limit user-agent interactions based on the touch-action property on iOS
1160         https://bugs.webkit.org/show_bug.cgi?id=193447
1161
1162         Unreviewed build fix.
1163
1164         * UIProcess/API/Cocoa/WKWebView.mm:
1165
1166 2019-01-28  Antoine Quint  <graouts@apple.com>
1167
1168         Limit user-agent interactions based on the touch-action property on iOS
1169         https://bugs.webkit.org/show_bug.cgi?id=193447
1170
1171         Unreviewed build fix.
1172
1173         * UIProcess/ios/WKContentViewInteraction.mm:
1174
1175 2019-01-28  Brent Fulgham  <bfulgham@apple.com>
1176
1177         Remove the UIProcess components of the ResourceLoadStatistics code
1178         https://bugs.webkit.org/show_bug.cgi?id=193303
1179         <rdar://problem/47160073>
1180
1181         Reviewed by Chris Dumez.
1182
1183         Now that the ResourceLoadStatistics code is running in the NetworkProcess, we can get rid
1184         of the UIProcess copies of these routines.
1185
1186         Tested by existing ResourceLoadStatistics and StorageAccess tests.
1187
1188         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1189         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
1190         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1191         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
1192         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
1193         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
1194         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
1195         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
1196         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
1197         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
1198         (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
1199         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1200         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
1201         (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
1202         (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
1203         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1204         * UIProcess/WebProcessProxy.cpp:
1205         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
1206         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
1207         * UIProcess/WebProcessProxy.h:
1208         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1209         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
1210         (WebKit::WebsiteDataStore::removeData):
1211         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
1212         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
1213         (WebKit::WebsiteDataStore::setGrandfatheringTime):
1214         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
1215         (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
1216         (WebKit::WebsiteDataStore::isPrevalentResource):
1217         (WebKit::WebsiteDataStore::setPrevalentResource):
1218         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
1219         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
1220         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
1221         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1222         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
1223         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
1224         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
1225         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
1226         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
1227         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
1228         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
1229         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
1230         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
1231         (WebKit::WebsiteDataStore::clearPrevalentResource):
1232         (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
1233         (WebKit::WebsiteDataStore::submitTelemetry):
1234         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
1235         (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
1236         (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
1237         (WebKit::WebsiteDataStore::setLastSeen):
1238         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
1239         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
1240         (WebKit::WebsiteDataStore::hasStorageAccess):
1241         (WebKit::WebsiteDataStore::requestStorageAccess):
1242         (WebKit::WebsiteDataStore::grantStorageAccess):
1243         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
1244         (WebKit::WebsiteDataStore::logUserInteraction):
1245         (WebKit::WebsiteDataStore::hasHadUserInteraction):
1246         (WebKit::WebsiteDataStore::clearUserInteraction):
1247         (WebKit::WebsiteDataStore::setGrandfathered):
1248         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
1249         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
1250         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1251         (WebKit::WebsiteDataStore::didCreateNetworkProcess):
1252         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
1253         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Deleted.
1254         (WebKit::WebsiteDataStore::setCacheMaxAgeCap): Deleted.
1255         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor): Deleted.
1256         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies): Deleted.
1257         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler): Deleted.
1258         (WebKit::WebsiteDataStore::grantStorageAccessHandler): Deleted.
1259         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler): Deleted.
1260         (WebKit::WebsiteDataStore::removePrevalentDomains): Deleted.
1261         (WebKit::WebsiteDataStore::isGrandfathered): Deleted.
1262         * UIProcess/WebsiteData/WebsiteDataStore.h:
1263
1264 2019-01-28  Antoine Quint  <graouts@apple.com>
1265
1266         Limit user-agent interactions based on the touch-action property on iOS
1267         https://bugs.webkit.org/show_bug.cgi?id=193447
1268         <rdar://problem/47283874>
1269
1270         Reviewed by Antti Koivisto and Simon Fraser.
1271
1272         Handle the "none", "pan-x", "pan-y" and "pinch-zoom" values for the touch-action property by querying the scrolling tree whenever a touch begins
1273         to identify whether its point is contained within the region of an element with a non-auto touch-action property. If it is, we use the list of
1274         permitted touch actions such to then customize the behavior of the nearest scroll view to pan or zoom only as instructed.
1275
1276         * Shared/WebCoreArgumentCoders.cpp:
1277         (IPC::ArgumentCoder<TouchActionData>::encode):
1278         (IPC::ArgumentCoder<TouchActionData>::decode):
1279         (IPC::ArgumentCoder<EventTrackingRegions>::encode):
1280         (IPC::ArgumentCoder<EventTrackingRegions>::decode):
1281         (IPC::ArgumentCoder<Region>::decode):
1282         * Shared/WebCoreArgumentCoders.h:
1283         * UIProcess/API/Cocoa/WKWebView.mm:
1284         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Account for panning constraints set on the content view to prevent deceleration
1285         to pan the view if it ought not.
1286         (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Implement an additional
1287         UIScrollView delegation method to apply the panning constraints set on the content view while panning.
1288         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1289         (WebKit::RemoteScrollingCoordinatorProxy::touchActionDataAtPoint const):
1290         (WebKit::RemoteScrollingCoordinatorProxy::touchActionDataForScrollNodeID const):
1291         (WebKit::RemoteScrollingCoordinatorProxy::setTouchDataForTouchIdentifier):
1292         (WebKit::RemoteScrollingCoordinatorProxy::clearTouchDataForTouchIdentifier):
1293         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1294         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
1295         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1296         (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Apply the same logic as in WKWebView.
1297         (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Apply
1298         the same logic as in WKWebView.
1299         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::touchActionData const):
1300         * UIProcess/WebPageProxy.h:
1301         (WebKit::WebPageProxy::isScrollingOrZooming const):
1302         * UIProcess/ios/WKContentViewInteraction.h:
1303         * UIProcess/ios/WKContentViewInteraction.mm:
1304         (-[WKContentView preventsPanningInXAxis]):
1305         (-[WKContentView preventsPanningInYAxis]):
1306         (-[WKContentView cleanupInteraction]):
1307         (-[WKContentView _webTouchEventsRecognized:]):
1308         (-[WKContentView _handleTouchActionsForTouchEvent:]): As we process touches, check whether there are touch actions set for this touch's points' locations. Based
1309         on those touch actions, either setDefaultPrevented on the _touchEventGestureRecognizer if the touch action is "none" or selectively disable panning and zooming.
1310         (-[WKContentView _resetPanningPreventionFlags]):
1311         (-[WKContentView _didEndScrollingOrZooming]):
1312
1313 2019-01-28  Antti Koivisto  <antti@apple.com>
1314
1315         WebUserContentController::removeUserScriptMessageHandlerInternal may deref and delete itself
1316         https://bugs.webkit.org/show_bug.cgi?id=193901
1317         <rdar://problem/47338669>
1318
1319         Reviewed by David Kilzer.
1320
1321         Don't know how to repro.
1322
1323         * WebProcess/UserContent/WebUserContentController.cpp:
1324         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
1325
1326         Calling userMessageHandlers.removeFirstMatching() may remove the last ref to this
1327         (because WebUserMessageHandlerDescriptorProxy refs WebUserContentController).
1328         Fix by protecting this over the function.
1329
1330 2018-12-15  Darin Adler  <darin@apple.com>
1331
1332         Replace many uses of String::format with more type-safe alternatives
1333         https://bugs.webkit.org/show_bug.cgi?id=192742
1334
1335         Reviewed by Mark Lam.
1336
1337         * Shared/WebMemorySampler.cpp:
1338         (WebKit::WebMemorySampler::writeHeaders): Use makeString.
1339
1340         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1341         (WebKit::LocalAuthenticator::makeCredential): Use string concatentation.
1342
1343         * UIProcess/WebInspectorUtilities.cpp:
1344         (WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
1345         * UIProcess/WebProcessPool.cpp:
1346         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
1347         (WebKit::WebProcessPool::startMemorySampler): Ditto.
1348
1349 2019-01-27  Jiewen Tan  <jiewen_tan@apple.com>
1350
1351         Use a load optimizer for some sites
1352         https://bugs.webkit.org/show_bug.cgi?id=193881
1353         <rdar://problem/46325455>
1354
1355         Reviewed by Brent Fulgham.
1356
1357         We will try to speed up some sites with a dedicated load optimizer. The load optimizer lives
1358         within the WebsiteDataStore as one client instance should have only one and it should live
1359         as long as the client lives. How does the load optimizer work? It intercepts every load in
1360         the navigation state. If a request meets some requirements, it will then fetch the request
1361         from its own cache. Once the fetch succeeds, the original load will be ignored and the
1362         optimizer will display the cached content.
1363
1364         Covered by API tests.
1365
1366         * SourcesCocoa.txt:
1367         * UIProcess/Cocoa/LoadOptimizer.h: Added.
1368         * UIProcess/Cocoa/LoadOptimizer.mm: Added.
1369         * UIProcess/Cocoa/MediaCaptureUtilities.h:
1370         * UIProcess/Cocoa/NavigationState.mm:
1371         (WebKit::tryInterceptNavigation):
1372         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1373         (WebKit::tryAppLink): Deleted.
1374         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1375         (WebKit::WebsiteDataStore::WebsiteDataStore):
1376         * UIProcess/WebsiteData/WebsiteDataStore.h:
1377         (WebKit::WebsiteDataStore::loadOptimizer):
1378         * WebKit.xcodeproj/project.pbxproj:
1379
1380 2019-01-25  Brian Burg  <bburg@apple.com>
1381
1382         Web Automation: add support for simulating single touches to Automation.performInteractionSequence
1383         https://bugs.webkit.org/show_bug.cgi?id=193852
1384         <rdar://problem/28360781>
1385
1386         Reviewed by Joseph Pecoraro and Simon Fraser.
1387
1388         This patch makes it possible to simulate touches via the Actions API. The approach is to
1389         use a stripped down version of HIDEventGenerator to send HID events to the UIWindow.
1390         The initial version supports a single touch point; this may be expanded if needed, but
1391         so far it hasn't been an impediment when running desktop-oriented WebDriver test suites.
1392
1393         As part of implementing this support, I went through and added [somewhat obnoxious] ENABLE()
1394         guards so that we don't mistakenly compile mouse support on iOS and touch on Mac,
1395         and vice versa. Each of the interaction methods---touch, mouse, keyboard---can be independently
1396         compiled out. If none is supported (i.e., Windows), then we don't even try to compile
1397         platformSimulate*Interaction methods or SimulatedInputDispatcher. This allows WebAutomationSession
1398         to not include members and code that are never going to be used on a particular platform.
1399
1400         This functionality is covered by existing WebDriver test suites that use Element Click command.
1401         Additional tests that explicitly include 'touch' pointerType will be submitted to WPT later.
1402
1403         * UIProcess/Automation/Automation.json: Update comment.
1404
1405         * UIProcess/Automation/SimulatedInputDispatcher.h:
1406         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1407         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
1408         - Add appropriate guards for code specific to each interaction type.
1409         - Handle SimulatedInputSourceType::Touch and call out to dispatch events.
1410
1411         * UIProcess/Automation/WebAutomationSession.h:
1412         * UIProcess/Automation/WebAutomationSession.cpp:
1413         (WebKit::WebAutomationSession::WebAutomationSession):
1414         (WebKit::WebAutomationSession::terminate):
1415         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
1416         (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
1417         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
1418         (WebKit::WebAutomationSession::willClosePage):
1419         Add appropriate guards for code specific to each interaction type.
1420
1421         (WebKit::WebAutomationSession::isSimulatingUserInteraction const):
1422         Add new hook so that we can detect when a touch simulation is in progress.
1423         We don't rely on checking WebKit's event queue, so use a flag.
1424
1425         (WebKit::WebAutomationSession::simulateTouchInteraction):
1426         (WebKit::WebAutomationSession::performMouseInteraction):
1427         (WebKit::WebAutomationSession::performKeyboardInteractions):
1428         (WebKit::WebAutomationSession::cancelInteractionSequence):
1429         (WebKit::WebAutomationSession::performInteractionSequence):
1430         - Add appropriate guards for code specific to each interaction type.
1431         - Bail out immediately if a requested interaction type is not supported.
1432         - Shim Touch input type to Mouse if mouse is not supported but touches are.
1433         Nearly all WebDriver tests in the wild will be requesting a 'mouse' pointerType,
1434         so this is necessary for compatibility. It's easier to shim at this level than try
1435         to implement platformSimulateMouseInteraction for iOS because
1436         platformSimulateMouseinteraction does not use a completion handler but the iOS
1437         implementation would require that.
1438
1439         (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Deleted.
1440         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Deleted.
1441         - Remove these stubs. Platform methods of this class are no longer being filled
1442         with stubs on unsupported platforms because we expect the command to fail earlier.
1443
1444         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
1445         (WebKit::WebAutomationSession::platformSimulateTouchInteraction):
1446         - Add appropriate guards for code specific to each interaction type.
1447         - Implement new platform method to simulate touches. This uses _WKTouchEventGenerator.
1448
1449         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1450         Add appropriate guards for code specific to each interaction type.
1451
1452         * UIProcess/_WKTouchEventGenerator.h: Added.
1453         * UIProcess/_WKTouchEventGenerator.mm: Added.
1454         (simpleCurveInterpolation):
1455         (calculateNextCurveLocation):
1456         (delayBetweenMove):
1457         (+[_WKTouchEventGenerator sharedTouchEventGenerator]):
1458         (+[_WKTouchEventGenerator nextEventCallbackID]):
1459         (-[_WKTouchEventGenerator init]):
1460         (-[_WKTouchEventGenerator dealloc]):
1461         (-[_WKTouchEventGenerator _createIOHIDEventType:]):
1462         (-[_WKTouchEventGenerator _sendHIDEvent:]):
1463         (-[_WKTouchEventGenerator _sendMarkerHIDEventWithCompletionBlock:]):
1464         (-[_WKTouchEventGenerator _updateTouchPoints:count:]):
1465         (-[_WKTouchEventGenerator touchDownAtPoints:touchCount:]):
1466         (-[_WKTouchEventGenerator touchDown:touchCount:]):
1467         (-[_WKTouchEventGenerator touchDown:]):
1468         (-[_WKTouchEventGenerator liftUpAtPoints:touchCount:]):
1469         (-[_WKTouchEventGenerator liftUp:touchCount:]):
1470         (-[_WKTouchEventGenerator liftUp:]):
1471         (-[_WKTouchEventGenerator moveToPoints:touchCount:duration:]):
1472         (-[_WKTouchEventGenerator touchDown:completionBlock:]):
1473         (-[_WKTouchEventGenerator liftUp:completionBlock:]):
1474         (-[_WKTouchEventGenerator moveToPoint:duration:completionBlock:]):
1475         (-[_WKTouchEventGenerator receivedHIDEvent:]):
1476         Copied and simplified from HIDEventGenerator in WebKitTestRunner.
1477
1478         * WebKit.xcodeproj/project.pbxproj:
1479         Add _WKTouchEventGenerator.{h,mm} and make it a private header. The client needs to
1480         route received HID events to -receivedHIDEvent: in order to detect when the marker
1481         HID event has been processed (and thus the interaction is completed).
1482
1483         * config.h: Add ENABLE(WEBDRIVER_*_INTERACTIONS) macros here.
1484
1485 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
1486
1487         Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
1488         https://bugs.webkit.org/show_bug.cgi?id=193879
1489
1490         Reviewed by Antti Koivisto.
1491
1492         Need a specialization of dump() for ScrollingStateFrameHostingNode to avoid infinite recursion.
1493
1494         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1495         (WebKit::dump):
1496
1497 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
1498
1499         AX: Introduce a static accessibility tree
1500         https://bugs.webkit.org/show_bug.cgi?id=193348
1501         <rdar://problem/47203295>
1502
1503         Reviewed by Ryosuke Niwa.
1504
1505         * Configurations/FeatureDefines.xcconfig:
1506         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1507         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
1508
1509 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
1510
1511         Allow scrolling tree nodes to exist in a detached state
1512         https://bugs.webkit.org/show_bug.cgi?id=193754
1513
1514         Reviewed by Zalan Bujtas.
1515
1516         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1517         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1518
1519 2019-01-25  Tim Horton  <timothy_horton@apple.com>
1520
1521         REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
1522         https://bugs.webkit.org/show_bug.cgi?id=193860
1523         <rdar://problem/47535022>
1524
1525         Reviewed by Antti Koivisto.
1526
1527         * UIProcess/Cocoa/ViewGestureController.cpp:
1528         (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
1529         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
1530         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
1531         * UIProcess/Cocoa/ViewGestureController.h:
1532         Treat provisional load and same document load the same: they already both
1533         unpause the snapshot removal tracker, request render tree size notifications,
1534         but same-document navigation was missing the call to dispatchAfterEnsuringDrawing
1535         and thus would get stuck waiting for RepaintAfterNavigation.
1536
1537 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
1538
1539         Need a mechanism to override navigator.userAgent
1540         https://bugs.webkit.org/show_bug.cgi?id=193762
1541         <rdar://problem/47504939>
1542
1543         Reviewed by Brent Fulgham.
1544
1545         This patch adds a new _WKWebsitePolicies SPI to specify the user agent string returned by
1546         navigator.userAgent without affecting the user agent string used to send network requests.
1547
1548         Tests: WebKit.WebsitePoliciesCustomJavaScriptUserAgent
1549                WebKit.WebsitePoliciesCustomUserAgents
1550
1551         * Shared/WebsitePoliciesData.cpp:
1552         (WebKit::WebsitePoliciesData::encode const):
1553         (WebKit::WebsitePoliciesData::decode):
1554         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1555         * Shared/WebsitePoliciesData.h:
1556         * UIProcess/API/APIWebsitePolicies.cpp:
1557         (API::WebsitePolicies::data):
1558         * UIProcess/API/APIWebsitePolicies.h:
1559         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1560         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1561         (-[_WKWebsitePolicies setCustomJavaScriptUserAgent:]):
1562         (-[_WKWebsitePolicies customJavaScriptUserAgent]):
1563
1564 2019-01-25  Devin Rousso  <drousso@apple.com>
1565
1566         Web Inspector: provide a way to edit page settings on a remote target
1567         https://bugs.webkit.org/show_bug.cgi?id=193813
1568         <rdar://problem/47359510>
1569
1570         Reviewed by Joseph Pecoraro.
1571
1572         * WebProcess/WebPage/WebInspectorUI.h:
1573         (WebKit::WebInspectorUI::isRemote() const): Added.
1574         * WebProcess/WebPage/RemoteWebInspectorUI.h:
1575         (WebKit::RemoteWebInspectorUI::isRemote() const): Added.
1576
1577 2019-01-25  Dean Jackson  <dino@apple.com>
1578
1579         REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
1580         https://bugs.webkit.org/show_bug.cgi?id=193831
1581         <rdar://problem/47399263>
1582
1583         Reviewed by Chris Dumez.
1584
1585         A System Preview (<a rel="ar">) displays in a modal and doesn't trigger
1586         a navigation. If the link was cross origin, it was causing a process swap,
1587         which meant that the response defaulted back to a navigation.
1588
1589         The fix is to not cause a PSON when the navigation is a system preview.
1590
1591         * UIProcess/API/APINavigation.h:
1592         (API::Navigation::shouldForceDownload const): This is now just tracking
1593         the "download" attribute, and not including System Preview.
1594         (API::Navigation::isSystemPreview const): New method to check for a
1595         navigation triggered as a System Preview.
1596         * UIProcess/WebPageProxy.cpp: Move the code from receivedPolicyDecision to
1597         receivedNavigationPolicyDecision, so that downloads and System Previews are
1598         detected before we decide to change process.
1599         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1600         (WebKit::WebPageProxy::receivedPolicyDecision):
1601
1602 2019-01-25  Tim Horton  <timothy_horton@apple.com>
1603
1604         Find-in-page on nyt.com scrolls around without touching the screen when find holes are visible
1605         https://bugs.webkit.org/show_bug.cgi?id=193853
1606
1607         Reviewed by Simon Fraser.
1608
1609         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1610         (WebKit::FindController::updateFindIndicator):
1611         There is no reason to scroll/zoom to the find indicator just because the
1612         holes are up, we should only do it on initial indicator presentation.
1613         This was a mistake in r178755 that was previously never exercised because
1614         isShowingOverlay was always false.
1615
1616 2019-01-25  Keith Rollin  <krollin@apple.com>
1617
1618         Update Xcode projects with "Check .xcfilelists" build phase
1619         https://bugs.webkit.org/show_bug.cgi?id=193790
1620         <rdar://problem/47201374>
1621
1622         Reviewed by Alex Christensen.
1623
1624         Support for XCBuild includes specifying inputs and outputs to various
1625         Run Script build phases. These inputs and outputs are specified as
1626         .xcfilelist files. Once created, these .xcfilelist files need to be
1627         kept up-to-date. In order to check that they are up-to-date or not,
1628         add an Xcode build step that invokes an external script that performs
1629         the checking. If the .xcfilelists are found to be out-of-date, update
1630         them, halt the build, and instruct the developer to restart the build
1631         with up-to-date files.
1632
1633         At this time, the checking and regenerating is performed only if the
1634         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
1635         who want to use this facility can set this variable and test out the
1636         checking/regenerating. Once it seems like there are no egregious
1637         issues that upset a developer's workflow, we'll unconditionally enable
1638         this facility.
1639
1640         * Scripts/check-xcfilelists.sh: Added.
1641         * WebKit.xcodeproj/project.pbxproj:
1642
1643 2019-01-25  Alex Christensen  <achristensen@webkit.org>
1644
1645         Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
1646         https://bugs.webkit.org/show_bug.cgi?id=193844
1647
1648         Reviewed by Andy Estes.
1649
1650         This simplifies ChildProcess and removes NetworkProcess-specific code from this generic abstraction.
1651
1652         * NetworkProcess/mac/NetworkProcessMac.mm:
1653         (WebKit::NetworkProcess::initializeProcess):
1654         * Shared/ios/ChildProcessIOS.mm:
1655         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
1656         * Shared/mac/ChildProcessMac.mm:
1657         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
1658
1659 2019-01-25  Keith Rollin  <krollin@apple.com>
1660
1661         Update Xcode projects with "Apply Configuration to XCFileLists" build target
1662         https://bugs.webkit.org/show_bug.cgi?id=193781
1663         <rdar://problem/47201153>
1664
1665         Reviewed by Alex Christensen.
1666
1667         Part of generating the .xcfilelists used as part of adopting XCBuild
1668         includes running `make DerivedSources.make` from a standalone script.
1669         It’s important for this invocation to have the same environment as
1670         when the actual build invokes `make DerivedSources.make`. If the
1671         environments are different, then the two invocations will provide
1672         different results. In order to get the same environment in the
1673         standalone script, have the script launch xcodebuild targeting the
1674         "Apply Configuration to XCFileLists" build target, which will then
1675         re-invoke our standalone script. The script is now running again, this
1676         time in an environment with all workspace, project, target, xcconfig
1677         and other environment variables established.
1678
1679         The "Apply Configuration to XCFileLists" build target accomplishes
1680         this task via a small embedded shell script that consists only of:
1681
1682             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
1683
1684         The process that invokes "Apply Configuration to XCFileLists" first
1685         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
1686         evaluated and exports it into the shell environment. When xcodebuild
1687         is invoked, it inherits the value of this variable and can `eval` the
1688         contents of that variable. Our external standalone script can then set
1689         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
1690         of command-line parameters needed to restart itself in the appropriate
1691         state.
1692
1693         * WebKit.xcodeproj/project.pbxproj:
1694
1695 2019-01-25  Alex Christensen  <achristensen@webkit.org>
1696
1697         Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning
1698         https://bugs.webkit.org/show_bug.cgi?id=193802
1699         <rdar://problem/46010580>
1700
1701         Reviewed by Andy Estes.
1702
1703         * UIProcess/API/APIUIClient.h:
1704         (API::UIClient::didClickGoBackFromSafeBrowsingWarning):
1705         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1706         * UIProcess/Cocoa/UIDelegate.h:
1707         * UIProcess/Cocoa/UIDelegate.mm:
1708         (WebKit::UIDelegate::setDelegate):
1709         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning):
1710         * UIProcess/WebPageProxy.cpp:
1711         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1712
1713 2019-01-25  Daniel Bates  <dabates@apple.com>
1714
1715         [iOS] Pressing Tab key doesn't move to next cell with Google Sheets
1716         https://bugs.webkit.org/show_bug.cgi?id=193048
1717         <rdar://problem/46433836>
1718
1719         Reviewed by Brent Fulgham.
1720
1721         WebCore knows how interpret the Tab and Shift + Tab keys. When building with UIKit keyboard additions
1722         we do not need to register key commands for handling them from the UIProcess code. Instead UIKit will
1723         sends key events for these commands to us. This will make the behavior of these key commands when executed
1724         in an editable field match the behavior of these command when executed in a non-editable field since
1725         both code paths will now go through WebCore.
1726
1727         * UIProcess/ios/WKContentViewInteraction.mm:
1728         (-[WKContentView keyCommands]): Only compile when building with !USE(UIKIT_KEYBOARD_ADDITIONS).
1729
1730 2019-01-25  Alex Christensen  <achristensen@webkit.org>
1731
1732         Fix Linux build.
1733
1734         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1735         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
1736
1737 2019-01-25  Keith Rollin  <krollin@apple.com>
1738
1739         Update WebKitAdditions.xcconfig with correct order of variable definitions
1740         https://bugs.webkit.org/show_bug.cgi?id=193793
1741         <rdar://problem/47532439>
1742
1743         Reviewed by Alex Christensen.
1744
1745         XCBuild changes the way xcconfig variables are evaluated. In short,
1746         all config file assignments are now considered in part of the
1747         evaluation. When using the new build system and an .xcconfig file
1748         contains multiple assignments of the same build setting:
1749
1750         - Later assignments using $(inherited) will inherit from earlier
1751           assignments in the xcconfig file.
1752         - Later assignments not using $(inherited) will take precedence over
1753           earlier assignments. An assignment to a more general setting will
1754           mask an earlier assignment to a less general setting. For example,
1755           an assignment without a condition ('FOO = bar') will completely mask
1756           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
1757
1758         This affects some of our .xcconfig files, in that sometimes platform-
1759         or sdk-specific definitions appear before the general definitions.
1760         Under the new evaluations rules, the general definitions alway take
1761         effect because they always overwrite the more-specific definitions. The
1762         solution is to swap the order, so that the general definitions are
1763         established first, and then conditionally overwritten by the
1764         more-specific definitions.
1765
1766         * Configurations/BaseTarget.xcconfig:
1767         * Configurations/Version.xcconfig:
1768         * Configurations/WebKit.xcconfig:
1769
1770 2019-01-25  Keith Rollin  <krollin@apple.com>
1771
1772         Update existing .xcfilelists
1773         https://bugs.webkit.org/show_bug.cgi?id=193791
1774         <rdar://problem/47201706>
1775
1776         Reviewed by Alex Christensen.
1777
1778         Many .xcfilelist files were added in r238824 in order to support
1779         XCBuild. Update these with recent changes to the set of build files
1780         and with the current generate-xcfilelist script.
1781
1782         * DerivedSources-input.xcfilelist:
1783         * DerivedSources-output.xcfilelist:
1784         * UnifiedSources-input.xcfilelist:
1785         * UnifiedSources-output.xcfilelist:
1786
1787 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
1788
1789         [iOS] Deny mach lookups to services not used.
1790         https://bugs.webkit.org/show_bug.cgi?id=193828
1791
1792         Reviewed by Brent Fulgham.
1793
1794         Start denying mach lookups to iOS services, which were previously allowed with reporting.
1795         Living-on has indicated that these services are not used.
1796
1797         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1798
1799 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
1800
1801         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
1802         https://bugs.webkit.org/show_bug.cgi?id=193297
1803         <rdar://problem/47158841>
1804
1805         Reviewed by Alex Christensen.
1806
1807         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
1808         it off in the UIProcess. It also updates test infrastructure to work with this change
1809         in architecture.
1810
1811         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1812         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
1813         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
1814         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
1815         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1816         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
1817         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
1818         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
1819         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
1820         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
1821         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
1822         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1823         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1824         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
1825         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
1826         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
1827         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1828         * NetworkProcess/NetworkSession.cpp:
1829         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
1830         * UIProcess/WebProcessPool.cpp:
1831         (WebKit::WebProcessPool::ensureNetworkProcess):
1832         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1833         (WebKit::WebsiteDataStore::parameters):
1834         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1835         (WebKit::WebsiteDataStore::removeData):
1836         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
1837         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1838         * Webprocess/WebProcess.cpp:
1839         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
1840
1841 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
1842
1843         iOS: inputmode="none" disables hardware keyboard's globe key
1844         https://bugs.webkit.org/show_bug.cgi?id=193811
1845         <rdar://problem/47406553>
1846
1847         Reviewed by Wenson Hsieh.
1848
1849         Removed the support for inputmode="none" for now since we need a new SPI from UIKit
1850         to properly implement this feature some time in the future.
1851
1852         * UIProcess/ios/WKContentViewInteraction.mm:
1853         (-[WKContentView _zoomToRevealFocusedElement]):
1854         (-[WKContentView inputView]):
1855         (-[WKContentView requiresAccessoryView]):
1856         (-[WKContentView textInputTraits]):
1857
1858 2019-01-25  David Kilzer  <ddkilzer@apple.com>
1859
1860         Move soft-linking of Lookup.framework out of LookupSPI.h
1861         <https://webkit.org/b/193815>
1862
1863         Reviewed by Tim Horton.
1864
1865         * UIProcess/Cocoa/WebViewImpl.mm:
1866         (-[WKWindowVisibilityObserver dealloc]):
1867         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
1868         - Move soft-linking to LookupSoftLink.{h,mm}.
1869
1870 2019-01-25  Antti Koivisto  <antti@apple.com>
1871
1872         REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recognized as swipe gestures
1873         https://bugs.webkit.org/show_bug.cgi?id=193818
1874         <rdar://problem/47456584>
1875
1876         Reviewed by Tim Horton.
1877
1878         We don't hit the RenderTreeSizeThreshold milestone to remove the snapshot and allow interaction because we request it
1879         from a wrong process (the one we are leaving behind).
1880
1881         * UIProcess/Cocoa/ViewGestureController.cpp:
1882         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
1883
1884         Request the RenderTreeSizeThreshold notification when the load has started and we know the process to use.
1885
1886         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
1887         * UIProcess/Cocoa/ViewGestureController.h:
1888         (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
1889         (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
1890         * UIProcess/mac/ViewGestureControllerMac.mm:
1891         (WebKit::ViewGestureController::endSwipeGesture):
1892
1893         Don't request immediately, save the threshold to SnapshotRemovalTracker.
1894
1895         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
1896
1897         Do the request to the right process.
1898
1899         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
1900         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold):
1901
1902         Ensure we send the notification even if we reached the threshold before it was requested.
1903
1904         (WebKit::ViewGestureGeometryCollector::sendDidHitRenderTreeSizeThresholdIfNeeded):
1905         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
1906         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
1907         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold): Deleted.
1908
1909 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1910
1911         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
1912         https://bugs.webkit.org/show_bug.cgi?id=193829
1913
1914         Reviewed by Tim Horton.
1915
1916         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1917         (WebKit::WebPageProxy::setDragCaretRect):
1918         * UIProcess/PageClient.h:
1919         * UIProcess/WebPageProxy.h:
1920         * UIProcess/WebPageProxy.messages.in:
1921         * UIProcess/ios/PageClientImplIOS.h:
1922         * UIProcess/ios/PageClientImplIOS.mm:
1923         (WebKit::PageClientImpl::didHandleDragStartRequest):
1924         (WebKit::PageClientImpl::didConcludeEditDrag):
1925         (WebKit::PageClientImpl::didChangeDragCaretRect):
1926         (WebKit::PageClientImpl::didHandleStartDataInteractionRequest): Deleted.
1927         (WebKit::PageClientImpl::didConcludeEditDataInteraction): Deleted.
1928         (WebKit::PageClientImpl::didChangeDataInteractionCaretRect): Deleted.
1929         * UIProcess/ios/WKContentViewInteraction.h:
1930         * UIProcess/ios/WKContentViewInteraction.mm:
1931         (-[WKContentView setupInteraction]):
1932         (-[WKContentView cleanupInteraction]):
1933         (-[WKContentView setupDragAndDropInteractions]):
1934         (-[WKContentView teardownDragAndDropInteractions]):
1935         (-[WKContentView _didHandleDragStartRequest:]):
1936         (-[WKContentView _didConcludeEditDrag:]):
1937         (-[WKContentView _didChangeDragCaretRect:currentRect:]):
1938         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
1939         (-[WKContentView setupDataInteractionDelegates]): Deleted.
1940         (-[WKContentView teardownDataInteractionDelegates]): Deleted.
1941         (-[WKContentView _didHandleStartDataInteractionRequest:]): Deleted.
1942         (-[WKContentView _didConcludeEditDataInteraction:]): Deleted.
1943         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): Deleted.
1944         * UIProcess/ios/WebPageProxyIOS.mm:
1945         (WebKit::WebPageProxy::didHandleDragStartRequest):
1946         (WebKit::WebPageProxy::requestDragStart):
1947         (WebKit::WebPageProxy::didConcludeEditDrag):
1948         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest): Deleted.
1949         (WebKit::WebPageProxy::requestStartDataInteraction): Deleted.
1950         (WebKit::WebPageProxy::didConcludeEditDataInteraction): Deleted.
1951         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1952         (WebKit::WebDragClient::didConcludeEditDrag):
1953         * WebProcess/WebPage/WebPage.h:
1954         * WebProcess/WebPage/WebPage.messages.in:
1955         * WebProcess/WebPage/ios/WebPageIOS.mm:
1956         (WebKit::WebPage::requestDragStart):
1957         (WebKit::WebPage::requestAdditionalItemsForDragSession):
1958         (WebKit::WebPage::didConcludeEditDrag):
1959         (WebKit::WebPage::requestStartDataInteraction): Deleted.
1960         (WebKit::WebPage::didConcludeEditDataInteraction): Deleted.
1961
1962 2019-01-25  Alex Christensen  <achristensen@webkit.org>
1963
1964         WKWebView.goBack should reload if there is a safe browsing warning
1965         https://bugs.webkit.org/show_bug.cgi?id=193805
1966         <rdar://problem/46908216>
1967
1968         Reviewed by Geoff Garen.
1969
1970         If a WKWebView is showing a safe browsing warning and the user clicks a back button
1971         in the app which calls WKWebView.goBack, the WKWebView is in a state where it has not navigated yet,
1972         so actually going back will appear to the user to go back twice.  We can't just do nothing because the
1973         app is in a state where it is expecting a navigation to happen.  Reloading achieves what the user expects
1974         and makes the app work like the app expects.
1975
1976         * UIProcess/API/C/WKPage.cpp:
1977         (WKPageGoBack):
1978         * UIProcess/API/Cocoa/WKWebView.mm:
1979         (-[WKWebView goBack]):
1980         * UIProcess/PageClient.h:
1981         (WebKit::PageClient::hasSafeBrowsingWarning const):
1982         * UIProcess/mac/PageClientImplMac.h:
1983         * UIProcess/mac/PageClientImplMac.mm:
1984         (WebKit::PageClientImpl::hasSafeBrowsingWarning const):
1985
1986 2019-01-25  Chris Dumez  <cdumez@apple.com>
1987
1988         Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started
1989         https://bugs.webkit.org/show_bug.cgi?id=193788
1990         <rdar://problem/47531231>
1991
1992         Reviewed by Alex Christensen.
1993
1994         When the page starts a new provisional load, make sure we cancel any pending one in the provisional
1995         process, as it would have happened in the first provisional load happened in the same process.
1996         Without this, we could have 2 parallel loads happening, one in the committed process and another
1997         in the provisional one, leading to assertion failures in debug.
1998
1999         * UIProcess/WebPageProxy.cpp:
2000         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2001
2002 2019-01-25  Chris Dumez  <cdumez@apple.com>
2003
2004         Drop WebKit::WebKitPolicyAction type as it is no longer needed
2005         https://bugs.webkit.org/show_bug.cgi?id=193827
2006
2007         Reviewed by Antti Koivisto.
2008
2009         Drop WebKit::WebKitPolicyAction type as it is no longer needed. It is now identical to
2010         WebCore::PolicyAction.
2011
2012         * Shared/WebPolicyAction.h: Removed.
2013         * UIProcess/WebFramePolicyListenerProxy.cpp:
2014         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
2015         (WebKit::WebFramePolicyListenerProxy::use):
2016         (WebKit::WebFramePolicyListenerProxy::download):
2017         (WebKit::WebFramePolicyListenerProxy::ignore):
2018         * UIProcess/WebFramePolicyListenerProxy.h:
2019         * UIProcess/WebFrameProxy.cpp:
2020         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
2021         * UIProcess/WebFrameProxy.h:
2022         * UIProcess/WebPageProxy.cpp:
2023         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2024         (WebKit::WebPageProxy::receivedPolicyDecision):
2025         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2026         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2027         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2028         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2029         * UIProcess/WebPageProxy.h:
2030         * WebKit.xcodeproj/project.pbxproj:
2031         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2032         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2033         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2034         * WebProcess/WebPage/WebFrame.cpp:
2035         (WebKit::WebFrame::didReceivePolicyDecision):
2036         (WebKit::toPolicyAction): Deleted.
2037         * WebProcess/WebPage/WebFrame.h:
2038         * WebProcess/WebPage/WebPage.cpp:
2039         (WebKit::WebPage::didReceivePolicyDecision):
2040         * WebProcess/WebPage/WebPage.h:
2041
2042 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
2043
2044         [iOS] Add logging of calls
2045         https://bugs.webkit.org/show_bug.cgi?id=193784
2046
2047         Reviewed by Brent Fulgham.
2048
2049         Add permissive logging of calls on iOS.
2050
2051         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2052
2053 2019-01-25  Chris Dumez  <cdumez@apple.com>
2054
2055         Regression(PSON?) Crash under NavigationState::NavigationClient::decidePolicyForNavigationAction()
2056         https://bugs.webkit.org/show_bug.cgi?id=193779
2057         <rdar://problem/46170903>
2058
2059         Reviewed by Antti Koivisto.
2060
2061         * UIProcess/Cocoa/NavigationState.mm:
2062         (WebKit::tryAppLink):
2063         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2064         We were crashing when trying to get the URL of the main frame, which was sad because we never
2065         ended up using the main frame URL. Therefore, this patch drops the code in question.
2066
2067         * UIProcess/ProvisionalPageProxy.cpp:
2068         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2069         Add assertion to make sure that the DecidePolicyForNavigationActionAsync IPC it is getting
2070         from the process is related to its main frame.
2071
2072 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2073
2074         Need a way for JavaScript (or bundle) code to participate in undo
2075         https://bugs.webkit.org/show_bug.cgi?id=190009
2076         <rdar://problem/44807048>
2077
2078         Reviewed by Ryosuke Niwa.
2079
2080         Invalidate undo steps when removing them from WebPage. Invalidation is a no-op for editing actions that come
2081         from the UA, but for custom undo steps backed by an UndoItem, we clear out the custom undo step's pointer to its
2082         UndoItem and additionally disconnect the UndoItem from its UndoManager.
2083
2084         * WebProcess/WebPage/WebPage.cpp:
2085         (WebKit::WebPage::addWebUndoStep):
2086         (WebKit::WebPage::removeWebEditCommand):
2087         * WebProcess/WebPage/WebUndoStep.h:
2088         (WebKit::WebUndoStep::invalidate):
2089
2090 2019-01-25  Patrick Griffis  <pgriffis@igalia.com>
2091
2092         [GTK][WPE] Add API to add paths to sandbox
2093         https://bugs.webkit.org/show_bug.cgi?id=193571
2094
2095         This allows applications to add paths to the web process
2096         if required by web extensions.
2097
2098         Reviewed by Michael Catanzaro.
2099
2100         * UIProcess/API/glib/WebKitWebContext.cpp:
2101         (webkit_web_context_add_path_to_sandbox):
2102         * UIProcess/API/gtk/WebKitWebContext.h:
2103         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2104         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
2105         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2106         (WebKit::bubblewrapSpawn):
2107         * UIProcess/WebProcessPool.h:
2108         * UIProcess/glib/WebProcessProxyGLib.cpp:
2109         (WebKit::WebProcessProxy::platformGetLaunchOptions):
2110
2111 2019-01-24  Ryosuke Niwa  <rniwa@webkit.org>
2112
2113         iOS: Split keyboard should not shrink visualViewport.height
2114         https://bugs.webkit.org/show_bug.cgi?id=193798
2115
2116         Reviewed by Tim Horton.
2117
2118         Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.
2119
2120         No new tests since while it's possible to transition between split and merged keyboard using some SPI,
2121         there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.
2122
2123         * Platform/spi/ios/UIKitSPI.h:
2124         * UIProcess/API/Cocoa/WKWebView.mm:
2125         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
2126
2127 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
2128
2129         [iOS] Silence MediaPlayer compile warnings
2130         https://bugs.webkit.org/show_bug.cgi?id=193780
2131         <rdar://problem/47518428>
2132
2133         Reviewed by Jer Noble.
2134
2135         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2136
2137 2019-01-24  Truitt Savell  <tsavell@apple.com>
2138
2139         Unreviewed, rolling out r240446.
2140
2141         Casued 5 API failures
2142
2143         Reverted changeset:
2144
2145         "Activate the WebResourceLoadStatisticsStore in the
2146         NetworkProcess and deactivate it in the UIProcess."
2147         https://bugs.webkit.org/show_bug.cgi?id=193297
2148         https://trac.webkit.org/changeset/240446
2149
2150 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
2151
2152         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
2153         https://bugs.webkit.org/show_bug.cgi?id=193297
2154         <rdar://problem/47158841>
2155
2156         Reviewed by Alex Christensen.
2157
2158         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
2159         it off in the UIProcess. It also updates test infrastructure to work with this change
2160         in architecture.
2161
2162         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2163         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
2164         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
2165         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
2166         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2167         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
2168         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
2169         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
2170         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2171         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
2172         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
2173         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2174         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2175         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
2176         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
2177         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
2178         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2179         * NetworkProcess/NetworkSession.cpp:
2180         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
2181         * UIProcess/WebProcessPool.cpp:
2182         (WebKit::WebProcessPool::ensureNetworkProcess):
2183         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2184         (WebKit::WebsiteDataStore::parameters):
2185         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2186         (WebKit::WebsiteDataStore::removeData):
2187         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2188         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2189         * Webprocess/WebProcess.cpp:
2190         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
2191
2192 2019-01-24  John Wilander  <wilander@apple.com>
2193
2194         Add Ad Click Attribution as an internal/experimental feature
2195         https://bugs.webkit.org/show_bug.cgi?id=193685
2196         <rdar://problem/47450399>
2197
2198         Reviewed by Brent Fulgham.
2199
2200         * Shared/WebPreferences.yaml:
2201             Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
2202
2203 2019-01-24  Antti Koivisto  <antti@apple.com>
2204
2205         [PSON] Flash on back navigation on Mac
2206         https://bugs.webkit.org/show_bug.cgi?id=193716
2207         <rdar://problem/47148458>
2208
2209         Reviewed by Chris Dumez.
2210
2211         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
2212
2213         * UIProcess/SuspendedPageProxy.cpp:
2214         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2215         (WebKit::SuspendedPageProxy::close):
2216
2217         Track closed state so we don't send the message twice, causing unhandled message errors in web process.
2218
2219         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
2220
2221         Close the suspended page if the suspension fails.
2222         Skip this if we are using web process side compositing on Mac.
2223
2224         * UIProcess/SuspendedPageProxy.h:
2225         * UIProcess/WebPageProxy.cpp:
2226         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2227
2228         On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
2229
2230         * UIProcess/WebProcessPool.cpp:
2231         (WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
2232         * UIProcess/WebProcessPool.h:
2233         * WebProcess/WebPage/WebPage.cpp:
2234         (WebKit::WebPage::suspendForProcessSwap):
2235
2236         Don't close the page on suspension failure. This is now managed by the UI process.
2237
2238 2019-01-24  Chris Dumez  <cdumez@apple.com>
2239
2240         Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
2241         https://bugs.webkit.org/show_bug.cgi?id=193761
2242         <rdar://problem/47456405>
2243
2244         Reviewed by Alex Christensen.
2245
2246         When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
2247         to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
2248         navigate to the expected back/forward list item.
2249
2250         WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
2251         toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
2252         BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).
2253
2254         Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
2255         (processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
2256         its constructor like so:
2257         `{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`
2258
2259         However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
2260         applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
2261         Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
2262         calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
2263         to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
2264         by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.
2265
2266         This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
2267         of subframes could end up as the WebBackForwardListItem's mainframe URL.
2268
2269         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2270         (WebKit::applyFrameState):
2271         Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
2272         Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.
2273
2274 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
2275
2276         Move FileSystem to WTF
2277         https://bugs.webkit.org/show_bug.cgi?id=193602
2278
2279         Reviewed by Yusuke Suzuki.
2280
2281         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
2282         * NetworkProcess/NetworkDataTaskBlob.h:
2283         * NetworkProcess/NetworkProcess.cpp:
2284         * NetworkProcess/cache/CacheStorageEngine.cpp:
2285         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2286         * NetworkProcess/cache/NetworkCache.cpp:
2287         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2288         * NetworkProcess/cache/NetworkCacheData.cpp:
2289         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2290         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2291         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2292         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2293         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2294         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2295         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2296         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2297         * NetworkProcess/mac/NetworkProcessMac.mm:
2298         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2299         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2300         * Shared/PersistencyUtils.cpp:
2301         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
2302         * Shared/Plugins/unix/PluginSearchPath.cpp:
2303         * Shared/WebMemorySampler.h:
2304         * Shared/glib/ProcessExecutablePathGLib.cpp:
2305         * Shared/ios/ChildProcessIOS.mm:
2306         * Shared/mac/ChildProcessMac.mm:
2307         * Shared/mac/SandboxExtensionMac.mm:
2308         * UIProcess/API/APIContentRuleListStore.cpp:
2309         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2310         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2311         * UIProcess/API/glib/IconDatabase.cpp:
2312         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
2313         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
2314         * UIProcess/API/glib/WebKitWebContext.cpp:
2315         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2316         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
2317         * UIProcess/Automation/WebAutomationSession.cpp:
2318         * UIProcess/Cocoa/DownloadClient.mm:
2319         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2320         * UIProcess/Cocoa/WebViewImpl.mm:
2321         * UIProcess/DeviceIdHashSaltStorage.cpp:
2322         * UIProcess/Downloads/DownloadProxy.cpp:
2323         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2324         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2325         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
2326         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2327         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
2328         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2329         * UIProcess/ServiceWorkerProcessProxy.cpp:
2330         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
2331         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2332         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2333         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2334         * UIProcess/glib/WebProcessProxyGLib.cpp:
2335         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2336         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2337         * UIProcess/ios/WKContentViewInteraction.mm:
2338         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2339         * UIProcess/mac/WebPageProxyMac.mm:
2340         * UIProcess/win/WebProcessPoolWin.cpp:
2341         * UIProcess/win/WebView.cpp:
2342         * UIProcess/wpe/WebProcessPoolWPE.cpp:
2343         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
2344         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
2345         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
2346         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2347         * WebProcess/Plugins/PluginProcessConnection.cpp:
2348         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2349         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
2350         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
2351         * WebProcess/cocoa/WebProcessCocoa.mm:
2352
2353 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
2354
2355         Create "frame hosting" nodes for the scrolling tree
2356         https://bugs.webkit.org/show_bug.cgi?id=193753
2357
2358         Reviewed by Antti Koivisto.
2359
2360         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
2361         require the iframe's scrolling node to get reparented in a new ancestor, which requires
2362         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
2363
2364         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
2365         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
2366         to provide a consistent parent node for the subframe's scrolling node.
2367
2368         This patch adds the node types, but does not instantiate them yet.
2369
2370         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2371         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
2372         (ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
2373         (WebKit::encodeNodeAndDescendants):
2374         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2375         (WebKit::dump):
2376         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2377         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2378         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2379         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
2380         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2381         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2382
2383 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
2384
2385         [Curl] Unreviewed build fix for r240292 and friends.
2386
2387         WinCairo test stability must be restored in subsequent patch.
2388
2389         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2390         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2391         (WebKit::NetworkProcess::setNetworkProxySettings):
2392
2393 2019-01-23  Commit Queue  <commit-queue@webkit.org>
2394
2395         Unreviewed, rolling out r240403.
2396         https://bugs.webkit.org/show_bug.cgi?id=193757
2397
2398         "Causes multiple crashes on macOS port (probably used wrong
2399         ENABLE macro)" (Requested by ddkilzer on #webkit).
2400
2401         Reverted changeset:
2402
2403         "[Curl] Unreviewed build fix for r240292 and friends."
2404         https://trac.webkit.org/changeset/240403
2405
2406 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
2407
2408         [Curl] Unreviewed build fix for r240292 and friends.
2409
2410         WinCairo test stability must be restored in subsequent patch.
2411
2412         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2413         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2414         (WebKit::NetworkProcess::setNetworkProxySettings):
2415
2416 2019-01-23  Alex Christensen  <achristensen@webkit.org>
2417
2418         Stop using NetworkProcess::singleton
2419         https://bugs.webkit.org/show_bug.cgi?id=193700
2420
2421         Reviewed by Don Olmstead.
2422
2423         This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.
2424
2425         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
2426         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2427         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
2428         * NetworkProcess/NetworkProcess.cpp:
2429         (WebKit::NetworkProcess::NetworkProcess):
2430         (WebKit::NetworkProcess::singleton): Deleted.
2431         * NetworkProcess/NetworkProcess.h:
2432         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
2433         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
2434         * NetworkProcess/win/NetworkProcessMainWin.cpp:
2435         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
2436         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2437         (WebKit::initializeChildProcess):
2438         (WebKit::XPCServiceInitializer):
2439
2440 2019-01-23  Ryan Haddad  <ryanhaddad@apple.com>
2441
2442         Unreviewed, rolling out r240343.
2443
2444         Caused 4 PSON API test failures.
2445
2446         Reverted changeset:
2447
2448         "[PSON] Flash on back navigation on Mac"
2449         https://bugs.webkit.org/show_bug.cgi?id=193716
2450         https://trac.webkit.org/changeset/240343
2451
2452 2019-01-23  Chris Dumez  <cdumez@apple.com>
2453
2454         Deprecate API to limit the maximum number of WebProcesses
2455         https://bugs.webkit.org/show_bug.cgi?id=193725
2456         <rdar://problem/47464879>
2457
2458         Reviewed by Geoff Garen.
2459
2460         Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
2461         complexity and is not safe (conflicts with PSON).
2462
2463         Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
2464         Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
2465         Note that enabling the single WebProcess mode will disable PSON and process prewarming.
2466
2467         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2468         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2469         (API::ProcessPoolConfiguration::copy):
2470         * UIProcess/API/APIProcessPoolConfiguration.h:
2471         * UIProcess/API/C/WKContext.cpp:
2472         (WKContextSetMaximumNumberOfProcesses):
2473         (WKContextGetMaximumNumberOfProcesses):
2474         * UIProcess/API/C/WKContext.h:
2475         * UIProcess/API/Cocoa/WKProcessPool.mm:
2476         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2477         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2478         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2479         (-[_WKProcessPoolConfiguration maximumProcessCount]):
2480         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
2481         (-[_WKProcessPoolConfiguration usesSingleWebProcess]):
2482         (-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
2483         (-[_WKProcessPoolConfiguration description]):
2484         * UIProcess/API/glib/WebKitWebContext.cpp:
2485         (webkitWebContextConstructed):
2486         (webkit_web_context_set_process_model):
2487         (webkit_web_context_set_web_process_count_limit):
2488         * UIProcess/WebProcessPool.cpp:
2489         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2490         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
2491         (WebKit::WebProcessPool::processForNavigationInternal):
2492         * UIProcess/WebProcessPool.h:
2493
2494 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
2495
2496         Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
2497         https://bugs.webkit.org/show_bug.cgi?id=193659
2498         <rdar://problem/47433290>
2499
2500         Reviewed by Alex Christensen.
2501
2502         Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
2503         'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
2504         consistent, and should reduce the possibility of bookkeeping errors in the message handling
2505         implementations.
2506
2507         Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
2508         (and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
2509         'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.
2510
2511         This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
2512         'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
2513         a connection is established to the network process, causing initialization messages to get dropped
2514         leading to test system flakiness.
2515
2516         Finally: The WK API test code was updated to ensure that completion handlers are always called, even
2517         when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.
2518
2519         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2520         * NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
2521         * NetworkProcess/Classifier/StorageAccessStatus.h: Added.
2522         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2523         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2524         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2525         * NetworkProcess/NetworkProcess.cpp:
2526         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
2527         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
2528         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
2529         (WebKit::NetworkProcess::hasStorageAccessForFrame):
2530         (WebKit::NetworkProcess::requestStorageAccess):
2531         (WebKit::NetworkProcess::grantStorageAccess):
2532         (WebKit::NetworkProcess::removeAllStorageAccess):
2533         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
2534         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
2535         (WebKit::NetworkProcess::deleteWebsiteData):
2536         * NetworkProcess/NetworkProcess.h:
2537         * NetworkProcess/NetworkProcess.messages.in:
2538         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2539         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2540         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2541         (WKWebsiteDataStoreStatisticsResetToConsistentState):
2542         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2543         * UIProcess/Network/NetworkProcessProxy.cpp:
2544         (WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
2545         is now autogenerated.
2546         (WebKit::NetworkProcessProxy::didClose): Ditto.
2547         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
2548         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
2549         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
2550         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
2551         (WebKit::NetworkProcessProxy::requestStorageAccess):
2552         (WebKit::NetworkProcessProxy::grantStorageAccess):
2553         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
2554         (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
2555         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
2556         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
2557         (WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
2558         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
2559         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
2560         (WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
2561         (WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
2562         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
2563         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
2564         * UIProcess/Network/NetworkProcessProxy.h:
2565         * UIProcess/Network/NetworkProcessProxy.messages.in:
2566         * UIProcess/WebPageProxy.cpp:
2567         * UIProcess/WebProcessPool.cpp:
2568         (WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
2569         to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
2570         causing initialization messages to get dropped.
2571         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
2572         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2573         (WebKit::WebsiteDataStore::removeData):
2574         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
2575         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
2576         (WebKit::WebsiteDataStore::setGrandfatheringTime):
2577         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
2578         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
2579         (WebKit::WebsiteDataStore::setPrevalentResource):
2580         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2581         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
2582         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
2583         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
2584         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
2585         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
2586         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
2587         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
2588         * UIProcess/WebsiteData/WebsiteDataStore.h:
2589         * WebKit.xcodeproj/project.pbxproj:
2590
2591 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
2592
2593         Clean up IndexedDB files between tests
2594         https://bugs.webkit.org/show_bug.cgi?id=192796
2595         <rdar://problem/46824999>
2596
2597         Reviewed by Geoffrey Garen.
2598
2599         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2600         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
2601         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2602
2603 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2604
2605         [iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
2606         https://bugs.webkit.org/show_bug.cgi?id=193182
2607         <rdar://problem/47452154>
2608
2609         Reviewed by Tim Horton.
2610
2611         Fix an existing bug where blurring an element doesn't always un-suppress text interactions.
2612
2613         * UIProcess/ios/WKContentViewInteraction.mm:
2614         (-[WKContentView _elementDidBlur]):
2615
2616 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2617
2618         Minor improvements to NetworkProcess
2619         https://bugs.webkit.org/show_bug.cgi?id=193708
2620
2621         Reviewed by Alex Christensen.
2622
2623         * NetworkProcess/NetworkProcess.cpp:
2624         (WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
2625         (WebKit::NetworkProcess::ensureSession): Add useful assertion.
2626         (WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
2627         (WebKit::NetworkProcess::destroySession): Add useful assertion.
2628         * NetworkProcess/NetworkProcess.h:
2629         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2630         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2631         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2632         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2633         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2634         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2635
2636 2019-01-23  Daniel Bates  <dabates@apple.com>
2637
2638         Fix the Apple Internal build. See <rdar://problem/47486758>.
2639
2640         * UIProcess/ios/WKContentViewInteraction.mm:
2641         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
2642
2643 2019-01-23  Per Arne Vollan  <pvollan@apple.com>
2644
2645         [macOS] Sandbox fails to compile
2646         https://bugs.webkit.org/show_bug.cgi?id=193727
2647         <rdar://problem/47476903>
2648
2649         Reviewed by Brent Fulgham.
2650
2651         Use '(with send-signal SIGKILL)' instead of '(with termination)'.
2652
2653         * WebProcess/com.apple.WebProcess.sb.in:
2654
2655 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
2656
2657         REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
2658         https://bugs.webkit.org/show_bug.cgi?id=193723
2659         <rdar://problem/47476802>
2660
2661         Reviewed by David Kilzer.
2662
2663         The new code added in r240243 could attempt to submit telemetry after the relevant
2664         WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
2665
2666         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
2667         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
2668
2669 2019-01-23  Antti Koivisto  <antti@apple.com>
2670
2671         [PSON] Flash on back navigation on Mac
2672         https://bugs.webkit.org/show_bug.cgi?id=193716
2673         <rdar://problem/47148458>
2674
2675         Reviewed by Chris Dumez.
2676
2677         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
2678
2679         * UIProcess/SuspendedPageProxy.cpp:
2680         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
2681
2682         Remove the suspended page (so closing it on web process side) if the suspension fails.
2683         Skip this if we are using web process side compositing on Mac.
2684
2685         * UIProcess/WebPageProxy.cpp:
2686         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2687
2688         On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
2689
2690         * UIProcess/WebProcessPool.cpp:
2691         (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
2692         * UIProcess/WebProcessPool.h:
2693         * WebProcess/WebPage/WebPage.cpp:
2694         (WebKit::WebPage::suspendForProcessSwap):
2695
2696         Don't close the page on suspension failure.
2697
2698 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2699
2700         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
2701         https://bugs.webkit.org/show_bug.cgi?id=193706
2702         <rdar://problem/44807048>
2703
2704         Reviewed by Ryosuke Niwa.
2705
2706         * UIProcess/Cocoa/WebViewImpl.mm:
2707         (WebKit::WebViewImpl::registerEditCommand):
2708         * UIProcess/WebEditCommandProxy.cpp:
2709         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
2710         * UIProcess/WebEditCommandProxy.h:
2711
2712         Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
2713         Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
2714         argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.
2715
2716         (WebKit::WebEditCommandProxy::create):
2717         (WebKit::WebEditCommandProxy::label const):
2718         (WebKit::WebEditCommandProxy::invalidate):
2719         (WebKit::WebEditCommandProxy::editAction const): Deleted.
2720
2721         Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.
2722
2723         * UIProcess/WebPageProxy.cpp:
2724         (WebKit::WebPageProxy::registerEditCommandForUndo):
2725         (WebKit::WebPageProxy::resetState):
2726
2727         Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
2728         and then iterating over the Vector.
2729
2730         * UIProcess/WebPageProxy.h:
2731         * UIProcess/WebPageProxy.messages.in:
2732
2733         Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.
2734
2735         * UIProcess/ios/PageClientImplIOS.mm:
2736         (WebKit::PageClientImpl::registerEditCommand):
2737         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2738         (WebKit::WebEditorClient::registerUndoStep):
2739
2740 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2741
2742         [SOUP] Remove libsoup cruft from WebProcess
2743         https://bugs.webkit.org/show_bug.cgi?id=193710
2744
2745         Reviewed by Carlos Garcia Campos.
2746
2747         SoupNetworkSession is no longer accessible from the web process because it's owned
2748         (indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
2749         code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
2750         removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
2751         WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there
2752
2753         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
2754         (AsyncReadData::AsyncReadData):
2755         (webkitSoupRequestInputStreamReadAsyncResultComplete):
2756         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
2757         (webkitSoupRequestInputStreamHasDataToRead):
2758         (webkitSoupRequestInputStreamIsWaitingForData):
2759         (webkitSoupRequestInputStreamReadAsync):
2760         (webkitSoupRequestInputStreamReadFinish):
2761         (webkitSoupRequestInputStreamFinalize):
2762         (webkit_soup_request_input_stream_init):
2763         (webkit_soup_request_input_stream_class_init):
2764         (webkitSoupRequestInputStreamNew):
2765         (webkitSoupRequestInputStreamAddData):
2766         (webkitSoupRequestInputStreamDidFailWithError):
2767         (webkitSoupRequestInputStreamFinished):
2768         * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
2769         * SourcesGTK.txt:
2770         * SourcesWPE.txt:
2771         * UIProcess/soup/WebProcessPoolSoup.cpp:
2772         (WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
2773         * WebProcess/WebProcess.h:
2774         * WebProcess/WebProcess.messages.in:
2775         * WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
2776         (WebKit::WebProcess::platformSetCacheModel):
2777         (WebKit::WebProcess::platformInitializeWebProcess):
2778         (WebKit::WebProcess::platformTerminate):
2779
2780 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2781
2782         [SOUP] Clean up NetworkStorageSession
2783         https://bugs.webkit.org/show_bug.cgi?id=193707
2784
2785         Reviewed by Carlos Garcia Campos.
2786
2787         Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
2788         adapt to NetworkStorageSessions API changes.
2789
2790         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
2791         (WebKit::LegacyCustomProtocolManager::registerScheme):
2792         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
2793         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2794         (WebKit::NetworkProcess::userPreferredLanguagesChanged):
2795         (WebKit::NetworkProcess::setNetworkProxySettings):
2796         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2797         (WebKit::NetworkSessionSoup::soupSession const):
2798
2799 2019-01-23  Philippe Normand  <pnormand@igalia.com>
2800
2801         [GTK] Crash when browsing inspector:// uri without port set
2802         https://bugs.webkit.org/show_bug.cgi?id=193721
2803
2804         Reviewed by Michael Catanzaro.
2805
2806         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2807         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
2808         back to caller after setting the error, if no port was provided
2809         along with the inspector URL.
2810
2811 2019-01-23  David Kilzer  <ddkilzer@apple.com>
2812
2813         Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
2814         <https://webkit.org/b/193694>
2815         <rdar://problem/47464025>
2816
2817         Reviewed by Tim Horton.
2818
2819         * Shared/ios/WebIconUtilities.mm:
2820         - Switch to using CoreMediaSoftLink.{h,mm} in PAL.
2821
2822 2019-01-22  Chris Dumez  <cdumez@apple.com>
2823
2824         Regression(r240178) Some API tests are crashing
2825         https://bugs.webkit.org/show_bug.cgi?id=193680
2826
2827         Reviewed by Alex Christensen.
2828
2829         r240178 made sure that userScripts / scriptMessageHandlers / contentExtensions are always
2830         properly populated in the WebPageCreationParameters. This was needed in case we need to
2831         reconstruct the WebUserContentController on the WebProcess side. However, this caused a
2832         regression in the case we reuse a process where the WebUserContentController still exists
2833         (because it was kept alive, e.g. by the WebPageGroup). In that case, we would add duplicate
2834         entries to the existing WebUserContentController instance because its "add" methods did not
2835         have duplicate checks. To address the issue, this patch adds duplicate checks to the
2836         WebUserContentController "add" methods.
2837
2838         * WebProcess/UserContent/WebUserContentController.cpp:
2839         (WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
2840         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
2841         (WebKit::WebUserContentController::addUserScriptInternal):
2842         (WebKit::WebUserContentController::removeUserScriptInternal):
2843         (WebKit::WebUserContentController::addUserStyleSheetInternal):
2844         (WebKit::WebUserContentController::removeUserStyleSheetInternal):
2845         (WebKit::WebUserContentController::forEachUserMessageHandler const):
2846         * WebProcess/UserContent/WebUserContentController.h:
2847
2848 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2849
2850         Unreviewed attempt to fix GTK/WPE bots
2851         https://bugs.webkit.org/show_bug.cgi?id=193580
2852         <rdar://problem/47457742>
2853
2854         Doesn't make sense to clear the storage session right after creating it. This should fix
2855         network process crash on startup under G_DEBUG=fatal-criticals due to the storage session
2856         not having a cookie jar.
2857
2858         * NetworkProcess/NetworkProcess.cpp:
2859         (WebKit::NetworkProcess::NetworkProcess):
2860
2861 2019-01-22  Megan Gardner  <megan_gardner@apple.com>
2862
2863         Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
2864         https://bugs.webkit.org/show_bug.cgi?id=193687
2865         <rdar://problem/47056717>
2866
2867         Reviewed by Tim Horton.
2868
2869         Cancel web gestures when a long press is recognized.
2870
2871         * Platform/spi/ios/UIKitSPI.h:
2872         * UIProcess/ios/WKContentViewInteraction.mm:
2873         (-[WKContentView _cancelWebGestureRecognizer]):
2874         (-[WKContentView _longPressRecognized:]):
2875
2876 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2877
2878         Fix an internal build failure after r240292
2879         https://bugs.webkit.org/show_bug.cgi?id=193580
2880
2881         Rubber-stamped by Wenson Hsieh.
2882
2883         * SourcesCocoa.txt:
2884         * UIProcess/mac/WebContextMenuProxyMac.mm:
2885         (-[WKMenuTarget forwardContextMenuAction:]):
2886         * WebKit.xcodeproj/project.pbxproj:
2887         It was apparently unclear to the compiler sometimes which "state" selector to use, and this apparently mattered.
2888         Tell the compiler to use the NSMenuItem selector, but at runtime it doesn't matter.
2889
2890 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2891
2892         Unreviewed, fix -Wunused-but-set-variable warning
2893         https://bugs.webkit.org/show_bug.cgi?id=193660
2894         <rdar://problem/47433602>
2895
2896         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2897         (WebKit::WebsiteDataStore::removeData):
2898
2899 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2900
2901         Unreviewed, further build fixes after r240292
2902         https://bugs.webkit.org/show_bug.cgi?id=193580
2903         <rdar://problem/47457742>
2904
2905         Oops.
2906
2907         * NetworkProcess/NetworkProcess.cpp:
2908         (WebKit::NetworkProcess::defaultStorageSession const):
2909
2910 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2911
2912         Unreviewed, further build fixes after r240292
2913         https://bugs.webkit.org/show_bug.cgi?id=193580
2914         <rdar://problem/47457742>
2915
2916         This builds for libsoup. Doesn't work, but at least builds.
2917
2918         Also, speculative fixes for curl.
2919
2920         * NetworkProcess/NetworkProcess.cpp:
2921         (WebKit::NetworkProcess::defaultStorageSession const):
2922
2923 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2924
2925         Unreviewed, further build fixes after r240292
2926         https://bugs.webkit.org/show_bug.cgi?id=193580
2927         <rdar://problem/47457742>
2928
2929         Still not working yet.
2930
2931         * NetworkProcess/NetworkProcess.cpp:
2932         (WebKit::NetworkProcess::NetworkProcess):
2933         * UIProcess/API/APIHTTPCookieStore.h:
2934
2935 2019-01-22  Antti Koivisto  <antti@apple.com>
2936
2937         [iOS] Flash when swiping back to Google search result page
2938         https://bugs.webkit.org/show_bug.cgi?id=193668
2939         <rdar://problem/47071684>
2940
2941         Reviewed by Simon Fraser.
2942
2943         If the google page is scrolled, there is sometimes a short flash.
2944
2945         When restoring the page state we also restore exposedContentRect which is used to determine
2946         which part of the page to create layers for. Scroll position is restored by the UI process
2947         later so we rely on this to get the right layers for the initial view update.
2948
2949         A viewport configuration update may sometimes trample over the restored exposedContentRect,
2950         moving it to top left. In this case the initial layer tree unfreeze commit may not have
2951         layers to cover the actual visible view position.
2952
2953         * WebProcess/WebPage/WebPage.cpp:
2954         (WebKit::WebPage::didCommitLoad):
2955         * WebProcess/WebPage/WebPage.h:
2956         * WebProcess/WebPage/ios/WebPageIOS.mm:
2957         (WebKit::WebPage::restorePageState):
2958
2959         Set a bit to indicate we have already restored the exposedContentRect.
2960
2961         (WebKit::WebPage::viewportConfigurationChanged):
2962
2963         Only reset exposedContentRect if wasn't already set by restorePageState.
2964
2965 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2966
2967         Fix more builds.
2968
2969         * SourcesCocoa.txt:
2970         * WebKit.xcodeproj/project.pbxproj:
2971
2972 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2973
2974         Another build fix after r240292
2975         https://bugs.webkit.org/show_bug.cgi?id=193580
2976         <rdar://problem/47457742>
2977
2978         Unreviewed, still not enough to fix soup builds, but closer.
2979
2980         * UIProcess/API/APIHTTPCookieStore.h:
2981
2982 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2983
2984         Fix some builds after r240292
2985         https://bugs.webkit.org/show_bug.cgi?id=193580
2986
2987         * NetworkProcess/NetworkProcess.cpp:
2988         (WebKit::NetworkProcess::switchToNewTestingSession):
2989         * NetworkProcess/cache/NetworkCache.cpp:
2990         (WebKit::NetworkCache::Cache::retrieve):
2991
2992 2019-01-22  Brian Burg  <bburg@apple.com>
2993
2994         Automation.computeElementLayout should return visual viewport-aware coordinates
2995         https://bugs.webkit.org/show_bug.cgi?id=193598
2996         <rdar://problem/35325644>
2997
2998         Unreviewed, restore a mistakenly-deleted line whose absence causes hangs.
2999
3000         * Shared/CoordinateSystem.h:
3001
3002 2019-01-22  Alex Christensen  <achristensen@webkit.org>
3003
3004         Move NetworkStorageSession ownership to NetworkProcess
3005         https://bugs.webkit.org/show_bug.cgi?id=193580
3006
3007         Reviewed by Geoff Garen.
3008
3009         * NetworkProcess/Cookies/WebCookieManager.cpp:
3010         (WebKit::WebCookieManager::WebCookieManager):
3011         (WebKit::WebCookieManager::getHostnamesWithCookies):
3012         (WebKit::WebCookieManager::deleteCookiesForHostname):
3013         (WebKit::WebCookieManager::deleteAllCookies):
3014         (WebKit::WebCookieManager::deleteCookie):
3015         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
3016         (WebKit::WebCookieManager::getAllCookies):
3017         (WebKit::WebCookieManager::getCookies):
3018         (WebKit::WebCookieManager::setCookie):
3019         (WebKit::WebCookieManager::setCookies):
3020         (WebKit::WebCookieManager::startObservingCookieChanges):
3021         (WebKit::WebCookieManager::stopObservingCookieChanges):
3022         * NetworkProcess/Cookies/WebCookieManager.h:
3023         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
3024         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3025         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3026         (WebKit::storageSession):
3027         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3028         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
3029         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
3030         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
3031         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
3032         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
3033         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
3034         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
3035         * NetworkProcess/NetworkProcess.cpp:
3036         (WebKit::NetworkProcess::initializeNetworkProcess):
3037         (WebKit::NetworkProcess::clearCachedCredentials):
3038         (WebKit::NetworkProcess::switchToNewTestingSession):
3039         (WebKit::NetworkProcess::ensureSession):
3040         (WebKit::NetworkProcess::storageSession const):
3041         (WebKit::NetworkProcess::defaultStorageSession const):
3042         (WebKit::NetworkProcess::forEachNetworkStorageSession):
3043         (WebKit::NetworkProcess::destroySession):
3044         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
3045         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
3046         (WebKit::NetworkProcess::hasStorageAccessForFrame):
3047         (WebKit::NetworkProcess::getAllStorageAccessEntries):
3048         (WebKit::NetworkProcess::grantStorageAccess):
3049         (WebKit::NetworkProcess::removeAllStorageAccess):
3050         (WebKit::NetworkProcess::removePrevalentDomains):
3051         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
3052         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
3053         (WebKit::NetworkProcess::fetchWebsiteData):
3054         (WebKit::NetworkProcess::deleteWebsiteData):
3055         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
3056         * NetworkProcess/NetworkProcess.h:
3057         * NetworkProcess/NetworkResourceLoader.cpp:
3058         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
3059         (WebKit::NetworkResourceLoader::logCookieInformation const):
3060         * NetworkProcess/NetworkSession.cpp:
3061         (WebKit::NetworkSession::networkStorageSession const):
3062         * NetworkProcess/NetworkStorageSessionProvider.h:
3063         * NetworkProcess/cache/NetworkCache.cpp:
3064         (WebKit::NetworkCache::makeUseDecision):
3065         (WebKit::NetworkCache::Cache::retrieve):
3066         (WebKit::NetworkCache::Cache::makeEntry):
3067         (WebKit::NetworkCache::Cache::makeRedirectEntry):
3068         (WebKit::NetworkCache::Cache::update):
3069         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3070         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
3071         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3072         (WebKit::NetworkProcess::platformSyncAllCookies):
3073         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3074         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3075         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3076         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3077         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3078         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3079         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3080         * SourcesCocoa.txt:
3081         * UIProcess/API/APIHTTPCookieStore.cpp:
3082         (API::HTTPCookieStore::~HTTPCookieStore):
3083         (API::HTTPCookieStore::cookies):
3084         (API::HTTPCookieStore::setCookie):
3085         (API::HTTPCookieStore::deleteCookie):
3086         (API::HTTPCookieStore::registerObserver):
3087         (API::HTTPCookieStore::unregisterObserver):
3088         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
3089         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
3090         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
3091         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
3092         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
3093         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
3094         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
3095         * UIProcess/API/APIHTTPCookieStore.h:
3096         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: Added.
3097         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
3098         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
3099         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
3100         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
3101         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
3102         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
3103         * UIProcess/WebProcessPool.cpp:
3104         (WebKit::WebProcessPool::clearCachedCredentials):
3105         * WebKit.xcodeproj/project.pbxproj:
3106         * WebProcess/Plugins/PluginView.cpp:
3107         (WebKit::PluginView::getAuthenticationInfo):
3108         * WebProcess/WebProcess.cpp:
3109         (WebKit::WebProcess::deleteWebsiteData):
3110         (WebKit::WebProcess::clearCachedCredentials): Deleted.
3111         * WebProcess/WebProcess.h:
3112         * WebProcess/WebProcess.messages.in:
3113
3114 2019-01-22  Per Arne Vollan  <pvollan@apple.com>
3115
3116         [macOS] Adjust logging policy in WebKit's sandbox
3117         https://bugs.webkit.org/show_bug.cgi?id=193454
3118
3119         Reviewed by Brent Fulgham.
3120
3121         Add a rule to initially deny all calls, since the default is to allow every call.
3122         Later rules allow syscalls that we determined are needed for proper WebKit function.
3123         This reduces the API surface available to attackers.
3124
3125         * WebProcess/com.apple.WebProcess.sb.in:
3126
3127 2019-01-22  Daniel Bates  <dabates@apple.com>
3128
3129         [iOS] WebKit should handle shift state changes when using the software keyboard
3130         https://bugs.webkit.org/show_bug.cgi?id=191475
3131         <rdar://problem/45949246>
3132
3133         Reviewed by Brent Fulgham.
3134
3135         Implement UIKit SPI to be notified of shift state changes to the software keyboard
3136         and dispatch a synthetic keydown or keyup event for either the Shift key or Caps Lock
3137         key.
3138
3139         A side benefit of this change is that we now show and hide the caps lock indicator
3140         in a focused password field when caps lock is enabled or disabled using the software
3141         keyboard, respectively.
3142
3143         * Platform/spi/ios/UIKitSPI.h: Expose more SPI.
3144         * SourcesCocoa.txt:
3145         * UIProcess/ios/WKContentViewInteraction.mm:
3146         (-[WKContentView modifierFlagsDidChangeFrom:to:]): Create a synthetic flags changed
3147         web event based on the state change and dispatch it.
3148         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Early return if the event
3149         was a synethic flags change event so that we do not notify UIKit about this event
3150         as it does not know anything about such synthetic events.
3151         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.h: Added.
3152         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.mm: Added.
3153         (-[WKSyntheticFlagsChangedWebEvent initWithKeyCode:modifiers:keyDown:]):
3154         (-[WKSyntheticFlagsChangedWebEvent initWithCapsLockState:]):
3155         (-[WKSyntheticFlagsChangedWebEvent initWithShiftState:]):
3156         * WebKit.xcodeproj/project.pbxproj:
3157
3158 2019-01-22  Daniel Bates  <dabates@apple.com>
3159
3160         [iOS] Interpret text key commands on keydown and app key commands on keypress
3161         https://bugs.webkit.org/show_bug.cgi?id=192897
3162         <rdar://problem/46857378>
3163
3164         Reviewed by Brent Fulgham.
3165
3166         Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent
3167         is false) and keypress (isCharEvent is true), respectively.
3168
3169         * Platform/spi/ios/UIKitSPI.h: Add more SPI.
3170         * UIProcess/ios/WKContentViewInteraction.mm:
3171         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
3172
3173 2019-01-22  David Kilzer  <ddkilzer@apple.com>
3174
3175         C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
3176         <https://webkit.org/b/193607>
3177         <rdar://problem/47334613>
3178
3179         Reviewed by Alex Christensen.
3180
3181         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
3182         (WebKit::AuthenticationManager::initializeConnection):
3183         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
3184         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
3185         - Update name of constants.
3186
3187         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
3188         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
3189         - Put constant values in a namespace, and move values to
3190           ClientCertificateAuthenticationXPCConstants.cpp.
3191
3192         * SourcesCocoa.txt:
3193         * UnifiedSources-input.xcfilelist:
3194         * WebKit.xcodeproj/project.pbxproj:
3195         - Add ClientCertificateAuthenticationXPCConstants.cpp.
3196
3197 2019-01-22  David Kilzer  <ddkilzer@apple.com>
3198
3199         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
3200         <https://webkit.org/b/193654>
3201         <rdar://problem/47430290>
3202
3203         Reviewed by Alex Christensen.
3204
3205         - Moves QuickLookSoftLink.{h,mm} to PAL.
3206         - Adds soft-link to 3 classes to consolidate QuickLook.framework
3207           soft-linking.
3208         - Updates existing source to work with above changes.
3209
3210         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3211         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3212         (WebKit::SystemPreviewController::start):
3213         * UIProcess/ios/WKSystemPreviewView.mm:
3214         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
3215         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
3216
3217 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
3218
3219         [css-logical] Implement flow-relative margin, padding and border shorthands
3220         https://bugs.webkit.org/show_bug.cgi?id=188697
3221
3222         Reviewed by Simon Fraser and Antti Koivisto.
3223
3224         Add a CSSLogicalEnabled runtime flag.
3225
3226         * Shared/WebPreferences.yaml:
3227
3228 2019-01-22  Frederic Wang  <fwang@igalia.com>
3229
3230         Enable CSSOMViewScrollingAPI
3231         https://bugs.webkit.org/show_bug.cgi?id=189472
3232
3233         Reviewed by Simon Fraser.
3234
3235         This patch enables the CSSOMViewScrollingAPI option by default. This feature has already been
3236         enabled in tests since r235855. Basically, this change fixes an old compatibility issue
3237         regarding which scrolling element correspond to the viewport in standard mode (WebKit uses
3238         document.body while Gecko/Edge/Chromium use document.documentElement as described in the
3239         CSSOM View specification). WebKit developers writing tests can use document.scrollingElement
3240         for that purpose, so that they work independently of whether the option is enabled.
3241
3242         [1] https://lists.webkit.org/pipermail/webkit-dev/2018-January/029857.html
3243
3244         * Shared/WebPreferences.yaml: Enable by default and remove "experimental" category in
3245         accordance with the new policy. Instead, keep an internal flag only for developers.
3246
3247 2019-01-21  Antti Koivisto  <antti@apple.com>
3248
3249         [iOS] Handle hit testing for subframes
3250         https://bugs.webkit.org/show_bug.cgi?id=192303
3251
3252         Reviewed by Frédéric Wang.
3253
3254         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3255         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3256
3257         Only set delegatesScrolling for the main frame.
3258
3259 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
3260
3261         Unreviewed test fix after r240243
3262         Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
3263         <rdar://problem/47433602>
3264
3265         The new ResourceLoadStatistics section of 'removeData' was incrementing the
3266         pending callback count before deciding whether to send a message to delete
3267         data. This left the count out-of-balance leading to the operation never
3268         completing.
3269
3270         This patch also prevents sending a second message to the NetworkProcess
3271         requesting data be deleted if the message was already sent in an earlier
3272         section of the method (e.g., as typically happens when all website data
3273         is being deleted).
3274
3275         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3276         (WebKit::WebsiteDataStore::removeData):
3277
3278 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
3279
3280         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
3281         https://bugs.webkit.org/show_bug.cgi?id=193556
3282         <rdar://problem/47368501>
3283
3284         Reviewed by Alex Christensen.
3285
3286         This patch adds a number of sibling methods for tracking ResourceLoadStatistics when the
3287         observations are being handled in the NetworkProcess, rather than the UIProcess. The
3288         original versions of these methods will be removed as part of Bug 193303.
3289
3290         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3291         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
3292         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
3293         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
3294         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
3295         (WebKit::ResourceLoadStatisticsMemoryStore::store const):
3296         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3297         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
3298         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured):
3299         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3300         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
3301         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
3302         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
3303         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
3304         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
3305         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3306         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3307         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3308         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
3309         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3310         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
3311         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
3312         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
3313         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
3314         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
3315         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
3316         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3317         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
3318         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
3319         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3320         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3321         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3322         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
3323         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
3324         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
3325         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
3326         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
3327         (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
3328         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
3329         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
3330         (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
3331         (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
3332         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3333         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
3334         (WebKit::submitTopList):
3335         (WebKit::submitTopLists):
3336         (WebKit::notifyPages):
3337         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
3338         (WebKit::nonEphemeralWebPageProxy): Deleted.
3339         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3340         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
3341         * NetworkProcess/NetworkConnectionToWebProcess.h:
3342         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3343         * NetworkProcess/NetworkProcess.cpp:
3344         (WebKit::NetworkProcess::dumpResourceLoadStatistics):
3345         (WebKit::NetworkProcess::isGrandfathered):
3346         (WebKit::NetworkProcess::isPrevalentResource):
3347         (WebKit::NetworkProcess::isVeryPrevalentResource):
3348         (WebKit::NetworkProcess::setGrandfathered):
3349         (WebKit::NetworkProcess::setPrevalentResource):
3350         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
3351         (WebKit::NetworkProcess::setVeryPrevalentResource):
3352         (WebKit::NetworkProcess::clearPrevalentResource):
3353         (WebKit::NetworkProcess::submitTelemetry):
3354         (WebKit::NetworkProcess::scheduleCookieBlockingUpdate):
3355         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
3356         (WebKit::NetworkProcess::resetParametersToDefaultValues):
3357         (WebKit::NetworkProcess::scheduleStatisticsAndDataRecordsProcessing):
3358         (WebKit::NetworkProcess::setNotifyPagesWhenDataRecordsWereScanned):
3359         (WebKit::NetworkProcess::setNotifyPagesWhenTelemetryWasCaptured):
3360         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
3361         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
3362         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
3363         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
3364         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
3365         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
3366         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
3367         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
3368         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
3369         (WebKit::NetworkProcess::setLastSeen):
3370         (WebKit::NetworkProcess::hasStorageAccess):
3371         (WebKit::NetworkProcess::requestStorageAccess):
3372         (WebKit::NetworkProcess::grantStorageAccess):
3373         (WebKit::NetworkProcess::logUserInteraction):
3374         (WebKit::NetworkProcess::hadUserInteraction):
3375         (WebKit::NetworkProcess::clearUserInteraction):
3376         (WebKit::NetworkProcess::setGrandfatheringTime):
3377         (WebKit::NetworkProcess::setMaxStatisticsEntries):
3378         (WebKit::NetworkProcess::setMinimumTimeBetweenDataRecordsRemoval):
3379         (WebKit::NetworkProcess::setPruneEntriesDownTo):
3380         (WebKit::NetworkProcess::setTimeToLiveUserInteraction):
3381         (WebKit::NetworkProcess::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3382         (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
3383         (WebKit::NetworkProcess::setResourceLoadStatisticsDebugMode):
3384         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
3385         (WebKit::NetworkProcess::deleteWebsiteData):
3386         (WebKit::filterForTopLevelDomains):
3387         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
3388         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
3389         * NetworkProcess/NetworkProcess.h:
3390         * NetworkProcess/NetworkProcess.messages.in:
3391         * NetworkProcess/NetworkSession.cpp:
3392         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
3393         (WebKit::NetworkSession::notifyResourceLoadStatisticsProcessed):
3394         (WebKit::NetworkSession::logDiagnosticMessageWithValue):
3395         (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
3396         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
3397         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData):
3398         (WebKit::NetworkSession::enableResourceLoadStatistics): Deleted.
3399         * NetworkProcess/NetworkSession.h:
3400         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3401         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3402         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3403         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
3404         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
3405         (WKWebsiteDataStoreSetStatisticsLastSeen):
3406         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
3407         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
3408         (WKWebsiteDataStoreDumpResourceLoadStatistics):
3409         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
3410         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
3411         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
3412         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
3413         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
3414         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
3415         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
3416         (WKWebsiteDataStoreSetStatisticsGrandfathered):
3417         (WKWebsiteDataStoreIsStatisticsGrandfathered):
3418         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
3419         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
3420         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
3421         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
3422         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
3423         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
3424         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
3425         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
3426         (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
3427         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
3428         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
3429         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
3430         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
3431         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
3432         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
3433         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
3434         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
3435         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
3436         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
3437         (WKWebsiteDataStoreStatisticsResetToConsistentState):
3438         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3439         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
3440         * UIProcess/Network/NetworkProcessProxy.cpp:
3441         (WebKit::NetworkProcessProxy::clearCallbackStates):
3442         (WebKit::NetworkProcessProxy::didClose):
3443         (WebKit::nonEphemeralWebPageProxy):
3444         (WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue):
3445         (WebKit::NetworkProcessProxy::dumpResourceLoadStatistics):
3446         (WebKit::NetworkProcessProxy::didDumpResourceLoadStatistics):
3447         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3448         (WebKit::NetworkProcessProxy::didUpdateBlockCookies):
3449         (WebKit::NetworkProcessProxy::isPrevalentResource):
3450         (WebKit::NetworkProcessProxy::isPrevalentResourceResult):
3451         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
3452         (WebKit::NetworkProcessProxy::setPrevalentResource):
3453         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
3454         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
3455         (WebKit::NetworkProcessProxy::didSetResourceLoadStatisticData):
3456         (WebKit::NetworkProcessProxy::setLastSeen):
3457         (WebKit::NetworkProcessProxy::clearPrevalentResource):
3458         (WebKit::NetworkProcessProxy::scheduleCookieBlockingUpdate):
3459         (WebKit::NetworkProcessProxy::didScheduleCookieBlockingUpdate):
3460         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
3461         (WebKit::NetworkProcessProxy::didScheduleStatisticsProcessing):
3462         (WebKit::NetworkProcessProxy::scheduleStatisticsAndDataRecordsProcessing):
3463         (WebKit::NetworkProcessProxy::logUserInteraction):
3464         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
3465         (WebKit::NetworkProcessProxy::didHaveUserInteraction):
3466         (WebKit::NetworkProcessProxy::clearUserInteraction):
3467         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
3468         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
3469         (WebKit::NetworkProcessProxy::setTimeToLiveUserInteraction):
3470         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings):
3471         (WebKit::NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured):
3472         (WebKit::NetworkProcessProxy::setNotifyPagesWhenDataRecordsWereScanned):
3473         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
3474         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
3475         (WebKit::NetworkProcessProxy::didIsRegisteredAsRedirectingTo):
3476         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
3477         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubFrameUnder):
3478         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
3479         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
3480         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubresourceUnder):
3481         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
3482         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
3483         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
3484         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
3485         (WebKit::NetworkProcessProxy::isGrandfathered):
3486         (WebKit::NetworkProcessProxy::didIsGrandfathered):
3487         (WebKit::NetworkProcessProxy::setGrandfathered):
3488         (WebKit::NetworkProcessProxy::hasStorageAccess):
3489         (WebKit::NetworkProcessProxy::requestStorageAccess):
3490         (WebKit::NetworkProcessProxy::grantStorageAccess):
3491         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
3492         (WebKit::NetworkProcessProxy::storageAccessOperationResult):
3493         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
3494         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
3495         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
3496         (WebKit::NetworkProcessProxy::setGrandfatheringTime):
3497         (WebKit::NetworkProcessProxy::setMaxStatisticsEntries):
3498         (WebKit::NetworkProcessProxy::setMinimumTimeBetweenDataRecordsRemoval):
3499         (WebKit::NetworkProcessProxy::setPruneEntriesDownTo):
3500         (WebKit::NetworkProcessProxy::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3501         (WebKit::NetworkProcessProxy::setResourceLoadStatisticsDebugMode):
3502         (WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
3503         (WebKit::NetworkProcessProxy::submitTelemetry):
3504         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsProcessed):
3505         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
3506         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
3507         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
3508         (WebKit::NetworkProcessProxy::didLogUserInteraction): Deleted.
3509         (WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources): Deleted.
3510         * UIProcess/Network/NetworkProcessProxy.h:
3511         * UIProcess/Network/NetworkProcessProxy.messages.in:
3512         * UIProcess/WebPageProxy.cpp:
3513         (WebKit::WebPageProxy::nonEphemeralWebPageProxy):
3514         * UIProcess/WebPageProxy.h:
3515         * UIProcess/WebProcessPool.cpp:
3516         (WebKit::WebProcessPool::ensureNetworkProcess):
3517         * UIProcess/WebProcessProxy.cpp:
3518         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
3519         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
3520         * UIProcess/WebProcessProxy.h:
3521         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3522         (WebKit::WebsiteDataStore::parameters):
3523         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3524         (WebKit::WebsiteDataStore::removeData):
3525         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
3526         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
3527         (WebKit::WebsiteDataStore::setGrandfatheringTime):
3528         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
3529         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
3530         (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
3531         (WebKit::WebsiteDataStore::isPrevalentResource):
3532         (WebKit::WebsiteDataStore::setPrevalentResource):
3533         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
3534         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
3535         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
3536         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3537         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
3538         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
3539         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
3540         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
3541         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
3542         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
3543         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
3544         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
3545         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
3546         (WebKit::WebsiteDataStore::clearPrevalentResource):
3547         (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
3548         (WebKit::WebsiteDataStore::submitTelemetry):
3549         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
3550         (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
3551         (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
3552         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
3553         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
3554         (WebKit::WebsiteDataStore::setLastSeen):
3555         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
3556         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
3557         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
3558         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
3559         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
3560         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
3561         (WebKit::WebsiteDataStore::removePrevalentDomains):
3562         (WebKit::WebsiteDataStore::hasStorageAccess):
3563         (WebKit::WebsiteDataStore::requestStorageAccess):
3564         (WebKit::WebsiteDataStore::grantStorageAccess):
3565         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
3566         (WebKit::WebsiteDataStore::logUserInteraction):
3567         (WebKit::WebsiteDataStore::hasHadUserInteraction):
3568         (WebKit::WebsiteDataStore::clearUserInteraction):
3569         (WebKit::WebsiteDataStore::isGrandfathered):
3570         (WebKit::WebsiteDataStore::setGrandfathered):
3571         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
3572         (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
3573         (WebKit::WebsiteDataStore::webPageWasAdded):
3574         (WebKit::WebsiteDataStore::webPageWasInvalidated):
3575         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
3576         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
3577         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
3578         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
3579         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
3580         (WebKit::WebsiteDataStore::processPools const):
3581         (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled const):
3582         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
3583         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
3584         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3585         (WebKit::WebsiteDataStore::logTestingEvent):
3586         * UIProcess/WebsiteData/WebsiteDataStore.h:
3587         (WebKit::WebsiteDataStore::setStatisticsTestingCallback):
3588         * WebProcess/WebProcess.cpp:
3589         (WebKit::WebProcess::initializeWebProcess):
3590
3591 2019-01-15  Darin Adler  <darin@apple.com>
3592
3593         Use references rather than pointers for register/unregister functions, and more
3594         https://bugs.webkit.org/show_bug.cgi?id=175028
3595
3596         Reviewed by Daniel Bates.
3597
3598         * WebProcess/FullScreen/WebFullScreenManager.cpp:
3599         (WebKit::WebFullScreenManager::willEnterFullScreen): Update for change to the
3600         functions in Document; pass a reference.
3601         (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto, don't pass the element.
3602         (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
3603         (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
3604
3605         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3606         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Pass a reference.
3607         (WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto.
3608         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto.
3609         * WebProcess/Plugins/PluginView.cpp:
3610         (WebKit::PluginView::~PluginView): Ditto.
3611         (WebKit::PluginView::initializePlugin): Ditto.
3612
3613 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3614
3615         Unreviewed, fix -Wreturn-type warning
3616         https://bugs.webkit.org/show_bug.cgi?id=193333
3617         <rdar://problem/45649489>
3618
3619         * UIProcess/Automation/WebAutomationSession.cpp:
3620         (WebKit::toProtocol):
3621
3622 2019-01-20  chris fleizach  <cfleizach@apple.com>
3623
3624         AX: Support returning relative frames for accessibility
3625         https://bugs.webkit.org/show_bug.cgi?id=193414
3626         <rdar://problem/47268501>
3627
3628         Reviewed by Zalan Bujtas.
3629
3630         * UIProcess/API/Cocoa/WKWebView.mm:
3631         (-[WKWebView accessibilityAttributeValue:forParameter:]):
3632         (-[WKWebView IGNORE_WARNINGS_END]):
3633         * UIProcess/API/mac/WKView.mm:
3634         (-[WKView accessibilityAttributeValue:forParameter:]):
3635         (-[WKView IGNORE_WARNINGS_END]):
3636         * UIProcess/Cocoa/WebViewImpl.h:
3637         * UIProcess/Cocoa/WebViewImpl.mm:
3638         (WebKit::WebViewImpl::accessibilityAttributeValue):
3639         * UIProcess/ios/WKContentView.mm:
3640         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
3641
3642 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3643
3644         Unreviewed, rolling out r240209.
3645
3646         Broke GTK/WPE injected bundle
3647
3648         Reverted changeset:
3649
3650         "AX: Support returning relative frames for accessibility"
3651         https://bugs.webkit.org/show_bug.cgi?id=193414
3652         https://trac.webkit.org/changeset/240209
3653
3654 2019-01-12  Dan Bernstein  <mitz@apple.com>
3655
3656         [Cocoa] Avoid importing directly from subumbrella frameworks
3657         https://bugs.webkit.org/show_bug.cgi?id=186016
3658         <rdar://problem/40591038>
3659
3660         Reviewed by Sam Weinig.
3661
3662         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
3663           OTHER_CPLUSPLUSFLAGS.
3664         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
3665           HIToolbox header.
3666         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
3667         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
3668         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
3669           header.
3670         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
3671           PDFKit header.
3672         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
3673         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
3674         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
3675         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
3676         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
3677         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
3678         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
3679
3680 2019-01-20  chris fleizach  <cfleizach@apple.com>
3681
3682         AX: Support returning relative frames for accessibility
3683         https://bugs.webkit.org/show_bug.cgi?id=193414
3684         <rdar://problem/47268501>
3685
3686         Reviewed by Zalan Bujtas.
3687
3688         * UIProcess/API/Cocoa/WKWebView.mm:
3689         (-[WKWebView accessibilityAttributeValue:forParameter:]):
3690         (-[WKWebView IGNORE_WARNINGS_END]):
3691         * UIProcess/API/mac/WKView.mm:
3692         (-[WKView accessibilityAttributeValue:forParameter:]):
3693         (-[WKView IGNORE_WARNINGS_END]):
3694         * UIProcess/Cocoa/WebViewImpl.h:
3695         * UIProcess/Cocoa/WebViewImpl.mm:
3696         (WebKit::WebViewImpl::accessibilityAttributeValue):
3697         * UIProcess/ios/WKContentView.mm:
3698         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
3699
3700 2019-01-20  Antoine Quint  <graouts@apple.com>
3701
3702         Add a POINTER_EVENTS feature flag
3703         https://bugs.webkit.org/show_bug.cgi?id=193577
3704         <rdar://problem/47408511>
3705
3706         Unreviewed. Also enable Pointer Events for iosmac.
3707
3708         * Configurations/FeatureDefines.xcconfig:
3709
3710 2019-01-19  David Kilzer  <ddkilzer@apple.com>
3711
3712         Follow-up: iOS: Updating input mode should update the software keyboard
3713         <https://bugs.webkit.org/show_bug.cgi?id=193565>
3714         <rdar://problem/47376334>
3715
3716         * WebProcess/WebPage/WebPage.cpp:
3717         (WebKit::WebPage::focusedElementDidChangeInputMode): Fix iOS
3718         Debug builds after r240199 by downcasting `element` to
3719         `HTMLElement` before calling canonicalInputMode().
3720
3721 2019-01-19  David Kilzer  <ddkilzer@apple.com>
3722
3723         Sort WebKit Xcode project file
3724
3725         * WebKit.xcodeproj/project.pbxproj:
3726
3727 2019-01-19  Antoine Quint  <graouts@apple.com>
3728
3729         Add a POINTER_EVENTS feature flag
3730         https://bugs.webkit.org/show_bug.cgi?id=193577
3731
3732         Reviewed by Dean Jackson.
3733
3734         * Configurations/FeatureDefines.xcconfig:
3735
3736 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
3737
3738         iOS: Updating input mode should update the software keyboard
3739         https://bugs.webkit.org/show_bug.cgi?id=193565
3740         <rdar://problem/47376334>
3741
3742         Reviewed by Wenson Hsieh.
3743
3744         Update the software keyboard when the inputmode content attribute on the focused element had been mutated.
3745
3746         * Scripts/webkit/messages.py:
3747         * Shared/WebCoreArgumentCoders.h:
3748         * UIProcess/PageClient.h:
3749         * UIProcess/WebPageProxy.h:
3750         * UIProcess/WebPageProxy.messages.in:
3751         * UIProcess/ios/PageClientImplIOS.h:
3752         * UIProcess/ios/PageClientImplIOS.mm:
3753         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
3754         * UIProcess/ios/WKContentViewInteraction.h:
3755         * UIProcess/ios/WKContentViewInteraction.mm:
3756         (-[WKContentView _didUpdateInputMode:]):
3757         * UIProcess/ios/WebPageProxyIOS.mm:
3758         (WebKit::WebPageProxy::focusedElementDidChangeInputMode):
3759         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3760         (WebKit::WebChromeClient::focusedElementDidChangeInputMode):
3761         * WebProcess/WebCoreSupport/WebChromeClient.h:
3762         * WebProcess/WebPage/WebPage.cpp:
3763         (WebKit::WebPage::focusedElementDidChangeInputMode):
3764         * WebProcess/WebPage/WebPage.h:
3765
3766 2019-01-18  Tim Horton  <timothy_horton@apple.com>
3767
3768         Adjust WKDrawingView protocol method name
3769         https://bugs.webkit.org/show_bug.cgi?id=193604
3770
3771         Reviewed by Wenson Hsieh.
3772
3773         * UIProcess/ios/WKDrawingView.mm:
3774         (-[WKDrawingView canvasViewDrawingDidChange:]):
3775         (-[WKDrawingView drawingDidChange:]): Deleted.
3776
3777 2019-01-18  David Kilzer  <ddkilzer@apple.com>
3778
3779         [WebKit] Change Xcode folders to map to folders on disk
3780
3781         * WebKit.xcodeproj/project.pbxproj: Update these folders:
3782         - Shared/Authentication
3783         - Shared/Authentication/cocoa
3784
3785 2019-01-18  Brian Burg  <bburg@apple.com>
3786
3787         Automation.computeElementLayout should return visual viewport-aware coordinates
3788         https://bugs.webkit.org/show_bug.cgi?id=193598
3789         <rdar://problem/35325644>
3790
3791         Reviewed by Simon Fraser.
3792
3793         Previously I added CoordinateSystem::VisualViewport to stub out this for iOS.
3794         But I think that it's a mistake for safaridriver to care about VisualViewport
3795         being enabled or not, because it is a runtime-switchable setting.
3796
3797         This patch removes CoordinateSystem::VisualViewport. Make the existing
3798         CoordinateSystem::LayoutViewport use visual viewport semantics if needed.
3799
3800         This is tested by WebDriver element clicking tests. There should not be any
3801         difference in behavior until it is possible to zoom with gestures via WebDriver.
3802
3803         * Shared/CoordinateSystem.h:
3804         * UIProcess/Automation/Automation.json:
3805         * UIProcess/Automation/WebAutomationSession.cpp:
3806         (WebKit::protocolStringToCoordinateSystem):
3807         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3808         (WebKit::WebAutomationSessionProxy::computeElementLayout):
3809
3810 2019-01-18  Daniel Bates  <dabates@apple.com>
3811
3812         Fix some build issues.
3813
3814         Include missing header WKDrawingCoordinator.
3815
3816         * UIProcess/ios/WKInkPickerView.mm:
3817
3818 2019-01-18  Tim Horton  <timothy_horton@apple.com>
3819
3820         Get rid of ADVANCED_SPELL_CHECKING
3821         https://bugs.webkit.org/show_bug.cgi?id=193592
3822
3823         Reviewed by Wenson Hsieh.
3824
3825         * UIProcess/Cocoa/WebViewImpl.mm:
3826         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
3827         (WebKit::WebViewImpl::insertText):
3828         * UIProcess/mac/TextCheckerMac.mm:
3829         (WebKit::TextChecker::checkTextOfParagraph):
3830         (WebKit::TextChecker::getGuessesForWord):
3831
3832 2019-01-18  Chris Dumez  <cdumez@apple.com>
3833
3834         Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
3835         https://bugs.webkit.org/show_bug.cgi?id=193588
3836         <rdar://problem/47131566>
3837
3838         Reviewed by Alex Christensen.
3839
3840         When the WebPageProxy needs to create initialization parameters for its WebPage in the
3841         WebContent process, it calls WebProcessProxy::addWebUserContentControllerProxy()
3842         which calls WebUserContentControllerProxy::addProcess(). This last call is supposed to
3843         register the WebProcessProxy with the WebUserContentControllerProxy and adding the
3844         contentRuleLists to the WebPageCreationParameters. The issue is that if the
3845         WebUserContentControllerProxy already knows about this WebProcessProxy, it would return
3846         early and not populate the WebPageCreationParameters.
3847
3848         In PSON world, when navigating back to a page that failed to enter page cache, we reuse
3849         the process where we previously loaded the page but re-create a new WebPage on the
3850         WebContent process site. When this happens, WebUserContentControllerProxy would not
3851         add the contentRuleLists to the WebPageCreationParameters and the new WebPage in the
3852         previously-suspended process would be missing them.
3853
3854         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3855         (WebKit::WebUserContentControllerProxy::addProcess):
3856
3857 2019-01-18  Jer Noble  <jer.noble@apple.com>
3858
3859         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
3860         https://bugs.webkit.org/show_bug.cgi?id=189553
3861
3862         Reviewed by Tim Horton.
3863
3864         * Configurations/Base.xcconfig:
3865         * Configurations/BaseTarget.xcconfig:
3866         * Configurations/SDKVariant.xcconfig: Added.
3867
3868 2019-01-18  Antti Koivisto  <antti@apple.com>
3869
3870         Implement asynchronous frame scrolling for iOS
3871         https://bugs.webkit.org/show_bug.cgi?id=193539
3872         <rdar://problem/47379873>
3873
3874         Reviewed by Simon Fraser.
3875
3876         Add a scrolling node type that can handle UIScrollView backed frames.
3877         It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.
3878
3879         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3880         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
3881         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3882         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3883         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
3884         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
3885         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
3886         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
3887         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
3888         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
3889         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
3890         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
3891         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
3892         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
3893         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
3894         * WebKit.xcodeproj/project.pbxproj:
3895
3896 2019-01-18  Chris Dumez  <cdumez@apple.com>
3897
3898         Regression(PSON) Scroll position is not always restored properly when navigating back
3899         https://bugs.webkit.org/show_bug.cgi?id=193578
3900         <rdar://problem/47386331>
3901
3902         Reviewed by Tim Horton.
3903
3904         Fix issues causing the scroll position to not be restored at all (or incorrectly) when
3905         navigating back cross-site with PSON enabled. Also make sure that the swipe gesture
3906         snapshot really stays up until we've restored the scroll position.
3907
3908         Note that even after those changes, I can still sometimes reproduce a white flash when
3909         swiping back to Google search results (scroll position being correct now). This is
3910         tracked by <rdar://problem/47071684> and happens even if I disable PSON entirely.
3911
3912         * Shared/SessionState.cpp:
3913         (WebKit::FrameState::encode const):
3914         (WebKit::FrameState::decode):
3915         * Shared/SessionState.h:
3916         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3917         (WebKit::toFrameState):
3918         (WebKit::applyFrameState):
3919         obscuredInsets is present on the HistoryItem in the WebProcess but was never passed to
3920         or stored by the UIProcess on the WebBackForwardListItem. obscuredInsets is needed to
3921         properly restore the scrollPosition (position was 70px off on my iPad without this).
3922         With PSON enabled, if you swipe back cross-process and the previous page was not put
3923         into PageCache, then the HistoryItem is gone on the WebProcess side. What happens is
3924         that the UIProcess sends its WebBackForwardListItem to the WebProcess, which restores
3925         the HistoryItem there, and then asks it to load it. The obscuredInsets was getting lost
3926         in the process since the UIProcess never knew about it.
3927
3928         * UIProcess/Cocoa/ViewGestureController.cpp:
3929         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
3930         Drop logic that was causing the ViewGestureController to not wait for the scroll position
3931         to be restored before taking down the snapshot, when UI-side compositing is enabled.
3932         If you look at the comment above the code, you'll see that the code in question was meant
3933         to impact only the non-UI side compositing code path. As a matter of fact, when the code
3934         was reviewed at https://bugs.webkit.org/show_bug.cgi?id=151224, it was protected by a
3935         #if PLATFORM(MAC), before getting modified the wrong way before landing. In practice, we
3936         would have often restored the scroll position by the time the load is finished so it would
3937         not cause a flash in most cases. However, with PSON enabled and the layer tree freezing we
3938         do on process-swap, the first post-scroll restoration layer tree commit may now occur a
3939         little bit later and we would lose the race more often.
3940
3941         * UIProcess/WebProcessProxy.cpp:
3942         (WebKit::WebProcessProxy::updateBackForwardItem):
3943         * UIProcess/WebProcessProxy.h:
3944         When adding PageCache support to PSON, we used to navigate the "suspended" page to
3945         about:blank. This would lead to unwanted WebProcessProxy::updateBackForwardItem()
3946         calls from the WebProcess which we wanted to ignore. We thus added logic to ignore
3947         updateBackForwardItem() IPC from the old WebProcess after a swap. The issue with this
3948         is that we sometimes miss/ignore legit updates to the HistoryItem from the old process,
3949         in particular with regards to the scroll position and the pageScaleFactor. So if you
3950         swiped and then quickly enough did a cross-site navigation, the UIProcess'
3951         WebBackForwardList would not get updated with the latest scroll position and we would
3952         thus fail to restore it later on. To address the issue, we now stop ignoring updates
3953         from the old WebProcess after a swap. This logic is no longer needed since we no longer
3954         navigate the old page to about:blank after a swap, we merely suspend it "in place".
3955
3956 2019-01-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3957
3958         Remove some last vestiges of assisted node terminology in WebKit
3959         https://bugs.webkit.org/show_bug.cgi?id=193572
3960
3961         Reviewed by Tim Horton.
3962
3963         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
3964         * UIProcess/ios/WKContentViewInteraction.mm:
3965         (-[WKContentView gestureRecognizerShouldBegin:]):
3966         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3967         (-[WKContentView _showKeyboard]):
3968         (-[WKContentView _hideKeyboard]):
3969
3970         Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.