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