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