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