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