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