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