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