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