Unable to copy and paste a PDF from Notes into Mail compose body
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Unable to copy and paste a PDF from Notes into Mail compose body
4         https://bugs.webkit.org/show_bug.cgi?id=196442
5         <rdar://problem/48573098>
6
7         Reviewed by Tim Horton.
8
9         Relax the -canPerformAction: logic in the case of pasting an attachment. Consider an NSItemProvider to possibly
10         paste as an attachment if either it has a preferred presentation style of UIPreferredPresentationStyleAttachment
11         or has a style of UIPreferredPresentationStyleUnspecified, but has a suggested file name.
12
13         This allows for the "Paste" action to be shown in the callout menu when copying and pasting a non-text file.
14
15         * UIProcess/ios/WKContentViewInteraction.mm:
16         (-[WKContentView canPerformActionForWebView:withSender:]):
17
18 2019-04-01  Tim Horton  <timothy_horton@apple.com>
19
20         Make UIWKDocumentContext rects per-character instead of per-word
21         https://bugs.webkit.org/show_bug.cgi?id=196459
22
23         Reviewed by Wenson Hsieh.
24
25         * WebProcess/WebPage/ios/WebPageIOS.mm:
26         (WebKit::WebPage::requestDocumentEditingContext):
27         Switch to CharacterIterator instead of TextIterator directly, to get
28         per-character rects as the API requests.
29
30 2019-04-01  Chris Dumez  <cdumez@apple.com>
31
32         UIProcess crash when a prewarmed process is terminated
33         https://bugs.webkit.org/show_bug.cgi?id=196451
34         <rdar://problem/49245471>
35
36         Reviewed by Geoffrey Garen.
37
38         Stop assuming that WebProcessProxy::m_websiteDataStore is non-null as this is no longer
39         true after r243384. For example, prewarmed WebContent processe do not get a data store
40         until they actually get used.
41
42         * UIProcess/API/Cocoa/WKProcessPool.mm:
43         (-[WKProcessPool _prewarmedProcessIdentifier]):
44         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
45         * UIProcess/WebProcessPool.cpp:
46         (WebKit::WebProcessPool::networkProcessIdentifier):
47         (WebKit::WebProcessPool::prewarmedProcessIdentifier):
48         * UIProcess/WebProcessPool.h:
49         * UIProcess/WebProcessProxy.cpp:
50         (WebKit::WebProcessProxy::didClose):
51         (WebKit::WebProcessProxy::didFinishLaunching):
52         (WebKit::WebProcessProxy::requestTermination):
53         (WebKit::WebProcessProxy::isReleaseLoggingAllowed const):
54         * UIProcess/WebProcessProxy.h:
55
56 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
57
58         [GTK][WPE] Add more websitedatastore directories to web process sandbox
59         https://bugs.webkit.org/show_bug.cgi?id=196447
60
61         Reviewed by Michael Catanzaro.
62
63         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
64         (WebKit::bubblewrapSpawn):
65         * UIProcess/glib/WebProcessProxyGLib.cpp:
66         (WebKit::WebProcessProxy::platformGetLaunchOptions):
67
68 2019-04-01  Per Arne Vollan  <pvollan@apple.com>
69
70         [macOS] Crash when loading Twitter with autoplay video enabled.
71         https://bugs.webkit.org/show_bug.cgi?id=196446
72         <rdar://problem/49060359>
73
74         Reviewed by Brent Fulgham.
75
76         This is caused by a syscall violation.
77
78         * WebProcess/com.apple.WebProcess.sb.in:
79
80 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
81
82         [GTK][WPE] Fix seccomp rule for blacklisting TIOCSTI
83         https://bugs.webkit.org/show_bug.cgi?id=196297
84
85         Reviewed by Michael Catanzaro.
86
87         More information can be found here: https://www.exploit-db.com/exploits/46594
88
89         Note that this sandbox never made it into production so does not
90         warrant any CVE specific to WebKit.
91
92         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
93         (WebKit::setupSeccomp):
94
95 2019-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
96
97         [iOS] Crash when changing inputmode for certain types of focusable elements
98         https://bugs.webkit.org/show_bug.cgi?id=196431
99         <rdar://problem/49454962>
100
101         Reviewed by Tim Horton.
102
103         The crash is happening because WebPage::focusedElementDidChangeInputMode assumes that the document's focused
104         element must be the same as m_focusedElement in WebPage. However, this is not the case, since m_focusedElement
105         is only set for certain types of elements that require user input (e.g. text fields, editable content, select
106         menus, etc.). The function then attempts to dereference m_focusedElement, which may be null if the document's
107         focused element doesn't fall into one of the aforementioned categories.
108
109         To fix this, bail if the element that is changing inputmode is not equal to the WebPage's current focused
110         element. See below for more details.
111
112         Test: fast/forms/change-inputmode-crash.html
113
114         * WebProcess/WebPage/WebPage.cpp:
115         (WebKit::isTextFormControlOrEditableContent):
116
117         Clean up some existing logic by introducing a helper method for determining whether an element should
118         propagate inputmode attribute changes to the UI process. Also, check the element type using type traits instead
119         of checking against the tag name.
120
121         (WebKit::WebPage::elementDidFocus):
122         (WebKit::WebPage::focusedElementDidChangeInputMode):
123
124 2019-03-31  Sam Weinig  <weinig@apple.com>
125
126         Remove more i386 specific configurations
127         https://bugs.webkit.org/show_bug.cgi?id=196430
128
129         Reviewed by Alexey Proskuryakov.
130
131         * Configurations/BaseTarget.xcconfig:
132         WK_HAVE_CORE_PREDICTION can now be enabled unconditionally.
133  
134         * Configurations/FeatureDefines.xcconfig:
135         ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
136
137 2019-03-31  Andy Estes  <aestes@apple.com>
138
139         [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
140         https://bugs.webkit.org/show_bug.cgi?id=196433
141         <rdar://problem/49293305>
142
143         Reviewed by Tim Horton.
144
145         Added WKWebViewConfiguration SPI for setting the QuickLook navigation response policy
146         decision behavior. The configuration setting defaults to YES for clients linked on or after
147         this WebKit change and NO otherwise.
148
149         * NetworkProcess/NetworkResourceLoader.cpp:
150         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
151         * Shared/WebPreferences.yaml:
152         * Shared/ios/QuickLookDocumentData.cpp:
153         (WebKit::QuickLookDocumentData::isEmpty const):
154         * Shared/ios/QuickLookDocumentData.h:
155         * UIProcess/API/Cocoa/WKWebView.mm:
156         (-[WKWebView _initializeWithConfiguration:]):
157         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
158         (defaultShouldDecidePolicyBeforeLoadingQuickLookPreview):
159         (-[WKWebViewConfiguration init]):
160         (-[WKWebViewConfiguration encodeWithCoder:]):
161         (-[WKWebViewConfiguration initWithCoder:]):
162         (-[WKWebViewConfiguration copyWithZone:]):
163         (-[WKWebViewConfiguration _shouldDecidePolicyBeforeLoadingQuickLookPreview]):
164         (-[WKWebViewConfiguration _setShouldDecidePolicyBeforeLoadingQuickLookPreview:]):
165         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
166         * UIProcess/Cocoa/VersionChecks.h:
167         * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
168         (WebKit::WebPreviewLoaderClient::didReceiveDataArray):
169
170 2019-03-30  Zalan Bujtas  <zalan@apple.com>
171
172         [ContentChangeObserver] Subframe load should not reset content observation on the mainframe
173         https://bugs.webkit.org/show_bug.cgi?id=196408
174         <rdar://problem/49436797>
175
176         Reviewed by Simon Fraser.
177
178         Hover intent fails when an unrelated frame commits a load the same time.
179         cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
180         (If the current frame navigates away, willDetachPage takes care of canceling the observation.)
181
182         * WebProcess/WebPage/ios/WebPageIOS.mm:
183         (WebKit::WebPage::cancelPotentialTap):
184         (WebKit::WebPage::cancelPotentialTapInFrame):
185
186 2019-03-29  John Wilander  <wilander@apple.com>
187
188         Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
189         https://bugs.webkit.org/show_bug.cgi?id=196407
190         <rdar://problem/47859936>
191
192         Reviewed by Brent Fulgham.
193
194         The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
195         moved Resource Load Statistics from the UI process to the network process. One
196         of the endpoints is the message RequestStorageAccessUnderOpener which underpins
197         our compatibility fix for federated logins using popups. This patch redirects
198         these IPC calls to the network process and cleans up some assumptions around
199         them.
200
201         * CMakeLists.txt:
202             Removed the old IPC receiver.
203         * DerivedSources.make:
204             Removed the old IPC receiver.
205         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
206         (WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.
207             This is no longer needed since there is a dedicated update mechanism
208             that actually sends the update.
209         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
210         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
211         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
212         (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
213             Two new IPC receivers to pipe the calls to the network process.
214         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.
215             NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
216             this purpose.
217         * NetworkProcess/NetworkConnectionToWebProcess.h:
218         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
219         * UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.
220             Removed the old IPC receiver.
221         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
222         * WebKit.xcodeproj/project.pbxproj:
223         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
224         (WKBundleResourceLoadStatisticsNotifyObserver):
225             Function name update.
226         * WebProcess/WebProcess.cpp:
227             Now calls IPC to the network process instead of the UI process.
228
229 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
230
231         Delete WebMetal implementation in favor of WebGPU
232         https://bugs.webkit.org/show_bug.cgi?id=195418
233
234         Reviewed by Dean Jackson.
235
236         * Configurations/FeatureDefines.xcconfig:
237         * Shared/WebPreferences.yaml:
238         * WebProcess/InjectedBundle/InjectedBundle.cpp:
239         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
240
241 2019-03-29  Takashi Komori  <Takashi.Komori@sony.com>
242
243         [Curl] Add Server Trust Evaluation Support.
244         https://bugs.webkit.org/show_bug.cgi?id=191646
245
246         Reviewed by Fujii Hironori.
247
248         Tests: http/tests/ssl/iframe-upgrade.https.html
249                http/tests/ssl/mixedContent/insecure-websocket.html
250                http/tests/ssl/upgrade-origin-usage.html
251
252         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
253         (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
254         (WebKit::NetworkDataTaskCurl::tryServerTrustEvaluation):
255         (WebKit::NetworkDataTaskCurl::restartWithCredential):
256         * NetworkProcess/curl/NetworkDataTaskCurl.h:
257
258 2019-03-29  Cathie Chen  <cathiechen@igalia.com>
259
260         Implement ResizeObserver.
261         https://bugs.webkit.org/show_bug.cgi?id=157743
262
263         Reviewed by Simon Fraser.
264
265         Add WebPreferences and FeatureDefines for ResizeObserver.
266
267         * Configurations/FeatureDefines.xcconfig:
268         * Shared/WebPreferences.yaml:
269
270 2019-03-28  Timothy Hatcher  <timothy@apple.com>
271
272         CFDictionary encoder crashes on non-string keys.
273         https://bugs.webkit.org/show_bug.cgi?id=196388
274         rdar://problem/49339242
275
276         Reviewed by Ryosuke Niwa.
277
278         Allow non-string keys in CFDictionary encoding/decoding. Encode the correct
279         size for dictionaries and arrays when unknown keys or values are skipped.
280         Allow null array encoding and decoding like dictionary already allowed.
281
282         * Shared/cf/ArgumentCodersCF.cpp:
283         (IPC::encode):
284         (IPC::decode):
285
286 2019-03-28  John Wilander  <wilander@apple.com>
287
288         Resource Load Statistics: IPC to the WebsiteDataStore in the UI process from NetworkProcess::deleteWebsiteDataForRegistrableDomains()
289         https://bugs.webkit.org/show_bug.cgi?id=196281
290         <rdar://problem/48938748>
291
292         Reviewed by Alex Christensen.
293
294         The move of Resource Load Statistics to the network process requires that it
295         calls the UI process when clearing website data (previously the other way
296         around). This patch achieves that.
297
298         Specifically, NetworkProcess::deleteWebsiteDataForRegistrableDomains() now
299         filters its WebsiteDataTypes down to just the ones applicable for the UI
300         process and then calls DeleteWebsiteDataInUIProcessForRegistrableDomains over
301         IPC.
302
303         NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains() on
304         the UI process side makes use of the re-introduced
305         WebsiteDataStore::fetchDataForRegistrableDomains() function to get the relevant
306         data records and call WebsiteDataStore::removeData(). The re-introduced
307         WebsiteDataStore::fetchDataForRegistrableDomains() was removed as dead code in
308         https://trac.webkit.org/changeset/242056/webkit, then under the name
309         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). The reason it
310         was dead code was the lack of IPC call that this patch adds.
311
312         * NetworkProcess/NetworkProcess.cpp:
313         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
314            Now calls DeleteWebsiteDataInUIProcessForRegistrableDomains over IPC if there
315            are WebsiteDataTypes applicable to the UI process.
316         * NetworkProcess/NetworkProcess.h:
317         * Shared/WebsiteData/WebsiteData.cpp:
318         (WebKit::WebsiteData::ownerProcess):
319         (WebKit::WebsiteData::filter):
320             Convenience functions to manage process ownership of website data types.
321         * Shared/WebsiteData/WebsiteData.h:
322         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
323         (WKWebsiteDataStoreStatisticsHasLocalStorage):
324             Test infrastructure, called by the TestRunner.
325         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
326         * UIProcess/Network/NetworkProcessProxy.cpp:
327         (WebKit::NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains):
328             New function to be called from the network process.
329         * UIProcess/Network/NetworkProcessProxy.h:
330         * UIProcess/Network/NetworkProcessProxy.messages.in:
331         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
332         (WebKit::WebsiteDataRecord::matches const):
333             Now matches with WebCore::RegistrableDomain instead of a string.
334         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain const): Deleted.
335             Replaced by WebsiteDataRecord::matches().
336         * UIProcess/WebsiteData/WebsiteDataRecord.h:
337         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
338         (WebKit::WebsiteDataStore::fetchDataForRegistrableDomains):
339             Re-introduced. It was removed as dead code in r242056.
340         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
341         (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
342             Test infrastructure, called by the TestRunner.
343         * UIProcess/WebsiteData/WebsiteDataStore.h:
344
345 2019-03-28  Jiewen Tan  <jiewen_tan@apple.com>
346
347         API::Data::createWithoutCopying should do a null check before calling CFRelease
348         https://bugs.webkit.org/show_bug.cgi?id=196276
349         <rdar://problem/48059859>
350
351         Reviewed by Alex Christensen.
352
353         * Shared/Cocoa/APIDataCocoa.mm:
354         (API::Data::createWithoutCopying):
355
356 2019-03-28  Per Arne Vollan  <pvollan@apple.com>
357
358         [iOS] Automatic focus of input field is flaky
359         https://bugs.webkit.org/show_bug.cgi?id=196302
360
361         Reviewed by Brent Fulgham.
362
363         Sometimes the status of whether a keyboard is connected can be incorrect, both in the UI process, and in
364         the WebContent process. Fix this by sending the keyboard status to the WebContent process as part of the
365         Web page creation parameters. Stop caching the keyboard status in the Web process proxy, and call
366         [UIKeyboard isInHardwareKeyboardMode] instead, since this method is swizzled in the test harness.
367
368         * Shared/WebPageCreationParameters.cpp:
369         (WebKit::WebPageCreationParameters::encode const):
370         (WebKit::WebPageCreationParameters::decode):
371         * Shared/WebPageCreationParameters.h:
372         * UIProcess/API/Cocoa/WKWebView.mm:
373         (hardwareKeyboardAvailabilityChangedCallback):
374         * UIProcess/WebPageProxy.cpp:
375         (WebKit::WebPageProxy::creationParameters):
376         * UIProcess/WebPageProxy.h:
377         * UIProcess/WebProcessProxy.cpp:
378         * UIProcess/WebProcessProxy.h:
379         (WebKit::WebProcessProxy::setKeyboardIsAttached): Deleted.
380         (WebKit::WebProcessProxy::keyboardIsAttached const): Deleted.
381         * UIProcess/ios/WKContentViewInteraction.mm:
382         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
383         * UIProcess/ios/WebPageProxyIOS.mm:
384         (WebKit::WebPageProxy::isInHardwareKeyboardMode):
385         (WebKit::WebPageProxy::applicationWillEnterForeground):
386         * WebProcess/WebPage/WebPage.cpp:
387         * WebProcess/WebPage/WebPage.h:
388
389 2019-03-28  Tim Horton  <timothy_horton@apple.com>
390
391         Fix the build.
392
393         * UIProcess/ios/WKActionSheetAssistant.mm:
394         (-[WKActionSheetAssistant showImageSheet]):
395         * UIProcess/ios/WKContentViewInteraction.mm:
396         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
397
398 2019-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
399
400         [WPE][GTK] webkit_web_resource_get_data_finish can return NULL without setting error
401         https://bugs.webkit.org/show_bug.cgi?id=186276
402
403         Reviewed by Carlos Garcia Campos.
404
405         Currently it's possible for webkit_web_resource_get_data_finish() to return NULL without
406         setting the error parameter. This is illegal because it is an API guarantee (and a GObject
407         convention) that if an error parameter exists, it should be set whenever a function call
408         returns NULL. Epiphany correctly dereferences the error in this case without checking if it
409         is NULL, because it knows it does not have to, and crashes. Fix this. We'll return a byte
410         array of length 1 containing a NUL character. This isn't great, but there's not really any
411         better solution without deprecating the API or returning an error code to indicate an empty
412         resource, and it at least fixes the Epiphany crash.
413
414         This does not fix bug #186276, in which this function incorrectly returns no data when it
415         ought to. But that is a different bug. Now, at least we won't crash when no data is
416         available.
417
418         * UIProcess/API/glib/WebKitWebResource.cpp:
419         (resourceDataCallback):
420
421 2019-03-28  Daniel Bates  <dabates@apple.com>
422
423         [iPad] Tapping on a popup form control may not show a popover
424         https://bugs.webkit.org/show_bug.cgi?id=196322
425         <rdar://problem/49229632>
426
427         Reviewed by Wenson Hsieh.
428
429         Stop taking advantage of -[WKContentView inputView] being called when we invoke -reloadInputViews
430         to "lazily" allocate the input peripheral for the currently focused element. In theory, UIKit only
431         needs to call -inputView when it actually needs to display the input view (the keyboard). For
432         popup menu buttons, like <select>, no keyboard is needed. Instead we should create the peripheral
433         as part of the logic in the UI process to focus a new element before we call -reloadInputViews.
434
435         * UIProcess/ios/WKContentViewInteraction.mm:
436         (-[WKContentView inputView]): Extract logic to allocate the peripheral from here and moved it to createInputPeripheralWithView().
437         (-[WKContentView accessoryTab:]): While I am here, add a FIXME comment to explain why we need to
438         end the input sessions and nullify the input peripheral before we tell the web process to switch
439         focus as opposed to letting this happen after the web process tells us it focused a new element.
440         (createInputPeripheralWithView): Added.
441         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
442         Write in terms of createInputPeripheralWithView(). Create the input peripheral after becoming
443         first responder because creating the peripheral has known side-effects: for popup buttons it
444         tells the popup controller to present the popover. For key input to popovers to work from the get-go,
445         the content view must be the first responder. See <https://bugs.webkit.org/show_bug.cgi?id=196272>
446         for more details.
447
448 2019-03-28  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
449
450         Silence lot of warnings when compiling with clang
451         https://bugs.webkit.org/show_bug.cgi?id=196310
452
453         Reviewed by Michael Catanzaro.
454
455         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: add missing
456         override clause.
457         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: add
458         missing override clause.
459
460 2019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
461
462         [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
463         https://bugs.webkit.org/show_bug.cgi?id=196336
464
465         Reviewed by Tim Horton.
466
467         The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
468         This resulted in RenderMenuList::m_popupIsVisible to be never reset.
469
470         Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
471         the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
472         Send cancelTracking to NSMenu instead, which DOES dismiss the popup.
473
474         Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
475                fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html
476
477         * UIProcess/mac/WebPopupMenuProxyMac.mm:
478         (WebKit::WebPopupMenuProxyMac::hidePopupMenu):
479         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
480         (WebKit::WebPopupMenu::hide):
481
482 2019-03-27  Dean Jackson  <dino@apple.com>
483
484         [ARKit] Black view when opening a 3D model usdz file in new tab
485         https://bugs.webkit.org/show_bug.cgi?id=196333
486         <rdar://problem/47693367>
487
488         Reviewed by Tim Horton.
489
490         When opening a new WKSystemPreviewView, we were exiting if there was no
491         presentingViewController. This code was unnecessary, and causing blank
492         content when opening a new tab.
493
494         * UIProcess/ios/WKSystemPreviewView.mm:
495         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
496         Remove the code looking for a presentingViewController.
497
498 2019-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
499
500         Need a way to include WebKitAdditions code in WebKit API headers
501         https://bugs.webkit.org/show_bug.cgi?id=196173
502
503         Reviewed by Tim Horton.
504
505         Introduce a mechanism that allows us to insert code from WebKitAdditions into public or private SDK headers
506         using `#import`s of the form:
507
508         ```
509         #if USE(APPLE_INTERNAL_SDK)
510         #import <WebKitAdditions/WKWebViewConfigurationAdditions.h>
511         #endif
512         ```
513
514         The resulting header in the built products directory will contain the contents of the imported file inserted in
515         place of the `#if USE(APPLE_INTERNAL_SDK) … #endif` block; however, when building with the Apple internal SDK,
516         the additions header content will be imported by the usual means.
517
518         * mac/postprocess-framework-headers.sh:
519         * mac/replace-webkit-additions-includes.py: Added.
520
521         Add a step when post-processing framework headers to replace instances of `#if USE(APPLE_INTERNAL_SDK) … #endif`
522         with the text content of the additions files. The replacement script first searches in the built products
523         directory for the matching additions file, and falls back to the SDK if no matching file is found. If neither
524         are present (e.g. a build using the public SDK), then the block is simply replaced by the empty string.
525
526         (read_content_from_webkit_additions):
527         (main):
528
529 2019-03-27  Andy Estes  <aestes@apple.com>
530
531         REGRESSION (r242686): package-root creates roots with broken symlinks in WebKit.framework/XPCServices/
532         https://bugs.webkit.org/show_bug.cgi?id=196317
533
534         Reviewed by Dan Bernstein.
535
536         Removed some remnants of the Storage Process.
537
538         * Configurations/BaseTarget.xcconfig:
539         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Removed.
540         * WebKit.xcodeproj/project.pbxproj:
541
542 2019-03-27  Keith Rollin  <krollin@apple.com>
543
544         Include the CFNetworking task UUID to the NSError when a resource-load fails
545         https://bugs.webkit.org/show_bug.cgi?id=196156
546
547         Reviewed by Alex Christensen.
548
549         In order to help track the connection between a failed resource-load
550         and a user-visible error message, include the CFNetworking task UUID
551         in the associated error as an element of the userInfo property. This
552         can then be pulled out and reported in the logging at the point the
553         error is reported to the user.
554
555         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
556         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
557
558 2019-03-27  Chris Dumez  <cdumez@apple.com>
559
560         [ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout
561         https://bugs.webkit.org/show_bug.cgi?id=195425
562         <rdar://problem/48682403>
563
564         Reviewed by Alex Christensen.
565
566         When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
567         process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
568         in which it was previously loaded. However, we were failing to check if the WebProcess in question was
569         still running so we could potentially try to use a process that's already exited.
570
571         * UIProcess/WebProcessPool.cpp:
572         (WebKit::WebProcessPool::processForNavigationInternal):
573
574 2019-03-27  Zalan Bujtas  <zalan@apple.com>
575
576         [ContentChangeObserver] Always dispatch the synthetic click asynchronously
577         https://bugs.webkit.org/show_bug.cgi?id=196278
578         <rdar://problem/49299968>
579
580         Reviewed by Simon Fraser.
581
582         This patch ensures that all completeSyntheticClick() calls happen in an asynchronous manner (unless the feature is turned off).
583
584         * WebProcess/WebPage/ios/WebPageIOS.mm:
585         (WebKit::dispatchSyntheticMouseMove):
586         (WebKit::WebPage::handleSyntheticClick):
587
588 2019-03-27  Tim Horton  <timothy_horton@apple.com>
589
590         Fix some more deprecation warnings in WKDrawingView
591         https://bugs.webkit.org/show_bug.cgi?id=196282
592         <rdar://problem/47637608>
593
594         Reviewed by Wenson Hsieh.
595
596         * Platform/spi/ios/PencilKitSPI.h:
597         * SourcesCocoa.txt:
598         * UIProcess/ios/PencilKitSoftLink.h:
599         * UIProcess/ios/PencilKitSoftLink.mm:
600         * UIProcess/ios/WKContentViewInteraction.mm:
601         * UIProcess/ios/WKDrawingCoordinator.h:
602         * UIProcess/ios/WKDrawingCoordinator.mm:
603         (-[WKDrawingCoordinator initWithContentView:]):
604         (-[WKDrawingCoordinator currentInk]):
605         (-[WKDrawingCoordinator undoManagerForInkPicker:]):
606         (-[WKDrawingCoordinator containingViewForInkPicker:]):
607         (-[WKDrawingCoordinator inkPickerDidToggleRuler:]):
608         (-[WKDrawingCoordinator inkPickerDidChangeInk:]):
609         (-[WKDrawingCoordinator installInkPickerForDrawing:]):
610         (-[WKDrawingCoordinator uninstallInkPicker]):
611         (-[WKDrawingCoordinator inkPicker]): Deleted.
612         (-[WKDrawingCoordinator didChangeRulerState:]): Deleted.
613         (-[WKDrawingCoordinator didChangeInk:]): Deleted.
614         * UIProcess/ios/WKDrawingView.mm:
615         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
616         * UIProcess/ios/WKInkPickerView.h: Removed.
617         * UIProcess/ios/WKInkPickerView.mm: Removed.
618         * WebKit.xcodeproj/project.pbxproj:
619         Adopt the new names.
620
621 2019-03-27  Carlos Garcia Campos  <cgarcia@igalia.com>
622
623         Geolocation request not complete when watch request was started in a different web process
624         https://bugs.webkit.org/show_bug.cgi?id=195996
625
626         Reviewed by Alex Christensen.
627
628         In WebGeolocationManagerProxy::startUpdating() we do nothing when the provider is already updating. We should
629         reply with a DidChangePosition using the last known position, if available. If we are updating, but we still
630         don't have a known position, the request will be completed when
631         WebGeolocationManagerProxy::providerDidChangePosition() is called since it always notifies all web
632         processes.
633
634         * UIProcess/WebGeolocationManagerProxy.cpp:
635         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition): Cache the position.
636         (WebKit::WebGeolocationManagerProxy::startUpdating): Reply using cached position if already known.
637         * UIProcess/WebGeolocationManagerProxy.h:
638         (WebKit::WebGeolocationManagerProxy::lastPosition const): Return cached position.
639         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
640         (WebKit::WebGeolocationClient::lastPosition): Remove the FIXME since we don't want this feature.
641
642 2019-03-26  Brent Fulgham  <bfulgham@apple.com>
643
644         [macOS] Correct kerberos-related sandbox violations
645         https://bugs.webkit.org/show_bug.cgi?id=196279
646         <rdar://problem/48622502>
647
648         Reviewed by Per Arne Vollan.
649
650         We need to allow communications with a Kerberos-related service on macOS
651         until <rdar://problem/35542803> is fixed.
652
653         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
654
655 2019-03-26  Chris Dumez  <cdumez@apple.com>
656
657         [macOS] The network process is not exiting reliably when the WebProcessPool is destroyed
658         https://bugs.webkit.org/show_bug.cgi?id=196277
659         <rdar://problem/49127581>
660
661         Reviewed by Alex Christensen.
662
663         When, an AuxiliaryProcess receives the AuxiliaryProcess::Terminate IPC, it calls stopRunLoop()
664         to exit. WebProcess overrides AuxiliaryProcess::stopRunLoop() to call exit(0) on the main
665         thread. Other auxiliary processes such as the NetworkProcess would end up calling
666         platformStopRunLoop(). On iOS and iOSMac, platformStopRunLoop() calls XPCServiceExit(), which
667         makes sense since auxiliary processes run their run loop by calling xpc_main(). However, on
668         macOS, platformStopRunLoop() was calling RunLoop::main().stop() to exit instead, which was
669         unreliable as demonstrated by the test app attached to the radar.
670
671         Updating platformStopRunLoop() to call XPCServiceExit() on macOS fixes the problem and I now
672         see the NetworkProcess exiting reliably there. This is the approach I have chosen in this
673         patch since it appears to be reliable and it makes the code consistent on all Cocoa platforms.
674
675         * Shared/AuxiliaryProcess.cpp:
676         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
677         (WebKit::AuxiliaryProcess::platformStopRunLoop):
678         * Shared/ios/AuxiliaryProcessIOS.mm:
679         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
680         * Shared/mac/AuxiliaryProcessMac.mm:
681         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
682
683 2019-03-26  Keith Rollin  <krollin@apple.com>
684
685         Inhibit CFNetwork logging in private sessions
686         https://bugs.webkit.org/show_bug.cgi?id=196268
687         <rdar://problem/48210793>
688
689         Reviewed by Alex Christensen.
690
691         Before performing any logging, the NetworkProcess checks to see if
692         it's performing an operation associated with a private (ephemeral)
693         browsing session. If so, it skips the logging. However, networking
694         layers below the NetworkProcess don't know about private browsing, so
695         they would still perform their own logging. CFNetwork now has a flag
696         that lets us control that, so set it to False if private browsing.
697
698         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
699         (WebKit::configurationForSessionID):
700
701 2019-03-26  Chris Dumez  <cdumez@apple.com>
702
703         Add basic layout test coverage for File Picker on iOS
704         https://bugs.webkit.org/show_bug.cgi?id=196265
705
706         Reviewed by Wenson Hsieh.
707
708         Add layout test infrastructure to test the file picker on iOS.
709
710         * UIProcess/API/Cocoa/WKWebView.mm:
711         (-[WKWebView _dismissFilePicker]):
712         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
713         * UIProcess/ios/WKContentViewInteraction.h:
714         * UIProcess/ios/WKContentViewInteraction.mm:
715         (-[WKContentView dismissFilePicker]):
716         (-[WKContentView _contentsOfUserInterfaceItem:]):
717         * UIProcess/ios/forms/WKFileUploadPanel.h:
718         * UIProcess/ios/forms/WKFileUploadPanel.mm:
719         (-[WKFileUploadPanel currentAvailableActionTitles]):
720
721 2019-03-26  Daniel Bates  <dabates@apple.com>
722
723         [iOS][WK2] Use a better concept to describe the reason we defer zooming a focused element: selectabiltiy
724         https://bugs.webkit.org/show_bug.cgi?id=196264
725
726         Reviewed by Wenson Hsieh.
727
728         Rename shouldDeferZoomingToSelectionWhenRevealingFocusedElement() to mayContainSelectableText() to describe
729         the criterion that we will use to decide whether to defer zooming or not. We defer zooming only for elements
730         that may support text selection on initial focus because we do not have an up-to-date selection rect at that
731         time. For element, like <select>, that do not support text selection, we can zoom them immediately when focused.
732
733         * UIProcess/ios/WKContentViewInteraction.mm:
734         (mayContainSelectableText): Renamed from shouldDeferZoomingToSelectionWhenRevealingFocusedElement.
735         List all the input types in the switch block and remove the default case to force the compiler to check that we
736         covered all cases. This will prevent unforseen keyboard issues (why isn't the keyboard shown? or why is the keyboard shown?)
737         for future input types that we may add.
738         (rectToRevealWhenZoomingToFocusedElement): Update for renaming.
739         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Add a
740         comment to explain why we may need to defer the zoom: the focused element supports text selection and we need
741         to wait for the web process to call back to provide an up-to-date selection rect for us to zoom and reveal.
742         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Update for renaming.
743         (shouldDeferZoomingToSelectionWhenRevealingFocusedElement): Deleted.
744
745 2019-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
746
747         Implement async paste method on UIWKInteractionViewProtocol
748         https://bugs.webkit.org/show_bug.cgi?id=196267
749         <rdar://problem/49236346>
750
751         Reviewed by Tim Horton.
752
753         Implement a new UIWKInteractionViewProtocol hook to perform a paste command, and invoke the given completion
754         handler when pasting is finished.
755
756         Test: UIPasteboardTests.PasteWithCompletionHandler
757
758         * UIProcess/ios/WKContentViewInteraction.mm:
759         (-[WKContentView pasteWithCompletionHandler:]):
760
761 2019-03-26  Per Arne Vollan  <pvollan@apple.com>
762
763         [macOS] Fix sandbox violations
764         https://bugs.webkit.org/show_bug.cgi?id=196262
765         <rdar://problem/47738015>
766
767         Reviewed by Brent Fulgham.
768
769         Fix various observed sandbox violations.
770
771         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
772         * WebProcess/com.apple.WebProcess.sb.in:
773
774 2019-03-26  Tomoki Imai  <Tomoki.Imai@sony.com>
775
776         Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyCoordinatedGraphics::incorporateUpdate when forceCompositingMode is turned on
777         https://bugs.webkit.org/show_bug.cgi?id=195879
778
779         Reviewed by Carlos Garcia Campos.
780
781         The root cause is that DrawingAreaProxyCoordinatedGraphics::isInAcceleratedCompositingMode checks both of alwaysUseCompositing() and !m_layerTreeContext.isEmpty().
782         alwaysUseCompositing() refers preferences, which is written by the application (UIProcess).
783         On the other hand, m_layerTreeContext is changed when it receives enterAcceleratedCompositingMode/exitAcceleratedCompositingMode from WebProcess.
784
785         It results when we set forceCompositingMode and acceleratedCompositingEnabled to true, WebProcess and UIProcess is out of sync until WebProcess sends enterAcceleratedCompositingMode message.
786         In such situation, WebProcess sends incorporateUpdate to UIProcess because WebProcess is in non-AC mode, but isInAcceleratedCompositingMode becomes true in UIProcess side.
787
788         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
789         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics): Should call exitAcceleratedCompositingMode even when alwaysUseCompositing is true.
790         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode): enterAcceleratedCompositingMode should check enterAcceleratedCompositingMode is not called twice.
791         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Remove alwaysUseCompositing from isInAcceleratedCompositingMode
792
793 2019-03-26  Antoine Quint  <graouts@apple.com>
794
795         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
796         https://bugs.webkit.org/show_bug.cgi?id=196254
797         <rdar://problem/49124334>
798
799         Reviewed by Dean Jackson.
800
801         * Shared/WebPreferences.yaml:
802
803 2019-03-26  Philippe Normand  <pnormand@igalia.com>
804
805         [WPE][Qt] Uninitialized racy ViewBackend
806         https://bugs.webkit.org/show_bug.cgi?id=196247
807
808         Reviewed by Carlos Garcia Campos.
809
810         * UIProcess/API/wpe/qt/WPEQtView.h: Initialize the backend pointer to nullptr.
811
812 2019-03-26  Carlos Garcia Campos  <cgarcia@igalia.com>
813
814         Unreviewed. Fix typo in GLib geolocation API after r243285.
815
816         gelocation -> geolocation.
817
818         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
819         (webkit_geolocation_manager_class_init):
820         (webkit_geolocation_manager_update_position):
821         (webkit_geolocation_manager_failed):
822         (webkit_gelocation_manager_update_position): Deleted.
823         (webkit_gelocation_manager_failed): Deleted.
824         * UIProcess/API/gtk/WebKitGeolocationManager.h:
825         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
826         * UIProcess/API/wpe/WebKitGeolocationManager.h:
827         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
828
829 2019-03-26  Patrick Griffis  <pgriffis@igalia.com>
830
831         [GTK][WPE] Disable process warming
832         https://bugs.webkit.org/show_bug.cgi?id=196208
833
834         Reviewed by Chris Dumez.
835
836         Fixes crash caused by r243384.
837
838         Process warming is incompatible with our launcher as it expects a valid
839         WebsiteDataStore at initialization time for sandbox permissions.
840
841         * UIProcess/glib/WebProcessPoolGLib.cpp:
842         (WebKit::WebProcessPool::platformInitialize):
843
844 2019-03-25  Alex Christensen  <achristensen@webkit.org>
845
846         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
847         https://bugs.webkit.org/show_bug.cgi?id=196213
848
849         Reviewed by Geoff Garen.
850
851         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
852         with a SecIdentityRef wrapped in an NSCredential.
853
854         * Shared/cf/ArgumentCodersCF.cpp:
855         (IPC::decode):
856
857 2019-03-25  Chris Dumez  <cdumez@apple.com>
858
859         Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
860         https://bugs.webkit.org/show_bug.cgi?id=196205
861         <rdar://problem/49083324>
862
863         Reviewed by Geoffrey Garen.
864
865         Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
866         wild cards (e.g. "image/*") that are defined in the HTML specification:
867         - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
868
869         Previously, we would fail to convert those to UTIs.
870
871         * UIProcess/ios/forms/WKFileUploadPanel.mm:
872
873 2019-03-25  Tim Horton  <timothy_horton@apple.com>
874
875         Remove some now-unnecessary dynamic class lookup
876         https://bugs.webkit.org/show_bug.cgi?id=196237
877
878         Reviewed by Simon Fraser.
879
880         * Shared/DocumentEditingContext.mm:
881         (WebKit::DocumentEditingContext::toPlatformContext):
882
883 2019-03-25  Tim Horton  <timothy_horton@apple.com>
884
885         Get rid of ENABLE(ANIMATED_KEYBOARD_SCROLLING)
886         https://bugs.webkit.org/show_bug.cgi?id=196224
887
888         Reviewed by Simon Fraser.
889
890         * Platform/spi/ios/AccessibilitySupportSPI.h:
891         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
892         (-[WKKeyboardScrollingAnimator invalidate]):
893         (perpendicularAbsoluteUnitVector):
894         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
895         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
896         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
897         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
898         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
899         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]): Deleted.
900         (-[WKKeyboardScrollingAnimator stopRepeatTimer]): Deleted.
901         (-[WKKeyboardScrollingAnimator performDiscreteScroll]): Deleted.
902
903 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
904
905         Enable IPC sending and receiving non-default-constructible types
906         https://bugs.webkit.org/show_bug.cgi?id=196132
907         <rdar://problem/49229221>
908
909         Unreviewed build fix for WinCairo port.
910
911         error C2440: '=': cannot convert from 'int' to 'HANDLE'
912
913         * Platform/win/SharedMemoryWin.cpp:
914         (WebKit::SharedMemory::Handle::Handle): std::exchange HANDLE with nullptr, not 0.
915         (WebKit::SharedMemory::Handle::operator=): Ditto.
916
917 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
918
919         [Coordinated Graphics][WinCairo] ASSERTION FAILED: state.id == m_nicosia.state.id
920         https://bugs.webkit.org/show_bug.cgi?id=196190
921
922         Reviewed by Žan Doberšek.
923
924         This assertion assumes the pre-committed and the committed scenes
925         are identical. But, the pre-committed scene is updated in the main
926         thread. Removed the false assertion.
927
928         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
929         (WebKit::CoordinatedGraphicsScene::purgeGLResources): Remove the
930         assertion. Removed layers of committed scene, not pre-committed
931         scene.
932
933 2019-03-25  Brady Eidson  <beidson@apple.com>
934
935         Add socket-delegate to another entitlements config
936         rdar://problem/48090350 and https://bugs.webkit.org/show_bug.cgi?id=196227
937
938         Reviewed by Geoffrey Garen.
939
940         * Configurations/Network-iOSMac.entitlements:
941
942 2019-03-25  Commit Queue  <commit-queue@webkit.org>
943
944         Unreviewed, rolling out r243465.
945         https://bugs.webkit.org/show_bug.cgi?id=196226
946
947         the test doesn't build (Requested by thorton on #webkit).
948
949         Reverted changeset:
950
951         "Do not terminate the NetworkProcess if a third party
952         application sends a NSCredential with a SecIdentityRef"
953         https://bugs.webkit.org/show_bug.cgi?id=196213
954         https://trac.webkit.org/changeset/243465
955
956 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
957
958         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
959         https://bugs.webkit.org/show_bug.cgi?id=196126
960         rdar://problem/49095791
961
962         Reviewed by Tim Horton.
963         
964         I fumbled the commit after the enum rename. Make this actually work.
965
966         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
967         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
968
969 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
970
971         Zoom on macOS is centered around a point lower than the cursor
972         https://bugs.webkit.org/show_bug.cgi?id=196225
973         rdar://problem/49213574
974
975         Reviewed by Tim Horton.
976         
977         The origin handed to ViewGestureController::handleMagnificationGestureEvent is in WKWebView
978         coordinates, but we end up setting the transform on the RenderView's layer, so we need
979         to subtract the topContentInset.
980
981         * UIProcess/mac/ViewGestureControllerMac.mm:
982         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
983
984 2019-03-25  Alex Christensen  <achristensen@webkit.org>
985
986         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
987         https://bugs.webkit.org/show_bug.cgi?id=196213
988
989         Reviewed by Geoff Garen.
990
991         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
992         with a SecIdentityRef wrapped in an NSCredential.
993
994         * Shared/cf/ArgumentCodersCF.cpp:
995         (IPC::decode):
996
997 2019-03-25  Chris Dumez  <cdumez@apple.com>
998
999         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
1000         https://bugs.webkit.org/show_bug.cgi?id=196210
1001         <rdar://problem/48681326>
1002
1003         Reviewed by Geoffrey Garen.
1004
1005         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
1006         instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.
1007
1008         This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
1009         communicate via DrawingArea IPC.
1010
1011         * WebProcess/WebPage/WebPage.cpp:
1012         (WebKit::WebPage::reinitializeWebPage):
1013         (WebKit::WebPage::setIsSuspended):
1014         * WebProcess/WebPage/WebPage.h:
1015
1016 2019-03-25  Alex Christensen  <achristensen@webkit.org>
1017
1018         Enable IPC sending and receiving non-default-constructible types
1019         https://bugs.webkit.org/show_bug.cgi?id=196132
1020
1021         Reviewed by Geoff Garen.
1022
1023         * Platform/IPC/ArgumentCoder.h:
1024         * Platform/IPC/ArgumentCoders.h:
1025         (IPC::TupleEncoder::encode):
1026         (IPC::tupleFromTupleAndObject):
1027         (IPC::TupleDecoderImpl::decode):
1028         (IPC::TupleDecoderImpl<Type>::decode):
1029         (IPC::TupleDecoder::decode):
1030         (IPC::TupleDecoder<0>::decode):
1031         (IPC::TupleCoder::encode): Deleted.
1032         (IPC::TupleCoder::decode): Deleted.
1033         * Platform/IPC/Connection.h:
1034         (IPC::Connection::sendWithReply):
1035         (IPC::TupleMover::move):
1036         (IPC::moveTuple):
1037         (IPC::Connection::sendSync):
1038         * Platform/IPC/Decoder.h:
1039         (IPC::Decoder::decode):
1040         (IPC::Decoder::operator>>):
1041         * Platform/IPC/HandleMessage.h:
1042         (IPC::handleMessage):
1043         (IPC::handleMessageSynchronous):
1044         (IPC::handleMessageSynchronousWantsConnection):
1045         (IPC::handleMessageAsync):
1046         * Platform/SharedMemory.h:
1047         * Scripts/webkit/LegacyMessages-expected.h:
1048         * Scripts/webkit/Messages-expected.h:
1049         * Scripts/webkit/MessagesSuperclass-expected.h:
1050         * Scripts/webkit/messages.py:
1051         * Shared/Databases/IndexedDB/WebIDBResult.h:
1052         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1053         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1054         * Shared/ShareableBitmap.h:
1055         * Shared/ShareableResource.h:
1056         * Shared/UpdateInfo.h:
1057         * Shared/WebEvent.h:
1058         * Shared/WebProcessCreationParameters.cpp:
1059         * Shared/WebProcessCreationParameters.h:
1060         * Shared/mac/SecItemResponseData.cpp:
1061         (WebKit::SecItemResponseData::SecItemResponseData):
1062         (WebKit::SecItemResponseData::decode):
1063         * Shared/mac/SecItemResponseData.h:
1064         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
1065
1066 2019-03-25  Tim Horton  <timothy_horton@apple.com>
1067
1068         Animated keyboard scrolling is extremely chaotic
1069         https://bugs.webkit.org/show_bug.cgi?id=196164
1070         <rdar://problem/48702444>
1071
1072         Reviewed by Simon Fraser.
1073
1074         * UIProcess/ios/WKContentViewInteraction.mm:
1075         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1076         Consume keyboard events instead of interpreting them traditionally
1077         if WKKeyboardScrollingAnimator is animating.
1078
1079         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
1080         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1081         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
1082         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
1083         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
1084         (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
1085         (-[WKKeyboardScrollingAnimator displayLinkFired:]):
1086         (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
1087         Expose the current state of interactive scrolling, and rename the related member.
1088
1089 2019-03-25  Keith Rollin  <krollin@apple.com>
1090
1091         Add WebKit logging for first paint and other interesting layout milestones
1092         https://bugs.webkit.org/show_bug.cgi?id=196159
1093         <rdar://problem/49128952>
1094
1095         Reviewed by Simon Fraser.
1096
1097         Add some logging to indicate what layout milestones have been reached.
1098         This should help us determine if there's a client, rendering, layout,
1099         or some other issue when page content does not appear in the client
1100         window.
1101
1102         The logging is being added to
1103         WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
1104         a nice central place to capture layout milestones. However, it will
1105         only log notifications that are being sent to clients. It does not
1106         indicate all milestones that have occurred. That is, it does not
1107         report milestones that are filtered out due to client disinterest.
1108         There doesn't seem to be a good central place to capture all
1109         milestones, regardless of client interest.
1110
1111         * Platform/Logging.h:
1112         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1113         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
1114
1115 2019-03-25  Patrick Griffis  <pgriffis@igalia.com>
1116
1117         [GTK][WPE] Remove network access from web process sandbox
1118         https://bugs.webkit.org/show_bug.cgi?id=189967
1119
1120         Reviewed by Michael Catanzaro.
1121
1122         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1123         (WebKit::createFlatpakInfo):
1124         (WebKit::bubblewrapSpawn):
1125         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
1126         (WebKit::flatpakSpawn):
1127
1128 2019-03-25  Andy Estes  <aestes@apple.com>
1129
1130         [Apple Pay] Call +canMakePayments on a work queue
1131         https://bugs.webkit.org/show_bug.cgi?id=196179
1132         <rdar://problem/45388749>
1133
1134         Reviewed by Brady Eidson.
1135
1136         Calling +canMakePayments on either PKPaymentAuthorizationController or
1137         PKPaymentAuthorizationViewController results in synchronous IPC and is therefore very
1138         expensive to call on the main thread. On iOS, these calls are made in the network process,
1139         and on Mac in the UI process.
1140
1141         Call these methods on a work queue to avoid main thread spins.
1142
1143         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
1144         (WebKit::WebPaymentCoordinatorProxy::canMakePayments):
1145         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
1146         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
1147         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
1148         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1149         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
1150
1151 2019-03-25  Andy Estes  <aestes@apple.com>
1152
1153         [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
1154         https://bugs.webkit.org/show_bug.cgi?id=196180
1155
1156         Reviewed by Youenn Fablet.
1157
1158         Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
1159         without an entitlement. Therefore, we can call it from the web process directly rather than
1160         synchronously messaging the entitled UI or networking process.
1161
1162         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
1163         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
1164         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1165         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1166         * SourcesCocoa.txt:
1167         * WebKit.xcodeproj/project.pbxproj:
1168         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1169         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
1170         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1171         * WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
1172         (WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
1173         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1174         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
1175         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
1176
1177 2019-03-25  Chris Dumez  <cdumez@apple.com>
1178
1179         Unreviewed, tiny fix after r243388 to address API test failures on iOS
1180
1181         m_processType was properly initialized on macOS but not iOS.
1182
1183         * WebProcess/cocoa/WebProcessCocoa.mm:
1184         (WebKit::WebProcess::platformInitializeProcess):
1185
1186 2019-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1187
1188         [GTK][WPE] Do not allow changes in active URI before provisional load starts for non-API requests
1189         https://bugs.webkit.org/show_bug.cgi?id=194208
1190
1191         Reviewed by Michael Catanzaro.
1192
1193         * UIProcess/API/glib/WebKitWebView.cpp:
1194         (webkitWebViewWillStartLoad): Block updates of active URL.
1195         (webkitWebViewLoadChanged): Unblock updates of active URL on WEBKIT_LOAD_STARTED.
1196
1197 2019-03-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1198
1199         Remove NavigatorContentUtils in WebCore/Modules
1200         https://bugs.webkit.org/show_bug.cgi?id=196070
1201
1202         Reviewed by Alex Christensen.
1203
1204         NavigatorContentUtils was to support the custom scheme spec [1].
1205         However, in WebKit side, no port has supported the feature in
1206         WebKit layer after EFL port was removed. So there has been the
1207         only IDL implementation of the NavigatorContentUtils in WebCore.
1208         So we don't need to keep the implementation in WebCore anymore.
1209
1210         [1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
1211
1212         * Configurations/FeatureDefines.xcconfig:
1213         * WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h: Removed.
1214
1215 2019-03-24  Zan Dobersek  <zdobersek@igalia.com>
1216
1217         Unreviewed WPE build fix.
1218
1219         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
1220         Add an explicit CompletionHandler.h include to avoid a trip-up in
1221         unified builds.
1222
1223 2019-03-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1224
1225         [WinCairo] WebProcessDataStoreParameters.h(32): error C2653: 'SandboxExtension': is not a class or namespace name
1226         https://bugs.webkit.org/show_bug.cgi?id=196192
1227
1228         Unreviewed for WinCairo port.
1229
1230         * Shared/WebProcessDataStoreParameters.h: Added #include "SandboxExtension.h".
1231
1232 2019-03-24  Andy Estes  <aestes@apple.com>
1233
1234         [watchOS] Remove unused Proximity Networking code
1235         https://bugs.webkit.org/show_bug.cgi?id=196188
1236
1237         Reviewed by Tim Horton.
1238
1239         * Configurations/WebKit.xcconfig:
1240         * NetworkProcess/NetworkProcess.cpp:
1241         (WebKit::NetworkProcess::NetworkProcess):
1242         * NetworkProcess/NetworkProcess.h:
1243         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1244         (WebKit::NetworkProcessCreationParameters::encode const):
1245         (WebKit::NetworkProcessCreationParameters::decode):
1246         * NetworkProcess/NetworkProcessCreationParameters.h:
1247         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1248         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1249         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1250         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1251         (WebKit::NetworkProcess::platformPrepareToSuspend):
1252         (WebKit::NetworkProcess::platformProcessDidResume):
1253         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
1254         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
1255         * NetworkProcess/watchos/NetworkProximityAssertion.h: Removed.
1256         * NetworkProcess/watchos/NetworkProximityAssertion.mm: Removed.
1257         * NetworkProcess/watchos/NetworkProximityManager.h: Removed.
1258         * NetworkProcess/watchos/NetworkProximityManager.mm: Removed.
1259         * SourcesCocoa.txt:
1260         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1261         (API::ProcessPoolConfiguration::copy):
1262         * UIProcess/API/APIProcessPoolConfiguration.h:
1263         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1264         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1265         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
1266         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
1267         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1268         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1269         * WebKit.xcodeproj/project.pbxproj:
1270
1271 2019-03-23  Chris Dumez  <cdumez@apple.com>
1272
1273         Unreviewed, fix typo in comment added in r243379.
1274
1275         * UIProcess/API/Cocoa/WKProcessGroup.mm:
1276         (-[WKProcessGroup setDelegate:]):
1277
1278 2019-03-23  Simon Fraser  <simon.fraser@apple.com>
1279
1280         REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
1281         https://bugs.webkit.org/show_bug.cgi?id=137043
1282         rdar://problem/16595330
1283
1284         Reviewed by Zalan Bujtas.
1285
1286         Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
1287         to the UI process, and use it to set UIScrollView indicators visible or not.
1288         
1289         The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
1290         where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
1291         tests, so would never get called.
1292
1293         * Shared/WebCoreArgumentCoders.cpp:
1294         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
1295         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
1296         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1297         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
1298
1299 2019-03-23  Zalan Bujtas  <zalan@apple.com>
1300
1301         [ContentChangeObserver] Taping on a form control should always result in click.
1302         https://bugs.webkit.org/show_bug.cgi?id=196177
1303
1304         Reviewed by Simon Fraser.
1305
1306         This patch enures that we send a synthetic click when the traget node is a form control (button, edit field etc) even if
1307         the mousemove brings up some hover content.
1308
1309         * WebProcess/WebPage/ios/WebPageIOS.mm:
1310         (WebKit::WebPage::handleSyntheticClick):
1311
1312 2019-03-23  Andy Estes  <aestes@apple.com>
1313
1314         [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS
1315         https://bugs.webkit.org/show_bug.cgi?id=196163
1316         <rdar://problem/48787564>
1317
1318         Reviewed by Anders Carlsson.
1319
1320         Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop
1321         calling PKPaymentAuthorizationViewController class methods on iOS in favor of their
1322         PKPaymentAuthorizationController alternatives.
1323
1324         While we're here, we should also transition to calling
1325         +paymentServicesMerchantURLForAPIType:completion: on both
1326         PKPaymentAuthorizationViewController and PKPaymentAuthorizationController.
1327
1328         * Platform/cocoa/PaymentAuthorizationViewController.mm:
1329         (-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
1330         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
1331         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
1332         (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]):
1333         (-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]):
1334         * Platform/ios/PaymentAuthorizationController.mm:
1335         (-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
1336         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1337         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted.
1338         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
1339         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
1340         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1341         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
1342
1343 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1344
1345         Unreviewed. Fix GTK build after r243409.
1346
1347         Build failure is actually unrelated to r243409, it's yet another unified build failure that happens when source
1348         file list changes.
1349
1350         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1351         (WebKit::WebInspectorProxy::platformShowCertificate): Use WebCore namespace for CertificateInfo parameter.
1352
1353 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1354
1355         [GTK] Remove build time dependency on Geoclue2
1356         https://bugs.webkit.org/show_bug.cgi?id=195994
1357
1358         Reviewed by Michael Catanzaro.
1359
1360         Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.
1361
1362         * PlatformGTK.cmake:
1363         * PlatformWPE.cmake:
1364         * SourcesGTK.txt:
1365         * SourcesWPE.txt:
1366         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
1367         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
1368         (webkitGeolocationManagerStop):
1369         (webkitGeolocationManagerSetEnableHighAccuracy):
1370         (webkitGeolocationManagerDispose):
1371         (webkit_geolocation_manager_class_init):
1372         * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
1373         (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
1374         (WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
1375         (WebKit::GeoclueGeolocationProvider::start):
1376         (WebKit::GeoclueGeolocationProvider::stop):
1377         (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
1378         (WebKit::GeoclueGeolocationProvider::destroyManagerLater):
1379         (WebKit::GeoclueGeolocationProvider::destroyManager):
1380         (WebKit::GeoclueGeolocationProvider::setupManager):
1381         (WebKit::GeoclueGeolocationProvider::createClient):
1382         (WebKit::GeoclueGeolocationProvider::setupClient):
1383         (WebKit::GeoclueGeolocationProvider::startClient):
1384         (WebKit::GeoclueGeolocationProvider::stopClient):
1385         (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
1386         (WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
1387         (WebKit::GeoclueGeolocationProvider::createLocation):
1388         (WebKit::GeoclueGeolocationProvider::locationUpdated):
1389         (WebKit::GeoclueGeolocationProvider::didFail):
1390         * UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
1391
1392 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
1393
1394         Undo collision with r243390.
1395
1396         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1397         (stringForSSLProtocol):
1398
1399 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
1400
1401         Fix internal builds.
1402
1403         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1404         (stringForSSLProtocol):
1405
1406 2019-03-22  Keith Rollin  <krollin@apple.com>
1407
1408         Enable ThinLTO support in Production builds
1409         https://bugs.webkit.org/show_bug.cgi?id=190758
1410         <rdar://problem/45413233>
1411
1412         Reviewed by Daniel Bates.
1413
1414         Enable building with Thin LTO in Production when using Xcode 10.2 or
1415         later. This change results in a 1.45% progression in PLT5. Full
1416         Production build times increase about 2-3%. Incremental build times
1417         are more severely affected, and so LTO is not enabled for local
1418         engineering builds.
1419
1420         LTO is enabled only on macOS for now, until rdar://problem/49013399,
1421         which affects ARM builds, is fixed.
1422
1423         To change the LTO setting when building locally:
1424
1425         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
1426           command line.
1427         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
1428           on the command line.
1429         - If building with `build-root`, specify --lto={none,thin,full} on the
1430           command line.
1431         - If building with Xcode, create a LocalOverrides.xcconfig file at the
1432           top level of your repository directory (if needed) and define
1433           WK_LTO_MODE to full, thin, or none.
1434
1435         * Configurations/Base.xcconfig:
1436
1437 2019-03-22  Chris Dumez  <cdumez@apple.com>
1438
1439         Unreviewed build fix after r243388.
1440
1441         * WebProcess/WebProcess.h:
1442
1443 2019-03-22  Per Arne Vollan  <pvollan@apple.com>
1444
1445         [macOS] Fix sandbox violation
1446         https://bugs.webkit.org/show_bug.cgi?id=196153
1447         <rdar://problem/49123855>
1448
1449         Reviewed by Brent Fulgham.
1450
1451         The sandbox on macOS is blocking the mach lookup.
1452
1453         * WebProcess/com.apple.WebProcess.sb.in:
1454
1455 2019-03-21  Ryan Haddad  <ryanhaddad@apple.com>
1456
1457         Unreviewed, fix the build with recent SDKs.
1458
1459         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1460         (stringForSSLProtocol):
1461
1462 2019-03-22  Chris Dumez  <cdumez@apple.com>
1463
1464         Implement WebProcess freezer opt-in completely on WebContent process side
1465         https://bugs.webkit.org/show_bug.cgi?id=196149
1466
1467         Reviewed by Brady Eidson.
1468
1469         Implement WebProcess freezer opt-in completely on WebContent process side, we do not need
1470         to involve the UIProcess with this and rely on IPC which may be fragile.
1471
1472         In the future, we may want to set freezable state from the UIProcess when the API supports
1473         it. We can move the logic to be fully on the UIProcess side then. In the mean time, it is
1474         likely best not to rely on IPC and process coordination for this.
1475
1476         * UIProcess/WebProcessProxy.cpp:
1477         (WebKit::globalPageMap):
1478         (WebKit::WebProcessProxy::WebProcessProxy):
1479         (WebKit::WebProcessProxy::setIsInProcessCache):
1480         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
1481         (WebKit::WebProcessProxy::didFinishLaunching):
1482         (WebKit::WebProcessProxy::validateFreezerStatus): Deleted.
1483         * UIProcess/WebProcessProxy.h:
1484         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
1485         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap): Deleted.
1486         (WebKit::WebProcessProxy::WebPageProxyMap::size const): Deleted.
1487         (WebKit::WebProcessProxy::WebPageProxyMap::values): Deleted.
1488         (WebKit::WebProcessProxy::WebPageProxyMap::values const): Deleted.
1489         (WebKit::WebProcessProxy::WebPageProxyMap::begin): Deleted.
1490         (WebKit::WebProcessProxy::WebPageProxyMap::end): Deleted.
1491         (WebKit::WebProcessProxy::WebPageProxyMap::get): Deleted.
1492         (WebKit::WebProcessProxy::WebPageProxyMap::contains const): Deleted.
1493         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const): Deleted.
1494         (WebKit::WebProcessProxy::WebPageProxyMap::set): Deleted.
1495         (WebKit::WebProcessProxy::WebPageProxyMap::take): Deleted.
1496         * WebProcess/WebProcess.cpp:
1497         (WebKit::WebProcess::setIsInProcessCache):
1498         (WebKit::WebProcess::markIsNoLongerPrewarmed):
1499         (WebKit::WebProcess::actualPrepareToSuspend):
1500         (WebKit::WebProcess::setFreezable): Deleted.
1501         * WebProcess/WebProcess.h:
1502         * WebProcess/WebProcess.messages.in:
1503         * WebProcess/cocoa/WebProcessCocoa.mm:
1504         (WebKit::WebProcess::updateProcessName):
1505         (WebKit::WebProcess::shouldFreezeOnSuspension const):
1506         (WebKit::WebProcess::updateFreezerStatus):
1507
1508 2019-03-22  Chris Dumez  <cdumez@apple.com>
1509
1510         Prewarmed processes should be usable with any website data store
1511         https://bugs.webkit.org/show_bug.cgi?id=196104
1512
1513         Reviewed by Alex Christensen.
1514
1515         Split WebsiteDataStore-specific data out of WebProcessCreationParameters and into a new
1516         WebProcessDataStoreParameters struct so that we do not need a WebsiteDataStore in order
1517         to lauch and initialize a WebProcess. When the process finally gets used and we thus
1518         know which WebsiteDataStore they will be used for, we send the WebProcessDataStoreParameters
1519         to the process to that it can do its data store-specific initialization.
1520
1521         This allows prewarmed processes not not have a WebsiteDataStore assocated with them. They
1522         can then be used for any WebsiteDataStore when we need them.
1523
1524         This is also used by our dummy WebProcessProxy since it does not have a backing process and
1525         thus has no associated WebsiteDataStore.
1526
1527         * Shared/WebProcessCreationParameters.cpp:
1528         (WebKit::WebProcessCreationParameters::encode const):
1529         (WebKit::WebProcessCreationParameters::decode):
1530         * Shared/WebProcessCreationParameters.h:
1531         * Shared/WebProcessDataStoreParameters.h: Added.
1532         (WebKit::WebProcessDataStoreParameters::encode const):
1533         (WebKit::WebProcessDataStoreParameters::decode):
1534         * UIProcess/API/C/WKContext.cpp:
1535         (WKContextWarmInitialProcess):
1536         * UIProcess/API/Cocoa/WKProcessPool.mm:
1537         (-[WKProcessPool _warmInitialProcess]):
1538         * UIProcess/ServiceWorkerProcessProxy.cpp:
1539         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
1540         * UIProcess/WebPageProxy.cpp:
1541         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
1542         * UIProcess/WebProcessPool.cpp:
1543         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
1544         (WebKit::WebProcessPool::createNewWebProcess):
1545         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1546         (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
1547         (WebKit::WebProcessPool::initializeNewWebProcess):
1548         (WebKit::WebProcessPool::prewarmProcess):
1549         (WebKit::WebProcessPool::processForRegistrableDomain):
1550         (WebKit::WebProcessPool::createWebPage):
1551         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
1552         * UIProcess/WebProcessPool.h:
1553         (WebKit::WebProcessPool::sendToOneProcess):
1554         * UIProcess/WebProcessProxy.cpp:
1555         (WebKit::WebProcessProxy::create):
1556         (WebKit::WebProcessProxy::WebProcessProxy):
1557         (WebKit::WebProcessProxy::setWebsiteDataStore):
1558         (WebKit::WebProcessProxy::addExistingWebPage):
1559         * UIProcess/WebProcessProxy.h:
1560         (WebKit::WebProcessProxy::websiteDataStore const):
1561         * WebKit.xcodeproj/project.pbxproj:
1562         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1563         (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
1564         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
1565         * WebProcess/WebProcess.cpp:
1566         (WebKit::WebProcess::initializeWebProcess):
1567         (WebKit::WebProcess::setWebsiteDataStoreParameters):
1568         * WebProcess/WebProcess.h:
1569         * WebProcess/WebProcess.messages.in:
1570         * WebProcess/WebProcessSupplement.h:
1571         (WebKit::WebProcessSupplement::initialize):
1572         (WebKit::WebProcessSupplement::setWebsiteDataStore):
1573         * WebProcess/cocoa/WebProcessCocoa.mm:
1574         (WebKit::WebProcess::platformInitializeWebProcess):
1575         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
1576         * WebProcess/win/WebProcessWin.cpp:
1577         (WebKit::WebProcess::platformInitializeWebProcess):
1578         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
1579
1580 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
1581
1582         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
1583         https://bugs.webkit.org/show_bug.cgi?id=196126
1584         rdar://problem/49095791
1585
1586         Reviewed by Antti Koivisto.
1587
1588         The scrolling tree doesn't have an accurate picture of the main view's scroll position
1589         during pinch-zooming, so don't have it apply layer positions if a transient zoom is
1590         in progress.
1591
1592         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1593         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1594         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1595         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
1596
1597 2019-03-22  Antti Koivisto  <antti@apple.com>
1598
1599         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
1600         https://bugs.webkit.org/show_bug.cgi?id=196100
1601         <rdar://problem/49117933>
1602
1603         Reviewed by Simon Fraser.
1604
1605         Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
1606
1607         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
1608         (WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const):
1609         (WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const):
1610
1611         Make more generic and save the associated positioning behavior.
1612
1613         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const): Deleted.
1614         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID): Deleted.
1615         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs): Deleted.
1616         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
1617         (WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs):
1618         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1619         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
1620         (WebKit::isScrolledBy):
1621
1622         Stationary relationship means the layer won't scroll the scroller.
1623
1624         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1625         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
1626
1627 2019-03-22  Chris Dumez  <cdumez@apple.com>
1628
1629         REGRESSION (r243094): ePub files do not render or open in Books
1630         https://bugs.webkit.org/show_bug.cgi?id=196119
1631         <rdar://problem/49121686>
1632
1633         Reviewed by Brady Eidson.
1634
1635         Do not delay the WebProcess launch until a load when contructing a web view and the client
1636         may observe when its injected bundle is loaded via WKProcessGroupDelegate's
1637         didCreateConnectionToWebProcessPlugIn.
1638
1639         * UIProcess/API/Cocoa/WKProcessGroup.mm:
1640         (-[WKProcessGroup setDelegate:]):
1641         * UIProcess/WebInspectorUtilities.cpp:
1642         (WebKit::inspectorProcessPool):
1643         * UIProcess/WebProcessPool.cpp:
1644         (WebKit::WebProcessPool::createWebPage):
1645         * UIProcess/WebProcessPool.h:
1646
1647 2019-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1648
1649         REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()
1650         https://bugs.webkit.org/show_bug.cgi?id=196140
1651
1652         Reviewed by Chris Dumez.
1653
1654         Since r243094, the WebPageProxy fullscreen manager is not created in the constructor, but once the page has a
1655         process launched.
1656
1657         * UIProcess/Automation/WebAutomationSession.cpp:
1658         (WebKit::WebAutomationSession::exitFullscreenWindowForPage): Null check WebPageProxy::fullScreenManager() before
1659         using it.
1660
1661 2019-03-22  Timothy Hatcher  <timothy@apple.com>
1662
1663         Change macosx() to macos() in WK_API... and JSC_API... macros.
1664         https://bugs.webkit.org/show_bug.cgi?id=196106
1665
1666         Reviewed by Brian Burg.
1667
1668         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
1669         * Shared/API/Cocoa/WKDragDestinationAction.h:
1670         * Shared/API/Cocoa/WKMain.h:
1671         * Shared/API/Cocoa/_WKFrameHandle.h:
1672         * Shared/API/Cocoa/_WKHitTestResult.h:
1673         * Shared/API/Cocoa/_WKNSWindowExtras.h:
1674         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
1675         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
1676         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
1677         * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
1678         * UIProcess/API/C/WKPage.h:
1679         * UIProcess/API/Cocoa/NSAttributedString.h:
1680         * UIProcess/API/Cocoa/WKBackForwardList.h:
1681         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1682         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
1683         * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
1684         * UIProcess/API/Cocoa/WKContentRuleList.h:
1685         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
1686         * UIProcess/API/Cocoa/WKError.h:
1687         * UIProcess/API/Cocoa/WKErrorPrivate.h:
1688         * UIProcess/API/Cocoa/WKFrameInfo.h:
1689         * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
1690         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
1691         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
1692         * UIProcess/API/Cocoa/WKNavigation.h:
1693         * UIProcess/API/Cocoa/WKNavigationAction.h:
1694         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1695         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1696         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1697         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1698         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
1699         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
1700         * UIProcess/API/Cocoa/WKPreferences.h:
1701         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1702         * UIProcess/API/Cocoa/WKProcessPool.h:
1703         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1704         * UIProcess/API/Cocoa/WKScriptMessage.h:
1705         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
1706         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
1707         * UIProcess/API/Cocoa/WKUIDelegate.h:
1708         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1709         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
1710         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
1711         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
1712         * UIProcess/API/Cocoa/WKUserContentController.h:
1713         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
1714         * UIProcess/API/Cocoa/WKUserScript.h:
1715         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
1716         * UIProcess/API/Cocoa/WKViewPrivate.h:
1717         * UIProcess/API/Cocoa/WKWebView.h:
1718         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1719         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1720         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1721         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1722         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
1723         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1724         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1725         * UIProcess/API/Cocoa/WKWindowFeatures.h:
1726         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
1727         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
1728         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
1729         * UIProcess/API/Cocoa/_WKAttachment.h:
1730         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
1731         * UIProcess/API/Cocoa/_WKAutomationSession.h:
1732         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
1733         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1734         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
1735         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
1736         * UIProcess/API/Cocoa/_WKDownload.h:
1737         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
1738         * UIProcess/API/Cocoa/_WKElementAction.h:
1739         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
1740         * UIProcess/API/Cocoa/_WKFindOptions.h:
1741         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
1742         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1743         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
1744         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
1745         * UIProcess/API/Cocoa/_WKInspector.h:
1746         * UIProcess/API/Cocoa/_WKInspectorWindow.h:
1747         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
1748         * UIProcess/API/Cocoa/_WKLayoutMode.h:
1749         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
1750         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
1751         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1752         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
1753         * UIProcess/API/Cocoa/_WKSessionState.h:
1754         * UIProcess/API/Cocoa/_WKTextInputContext.h:
1755         * UIProcess/API/Cocoa/_WKThumbnailView.h:
1756         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
1757         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
1758         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
1759         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
1760         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
1761         * UIProcess/API/Cocoa/_WKUserInitiatedAction.h:
1762         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1763         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1764         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
1765         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1766         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
1767         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
1768         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1769         * WebProcess/API/Cocoa/WKWebProcess.h:
1770         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
1771         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1772         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
1773         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
1774         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
1775         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
1776         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
1777         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
1778         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
1779         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
1780         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
1781         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
1782         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
1783         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
1784         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
1785         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
1786         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1787
1788 2019-03-22  Yousuke Kimoto  <Yousuke.Kimoto@sony.com>
1789
1790         Unreviewed build fix.
1791
1792         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1793
1794 2019-03-22  Tim Horton  <timothy_horton@apple.com>
1795
1796         Fix the build after r243354
1797         https://bugs.webkit.org/show_bug.cgi?id=196138
1798         <rdar://problem/49145951>
1799
1800         * Platform/spi/ios/UIKitSPI.h:
1801         * Shared/DocumentEditingContext.mm:
1802         (WebKit::DocumentEditingContext::toPlatformContext):
1803         * UIProcess/ios/WKContentViewInteraction.mm:
1804
1805 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
1806
1807         Clean up some TiledCoreAnimationDrawingArea members
1808         https://bugs.webkit.org/show_bug.cgi?id=196124
1809
1810         Reviewed by Tim Horton.
1811
1812         The giant m_transform was unused.
1813         
1814         Group the bools etc.
1815
1816         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1817         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1818         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1819         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
1820
1821 2019-03-21  Brady Eidson  <beidson@apple.com>
1822
1823         Certain WebProcesses should opt-out of the freezer.
1824         <rdar://problem/42846139> and https://bugs.webkit.org/show_bug.cgi?id=196062
1825
1826         Reviewed by Andy Estes.
1827
1828         WebProcesses should opt-in and opt-out of the freezer as is appropriate.
1829         By default a WebProcess is freezer eligible.
1830         If any of the following become true then it should become ineligible:
1831         - The WebProcess is a pre-warmed process.
1832         - The WebProcess is in the process cache.
1833         - The WebProcess is not actively hosting any web pages (e.g. it only has suspending web pages)
1834
1835         The most complicated part of the above is guaranteeing that any operation that changes
1836         the active pages hosted by the process causes a recalculation of the freezer opt-in state.
1837
1838         To do that this replaces the basic WebPageProxyMap with a custom class.
1839
1840         * UIProcess/WebProcessProxy.cpp:
1841         (WebKit::globalPageMap):
1842         (WebKit::WebProcessProxy::WebProcessProxy):
1843         (WebKit::WebProcessProxy::validateFreezerStatus):
1844         (WebKit::WebProcessProxy::setIsInProcessCache):
1845         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
1846         (WebKit::WebProcessProxy::didFinishLaunching):
1847         * UIProcess/WebProcessProxy.h:
1848         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap):
1849         (WebKit::WebProcessProxy::WebPageProxyMap::size const):
1850         (WebKit::WebProcessProxy::WebPageProxyMap::values):
1851         (WebKit::WebProcessProxy::WebPageProxyMap::values const):
1852         (WebKit::WebProcessProxy::WebPageProxyMap::begin):
1853         (WebKit::WebProcessProxy::WebPageProxyMap::end):
1854         (WebKit::WebProcessProxy::WebPageProxyMap::get):
1855         (WebKit::WebProcessProxy::WebPageProxyMap::contains const):
1856         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const):
1857         (WebKit::WebProcessProxy::WebPageProxyMap::set):
1858         (WebKit::WebProcessProxy::WebPageProxyMap::take):
1859
1860         * WebProcess/WebProcess.cpp:
1861         (WebKit::WebProcess::setFreezable):
1862         * WebProcess/WebProcess.h:
1863         * WebProcess/WebProcess.messages.in:
1864
1865 2019-03-21  Tim Horton  <timothy_horton@apple.com>
1866
1867         Adopt UIWKDocumentContext
1868         https://bugs.webkit.org/show_bug.cgi?id=196040
1869         <rdar://problem/48642440>
1870
1871         Reviewed by Ryosuke Niwa.
1872
1873         * Platform/spi/ios/UIKitSPI.h:
1874         * Scripts/webkit/messages.py:
1875         * Shared/DocumentEditingContext.h: Added.
1876         * Shared/DocumentEditingContext.mm: Added.
1877         (WebKit::toNSRange):
1878         (WebKit::DocumentEditingContext::toPlatformContext):
1879         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::encode):
1880         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::decode):
1881         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::encode):
1882         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::decode):
1883         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::encode):
1884         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::decode):
1885         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::encode):
1886         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
1887         Add DocumentEditingContext(Request), and coders.
1888         Also expose DocumentEditingContext::toPlatformContext, which populates
1889         a UIWKDocumentContext with the relevant values.
1890
1891         * SourcesCocoa.txt:
1892         * UIProcess/WebPageProxy.h:
1893         * UIProcess/ios/WKContentViewInteraction.mm:
1894         (toWebDocumentRequestOptions):
1895         (toWebRequest):
1896         (-[WKContentView adjustSelectionWithDelta:completionHandler:]):
1897         (-[WKContentView requestDocumentContext:completionHandler:]):
1898         (-[WKContentView selectPositionAtPoint:withContextRequest:completionHandler:]):
1899         * UIProcess/ios/WebPageProxyIOS.mm:
1900         (WebKit::WebPageProxy::adjustSelectionWithDelta):
1901         (WebKit::WebPageProxy::requestDocumentEditingContext):
1902         * WebKit.xcodeproj/project.pbxproj:
1903         * WebProcess/WebPage/WebPage.h:
1904         * WebProcess/WebPage/WebPage.messages.in:
1905         Plumb DocumentEditingContext(Request) around.
1906
1907         * WebProcess/WebPage/ios/WebPageIOS.mm:
1908         (WebKit::WebPage::adjustSelectionWithDelta):
1909         Adjust the current selection given deltas to apply to the location and length.
1910
1911         (WebKit::visiblePositionAdjacentToVisiblePosition):
1912         (WebKit::visiblePositionForPointInRootViewCoordinates):
1913         (WebKit::WebPage::requestDocumentEditingContext):
1914         Retrieve the relevant part of the selection, as well as the context,
1915         given either the selection, or a rect.
1916         If we're collecting context for a rect, we split the context between
1917         before and after (except for the part that intersects the selection).
1918         The three strings will always be directly adjacent, and any of the three
1919         can sometimes be null.
1920
1921 2019-03-21  James Magahern  <jmagahern@apple.com>
1922
1923         Long press gesture recognizers in WKWebView are conflicting with internal scroll view long press gesture recognizers
1924         https://bugs.webkit.org/show_bug.cgi?id=195726
1925         rdar://problem/48582449
1926
1927         Reviewed by Megan Gardner.
1928
1929         We just need to add another clause to WKContentViewInteraction's
1930         canPreventGestureRecognizer whitelist. 
1931
1932         * UIProcess/ios/WKContentViewInteraction.mm:
1933         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
1934
1935 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
1936
1937         [iOS WK2] Turn on async overflow scrolling by default
1938         https://bugs.webkit.org/show_bug.cgi?id=196011
1939         rdar://problem/48453859
1940
1941         Reviewed by Antti Koivisto.
1942
1943         * Shared/WebPreferences.yaml:
1944         * Shared/WebPreferencesDefaultValues.h:
1945
1946 2019-03-21  Alex Christensen  <achristensen@webkit.org>
1947
1948         Remove last use of LegacySync IPC messages
1949         https://bugs.webkit.org/show_bug.cgi?id=196113
1950
1951         Reviewed by Chris Dumez.
1952
1953         Also rename "Delayed" to "Synchronous" now that there's only one type of synchronous message.
1954
1955         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1956         * NetworkProcess/NetworkProcess.messages.in:
1957         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1958         (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient):
1959         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1960         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
1961         * Platform/IPC/Connection.cpp:
1962         (IPC::Connection::dispatchMessage):
1963         * Platform/IPC/HandleMessage.h:
1964         (IPC::handleMessageSynchronous):
1965         (IPC::handleMessageSynchronousWantsConnection):
1966         (IPC::handleMessageLegacySync): Deleted.
1967         (IPC::handleMessageDelayed): Deleted.
1968         (IPC::handleMessageDelayedWantsConnection): Deleted.
1969         * PluginProcess/PluginControllerProxy.messages.in:
1970         * PluginProcess/WebProcessConnection.messages.in:
1971         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
1972         (WebKit::WebPage::didReceiveSyncWebPageMessage):
1973         * Scripts/webkit/MessageReceiver-expected.cpp:
1974         (WebKit::WebPage::didReceiveSyncMessage):
1975         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
1976         (Messages::WebPage::TestSyncMessage::send):
1977         (Messages::WebPage::TestSynchronousMessage::send):
1978         (WebKit::WebPage::didReceiveSyncMessage):
1979         (Messages::WebPage::TestDelayedMessage::send): Deleted.
1980         * Scripts/webkit/MessagesSuperclass-expected.h:
1981         (Messages::WebPage::TestSynchronousMessage::name):
1982         (Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
1983         (Messages::WebPage::TestDelayedMessage::receiverName): Deleted.
1984         (Messages::WebPage::TestDelayedMessage::name): Deleted.
1985         (Messages::WebPage::TestDelayedMessage::TestDelayedMessage): Deleted.
1986         (Messages::WebPage::TestDelayedMessage::arguments const): Deleted.
1987         * Scripts/webkit/messages.py:
1988         * Scripts/webkit/messages_unittest.py:
1989         * Scripts/webkit/test-legacy-messages.in:
1990         * Scripts/webkit/test-messages.in:
1991         * Scripts/webkit/test-superclass-messages.in:
1992         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1993         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
1994         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1995         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1996         * UIProcess/WebFullScreenManagerProxy.messages.in:
1997         * UIProcess/WebPageProxy.messages.in:
1998         * UIProcess/WebPasteboardProxy.messages.in:
1999         * UIProcess/WebProcessPool.messages.in:
2000         * UIProcess/WebProcessProxy.messages.in:
2001         * UIProcess/WebStorage/StorageManager.messages.in:
2002         * UIProcess/mac/SecItemShimProxy.messages.in:
2003         * WebProcess/Plugins/PluginProcessConnection.messages.in:
2004         * WebProcess/Plugins/PluginProxy.messages.in:
2005         * WebProcess/Storage/WebSWClientConnection.cpp:
2006         (WebKit::WebSWClientConnection::syncTerminateWorker):
2007         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2008         * WebProcess/WebPage/WebPage.messages.in:
2009         * WebProcess/WebProcess.messages.in:
2010
2011 2019-03-21  Brian Burg  <bburg@apple.com>
2012
2013         Web Automation: support uploading non-local file paths
2014         https://bugs.webkit.org/show_bug.cgi?id=196081
2015         <rdar://problem/45819897>
2016
2017         Reviewed by Devin Rousso and Joseph Pecoraro.
2018
2019         To support cases where supplied file paths do not exist on the session host, add support for
2020         receiving file contents via Automation.setFilesToSelectForFileUpload.
2021
2022         * UIProcess/Automation/Automation.json: Add new parameter.
2023
2024         * UIProcess/Automation/WebAutomationSession.h:
2025         * UIProcess/Automation/WebAutomationSession.cpp:
2026         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
2027         Add support for receiving and saving file contents to a temporary directory. Rewrite the used paths so
2028         that WebCore knows to look at the revised paths where the file contents have been saved.
2029
2030         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
2031         Since WebKit does not have usable FileSystem implementations for all ports, shell out the actual
2032         saving of base64-encoded file data. Provide a Cocoa implementation, since that's what I can test.
2033
2034         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
2035         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
2036         Use WTF::FileSystem to create a temporary directory, and use Cocoa methods to actually write the file.
2037
2038 2019-03-21  Youenn Fablet  <youenn@apple.com>
2039
2040         Cache API and IDB space usages should be initialized on first quota check
2041         https://bugs.webkit.org/show_bug.cgi?id=195707
2042
2043         Reviewed by Chris Dumez.
2044
2045         When the quota manager is created, make sure it delays quota check decisions until IDB and Cache API quota users are initialized.
2046         For IDB, the creation is synchronous but it may not be synchronous for Cache API.
2047         For that purpose, add a temporary quota user that will stay uninitialized until these two quota users are added.
2048         Once added, the temporary quota user is removed.
2049         The addition of the real users is made asynchronously as this is triggered by the creation of one of the two quota users.
2050
2051         In the case of a Cache API caches being cleared, make sure to reset the size to zero and to redo the quota user initialization dance.
2052
2053         * NetworkProcess/NetworkProcess.cpp:
2054         (WebKit::QuotaUserInitializer::initialize):
2055         (WebKit::QuotaUserInitializer::~QuotaUserInitializer):
2056         (WebKit::QuotaUserInitializer::QuotaUserInitializer):
2057         (WebKit::NetworkProcess::storageQuotaManager):
2058         * NetworkProcess/cache/CacheStorageEngine.cpp:
2059         (WebKit::CacheStorage::Engine::initializeQuotaUser):
2060         * NetworkProcess/cache/CacheStorageEngine.h:
2061         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2062         (WebKit::CacheStorage::Caches::clear):
2063
2064 2019-03-21  Per Arne Vollan  <pvollan@apple.com>
2065
2066         [iOS][macOS] Fix sandbox call violations
2067         https://bugs.webkit.org/show_bug.cgi?id=195809
2068         <rdar://problem/48829655>
2069
2070         Reviewed by Brent Fulgham.
2071
2072         An additional syscall needs to be added to the sandbox allow list.
2073
2074         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2075         * WebProcess/com.apple.WebProcess.sb.in:
2076
2077 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
2078
2079         Add UI process WebRTC runtime logging.
2080         https://bugs.webkit.org/show_bug.cgi?id=196020
2081         <rdar://problem/49071443>
2082
2083         Reviewed by Youenn Fablet.
2084
2085         * Platform/Logging.cpp:
2086         (WebKit::getLogChannel): New.
2087         * Platform/Logging.h:
2088         * Shared/WebCoreArgumentCoders.h: Add coders for WTFLogChannelState and WTFLogLevel.
2089
2090         Add runtime logging.
2091         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2092         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
2093         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture):
2094         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2095         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState):
2096         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2097         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
2098         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2099         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
2100         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
2101         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2102         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
2103         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
2104         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
2105         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
2106         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2107         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
2108         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired):
2109         (WebKit::UserMediaPermissionRequestManagerProxy::logChannel const):
2110         (WebKit::convertEnumerationToString):
2111
2112         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2113         (WTF::LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction>::toString):
2114         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2115         (WebKit::convertEnumerationToString): Add an enum specialization for logging.
2116
2117         * UIProcess/UserMediaPermissionRequestProxy.h:
2118         (WTF::LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason>::toString): Ditto.
2119
2120         * UIProcess/WebPageProxy.cpp:
2121         (WebKit::WebPageProxy::logger):
2122         (WebKit::WebPageProxy::configureLoggingChannel):
2123         * UIProcess/WebPageProxy.h:
2124         * UIProcess/WebPageProxy.messages.in:
2125
2126         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2127         (WebKit::WebChromeClient::configureLoggingChannel):
2128         * WebProcess/WebCoreSupport/WebChromeClient.h:
2129         * WebProcess/WebPage/WebPage.cpp:
2130         (WebKit::WebPage::configureLoggingChannel):
2131         * WebProcess/WebPage/WebPage.h:
2132
2133 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2134
2135         Stop using LegacySync messages in WebPageProxy
2136         https://bugs.webkit.org/show_bug.cgi?id=196056
2137
2138         Reviewed by Chris Dumez.
2139
2140         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2141         (WebKit::WebPageProxy::loadRecentSearches):
2142         * UIProcess/ProvisionalPageProxy.cpp:
2143         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
2144         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
2145         * UIProcess/ProvisionalPageProxy.h:
2146         * UIProcess/WebPageProxy.cpp:
2147         (WebKit::WebPageProxy::handleSynchronousMessage):
2148         (WebKit::WebPageProxy::hasInsecureContent):
2149         (WebKit::WebPageProxy::accessibilityScreenToRootView):
2150         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
2151         (WebKit::WebPageProxy::printFrame):
2152         (WebKit::WebPageProxy::backForwardGoToItem):
2153         (WebKit::WebPageProxy::backForwardGoToItemShared):
2154         (WebKit::WebPageProxy::backForwardItemAtIndex):
2155         (WebKit::WebPageProxy::backForwardBackListCount):
2156         (WebKit::WebPageProxy::backForwardForwardListCount):
2157         (WebKit::WebPageProxy::canUndoRedo):
2158         (WebKit::WebPageProxy::executeUndoRedo):
2159         (WebKit::WebPageProxy::checkTextOfParagraph):
2160         (WebKit::WebPageProxy::checkSpellingOfString):
2161         (WebKit::WebPageProxy::checkGrammarOfString):
2162         (WebKit::WebPageProxy::spellingUIIsShowing):
2163         (WebKit::WebPageProxy::getGuessesForWord):
2164         (WebKit::WebPageProxy::substitutionsPanelIsShowing):
2165         (WebKit::WebPageProxy::showCorrectionPanel):
2166         (WebKit::WebPageProxy::dismissCorrectionPanel):
2167         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
2168         (WebKit::WebPageProxy::recordAutocorrectionResponse):
2169         (WebKit::WebPageProxy::dictationAlternatives):
2170         (WebKit::WebPageProxy::wrapCryptoKey):
2171         (WebKit::WebPageProxy::unwrapCryptoKey):
2172         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
2173         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
2174         (WebKit::WebPageProxy::speechSynthesisVoiceList):
2175         (WebKit::WebPageProxy::printMainFrame): Deleted.
2176         * UIProcess/WebPageProxy.h:
2177         * UIProcess/WebPageProxy.messages.in:
2178         * UIProcess/gtk/WebPageProxyGtk.cpp:
2179         (WebKit::WebPageProxy::createPluginContainer):
2180         * UIProcess/ios/WebPageProxyIOS.mm:
2181         (WebKit::WebPageProxy::interpretKeyEvent):
2182         * UIProcess/mac/WebPageProxyMac.mm:
2183         (WebKit::WebPageProxy::getIsSpeaking):
2184         (WebKit::WebPageProxy::executeSavedCommandBySelector):
2185         (WebKit::WebPageProxy::showPDFContextMenu):
2186
2187 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2188
2189         Stop using LegacySync messages in WebPage
2190         https://bugs.webkit.org/show_bug.cgi?id=196057
2191
2192         Reviewed by Chris Dumez.
2193
2194         * WebProcess/WebPage/WebPage.h:
2195         (WebKit::WebPage::markLayersVolatile):
2196         * WebProcess/WebPage/WebPage.messages.in:
2197         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2198         (WebKit::WebPage::getCenterForZoomGesture):
2199         * WebProcess/WebPage/ios/WebPageIOS.mm:
2200         (WebKit::WebPage::readSelectionFromPasteboard):
2201         (WebKit::WebPage::getStringSelectionForPasteboard):
2202         (WebKit::WebPage::getDataSelectionForPasteboard):
2203         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
2204         (WebKit::WebPage::acceptsFirstMouse):
2205         * WebProcess/WebPage/mac/WebPageMac.mm:
2206         (WebKit::WebPage::replaceSelectionWithPasteboardData):
2207         (WebKit::WebPage::readSelectionFromPasteboard):
2208         (WebKit::WebPage::getStringSelectionForPasteboard):
2209         (WebKit::WebPage::getDataSelectionForPasteboard):
2210         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
2211         (WebKit::WebPage::acceptsFirstMouse):
2212
2213 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2214
2215         Stop using LegacySync messages in WebPasteboardProxy
2216         https://bugs.webkit.org/show_bug.cgi?id=196060
2217
2218         Reviewed by Chris Dumez.
2219
2220         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2221         (WebKit::WebPasteboardProxy::getPasteboardTypes):
2222         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
2223         (WebKit::WebPasteboardProxy::getPasteboardStringForType):
2224         (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
2225         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
2226         (WebKit::WebPasteboardProxy::pasteboardCopy):
2227         (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
2228         (WebKit::WebPasteboardProxy::getPasteboardUniqueName):
2229         (WebKit::WebPasteboardProxy::getPasteboardColor):
2230         (WebKit::WebPasteboardProxy::getPasteboardURL):
2231         (WebKit::WebPasteboardProxy::addPasteboardTypes):
2232         (WebKit::WebPasteboardProxy::setPasteboardTypes):
2233         (WebKit::WebPasteboardProxy::setPasteboardURL):
2234         (WebKit::WebPasteboardProxy::setPasteboardColor):
2235         (WebKit::WebPasteboardProxy::setPasteboardStringForType):
2236         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
2237         (WebKit::WebPasteboardProxy::getNumberOfFiles):
2238         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2239         (WebKit::WebPasteboardProxy::writeCustomData):
2240         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
2241         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
2242         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
2243         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
2244         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
2245         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
2246         * UIProcess/WebPasteboardProxy.cpp:
2247         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2248         (WebKit::WebPasteboardProxy::writeCustomData):
2249         * UIProcess/WebPasteboardProxy.h:
2250         * UIProcess/WebPasteboardProxy.messages.in:
2251         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
2252         (WebKit::WebPasteboardProxy::writeToClipboard):
2253         (WebKit::WebPasteboardProxy::readFromClipboard):
2254         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
2255         (WebKit::WebPasteboardProxy::getPasteboardTypes):
2256         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
2257         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
2258         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
2259
2260 2019-03-21  Andy Estes  <aestes@apple.com>
2261
2262         [iOS] Apple Pay should be available in documents with no user agent scripts
2263         https://bugs.webkit.org/show_bug.cgi?id=196061
2264         <rdar://problem/48649391>
2265
2266         Reviewed by Brady Eidson.
2267
2268         * Shared/AuxiliaryProcess.h:
2269         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
2270         (WebKit::AuxiliaryProcess::parentProcessHasEntitlement):
2271
2272         Added a convenience function for checking parent process entitlements.
2273
2274         * Shared/WebPreferences.yaml:
2275         * Shared/WebPreferencesDefaultValues.h:
2276         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2277         (-[WKWebViewConfiguration init]):
2278
2279         Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
2280
2281         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2282         (WebKit::WebPaymentCoordinator::supportsUnrestrictedApplePay const):
2283         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2284
2285         Implemented supportsUnrestrictedApplePay by checking for the
2286         com.apple.private.WebKit.UnrestrictedApplePay entitlement on platforms that enable
2287         APPLE_PAY_REMOTE_UI.
2288
2289         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2290         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2291         (didClearWindowObjectForFrame):
2292         (setUpPageLoaderClient):
2293
2294         Added injected bundle SPI that TestWebKitAPI uses to inject the WebCore Internals interface.
2295
2296         * WebProcess/WebPage/WebPage.cpp:
2297         (WebKit::WebPage::runJavaScript):
2298
2299         Changed to call ScriptController::executeUserAgentScriptInWorld.
2300
2301 2019-03-21  Chris Dumez  <cdumez@apple.com>
2302
2303         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store
2304         https://bugs.webkit.org/show_bug.cgi?id=196041
2305         <rdar://problem/49083230>
2306
2307         Reviewed by Alex Christensen.
2308
2309         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store.
2310         We do not support having several WebsiteDataStores sharing the same WebProcess.
2311
2312         * UIProcess/API/Cocoa/WKWebView.mm:
2313         (-[WKWebView _initializeWithConfiguration:]):
2314         * UIProcess/WebProcessPool.cpp:
2315         (WebKit::WebProcessPool::createWebPage):
2316
2317 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2318
2319         Add SPI to inform applications of WKContentRuleList actions
2320         https://bugs.webkit.org/show_bug.cgi?id=195965
2321         <rdar://problem/42664365>
2322
2323         Reviewed by Geoff Garen.
2324
2325         * NetworkProcess/NetworkLoadChecker.cpp:
2326         (WebKit::NetworkLoadChecker::checkRequest):
2327         (WebKit::NetworkLoadChecker::processContentRuleListsForLoad):
2328         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): Deleted.
2329         * NetworkProcess/NetworkLoadChecker.h:
2330         * UIProcess/API/APINavigationClient.h:
2331         (API::NavigationClient::contentRuleListNotification):
2332         * UIProcess/API/C/WKPage.cpp:
2333         (WKPageSetPageNavigationClient):
2334         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2335         * UIProcess/Cocoa/NavigationState.h:
2336         * UIProcess/Cocoa/NavigationState.mm:
2337         (WebKit::NavigationState::setNavigationDelegate):
2338         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
2339         * UIProcess/WebPageProxy.cpp:
2340         (WebKit::WebPageProxy::contentRuleListNotification):
2341         * UIProcess/WebPageProxy.h:
2342         * UIProcess/WebPageProxy.messages.in:
2343         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2344         (WebKit::WebChromeClient::contentRuleListNotification):
2345         * WebProcess/WebCoreSupport/WebChromeClient.h:
2346
2347 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
2348
2349         Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
2350         https://bugs.webkit.org/show_bug.cgi?id=196058
2351         rdar://problem/49078202
2352
2353         Reviewed by Antti Koivisto.
2354
2355         Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
2356         on by default.
2357
2358         * Shared/WebPreferences.yaml:
2359
2360 2019-03-21  Antti Koivisto  <antti@apple.com>
2361
2362         UI-process hit-testing needs to know about containing block relationships
2363         https://bugs.webkit.org/show_bug.cgi?id=195845
2364         <rdar://problem/48949633>
2365
2366         Reviewed by Simon Fraser.
2367
2368         Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
2369
2370         When an overflow scroller contains a positioned element the element may not be on a descendant layer of the scroller,
2371         yet should move along with it. This needs to be taken into account in UI-side hit testing.
2372
2373         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
2374         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const):
2375         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID):
2376         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs):
2377
2378         Maintain non-ancestor scrolling relationships for layers.
2379
2380         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2381         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
2382         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
2383         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2384         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2385         (WebKit::isScrolledBy):
2386
2387         Helper to figure out who scrolls who.
2388
2389         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
2390         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2391         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
2392
2393         After commit, pull the non-ancestor scrolling relationships from the scrolling tree and update the layer tree.
2394
2395 2019-03-21  Daniel Bates  <dabates@apple.com>
2396
2397         [iOS] Inline -_ensureFormAccessoryView into -formAccessoryView and have -_updateAccessory ensure we have a form accessory
2398         https://bugs.webkit.org/show_bug.cgi?id=196021
2399
2400         Reviewed by Wenson Hsieh.
2401
2402         Every caller of -_ensureFormAccessoryView, except -formAccessoryView, immediately follows the call
2403         with a call to -_updateAccessory. Let's just have -_updateAccessory ensure we have a form accessory
2404         view and inline the implementation of -_ensureFormAccessoryView into -formAccessoryView so we can
2405         remove one method.
2406
2407         * UIProcess/ios/WKContentViewInteraction.mm:
2408         (-[WKContentView inputView]): Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
2409         the equivalent work for us.
2410         (-[WKContentView formAccessoryView]): Moved implementation of -_ensureFormAccessoryView into here.
2411         (-[WKContentView _updateAccessory]): Call self.formAccessoryView to ensure we have a form accessory view.
2412         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2413         Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
2414         the equivalent work for us.
2415         (-[WKContentView _ensureFormAccessoryView]): Deleted.
2416
2417 2019-03-21  Shawn Roberts  <sroberts@apple.com>
2418
2419         Unreviewed, rolling out r243250.
2420
2421         Causing 109 Failures and 2 crashes on iOS Sim Debug
2422         OpenSource/Internal queues
2423
2424         Reverted changeset:
2425
2426         "[iOS WK2] Turn on async overflow scrolling by default"
2427         https://bugs.webkit.org/show_bug.cgi?id=196011
2428         https://trac.webkit.org/changeset/243250
2429
2430 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
2431
2432         Fix possible memory leak when dismissing a color picker
2433         https://bugs.webkit.org/show_bug.cgi?id=196026
2434         <rdar://problem/48778568>
2435
2436         Reviewed by Wenson Hsieh.
2437
2438         Fix a problem with WebPageProxy::endColorPicker where an early return could leave a color picker
2439         with a +1 reference count after dismissing it.
2440
2441         * UIProcess/WebColorPicker.cpp:
2442         (WebKit::WebColorPicker::endPicker):
2443         * UIProcess/WebPageProxy.cpp:
2444         (WebKit::WebPageProxy::endColorPicker):
2445         (WebKit::WebPageProxy::didEndColorPicker):
2446
2447 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2448
2449         [GTK][WPE] Add API to provide geolocation information
2450         https://bugs.webkit.org/show_bug.cgi?id=195940
2451
2452         Reviewed by Michael Catanzaro.
2453
2454         Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
2455         been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.
2456
2457         * PlatformGTK.cmake:
2458         * PlatformWPE.cmake:
2459         * SourcesGTK.txt:
2460         * SourcesWPE.txt:
2461         * UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
2462         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
2463         (webkit_geolocation_position_new):
2464         (webkit_geolocation_position_copy):
2465         (webkit_geolocation_position_free):
2466         (webkit_geolocation_position_set_timestamp):
2467         (webkit_geolocation_position_set_altitude):
2468         (webkit_geolocation_position_set_altitude_accuracy):
2469         (webkit_geolocation_position_set_heading):
2470         (webkit_geolocation_position_set_speed):
2471         (webkitGeolocationManagerStop):
2472         (webkitGeolocationManagerSetEnableHighAccuracy):
2473         (webkitGeolocationManagerCreate):
2474         (webkitGeolocationManagerGetProperty):
2475         (webkit_geolocation_manager_class_init):
2476         (webkit_gelocation_manager_update_position):
2477         (webkit_gelocation_manager_failed):
2478         (webkit_geolocation_manager_get_enable_high_accuracy):
2479         * UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
2480         * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
2481         * UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
2482         * UIProcess/API/glib/WebKitWebContext.cpp:
2483         (webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
2484         (webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
2485         * UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
2486         * UIProcess/API/gtk/WebKitWebContext.h:
2487         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2488         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
2489         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2490         * UIProcess/API/gtk/webkit2.h:
2491         * UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
2492         * UIProcess/API/wpe/WebKitWebContext.h:
2493         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
2494         * UIProcess/API/wpe/docs/wpe-docs.sgml:
2495         * UIProcess/API/wpe/webkit.h:
2496
2497 2019-03-20  Youenn Fablet  <youenn@apple.com>
2498
2499         Compute quota after network process restart based on default quota and space used
2500         https://bugs.webkit.org/show_bug.cgi?id=195804
2501
2502         Reviewed by Chris Dumez.
2503
2504         Make sure that Cache Storage quota user waits to declare as initialized to its manager
2505         until all data is loaded so that it can report a valid space used from the start.
2506
2507         Add test API to reset the quota to its default value and compute it according current space use.
2508
2509         * NetworkProcess/NetworkProcess.cpp:
2510         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
2511         * NetworkProcess/NetworkProcess.h:
2512         * NetworkProcess/NetworkProcess.messages.in:
2513         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2514         (WebKit::CacheStorage::Caches::create):
2515         (WebKit::CacheStorage::Caches::Caches):
2516         (WebKit::CacheStorage::Caches::whenInitialized):
2517         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2518         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2519         (WebKit::CacheStorageEngineConnection::dereference):
2520         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2521         (WebKit::WebCacheStorageConnection::setQuotaBasedOnSpaceUsage):
2522         * WebProcess/Cache/WebCacheStorageConnection.h:
2523
2524 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
2525
2526         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
2527         https://bugs.webkit.org/show_bug.cgi?id=196049
2528
2529         Reviewed by Tim Horton.
2530
2531         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
2532         overflow scrolling in general, so rename it.
2533
2534         * Configurations/FeatureDefines.xcconfig:
2535
2536 2019-03-20  Jiewen Tan  <jiewen_tan@apple.com>
2537
2538         Extend Networking Process sandbox for some system frameworks
2539         https://bugs.webkit.org/show_bug.cgi?id=196036
2540         <rdar://problem/47594150>
2541
2542         Reviewed by Brent Fulgham.
2543
2544         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2545         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2546
2547 2019-03-20  Alex Christensen  <achristensen@webkit.org>
2548
2549         Reduce use of LegacySync IPC message type
2550         https://bugs.webkit.org/show_bug.cgi?id=194835
2551
2552         Reviewed by Darin Adler.
2553
2554         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2555         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
2556         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
2557         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
2558         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
2559         (WebKit::NetworkConnectionToWebProcess::blobSize):
2560         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
2561         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
2562         * NetworkProcess/NetworkConnectionToWebProcess.h:
2563         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest):
2564         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationResponse):
2565         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadIntermediateInformation):
2566         (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
2567         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2568         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2569         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2570         (WebKit::UserMediaCaptureManagerProxy::capabilities):
2571         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2572         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2573         * UIProcess/Plugins/PluginProcessProxy.h:
2574         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2575         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2576         (WebKit::PluginProcessProxy::launchProcess):
2577         (WebKit::PluginProcessProxy::launchApplicationAtURL):
2578         (WebKit::PluginProcessProxy::openURL):
2579         (WebKit::PluginProcessProxy::openFile):
2580         * UIProcess/WebFullScreenManagerProxy.cpp:
2581         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
2582         * UIProcess/WebFullScreenManagerProxy.h:
2583         * UIProcess/WebFullScreenManagerProxy.messages.in:
2584         * WebProcess/WebProcess.cpp:
2585         (WebKit::WebProcess::fetchWebsiteData):
2586         (WebKit::WebProcess::deleteWebsiteData):
2587         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
2588         (WebKit::WebProcess::processWillSuspendImminently):
2589         * WebProcess/WebProcess.h:
2590         * WebProcess/WebProcess.messages.in:
2591
2592 2019-03-20  Keith Rollin  <krollin@apple.com>
2593
2594         Update checks that determine if WebKit is system WebKit
2595         https://bugs.webkit.org/show_bug.cgi?id=195756
2596
2597         Unreviewed tweak of r243251 after unreviewed build fix after r243230.
2598
2599         * Shared/mac/AuxiliaryProcessMac.mm:
2600         (WebKit::AuxiliaryProcess::isSystemWebKit):
2601
2602 2019-03-20  Keith Rollin  <krollin@apple.com>
2603
2604         Update checks that determine if WebKit is system WebKit
2605         https://bugs.webkit.org/show_bug.cgi?id=195756
2606
2607         Unreviewed build fix after r243230.
2608
2609         * Shared/mac/AuxiliaryProcessMac.mm:
2610         (WebKit::AuxiliaryProcess::isSystemWebKit):
2611
2612 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
2613
2614         [iOS WK2] Turn on async overflow scrolling by default
2615         https://bugs.webkit.org/show_bug.cgi?id=196011
2616         rdar://problem/48453859
2617
2618         Reviewed by Antti Koivisto.
2619
2620         Turn async overflow scroll on by default for iOS WK2.
2621
2622         * Shared/WebPreferences.yaml:
2623         * Shared/WebPreferencesDefaultValues.h:
2624
2625 2019-03-20  Youenn Fablet  <youenn@apple.com>
2626
2627         Have smaller default quotas for third party frames
2628         https://bugs.webkit.org/show_bug.cgi?id=195841
2629
2630         Reviewed by Geoffrey Garen.
2631
2632         * NetworkProcess/NetworkProcess.cpp:
2633         (WebKit::NetworkProcess::storageQuotaManager):
2634         For third party iframes, use the default quota divided by 10.
2635
2636 2019-03-20  Dean Jackson  <dino@apple.com>
2637
2638         [iOS] Enable fast clicking everywhere
2639         https://bugs.webkit.org/show_bug.cgi?id=196023
2640         <rdar://problem/49073589>
2641
2642         Reviewed by Wenson Hsieh.
2643
2644         Set FastClicksEverywhere to on by default for iPhone & iPad.
2645
2646         * Shared/WebPreferences.yaml:
2647         * Shared/WebPreferencesDefaultValues.h:
2648
2649 2019-03-20  Chris Dumez  <cdumez@apple.com>
2650
2651         Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS
2652         https://bugs.webkit.org/show_bug.cgi?id=196029
2653         <rdar://problem/48954651>
2654
2655         Reviewed by Tim Horton.
2656
2657         If there is a ViewGestureController when process swapping, make sure we disconnect it
2658         from the old process and reconnect it to the new one. This matches what is done in
2659         WebViewImpl for macOS (see r238356).
2660
2661         * UIProcess/API/Cocoa/WKWebView.mm:
2662         (-[WKWebView _processWillSwap]):
2663         (-[WKWebView _processDidExit]):
2664         (-[WKWebView _didRelaunchProcess]):
2665
2666 2019-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2667
2668         [GTK] REGRESSION(r243094): crash when launching minibrowser
2669         https://bugs.webkit.org/show_bug.cgi?id=195951
2670
2671         Reviewed by Joseph Pecoraro.
2672
2673         Always return the inspector from WebPageProxy::inspector() when the page hasn't been closed. The inspector is
2674         created in WebPageProxy constructor and it's safe to use even before a process has been launched, because
2675         m_inspectedPage is null-checked everywhere.
2676
2677         * UIProcess/WebPageProxy.cpp:
2678         (WebKit::WebPageProxy::inspector const):
2679
2680 2019-03-20  Keith Rollin  <krollin@apple.com>
2681
2682         Update checks that determine if WebKit is system WebKit
2683         https://bugs.webkit.org/show_bug.cgi?id=195756
2684
2685         Reviewed by Alexey Proskuryakov.
2686
2687         The system WebKit can be installed in additional locations, so check
2688         for and allow those, too.
2689
2690         * Shared/mac/AuxiliaryProcessMac.mm:
2691         (WebKit::AuxiliaryProcess::isSystemWebKit):
2692
2693 2019-03-20  Per Arne Vollan  <pvollan@apple.com>
2694
2695         [iOS] Unable to PiP web videos in Safari due to sandbox violation
2696         https://bugs.webkit.org/show_bug.cgi?id=196015
2697         <rdar://problem/48867037>
2698
2699         Reviewed by Brent Fulgham.
2700
2701         The sandbox should allow getting the iokit property 'ui-pip'.
2702
2703         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2704
2705 2019-03-20  John Wilander  <wilander@apple.com>
2706
2707         (Test fix) Override minimumTimeBetweenDataRecordsRemoval in ResourceLoadStatisticsStore::shouldRemoveDataRecord() during layout tests
2708         https://bugs.webkit.org/show_bug.cgi?id=196017
2709
2710         Unreviewed test fix.
2711
2712         This patch adds a check of parameters().isRunningTest to the return of
2713         ResourceLoadStatisticsStore::shouldRemoveDataRecord() to allow successive
2714         layout tests to remove website data, effectively overriding the
2715         minimumTimeBetweenDataRecordsRemoval setting.
2716
2717         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
2718         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
2719
2720 2019-03-20  Daniel Bates  <dabates@apple.com>
2721
2722         [iOS] Group UIWebFormAccessoryDelegate-related code and tighten it up a bit
2723         https://bugs.webkit.org/show_bug.cgi?id=196018
2724
2725         Reviewed by Wenson Hsieh.
2726
2727         * UIProcess/ios/WKContentViewInteraction.mm:
2728         (-[WKContentView accessoryClear]): Use uniform initializer syntax. Code could send the empty
2729         string, but I resisted since null string, as we do now, likely encodes more compactly and we
2730         avoid a per-process alloc.
2731         (-[WKContentView accessoryTab:]): Fix style nit; missing space between capture list and arguments
2732         in lambda. Also use lamdba capture initializer syntax and remove a local.
2733         (-[WKContentView _updateAccessory]): Remove a FIXME as it can't be satified with the current
2734         design without more bookkeeping. The design for showing and hiding an AutoFill button added in
2735         r166933 requires knowing the title for the button when showing it via -setAccessoryViewCustomButtonTitle.
2736         We could re-implement such that -setAccessoryViewCustomButtonTitle: stores the title and calls
2737         -_updateAccessory, but that has the disadvantage of increasing the memory footprint of WKContentView
2738         for the stored title and that seems worse than centralizing the logic in _updateAccessory. So,
2739         let's not fix this FIXME. Now that we are removing the FIXME, change to use an early return style.
2740         (-[WKContentView _hideKeyboard]): Micro optimization; only call _updateAccessory if we have
2741         a form accessory view. This method is called everytime we load a page (more precisely when we
2742         commit the load for a page) in addition to everytime we blur (defocus) an element. No need to
2743         update an accessory if we don't have one.
2744  
2745 2019-03-20  Olivier Robin  <olivierrobin@chromium.org>
2746
2747         Fix _getContentsAsAttributedStringWithCompletionHandler availability for iOS.
2748         https://bugs.webkit.org/show_bug.cgi?id=195999
2749
2750         Reviewed by Tim Horton.
2751
2752         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2753
2754 2019-03-20  Brent Fulgham  <bfulgham@apple.com>
2755
2756         Adopt RegistrableDomain in the Storage Access API prompt code paths
2757         https://bugs.webkit.org/show_bug.cgi?id=195957
2758         <rdar://problem/49048028>
2759
2760         Reviewed by Chris Dumez.
2761
2762         While making the code changes in Bug 195866 we noticed that strings were being
2763         used to pass the origins for the API calls. We should adopt the RegistrableDomain
2764         class to improve type safety and avoid introducing bugs in the future.
2765
2766         * UIProcess/API/APIUIClient.h:
2767         (API::UIClient::requestStorageAccessConfirm):
2768         * UIProcess/API/C/WKPage.cpp:
2769         (WKPageSetPageUIClient):
2770         * UIProcess/Cocoa/UIDelegate.h:
2771         * UIProcess/Cocoa/UIDelegate.mm:
2772         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
2773         * UIProcess/Cocoa/WKStorageAccessAlert.h:
2774         * UIProcess/Cocoa/WKStorageAccessAlert.mm:
2775         (WebKit::presentStorageAccessAlert):
2776         * UIProcess/WebPageProxy.cpp:
2777         (WebKit::WebPageProxy::requestStorageAccessConfirm):
2778
2779 2019-03-20  Chris Dumez  <cdumez@apple.com>
2780
2781         Unreviewed, fix typo in comment added in r243156.
2782
2783         * UIProcess/WebPageProxy.cpp:
2784         (WebKit::WebPageProxy::postMessageToInjectedBundle):
2785
2786 2019-03-20  Chris Dumez  <cdumez@apple.com>
2787
2788         Unreviewed, drop invalid assertions landed in r243163.
2789
2790         Those assertions were causing some API tests to crash.
2791         Also include some post-review suggestions from Darin.
2792
2793         * Shared/CallbackID.h:
2794         (WebKit::CallbackID::operator=):
2795         * Shared/OptionalCallbackID.h:
2796         (WebKit::OptionalCallbackID::operator=):
2797
2798 2019-03-20  Chris Dumez  <cdumez@apple.com>
2799
2800         Unreviewed, fix assertion failures in API tests after r243159.
2801
2802         * UIProcess/VisitedLinkStore.cpp:
2803         (WebKit::VisitedLinkStore::removeProcess):
2804
2805 2019-03-20  Tim Horton  <timothy_horton@apple.com>
2806
2807         Add an platform-driven spell-checking mechanism
2808         https://bugs.webkit.org/show_bug.cgi?id=195795
2809
2810         Reviewed by Ryosuke Niwa.
2811
2812         * DerivedSources-input.xcfilelist:
2813         * DerivedSources-output.xcfilelist:
2814         * DerivedSources.make:
2815         * SourcesCocoa.txt:
2816         * UIProcess/Cocoa/TextCheckingController.h: Added.
2817         * UIProcess/Cocoa/TextCheckingController.mm: Added.
2818         (WebKit::TextCheckingController::TextCheckingController):
2819         (WebKit::TextCheckingController::replaceRelativeToSelection):
2820         (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
2821         * UIProcess/ios/WKContentViewInteraction.h:
2822         * UIProcess/ios/WKContentViewInteraction.mm:
2823         (-[WKContentView setupInteraction]):
2824         (-[WKContentView replaceSelectionOffset:length:withAnnotatedString:relativeReplacementRange:]):
2825         (-[WKContentView removeAnnotation:forSelectionOffset:length:]):
2826         * WebKit.xcodeproj/project.pbxproj:
2827         * WebProcess/WebPage/WebPage.cpp:
2828         * WebProcess/WebPage/WebPage.h:
2829         (WebKit::WebPage::textCheckingController):
2830         Plumb two UITextInput methods through to the Web Content process.
2831         I added a new object instead of just sticking things on WebPage
2832         because there are quite a few more related ones coming down the pipeline,
2833         and will also end up being messages going in the opposite direction.
2834
2835         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: Added.
2836         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in: Added.
2837         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm: Added.
2838         (WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
2839         (WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
2840         (WebKit::relevantMarkerTypes):
2841         (WebKit::TextCheckingControllerProxy::rangeAndOffsetRelativeToSelection):
2842         (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
2843         (WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection):
2844         Make it possible for the platform to maintain arbitrary key-value pairs
2845         attached to document ranges, as a way for it to keep track of various
2846         text checking context (e.g. if something has been checked, replaced,
2847         what language it might be, ...).
2848
2849         Allow it to replace the text of a range and the annotations in that range,
2850         or remove annotations in a range. Ranges are specified relative to
2851         the selection.
2852
2853         One large missing piece is giving the platform the ability to retrieve
2854         annotations in a range; that is coming in a future patch.
2855
2856         We translate certain annotations into traditional WebCore spelling
2857         and grammar document markers, for normal display-time treatment.
2858
2859         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2860         (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
2861         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
2862         Unified sources fixes.
2863
2864 2019-03-19  Jiewen Tan  <jiewen_tan@apple.com>
2865
2866         [WebAuthN] Implement FIDO AppID extension
2867         https://bugs.webkit.org/show_bug.cgi?id=143491
2868         <rdar://problem/48298273>
2869
2870         Reviewed by Brent Fulgham.
2871
2872         In U2fHidAuthenticator::continueSignCommandAfterResponseReceived, it will retry the current command
2873         with the AppID if it exists when SW_WRONG_DATA is received from devices. Noted, it will not set
2874         the AuthenticationExtensionsClientOutputs::appid to false in any circumstances. In other words, the
2875         field will be empty if AppID is supplied in AuthenticationExtensionsClientInputs and not used.
2876
2877         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2878         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
2879         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
2880         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
2881         (WebKit::U2fHidAuthenticator::issueSignCommand):
2882         (WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
2883         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h:
2884
2885 2019-03-19  Ross Kirsling  <ross.kirsling@sony.com>
2886
2887         Unreviewed adjustment to r242842 per Darin's request.
2888
2889         * Platform/win/LoggingWin.cpp:
2890         (WebKit::logLevelString):
2891
2892 2019-03-19  Gyuyoung Kim  <gyuyoung.kim@lge.com>
2893
2894         [WPE] Fix build warnings because of missing an argument when initializing wpe_input_axis_event
2895         https://bugs.webkit.org/show_bug.cgi?id=195931
2896
2897         Reviewed by Michael Catanzaro.
2898
2899         There are still build warnings when building wpe port. It looks like
2900         these build warnings have been caused by missing to set an argument
2901         for the modifier parameter of wpe_input_axis_event. This patch sets 0
2902         for the modifier argument to avoid the build warnings.
2903
2904         * UIProcess/API/wpe/ScrollGestureController.cpp:
2905         (WebKit::ScrollGestureController::handleEvent):
2906
2907 2019-03-19  John Wilander  <wilander@apple.com>
2908
2909         Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
2910         https://bugs.webkit.org/show_bug.cgi?id=195923
2911         <rdar://problem/49001272>
2912
2913         Reviewed by Alex Christensen.
2914
2915         Cross-site trackers abuse link query parameters to transport user identifiers and then store
2916         them in first-party storage space. To address this, we've done three things:
2917         - r236448 capped all persistent client-side cookies to seven days of storage.
2918         - r242288 further capped persistent client-side cookies for navigations with link decoration from prevalent resources.
2919         - r242603 added logging of navigations with link decoration from prevalent resources.
2920
2921         This patch introduces an experimental feature that removes non-cookie website data for sites
2922         that have been navigated to, with link decoration, by a prevalent resource.
2923
2924         To achieve this, resource domains to remove website data for are now marked with an enum called
2925         WebsiteDataToRemove with values All, AllButHttpOnlyCookies, AllButCookies. As resources are
2926         iterated, they are marked for either of these values and the new function
2927         ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor() leads to the marking with
2928         WebsiteDataToRemove::AllButCookies.
2929
2930         Then NetworkProcess::deleteWebsiteDataForRegistrableDomains() looks at this setting and removes
2931         website data accordingly.
2932
2933         The thinking behind this is that the lifetime cap applied in r236448 and r242288 take care of
2934         script writable cookies, and this patch takes care of all other script writable storage.
2935
2936         The infrastructure to handle user interaction expiration is now parameterized so that multiple
2937         expiries can be applied. In this particular case, seven days of browser use.
2938
2939         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2940         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
2941         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
2942         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
2943         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const):
2944         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const):
2945         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
2946         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2947         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2948         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
2949         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
2950         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllWebsiteDataFor const):
2951         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
2952         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
2953         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2954         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
2955         (WebKit::domainsToString):
2956         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
2957         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
2958         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
2959         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
2960         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
2961         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2962         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2963         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2964         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
2965         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
2966            Renamed to reflect that it actually takes a parameter for which types of data to remove.
2967         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2968         * NetworkProcess/NetworkProcess.cpp:
2969         (WebKit::NetworkProcess::initializeNetworkProcess):
2970         (WebKit::NetworkProcess::setCrossSiteLoadWithLinkDecorationForTesting):
2971         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2972         (WebKit::NetworkProcess::deleteCookiesForTesting):
2973         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
2974            Renamed to reflect that it actually takes a parameter for which types of data to remove.
2975         * NetworkProcess/NetworkProcess.h:
2976         * NetworkProcess/NetworkProcess.messages.in:
2977         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2978         (WebKit::NetworkProcessCreationParameters::encode const):
2979         (WebKit::NetworkProcessCreationParameters::decode):
2980         * NetworkProcess/NetworkProcessCreationParameters.h:
2981         * NetworkProcess/NetworkSession.cpp:
2982         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
2983         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
2984            Renamed to reflect that it actually takes a parameter for which types of data to remove.
2985         * NetworkProcess/NetworkSession.h:
2986         * Shared/WebPreferences.yaml:
2987         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2988         (WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
2989         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
2990         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
2991         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2992         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2993         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2994         * UIProcess/Network/NetworkProcessProxy.cpp:
2995         (WebKit::NetworkProcessProxy::setCrossSiteLoadWithLinkDecorationForTesting):
2996         * UIProcess/Network/NetworkProcessProxy.h:
2997         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2998         (WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
2999         * UIProcess/WebsiteData/WebsiteDataStore.h:
3000
3001 2019-03-19  Chris Dumez  <cdumez@apple.com>
3002
3003         Unreviewed build fix after r243173.
3004
3005         * UIProcess/Cocoa/UIDelegate.mm:
3006         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
3007
3008 2019-03-19  Brent Fulgham  <bfulgham@apple.com>
3009
3010         Add default prompt implementation for the Storage Access API
3011         https://bugs.webkit.org/show_bug.cgi?id=195866
3012         <rdar://problem/45150009>
3013
3014         Reviewed by Chris Dumez.
3015
3016         This patch revises the UIDelegate implementation with a default permission dialog
3017         for the Storage Access API. This allows us to use and test the API in MiniBrowser,
3018         rather than requiring a full-fledged web browser to drive testing.
3019  
3020         * UIProcess/Cocoa/UIDelegate.h:
3021         * UIProcess/Cocoa/UIDelegate.mm:
3022         (WebKit::UIDelegate::UIClient::presentStorageAccessConfirmDialog): Added.
3023         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm): Modify to call new default
3024         implementation if the WKWebVIew client doesn't implement the necessary SPI.
3025         * UIProcess/Cocoa/WKStorageAccessAlert.h: Added.
3026         * UIProcess/Cocoa/WKStorageAccessAlert.mm: Added.
3027         (WebKit::presentStorageAccessAlert):
3028         * WebKit.xcodeproj/project.pbxproj:
3029
3030 2019-03-19  Conrad Shultz  <conrad_shultz@apple.com>
3031
3032         REGRESSION (r242369): Only use picker-supported UTIs when creating image picker
3033         https://bugs.webkit.org/show_bug.cgi?id=195955
3034
3035         Reviewed by Chris Dumez and Wenson Hsieh.
3036
3037         r242369 started passing UTIs to -[UIImagePickerController setMediaTypes:] that correspond to types accepted by the
3038         file input element. However, UIImagePickerController expects a specific subset of UTIs. In the worst case, if no
3039         expected types are passed, this can cause a crash.
3040
3041         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3042         (UTIsForMIMETypes):
3043         Return a set rather than an array.
3044         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
3045         Rather than hardcode specific UTIs, ask UIImagePickerController for its available types. If an accepted type
3046         is in the list of available types, use it. Otherwise, if an accepted type conforms to an available type,
3047         use the available type. This is an O(n^2) process, but there typically are only a handful of types, so
3048         this seems acceptable.
3049         (-[WKFileUploadPanel _showDocumentPickerMenu]):
3050         Convert the set from UTIsForMIMETypes() to an array.
3051
3052 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3053
3054         Build cleanly with GCC 9
3055         https://bugs.webkit.org/show_bug.cgi?id=195920
3056
3057         Reviewed by Chris Dumez.
3058
3059         WebKit triggers three new GCC 9 warnings:
3060
3061         """
3062         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
3063         declared copy constructor and assignment operator if one of them is user-provided.
3064         """
3065
3066         Solution is to either add a copy constructor or copy assignment operator, if required, or
3067         else remove one if it is redundant.
3068
3069         """
3070         -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
3071         -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
3072         """
3073
3074         These account for most of this patch. Solution is to just remove the bad WTFMove().
3075
3076         Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
3077         These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
3078         would be safer to not use memcpy on nontrivial types, but that's too complex for this
3079         patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
3080
3081         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3082         (WebKit::CacheStorage::Cache::decode):
3083         * Platform/IPC/ArgumentCoders.h:
3084         * Shared/CallbackID.h:
3085         (WebKit::CallbackID::operator=):
3086         * Shared/OptionalCallbackID.h:
3087         (WebKit::OptionalCallbackID::operator=):
3088         * Shared/Plugins/NPIdentifierData.cpp:
3089         (WebKit::NPIdentifierData::decode):
3090         * Shared/Plugins/NPVariantData.cpp:
3091         (WebKit::NPVariantData::decode):
3092         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
3093         (WebKit::NetscapePluginModule::getOrCreate):
3094         * Shared/RTCNetwork.cpp:
3095         (WebKit::RTCNetwork::IPAddress::decode):
3096         * Shared/SessionState.cpp:
3097         (WebKit::HTTPBody::Element::decode):
3098         (WebKit::FrameState::decode):
3099         (WebKit::BackForwardListItemState::decode):
3100         * Shared/WebCompiledContentRuleListData.cpp:
3101         (WebKit::WebCompiledContentRuleListData::decode):
3102         * Shared/WebCoreArgumentCoders.cpp:
3103         (IPC::ArgumentCoder<FloatPoint>::decode):
3104         (IPC::ArgumentCoder<FloatRect>::decode):
3105         (IPC::ArgumentCoder<FloatQuad>::decode):
3106         (IPC::ArgumentCoder<ViewportArguments>::decode):
3107         (IPC::ArgumentCoder<IntPoint>::decode):
3108         (IPC::ArgumentCoder<IntRect>::decode):
3109         (IPC::ArgumentCoder<IntSize>::decode):
3110         (IPC::ArgumentCoder<MimeClassInfo>::decode):
3111         (IPC::ArgumentCoder<PluginInfo>::decode):
3112         (IPC::ArgumentCoder<SelectionRect>::decode):
3113         (IPC::ArgumentCoder<CompositionUnderline>::decode):
3114         (IPC::ArgumentCoder<BlobPart>::decode):
3115         (IPC::ArgumentCoder<TextIndicatorData>::decode):
3116         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3117         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
3118         * Shared/WebPageCreationParameters.cpp:
3119         (WebKit::WebPageCreationParameters::decode):
3120         * Shared/WebPlatformTouchPoint.cpp:
3121         (WebKit::WebPlatformTouchPoint::decode):
3122         * Shared/WebsiteData/WebsiteData.cpp:
3123         (WebKit::WebsiteData::Entry::decode):
3124         * Shared/WebsiteDataStoreParameters.cpp:
3125         (WebKit::WebsiteDataStoreParameters::decode):
3126         * UIProcess/API/APIContentRuleListStore.cpp:
3127         (API::decodeContentRuleListMetaData):
3128         * UIProcess/WebPageProxy.cpp:
3129         (WebKit::WebPageProxy::launchProcessForReload):
3130         (WebKit::WebPageProxy::launchProcessWithItem):
3131         (WebKit::WebPageProxy::loadRequest):
3132         (WebKit::WebPageProxy::loadFile):
3133         (WebKit::WebPageProxy::loadData):
3134         (WebKit::WebPageProxy::reload):
3135         * UIProcess/WebProcessCache.cpp:
3136         (WebKit::WebProcessCache::takeProcess):
3137         * UIProcess/WebProcessPool.cpp:
3138         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
3139         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
3140         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
3141         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3142         (WebKit::InjectedBundleRangeHandle::getOrCreate):
3143         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3144         (WebKit::InjectedBundle::create):
3145         * WebProcess/Network/WebLoaderStrategy.cpp:
3146         (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
3147         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3148         (WebKit::CompositingCoordinator::createGraphicsLayer):
3149         * WebProcess/WebPage/WebPage.cpp:
3150         (WebKit::WebPage::pdfSnapshotAtSize):
3151         (WebKit::WebPage::createDocumentLoader):
3152         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
3153         (WebKit::StorageNamespaceImpl::copy):
3154
3155 2019-03-19  Chris Dumez  <cdumez@apple.com>
3156
3157         Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
3158         https://bugs.webkit.org/show_bug.cgi?id=194787
3159         <rdar://problem/48175520>
3160
3161         Reviewed by Geoff Garen.
3162
3163         The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
3164         when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
3165         given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
3166         side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.
3167
3168         In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
3169         WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
3170         as soon as the WebPage object has been created on the WebProcess side. This part was fine.
3171         However, unregistration from the visitedLinkStores would only happen when either the
3172         visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
3173         WebProcess could stay registered with a visitedLinkStore even after the page that was using it
3174         has been closed, which would lead to such logging.
3175
3176         To address the issue, the WebProcessProxy now keeps track for which pages are using which
3177         visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
3178         WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
3179         using a given visitedLinkStore is closed, the process unregisters itself from the
3180         visitedLinkStore, thus avoiding the bug.
3181
3182         I also simplified a lot the logic for having a page telling the WebProcessProxy it started
3183         using a visitedLinkStore. Previously, it would have to wait until the process is done launching
3184         before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
3185         that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
3186         WebProcess (no matter if the process is still launching or not). At this point, the
3187         WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
3188         until it is done launching before registering itself with the visitedLinkStore.
3189
3190         * UIProcess/ProvisionalPageProxy.cpp:
3191         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
3192         (WebKit::ProvisionalPageProxy::initializeWebPage):
3193         (WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
3194         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
3195         * UIProcess/ProvisionalPageProxy.h:
3196         * UIProcess/VisitedLinkStore.cpp:
3197         (WebKit::VisitedLinkStore::~VisitedLinkStore):
3198         (WebKit::VisitedLinkStore::addProcess):
3199         * UIProcess/WebPageProxy.cpp:
3200         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3201         (WebKit::WebPageProxy::initializeWebPage):
3202         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3203         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
3204         (WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
3205         * UIProcess/WebPageProxy.h:
3206         * UIProcess/WebProcessProxy.cpp:
3207         (WebKit::WebProcessProxy::shutDown):
3208         (WebKit::WebProcessProxy::removeWebPage):
3209         (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
3210         (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
3211         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
3212         (WebKit::WebProcessProxy::didFinishLaunching):
3213         (WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
3214         (WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
3215         * UIProcess/WebProcessProxy.h:
3216
3217 2019-03-19  Chris Dumez  <cdumez@apple.com>
3218
3219         REGRESSION (r243094): internal media test fairplay-hls-error.html is failing
3220         https://bugs.webkit.org/show_bug.cgi?id=195954
3221         <rdar://problem/49005981>
3222
3223         Reviewed by Geoffrey Garen.
3224
3225         TestController::resetStateToConsistentValues() tries to send a "reset" message to its
3226         injected bundle. Part of the "reset" message sets the external hosts that we're allowed
3227         to load. If there is no WebProcess yet when WKPagePostMessageToInjectedBundle() is called,
3228         then this message does not get sent and the allowed hosts do not get set, causing this
3229         test failure.
3230
3231         To address the issue, make sure we launch the initial process if necessary when
3232         WebPageProxy::postMessageToInjectedBundle() is called, in order to maintain backward
3233         compatibility.
3234
3235         * UIProcess/WebPageProxy.cpp:
3236         (WebKit::WebPageProxy::postMessageToInjectedBundle):
3237
3238 2019-03-19  Chris Dumez  <cdumez@apple.com>
3239
3240         Unreviewed, rolling out r243142.
3241
3242         Caused assertion hits in WK2 Debug
3243
3244         Reverted changeset:
3245
3246         "Spew: Unhandled web process message
3247         'VisitedLinkTableController:VisitedLinkStateChanged'"
3248         https://bugs.webkit.org/show_bug.cgi?id=194787
3249         https://trac.webkit.org/changeset/243142
3250
3251 2019-03-19  Daniel Bates  <dabates@apple.com>
3252
3253         [iOS] Focus not preserved when switching between tabs
3254         https://bugs.webkit.org/show_bug.cgi?id=195820
3255         <rdar://problem/43614450>
3256
3257         Reviewed by Brent Fulgham.
3258
3259         Fixes a usability annoyance when using a hardware keyboard; focus is not preserved when switching between tabs.
3260         Do not unconditionally tell the WebProcess to blur the currently focused element when the content view (WKContentView)
3261         resigns first responder. Instead only tell it to blur when the content view is resigning because either the
3262         accessory view was dismissed (Done button was pressed) or the keyboard was dismissed (the hide keyboard button
3263         was pressed).
3264
3265         * UIProcess/ios/WKContentViewInteraction.h:
3266         * UIProcess/ios/WKContentViewInteraction.mm: Add new ivar to track whether the content view is resigning
3267         first responder status because the accessory view is being dismissed.
3268         (-[WKContentView resignFirstResponderForWebView]): Only tell WebKit to blur the focused element if we are
3269         resigning because the accessory view is being dismissed or the keyboard was hidden. We continue to do all
3270         other steps when resigning, including hiding the keyboard. Note that by not telling WebKit to blur the
3271         focused element we let it's focus controller manage the focused element with respect to the current
3272         page activation state (i.e. whether the content view is first responder or not). When the content view
3273         becomes the first responder then WebKit's focus controller will be told that the page has become activated
3274         and will tell the UIProcess to focus the currently focused element, which will bring up the keyboard.
3275         (-[WKContentView accessoryDone]): Update state so we know that a subsequent call to resign first responder
3276         was due to the accessory view being dismissed.
3277
3278 2019-03-19  Per Arne Vollan  <pvollan@apple.com>
3279
3280         [iOS] Remove overridden rules in sandbox
3281         https://bugs.webkit.org/show_bug.cgi?id=193840
3282         <rdar://problem/47558526>
3283
3284         Reviewed by Brent Fulgham.
3285
3286         On iOS, there are some rules overridden in the same sandbox file. The overridden rules
3287         should be removed.
3288
3289         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3290
3291 2019-03-19  Timothy Hatcher  <timothy@apple.com>
3292
3293         Make WebKit/NSAttributedString.h a public header.
3294         https://bugs.webkit.org/show_bug.cgi?id=195944
3295
3296         Reviewed by Dean Jackson.
3297
3298         * WebKit.xcodeproj/project.pbxproj:
3299
3300 2019-03-19  Chris Dumez  <cdumez@apple.com>
3301
3302         Drop NetworkCacheStatistics code
3303         https://bugs.webkit.org/show_bug.cgi?id=195910
3304
3305         Reviewed by Antti Koivisto.
3306
3307         Drop NetworkCacheStatistics code. It was a temporary experiment and has not been used in a long time.
3308
3309         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3310         (WebKit::NetworkProcessCreationParameters::encode const):
3311         (WebKit::NetworkProcessCreationParameters::decode):
3312         * NetworkProcess/NetworkProcessCreationParameters.h:
3313         * NetworkProcess/cache/NetworkCache.cpp:
3314         (WebKit::NetworkCache::Cache::Cache):
3315         (WebKit::NetworkCache::Cache::retrieve):
3316         (WebKit::NetworkCache::Cache::store):
3317         (WebKit::NetworkCache::Cache::storeRedirect):
3318         (WebKit::NetworkCache::Cache::update):
3319         (WebKit::NetworkCache::Cache::clear):
3320         * NetworkProcess/cache/NetworkCache.h:
3321         * NetworkProcess/cache/NetworkCacheStatistics.cpp: Removed.
3322         * NetworkProcess/cache/NetworkCacheStatistics.h: Removed.
3323         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3324         (WebKit::NetworkCache::traverseRecordsFiles):
3325         * NetworkProcess/cache/NetworkCacheStorage.h:
3326         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3327         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3328         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3329         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
3330         * Sources.txt:
3331         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3332         (WebKit::registerUserDefaultsIfNeeded):
3333         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3334         * UIProcess/soup/WebProcessPoolSoup.cpp:
3335         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3336         * WebKit.xcodeproj/project.pbxproj:
3337
3338 2019-03-19  Chris Dumez  <cdumez@apple.com>
3339
3340         Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
3341         https://bugs.webkit.org/show_bug.cgi?id=194787
3342         <rdar://problem/48175520>
3343
3344         Reviewed by Geoffrey Garen.
3345
3346         The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
3347         when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
3348         given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
3349         side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.
3350
3351         In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
3352         WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
3353         as soon as the WebPage object has been created on the WebProcess side. This part was fine.
3354         However, unregistration from the visitedLinkStores would only happen when either the
3355         visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
3356         WebProcess could stay registered with a visitedLinkStore even after the page that was using it
3357         has been closed, which would lead to such logging.
3358
3359         To address the issue, the WebProcessProxy now keeps track for which pages are using which
3360         visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
3361         WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
3362         using a given visitedLinkStore is closed, the process unregisters itself from the
3363         visitedLinkStore, thus avoiding the bug.
3364
3365         I also simplified a lot the logic for having a page telling the WebProcessProxy it started
3366         using a visitedLinkStore. Previously, it would have to wait until the process is done launching
3367         before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
3368         that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
3369         WebProcess (no matter if the process is still launching or not). At this point, the
3370         WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
3371         until it is done launching before registering itself with the visitedLinkStore.
3372
3373         * UIProcess/ProvisionalPageProxy.cpp:
3374         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
3375         (WebKit::ProvisionalPageProxy::initializeWebPage):
3376         (WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
3377         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
3378         * UIProcess/ProvisionalPageProxy.h:
3379         * UIProcess/VisitedLinkStore.cpp:
3380         (WebKit::VisitedLinkStore::~VisitedLinkStore):
3381         (WebKit::VisitedLinkStore::addProcess):
3382         * UIProcess/WebPageProxy.cpp:
3383         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3384         (WebKit::WebPageProxy::initializeWebPage):
3385         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3386         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
3387         (WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
3388         * UIProcess/WebPageProxy.h:
3389         * UIProcess/WebProcessProxy.cpp:
3390         (WebKit::WebProcessProxy::shutDown):
3391         (WebKit::WebProcessProxy::removeWebPage):
3392         (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
3393         (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
3394         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
3395         (WebKit::WebProcessProxy::didFinishLaunching):
3396         (WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
3397         (WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
3398         * UIProcess/WebProcessProxy.h:
3399
3400 2019-03-19  Alex Christensen  <achristensen@webkit.org>
3401
3402         Make WTFLogChannelState and WTFLogLevel enum classes
3403         https://bugs.webkit.org/show_bug.cgi?id=195904
3404
3405         Reviewed by Eric Carlson.
3406
3407         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3408         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
3409         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3410         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
3411
3412 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3413
3414         Unreviewed, rolling out r243132.
3415
3416         Broke GTK build
3417
3418         Reverted changeset:
3419
3420         "Make WTFLogChannelState and WTFLogLevel enum classes"
3421         https://bugs.webkit.org/show_bug.cgi?id=195904
3422         https://trac.webkit.org/changeset/243132
3423
3424 2019-03-19  Antti Koivisto  <antti@apple.com>
3425
3426         Layer with no backing store should still hit-test over a scroller
3427         https://bugs.webkit.org/show_bug.cgi?id=195378
3428         <rdar://problem/48652078>
3429
3430         Reviewed by Simon Fraser.
3431
3432         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3433         (WebKit::RemoteLayerTreeHost::makeNode):
3434         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
3435         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3436         (WebKit::collectDescendantViewsAtPoint):
3437
3438         No need for special WKTiledBackingView, tiled views now have correct event regions.
3439
3440 2019-03-18  Alex Christensen  <achristensen@webkit.org>
3441
3442         Make WTFLogChannelState and WTFLogLevel enum classes
3443         https://bugs.webkit.org/show_bug.cgi?id=195904
3444
3445         Reviewed by Eric Carlson.
3446
3447         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3448         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
3449         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3450         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
3451
3452 2019-03-18  Commit Queue  <commit-queue@webkit.org>
3453
3454         Unreviewed, rolling out r243092 and r243096.
3455         https://bugs.webkit.org/show_bug.cgi?id=195926
3456
3457         Caused assertions in tests (Requested by smfr on #webkit).
3458
3459         Reverted changesets:
3460
3461         "Layer with no backing store should still hit-test over a
3462         scroller"
3463         https://bugs.webkit.org/show_bug.cgi?id=195378
3464         https://trac.webkit.org/changeset/243092
3465
3466         "Try to fix Windows build."
3467         https://trac.webkit.org/changeset/243096
3468
3469 2019-03-18  Timothy Hatcher  <timothy@apple.com>
3470
3471         WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
3472         https://bugs.webkit.org/show_bug.cgi?id=195916
3473
3474         Reviewed by Tim Horton.
3475
3476         Add direct support for UIColor so it does not try to use the NSSecureCoding path.
3477         This avoids needs to list the classes when decoding the attributes NSDictionary
3478         and matches the macOS NSColor encoder/decoder.
3479
3480         * Shared/Cocoa/ArgumentCodersCocoa.mm:
3481         (IPC::typeFromObject):
3482         (IPC::encodeColorInternal):
3483         (IPC::decodeColorInternal):
3484         (IPC::encodeObject):
3485         (IPC::decodeObject):
3486
3487 2019-03-18  Timothy Hatcher  <timothy@apple.com>
3488
3489         Add new NSAttributedString API for converting HTML.
3490         https://bugs.webkit.org/show_bug.cgi?id=195636
3491         rdar://problem/45055697
3492
3493         Reviewed by Tim Horton.
3494
3495         * Platform/spi/ios/UIKitSPI.h:
3496         * SourcesCocoa.txt:
3497         * UIProcess/API/Cocoa/NSAttributedString.h: Added.
3498         * UIProcess/API/Cocoa/NSAttributedString.mm: Added.
3499         (-[_WKAttributedStringNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
3500         (-[_WKAttributedStringNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
3501         (-[_WKAttributedStringNavigationDelegate webView:didFailNavigation:withError:]):
3502         (-[_WKAttributedStringNavigationDelegate webView:didFinishNavigation:]):
3503         (+[_WKAttributedStringWebViewCache cache]):
3504         (+[_WKAttributedStringWebViewCache configuration]):
3505         (+[_WKAttributedStringWebViewCache clearConfiguration]):
3506         (+[_WKAttributedStringWebViewCache retrieveOrCreateWebView]):
3507         (+[_WKAttributedStringWebViewCache cacheWebView:]):
3508         (+[_WKAttributedStringWebViewCache resetPurgeDelay]):
3509         (+[_WKAttributedStringWebViewCache purgeSingleWebView]):
3510         (+[_WKAttributedStringWebViewCache purgeAllWebViews]):
3511         (+[NSAttributedString _loadFromHTMLWithOptions:contentLoader:completionHandler:]):
3512         (+[NSAttributedString loadFromHTMLWithRequest:options:completionHandler:]):
3513         (+[NSAttributedString loadFromHTMLWithFileURL:options:completionHandler:]):
3514         (+[NSAttributedString loadFromHTMLWithString:options:completionHandler:]):
3515         (+[NSAttributedString loadFromHTMLWithData:options:completionHandler:]):
3516         * UIProcess/API/Cocoa/NSAttributedStringPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKErrorInternal.h.
3517         * UIProcess/API/Cocoa/WKError.h:
3518         * UIProcess/API/Cocoa/WKError.mm:
3519         (localizedDescriptionForErrorCode):
3520         (createNSError):
3521         * UIProcess/API/Cocoa/WKErrorInternal.h:
3522         * WebKit.xcodeproj/project.pbxproj:
3523         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
3524         (WebKit::WebPage::getContentsAsAttributedString):
3525
3526 2019-03-18  Alex Christensen  <achristensen@webkit.org>
3527
3528         Implement DownloadMonitor to prevent long-running slow downloads from background apps
3529         https://bugs.webkit.org/show_bug.cgi?id=195785
3530
3531         Reviewed by Geoffrey Garen.
3532
3533         This is similar to what was updated in <rdar://problem/42677685> but for WebKit Downloads.
3534         To test it I implemented a throttled TCP server, SPI to speed up DownloadMonitor's timer,
3535         and SPI to synthesize the application going into the background and foreground, which
3536         NSNotificationCenter does on iOS.
3537
3538         * NetworkProcess/Downloads/Download.cpp:
3539         (WebKit::Download::didReceiveData):
3540         (WebKit::Download::didFinish):
3541         (WebKit::Download::didFail):
3542         (WebKit::Download::didCancel):
3543         * NetworkProcess/Downloads/Download.h:
3544         (WebKit::Download::applicationEnteredBackground):
3545         (WebKit::Download::applicationEnteredForeground):
3546         (WebKit::Download::manager const):
3547         * NetworkProcess/Downloads/DownloadManager.cpp:
3548         (WebKit::DownloadManager::downloadFinished):
3549         (WebKit::DownloadManager::applicationDidEnterBackground):
3550         (WebKit::DownloadManager::applicationWillEnterForeground):
3551         * NetworkProcess/Downloads/DownloadManager.h:
3552         * NetworkProcess/Downloads/DownloadMap.cpp:
3553         (WebKit::DownloadMap::values):
3554         * NetworkProcess/Downloads/DownloadMap.h:
3555         * NetworkProcess/Downloads/DownloadMonitor.cpp: Added.
3556         (WebKit::operator _kbps):
3557         (WebKit::timeUntilNextInterval):
3558         (WebKit::DownloadMonitor::DownloadMonitor):
3559         (WebKit::DownloadMonitor::measuredThroughputRate const):
3560         (WebKit::DownloadMonitor::downloadReceivedBytes):
3561         (WebKit::DownloadMonitor::applicationEnteredForeground):
3562         (WebKit::DownloadMonitor::applicationEnteredBackground):
3563         (WebKit::DownloadMonitor::speedMultiplier const):
3564         (WebKit::DownloadMonitor::timerFired):
3565         * NetworkProcess/Downloads/DownloadMonitor.h: Added.
3566         * NetworkProcess/NetworkProcess.cpp:
3567         (WebKit::NetworkProcess::initializeNetworkProcess):
3568         (WebKit::NetworkProcess::applicationDidEnterBackground):
3569         (WebKit::NetworkProcess::applicationWillEnterForeground):
3570         * NetworkProcess/NetworkProcess.h:
3571         * NetworkProcess/NetworkProcess.messages.in:
3572         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3573         (WebKit::NetworkProcessCreationParameters::encode const):
3574         (WebKit::NetworkProcessCreationParameters::decode):
3575         * NetworkProcess/NetworkProcessCreationParameters.h:
3576         * Sources.txt:
3577         * SourcesCocoa.txt:
3578         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3579         (API::ProcessPoolConfiguration::copy):
3580         * UIProcess/API/APIProcessPoolConfiguration.h:
3581         * UIProcess/API/C/WKContext.cpp:
3582         (WKContextDownloadURLRequest):
3583         (WKContextResumeDownload):
3584         * UIProcess/API/Cocoa/WKProcessPool.mm:
3585         (-[WKProcessPool _synthesizeAppIsBackground:]):
3586         (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
3587         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3588         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3589         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3590         (-[_WKProcessPoolConfiguration downloadMonitorSpeedMultiplier]):
3591         (-[_WKProcessPoolConfiguration setDownloadMonitorSpeedMultiplier:]):
3592         * UIProcess/Cocoa/DownloadProxyMapCocoa.mm: Added.
3593         (WebKit::DownloadProxyMap::platformCreate):
3594         (WebKit::DownloadProxyMap::platformDestroy):
3595         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3596         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3597         * UIProcess/Downloads/DownloadProxy.cpp:
3598         (WebKit::DownloadProxy::didFinish):
3599         (WebKit::DownloadProxy::didFail):
3600         (WebKit::DownloadProxy::didCancel):
3601         * UIProcess/Downloads/DownloadProxyMap.cpp:
3602         (WebKit::DownloadProxyMap::DownloadProxyMap):
3603         (WebKit::DownloadProxyMap::~DownloadProxyMap):
3604         (WebKit::DownloadProxyMap::platformCreate):
3605         (WebKit::DownloadProxyMap::platformDestroy):
3606         (WebKit::DownloadProxyMap::applicationDidEnterBackground):
3607         (WebKit::DownloadProxyMap::applicationWillEnterForeground):
3608         (WebKit::DownloadProxyMap::createDownloadProxy):
3609         (WebKit::DownloadProxyMap::downloadFinished):
3610         * UIProcess/Downloads/DownloadProxyMap.h:
3611         * UIProcess/Network/NetworkProcessProxy.cpp:
3612         (WebKit::NetworkProcessProxy::synthesizeAppIsBackground):
3613         (WebKit::NetworkProcessProxy::createDownloadProxy):
3614         * UIProcess/Network/NetworkProcessProxy.h:
3615         * UIProcess/PageClient.h:
3616         * UIProcess/WebPageProxy.cpp:
3617         (WebKit::WebPageProxy::receivedPolicyDecision):
3618         (WebKit::WebPageProxy::handleDownloadRequest):
3619         * UIProcess/WebPageProxy.h:
3620         * UIProcess/WebProcessPool.cpp:
3621         (WebKit::WebProcessPool::download):
3622         (WebKit::WebProcessPool::resumeDownload):
3623         (WebKit::WebProcessPool::createDownloadProxy):
3624         (WebKit::WebProcessPool::synthesizeAppIsBackground):
3625         * UIProcess/WebProcessPool.h:
3626         * UIProcess/ios/PageClientImplIOS.h:
3627         * UIProcess/ios/PageClientImplIOS.mm:
3628         (WebKit::PageClientImpl::handleDownloadRequest):
3629         * UIProcess/mac/PageClientImplMac.h:
3630         * UIProcess/mac/PageClientImplMac.mm:
3631         (WebKit::PageClientImpl::handleDownloadRequest):
3632         * WebKit.xcodeproj/project.pbxproj:
3633
3634 2019-03-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3635
3636         [iOS] Native selection views sometimes appear in hidden editable areas after losing focus
3637         https://bugs.webkit.org/show_bug.cgi?id=195894
3638         <rdar://problem/48849989>
3639
3640         Reviewed by Tim Horton.
3641
3642         On certain websites, focus is moved away from an editable element while maintaining a selection inside the
3643         editable element. In the case where the editable element is hidden, this currently breaks our text interaction
3644         suppression heuristics, which suppress text selection gestures and overlays inside focused hidden editable
3645         elements. To fix this, we refactor our text interaction suppression heuristics, such that they are not dependent
3646         on an editable element being focused. See changes below for more details.
3647
3648         Test: editing/selection/ios/hide-selection-in-non-focused-element.html
3649
3650         * Shared/EditorState.cpp:
3651         (WebKit::EditorState::PostLayoutData::encode const):
3652         (WebKit::EditorState::PostLayoutData::decode):
3653         * Shared/EditorState.h:
3654
3655         Rename elementIsTransparentOrFullyClipped to editableRootIsTransparentOrFullyClipped, and additionally compute
3656         this flag by checking whether the root editable element containing the selection is transparent or clipped,
3657         instead of using the currently focused element.
3658
3659         * Shared/FocusedElementInformation.cpp:
3660         (WebKit::FocusedElementInformation::encode const):
3661         (WebKit::FocusedElementInformation::decode):
3662         * Shared/FocusedElementInformation.h:
3663
3664         Remove the elementIsTransparentOrFullyClipped flag from FocusedElementInformation (see below for more detail).
3665
3666         * UIProcess/ios/WKContentViewInteraction.h:
3667
3668         Rename FocusedElementIsTransparentOrFullyClipped to EditableRootIsTransparentOrFullyClipped.
3669
3670         * UIProcess/ios/WKContentViewInteraction.mm:
3671         (-[WKContentView _zoomToRevealFocusedElement]):
3672         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3673
3674         Remove logic that currently uses state on FocusedElementInformation to determine whether to suppress platform
3675         text interactions; instead, only use EditorState to make this determination. This logic was originally added in
3676         the initial implementation of the text interaction suppression heuristic as a way to begin suppressing text
3677         selection state before zooming to reveal the focused element; however, since we now zoom to reveal the text
3678         selection when focusing editable elements, zooming is deferred until the next complete EditorState update
3679         arrives in the UI process so we don't need to worry about beginning to suppress text interactions prior to this
3680         initial editor state update.
3681
3682         (-[WKContentView _elementDidBlur]):
3683         (-[WKContentView _updateSelectionAssistantSuppressionState]):
3684
3685         Add a helper method that updates text selection suppression state using the current EditorState.
3686
3687         (-[WKContentView _selectionChanged]):
3688         (-[WKContentView _updateChangedSelection:]):
3689
3690         Always update text suppression state when receiving an EditorState, instead of only doing so when processing a
3691         text selection gesture.
3692
3693         (-[WKContentView _startSuppressingSelectionAssistantForReason:]):
3694
3695         Renamed from _beginSuppressingSelectionAssistantForReason:, to better match "start/end" terminology of
3696         _endSuppressingSelectionAssistantForReason:.
3697
3698         (-[WKContentView dropInteraction:performDrop:]):
3699         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]): Deleted.
3700         * UIProcess/ios/WebPageProxyIOS.mm:
3701         (WebKit::WebPageProxy::editorStateChanged):
3702
3703         Ensure that we run logic to zoom to the focused element *after* updating text selection suppression state, so we
3704         don't erroneously zoom to reveal hidden editable elements.
3705
3706         * WebProcess/WebPage/ios/WebPageIOS.mm:
3707         (WebKit::WebPage::platformEditorState const):
3708         (WebKit::WebPage::getFocusedElementInformation):
3709
3710 2019-03-18  Chris Dumez  <cdumez@apple.com>
3711
3712         Delay WebProcess launch until a load is triggered in a Web view
3713         https://bugs.webkit.org/show_bug.cgi?id=195758
3714         <rdar://problem/48126013>
3715
3716         Reviewed by Geoff Garen.
3717
3718         This is achieved by constructing WebPageProxy objects with a WebProcessProxy that is in
3719         terminated state (because it never launched its process). This is convenient because
3720         it is a state that the WebPageProxy supports, which normally happened by the WebProcess
3721         crashes. When trying to do a load, we were already checking if the WebPageProxy's process
3722         was running (via an isValid() check) and we would re-launch the WebProcess if necessary
3723         by calling reattachToWebProcess(). For clarity, given that this state is no longer
3724         indicating that the WebProcess crashed, I renamed isValid() to hasRunningProcess() and
3725         reattachToWebProcess() to launchProcess().
3726
3727         The reason delaying the WebProcess launch until the first load is useful is because it
3728         allows us to leverage the WebProcessCache given that we now know which registrable
3729         domain is going to be loaded in the process.
3730
3731         This is a progression from a power usage standpoint. When it comes to page load time,
3732         it would be a progression if we found a suitable process in the cache. I do not expect
3733         a performance hit when no process is found in the cache because of process prewarming.
3734
3735         * Shared/API/Cocoa/RemoteObjectRegistry.h:
3736         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
3737         (WebKit::m_launchInitialProcessIfNecessary):
3738         (WebKit::RemoteObjectRegistry::sendInvocation):
3739         * UIProcess/API/Cocoa/WKProcessPool.mm:
3740         (-[WKProcessPool _processCacheSize]):
3741         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3742         * UIProcess/API/Cocoa/WKWebView.mm:
3743         (-[WKWebView _isValid]):
3744         * UIProcess/Automation/WebAutomationSession.cpp:
3745         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
3746         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3747         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
3748         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
3749         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
3750         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
3751         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
3752         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
3753         * UIProcess/DrawingAreaProxy.cpp:
3754         (WebKit::DrawingAreaProxy::setViewExposedRect):
3755         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
3756         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
3757         (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
3758         * UIProcess/InspectorTargetProxy.cpp:
3759         (WebKit::InspectorTargetProxy::connect):
3760         (WebKit::InspectorTargetProxy::disconnect):
3761         (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
3762         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3763         (WebKit::RemoteLayerTreeDrawingAreaProxy::sizeDidChange):
3764         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3765         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3766         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3767         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
3768         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
3769         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
3770         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
3771         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3772         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
3773         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3774         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
3775         * UIProcess/ViewGestureController.cpp:
3776         (WebKit::ViewGestureController::ViewGestureController):
3777         * UIProcess/WebBackForwardList.cpp:
3778         (WebKit::WebBackForwardList::~WebBackForwardList):
3779         * UIProcess/WebCookieManagerProxy.cpp:
3780         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
3781         * UIProcess/WebEditCommandProxy.cpp:
3782         (WebKit::WebEditCommandProxy::unapply):
3783         (WebKit::WebEditCommandProxy::reapply):
3784         * UIProcess/WebFrameProxy.cpp:
3785         (WebKit::WebFrameProxy::stopLoading const):
3786         * UIProcess/WebInspectorProxy.cpp:
3787         (WebKit::WebInspectorProxy::WebInspectorProxy):
3788         * UIProcess/WebPageProxy.cpp:
3789         (WebKit::m_resetRecentCrashCountTimer):
3790         (WebKit::WebPageProxy::hasRunningProcess const):
3791         (WebKit::WebPageProxy::setUIClient):
3792         (WebKit::WebPageProxy::setIconLoadingClient):
3793         (WebKit::WebPageProxy::launchProcess):
3794         (WebKit::WebPageProxy::swapToWebProcess):
3795         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3796         (WebKit::WebPageProxy::didAttachToRunningProcess):
3797         (WebKit::WebPageProxy::launchProcessForReload):
3798         (WebKit::WebPageProxy::launchProcessWithItem):
3799         (WebKit::WebPageProxy::initializeWebPage):
3800         (WebKit::WebPageProxy::tryClose):
3801         (WebKit::WebPageProxy::loadRequest):
3802         (WebKit::WebPageProxy::loadFile):
3803         (WebKit::WebPageProxy::loadData):
3804         (WebKit::WebPageProxy::loadAlternateHTML):
3805         (WebKit::WebPageProxy::loadWebArchiveData):
3806         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
3807         (WebKit::WebPageProxy::stopLoading):
3808         (WebKit::WebPageProxy::reload):
3809         (WebKit::WebPageProxy::goToBackForwardItem):
3810         (WebKit::WebPageProxy::tryRestoreScrollPosition):
3811         (WebKit::WebPageProxy::setControlledByAutomation):
3812         (WebKit::WebPageProxy::setIndicating):
3813         (WebKit::WebPageProxy::setBackgroundColor):
3814         (WebKit::WebPageProxy::setTopContentInset):
3815         (WebKit::WebPageProxy::setUnderlayColor):
3816         (WebKit::WebPageProxy::viewWillStartLiveResize):
3817         (WebKit::WebPageProxy::viewWillEndLiveResize):
3818         (WebKit::WebPageProxy::dispatchActivityStateChange):
3819         (WebKit::WebPageProxy::layerHostingModeDidChange):
3820         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
3821         (WebKit::WebPageProxy::setInitialFocus):
3822         (WebKit::WebPageProxy::clearSelection):
3823         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
3824         (WebKit::WebPageProxy::validateCommand):
3825         (WebKit::WebPageProxy::increaseListLevel):
3826         (WebKit::WebPageProxy::decreaseListLevel):
3827         (WebKit::WebPageProxy::changeListType):
3828         (WebKit::WebPageProxy::setBaseWritingDirection):
3829         (WebKit::WebPageProxy::setNeedsFontAttributes):
3830         (WebKit::WebPageProxy::executeEditCommand):
3831         (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
3832         (WebKit::WebPageProxy::setEditable):
3833         (WebKit::WebPageProxy::performDragControllerAction):
3834         (WebKit::WebPageProxy::dragEnded):
3835         (WebKit::WebPageProxy::didStartDrag):
3836         (WebKit::WebPageProxy::dragCancelled):
3837         (WebKit::WebPageProxy::handleMouseEvent):
3838         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
3839         (WebKit::WebPageProxy::handleWheelEvent):
3840         (WebKit::WebPageProxy::handleKeyboardEvent):
3841         (WebKit::WebPageProxy::handleGestureEvent):
3842         (WebKit::WebPageProxy::handleTouchEventSynchronously):
3843         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
3844         (WebKit::WebPageProxy::handleTouchEvent):
3845         (WebKit::WebPageProxy::scrollBy):
3846         (WebKit::WebPageProxy::centerSelectionInVisibleArea):
3847         (WebKit::WebPageProxy::receivedPolicyDecision):
3848         (WebKit::WebPageProxy::setUserAgent):
3849         (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
3850         (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
3851         (WebKit::WebPageProxy::setCustomTextEncodingName):
3852         (WebKit::WebPageProxy::setTextZoomFactor):
3853         (WebKit::WebPageProxy::setPageZoomFactor):
3854         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
3855         (WebKit::WebPageProxy::scalePage):
3856         (WebKit::WebPageProxy::scalePageInViewCoordinates):
3857         (WebKit::WebPageProxy::scaleView):
3858         (WebKit::WebPageProxy::windowScreenDidChange):
3859         (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
3860         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
3861         (WebKit::WebPageProxy::updateAccessibilityEventsEnabled):
3862         (WebKit::WebPageProxy::setUseFixedLayout):
3863         (WebKit::WebPageProxy::setFixedLayoutSize):
3864         (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
3865         (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
3866         (WebKit::WebPageProxy::listenForLayoutMilestones):
3867         (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
3868         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
3869         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
3870         (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
3871         (WebKit::WebPageProxy::setPaginationMode):
3872         (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
3873         (WebKit::WebPageProxy::setPageLength):
3874         (WebKit::WebPageProxy::setGapBetweenPages):
3875         (WebKit::WebPageProxy::setPaginationLineGridEnabled):
3876         (WebKit::WebPageProxy::countStringMatches):
3877         (WebKit::WebPageProxy::replaceMatches):
3878         (WebKit::WebPageProxy::launchInitialProcessIfNecessary):
3879         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
3880         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
3881         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
3882         (WebKit::WebPageProxy::getSourceForFrame):
3883         (WebKit::WebPageProxy::getContentsAsString):
3884         (WebKit::WebPageProxy::getContentsAsAttributedString):
3885         (WebKit::WebPageProxy::getBytecodeProfile):
3886         (WebKit::WebPageProxy::getSamplingProfilerOutput):
3887         (WebKit::WebPageProxy::getContentsAsMHTMLData):
3888         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
3889         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
3890         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
3891         (WebKit::WebPageProxy::getResourceDataFromFrame):
3892         (WebKit::WebPageProxy::getWebArchiveOfFrame):
3893         (WebKit::WebPageProxy::forceRepaint):
3894         (WebKit::WebPageProxy::preferencesDidChange):
3895         (WebKit::WebPageProxy::setMediaVolume):
3896         (WebKit::WebPageProxy::setMuted):
3897         (WebKit::WebPageProxy::setMediaCaptureEnabled):
3898         (WebKit::WebPageProxy::stopMediaCapture):
3899         (WebKit::WebPageProxy::stopAllMediaPlayback):
3900         (WebKit::WebPageProxy::suspendAllMediaPlayback):
3901         (WebKit::WebPageProxy::resumeAllMediaPlayback):
3902         (WebKit::WebPageProxy::handleMediaEvent):
3903         (WebKit::WebPageProxy::setVolumeOfMediaElement):
3904         (WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
3905         (WebKit::WebPageProxy::didChooseColor):
3906         (WebKit::WebPageProxy::didEndColorPicker):
3907         (WebKit::WebPageProxy::didSelectOption):
3908         (WebKit::WebPageProxy::inspector const):
3909         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
3910         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
3911         (WebKit::WebPageProxy::didCancelForOpenPanel):
3912         (WebKit::WebPageProxy::removeEditCommand):
3913         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
3914         (WebKit::WebPageProxy::processDidBecomeResponsive):
3915         (WebKit::WebPageProxy::processDidTerminate):
3916         (WebKit::WebPageProxy::processWillBecomeSuspended):
3917         (WebKit::WebPageProxy::processWillBecomeForeground):
3918         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3919         (WebKit::WebPageProxy::setCanRunModal):
3920         (WebKit::WebPageProxy::canRunModal):
3921         (WebKit::WebPageProxy::computePagesForPrinting):
3922         (WebKit::WebPageProxy::drawRectToImage):
3923         (WebKit::WebPageProxy::drawPagesToPDF):
3924         (WebKit::WebPageProxy::drawPagesForPrinting):
3925         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
3926         (WebKit::WebPageProxy::setViewLayoutSize):
3927         (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
3928         (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
3929         (WebKit::WebPageProxy::setComposition):
3930         (WebKit::WebPageProxy::confirmComposition):
3931         (WebKit::WebPageProxy::cancelComposition):
3932         (WebKit::WebPageProxy::setScrollPinningBehavior):
3933         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
3934         (WebKit::WebPageProxy::changeFontAttributes):
3935         (WebKit::WebPageProxy::changeFont):
3936         (WebKit::WebPageProxy::setTextAsync):
3937         (WebKit::WebPageProxy::insertTextAsync):
3938         (WebKit::WebPageProxy::getMarkedRangeAsync):
3939         (WebKit::WebPageProxy::getSelectedRangeAsync):
3940         (WebKit::WebPageProxy::characterIndexForPointAsync):
3941         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
3942         (WebKit::WebPageProxy::setCompositionAsync):
3943         (WebKit::WebPageProxy::confirmCompositionAsync):
3944         (WebKit::WebPageProxy::takeSnapshot):
3945         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
3946         (WebKit::WebPageProxy::setUseSystemAppearance):
3947         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
3948         (WebKit::WebPageProxy::setPlaybackTarget):
3949         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
3950         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
3951         (WebKit::WebPageProxy::clearWheelEventTestTrigger):
3952         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
3953         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
3954         (WebKit::WebPageProxy::getLoadDecisionForIcon):
3955         (WebKit::WebPageProxy::setResourceCachingDisabled):
3956         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
3957         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
3958         (WebKit::WebPageProxy::insertAttachment):
3959         (WebKit::WebPageProxy::updateAttachmentAttributes):
3960         (WebKit::WebPageProxy::getApplicationManifest):
3961         (WebKit::WebPageProxy::textInputContextsInRect):
3962         (WebKit::WebPageProxy::focusTextInputContext):
3963         * UIProcess/WebPageProxy.h:
3964         * UIProcess/WebProcessPool.cpp:
3965         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3966         (WebKit::WebProcessPool::initializeNewWebProcess):
3967         (WebKit::WebProcessPool::disconnectProcess):
3968         (WebKit::WebProcessPool::createWebPage):
3969         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
3970         * UIProcess/WebProcessPool.h:
3971         * UIProcess/WebProcessProxy.cpp:
3972         (WebKit::WebProcessProxy::create):