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