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