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