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