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