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