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