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