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