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