Add socket-delegate to another entitlements config
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-25  Brady Eidson  <beidson@apple.com>
2
3         Add socket-delegate to another entitlements config
4         rdar://problem/48090350 and https://bugs.webkit.org/show_bug.cgi?id=196227
5
6         Reviewed by Geoffrey Garen.
7
8         * Configurations/Network-iOSMac.entitlements:
9
10 2019-03-25  Commit Queue  <commit-queue@webkit.org>
11
12         Unreviewed, rolling out r243465.
13         https://bugs.webkit.org/show_bug.cgi?id=196226
14
15         the test doesn't build (Requested by thorton on #webkit).
16
17         Reverted changeset:
18
19         "Do not terminate the NetworkProcess if a third party
20         application sends a NSCredential with a SecIdentityRef"
21         https://bugs.webkit.org/show_bug.cgi?id=196213
22         https://trac.webkit.org/changeset/243465
23
24 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
25
26         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
27         https://bugs.webkit.org/show_bug.cgi?id=196126
28         rdar://problem/49095791
29
30         Reviewed by Tim Horton.
31         
32         I fumbled the commit after the enum rename. Make this actually work.
33
34         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
35         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
36
37 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
38
39         Zoom on macOS is centered around a point lower than the cursor
40         https://bugs.webkit.org/show_bug.cgi?id=196225
41         rdar://problem/49213574
42
43         Reviewed by Tim Horton.
44         
45         The origin handed to ViewGestureController::handleMagnificationGestureEvent is in WKWebView
46         coordinates, but we end up setting the transform on the RenderView's layer, so we need
47         to subtract the topContentInset.
48
49         * UIProcess/mac/ViewGestureControllerMac.mm:
50         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
51
52 2019-03-25  Alex Christensen  <achristensen@webkit.org>
53
54         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
55         https://bugs.webkit.org/show_bug.cgi?id=196213
56
57         Reviewed by Geoff Garen.
58
59         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
60         with a SecIdentityRef wrapped in an NSCredential.
61
62         * Shared/cf/ArgumentCodersCF.cpp:
63         (IPC::decode):
64
65 2019-03-25  Chris Dumez  <cdumez@apple.com>
66
67         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
68         https://bugs.webkit.org/show_bug.cgi?id=196210
69         <rdar://problem/48681326>
70
71         Reviewed by Geoffrey Garen.
72
73         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
74         instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.
75
76         This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
77         communicate via DrawingArea IPC.
78
79         * WebProcess/WebPage/WebPage.cpp:
80         (WebKit::WebPage::reinitializeWebPage):
81         (WebKit::WebPage::setIsSuspended):
82         * WebProcess/WebPage/WebPage.h:
83
84 2019-03-25  Alex Christensen  <achristensen@webkit.org>
85
86         Enable IPC sending and receiving non-default-constructible types
87         https://bugs.webkit.org/show_bug.cgi?id=196132
88
89         Reviewed by Geoff Garen.
90
91         * Platform/IPC/ArgumentCoder.h:
92         * Platform/IPC/ArgumentCoders.h:
93         (IPC::TupleEncoder::encode):
94         (IPC::tupleFromTupleAndObject):
95         (IPC::TupleDecoderImpl::decode):
96         (IPC::TupleDecoderImpl<Type>::decode):
97         (IPC::TupleDecoder::decode):
98         (IPC::TupleDecoder<0>::decode):
99         (IPC::TupleCoder::encode): Deleted.
100         (IPC::TupleCoder::decode): Deleted.
101         * Platform/IPC/Connection.h:
102         (IPC::Connection::sendWithReply):
103         (IPC::TupleMover::move):
104         (IPC::moveTuple):
105         (IPC::Connection::sendSync):
106         * Platform/IPC/Decoder.h:
107         (IPC::Decoder::decode):
108         (IPC::Decoder::operator>>):
109         * Platform/IPC/HandleMessage.h:
110         (IPC::handleMessage):
111         (IPC::handleMessageSynchronous):
112         (IPC::handleMessageSynchronousWantsConnection):
113         (IPC::handleMessageAsync):
114         * Platform/SharedMemory.h:
115         * Scripts/webkit/LegacyMessages-expected.h:
116         * Scripts/webkit/Messages-expected.h:
117         * Scripts/webkit/MessagesSuperclass-expected.h:
118         * Scripts/webkit/messages.py:
119         * Shared/Databases/IndexedDB/WebIDBResult.h:
120         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
121         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
122         * Shared/ShareableBitmap.h:
123         * Shared/ShareableResource.h:
124         * Shared/UpdateInfo.h:
125         * Shared/WebEvent.h:
126         * Shared/WebProcessCreationParameters.cpp:
127         * Shared/WebProcessCreationParameters.h:
128         * Shared/mac/SecItemResponseData.cpp:
129         (WebKit::SecItemResponseData::SecItemResponseData):
130         (WebKit::SecItemResponseData::decode):
131         * Shared/mac/SecItemResponseData.h:
132         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
133
134 2019-03-25  Tim Horton  <timothy_horton@apple.com>
135
136         Animated keyboard scrolling is extremely chaotic
137         https://bugs.webkit.org/show_bug.cgi?id=196164
138         <rdar://problem/48702444>
139
140         Reviewed by Simon Fraser.
141
142         * UIProcess/ios/WKContentViewInteraction.mm:
143         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
144         Consume keyboard events instead of interpreting them traditionally
145         if WKKeyboardScrollingAnimator is animating.
146
147         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
148         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
149         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
150         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
151         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
152         (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
153         (-[WKKeyboardScrollingAnimator displayLinkFired:]):
154         (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
155         Expose the current state of interactive scrolling, and rename the related member.
156
157 2019-03-25  Keith Rollin  <krollin@apple.com>
158
159         Add WebKit logging for first paint and other interesting layout milestones
160         https://bugs.webkit.org/show_bug.cgi?id=196159
161         <rdar://problem/49128952>
162
163         Reviewed by Simon Fraser.
164
165         Add some logging to indicate what layout milestones have been reached.
166         This should help us determine if there's a client, rendering, layout,
167         or some other issue when page content does not appear in the client
168         window.
169
170         The logging is being added to
171         WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
172         a nice central place to capture layout milestones. However, it will
173         only log notifications that are being sent to clients. It does not
174         indicate all milestones that have occurred. That is, it does not
175         report milestones that are filtered out due to client disinterest.
176         There doesn't seem to be a good central place to capture all
177         milestones, regardless of client interest.
178
179         * Platform/Logging.h:
180         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
181         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
182
183 2019-03-25  Patrick Griffis  <pgriffis@igalia.com>
184
185         [GTK][WPE] Remove network access from web process sandbox
186         https://bugs.webkit.org/show_bug.cgi?id=189967
187
188         Reviewed by Michael Catanzaro.
189
190         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
191         (WebKit::createFlatpakInfo):
192         (WebKit::bubblewrapSpawn):
193         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
194         (WebKit::flatpakSpawn):
195
196 2019-03-25  Andy Estes  <aestes@apple.com>
197
198         [Apple Pay] Call +canMakePayments on a work queue
199         https://bugs.webkit.org/show_bug.cgi?id=196179
200         <rdar://problem/45388749>
201
202         Reviewed by Brady Eidson.
203
204         Calling +canMakePayments on either PKPaymentAuthorizationController or
205         PKPaymentAuthorizationViewController results in synchronous IPC and is therefore very
206         expensive to call on the main thread. On iOS, these calls are made in the network process,
207         and on Mac in the UI process.
208
209         Call these methods on a work queue to avoid main thread spins.
210
211         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
212         (WebKit::WebPaymentCoordinatorProxy::canMakePayments):
213         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
214         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
215         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
216         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
217         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
218
219 2019-03-25  Andy Estes  <aestes@apple.com>
220
221         [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
222         https://bugs.webkit.org/show_bug.cgi?id=196180
223
224         Reviewed by Youenn Fablet.
225
226         Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
227         without an entitlement. Therefore, we can call it from the web process directly rather than
228         synchronously messaging the entitled UI or networking process.
229
230         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
231         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
232         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
233         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
234         * SourcesCocoa.txt:
235         * WebKit.xcodeproj/project.pbxproj:
236         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
237         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
238         * WebProcess/ApplePay/WebPaymentCoordinator.h:
239         * WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
240         (WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
241         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
242         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
243         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
244
245 2019-03-25  Chris Dumez  <cdumez@apple.com>
246
247         Unreviewed, tiny fix after r243388 to address API test failures on iOS
248
249         m_processType was properly initialized on macOS but not iOS.
250
251         * WebProcess/cocoa/WebProcessCocoa.mm:
252         (WebKit::WebProcess::platformInitializeProcess):
253
254 2019-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
255
256         [GTK][WPE] Do not allow changes in active URI before provisional load starts for non-API requests
257         https://bugs.webkit.org/show_bug.cgi?id=194208
258
259         Reviewed by Michael Catanzaro.
260
261         * UIProcess/API/glib/WebKitWebView.cpp:
262         (webkitWebViewWillStartLoad): Block updates of active URL.
263         (webkitWebViewLoadChanged): Unblock updates of active URL on WEBKIT_LOAD_STARTED.
264
265 2019-03-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
266
267         Remove NavigatorContentUtils in WebCore/Modules
268         https://bugs.webkit.org/show_bug.cgi?id=196070
269
270         Reviewed by Alex Christensen.
271
272         NavigatorContentUtils was to support the custom scheme spec [1].
273         However, in WebKit side, no port has supported the feature in
274         WebKit layer after EFL port was removed. So there has been the
275         only IDL implementation of the NavigatorContentUtils in WebCore.
276         So we don't need to keep the implementation in WebCore anymore.
277
278         [1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
279
280         * Configurations/FeatureDefines.xcconfig:
281         * WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h: Removed.
282
283 2019-03-24  Zan Dobersek  <zdobersek@igalia.com>
284
285         Unreviewed WPE build fix.
286
287         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
288         Add an explicit CompletionHandler.h include to avoid a trip-up in
289         unified builds.
290
291 2019-03-24  Fujii Hironori  <Hironori.Fujii@sony.com>
292
293         [WinCairo] WebProcessDataStoreParameters.h(32): error C2653: 'SandboxExtension': is not a class or namespace name
294         https://bugs.webkit.org/show_bug.cgi?id=196192
295
296         Unreviewed for WinCairo port.
297
298         * Shared/WebProcessDataStoreParameters.h: Added #include "SandboxExtension.h".
299
300 2019-03-24  Andy Estes  <aestes@apple.com>
301
302         [watchOS] Remove unused Proximity Networking code
303         https://bugs.webkit.org/show_bug.cgi?id=196188
304
305         Reviewed by Tim Horton.
306
307         * Configurations/WebKit.xcconfig:
308         * NetworkProcess/NetworkProcess.cpp:
309         (WebKit::NetworkProcess::NetworkProcess):
310         * NetworkProcess/NetworkProcess.h:
311         * NetworkProcess/NetworkProcessCreationParameters.cpp:
312         (WebKit::NetworkProcessCreationParameters::encode const):
313         (WebKit::NetworkProcessCreationParameters::decode):
314         * NetworkProcess/NetworkProcessCreationParameters.h:
315         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
316         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
317         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
318         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
319         (WebKit::NetworkProcess::platformPrepareToSuspend):
320         (WebKit::NetworkProcess::platformProcessDidResume):
321         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
322         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
323         * NetworkProcess/watchos/NetworkProximityAssertion.h: Removed.
324         * NetworkProcess/watchos/NetworkProximityAssertion.mm: Removed.
325         * NetworkProcess/watchos/NetworkProximityManager.h: Removed.
326         * NetworkProcess/watchos/NetworkProximityManager.mm: Removed.
327         * SourcesCocoa.txt:
328         * UIProcess/API/APIProcessPoolConfiguration.cpp:
329         (API::ProcessPoolConfiguration::copy):
330         * UIProcess/API/APIProcessPoolConfiguration.h:
331         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
332         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
333         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
334         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
335         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
336         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
337         * WebKit.xcodeproj/project.pbxproj:
338
339 2019-03-23  Chris Dumez  <cdumez@apple.com>
340
341         Unreviewed, fix typo in comment added in r243379.
342
343         * UIProcess/API/Cocoa/WKProcessGroup.mm:
344         (-[WKProcessGroup setDelegate:]):
345
346 2019-03-23  Simon Fraser  <simon.fraser@apple.com>
347
348         REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
349         https://bugs.webkit.org/show_bug.cgi?id=137043
350         rdar://problem/16595330
351
352         Reviewed by Zalan Bujtas.
353
354         Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
355         to the UI process, and use it to set UIScrollView indicators visible or not.
356         
357         The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
358         where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
359         tests, so would never get called.
360
361         * Shared/WebCoreArgumentCoders.cpp:
362         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
363         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
364         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
365         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
366
367 2019-03-23  Zalan Bujtas  <zalan@apple.com>
368
369         [ContentChangeObserver] Taping on a form control should always result in click.
370         https://bugs.webkit.org/show_bug.cgi?id=196177
371
372         Reviewed by Simon Fraser.
373
374         This patch enures that we send a synthetic click when the traget node is a form control (button, edit field etc) even if
375         the mousemove brings up some hover content.
376
377         * WebProcess/WebPage/ios/WebPageIOS.mm:
378         (WebKit::WebPage::handleSyntheticClick):
379
380 2019-03-23  Andy Estes  <aestes@apple.com>
381
382         [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS
383         https://bugs.webkit.org/show_bug.cgi?id=196163
384         <rdar://problem/48787564>
385
386         Reviewed by Anders Carlsson.
387
388         Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop
389         calling PKPaymentAuthorizationViewController class methods on iOS in favor of their
390         PKPaymentAuthorizationController alternatives.
391
392         While we're here, we should also transition to calling
393         +paymentServicesMerchantURLForAPIType:completion: on both
394         PKPaymentAuthorizationViewController and PKPaymentAuthorizationController.
395
396         * Platform/cocoa/PaymentAuthorizationViewController.mm:
397         (-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
398         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
399         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
400         (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]):
401         (-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]):
402         * Platform/ios/PaymentAuthorizationController.mm:
403         (-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
404         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
405         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted.
406         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
407         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
408         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
409         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
410
411 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
412
413         Unreviewed. Fix GTK build after r243409.
414
415         Build failure is actually unrelated to r243409, it's yet another unified build failure that happens when source
416         file list changes.
417
418         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
419         (WebKit::WebInspectorProxy::platformShowCertificate): Use WebCore namespace for CertificateInfo parameter.
420
421 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
422
423         [GTK] Remove build time dependency on Geoclue2
424         https://bugs.webkit.org/show_bug.cgi?id=195994
425
426         Reviewed by Michael Catanzaro.
427
428         Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.
429
430         * PlatformGTK.cmake:
431         * PlatformWPE.cmake:
432         * SourcesGTK.txt:
433         * SourcesWPE.txt:
434         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
435         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
436         (webkitGeolocationManagerStop):
437         (webkitGeolocationManagerSetEnableHighAccuracy):
438         (webkitGeolocationManagerDispose):
439         (webkit_geolocation_manager_class_init):
440         * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
441         (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
442         (WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
443         (WebKit::GeoclueGeolocationProvider::start):
444         (WebKit::GeoclueGeolocationProvider::stop):
445         (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
446         (WebKit::GeoclueGeolocationProvider::destroyManagerLater):
447         (WebKit::GeoclueGeolocationProvider::destroyManager):
448         (WebKit::GeoclueGeolocationProvider::setupManager):
449         (WebKit::GeoclueGeolocationProvider::createClient):
450         (WebKit::GeoclueGeolocationProvider::setupClient):
451         (WebKit::GeoclueGeolocationProvider::startClient):
452         (WebKit::GeoclueGeolocationProvider::stopClient):
453         (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
454         (WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
455         (WebKit::GeoclueGeolocationProvider::createLocation):
456         (WebKit::GeoclueGeolocationProvider::locationUpdated):
457         (WebKit::GeoclueGeolocationProvider::didFail):
458         * UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
459
460 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
461
462         Undo collision with r243390.
463
464         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
465         (stringForSSLProtocol):
466
467 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
468
469         Fix internal builds.
470
471         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
472         (stringForSSLProtocol):
473
474 2019-03-22  Keith Rollin  <krollin@apple.com>
475
476         Enable ThinLTO support in Production builds
477         https://bugs.webkit.org/show_bug.cgi?id=190758
478         <rdar://problem/45413233>
479
480         Reviewed by Daniel Bates.
481
482         Enable building with Thin LTO in Production when using Xcode 10.2 or
483         later. This change results in a 1.45% progression in PLT5. Full
484         Production build times increase about 2-3%. Incremental build times
485         are more severely affected, and so LTO is not enabled for local
486         engineering builds.
487
488         LTO is enabled only on macOS for now, until rdar://problem/49013399,
489         which affects ARM builds, is fixed.
490
491         To change the LTO setting when building locally:
492
493         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
494           command line.
495         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
496           on the command line.
497         - If building with `build-root`, specify --lto={none,thin,full} on the
498           command line.
499         - If building with Xcode, create a LocalOverrides.xcconfig file at the
500           top level of your repository directory (if needed) and define
501           WK_LTO_MODE to full, thin, or none.
502
503         * Configurations/Base.xcconfig:
504
505 2019-03-22  Chris Dumez  <cdumez@apple.com>
506
507         Unreviewed build fix after r243388.
508
509         * WebProcess/WebProcess.h:
510
511 2019-03-22  Per Arne Vollan  <pvollan@apple.com>
512
513         [macOS] Fix sandbox violation
514         https://bugs.webkit.org/show_bug.cgi?id=196153
515         <rdar://problem/49123855>
516
517         Reviewed by Brent Fulgham.
518
519         The sandbox on macOS is blocking the mach lookup.
520
521         * WebProcess/com.apple.WebProcess.sb.in:
522
523 2019-03-21  Ryan Haddad  <ryanhaddad@apple.com>
524
525         Unreviewed, fix the build with recent SDKs.
526
527         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
528         (stringForSSLProtocol):
529
530 2019-03-22  Chris Dumez  <cdumez@apple.com>
531
532         Implement WebProcess freezer opt-in completely on WebContent process side
533         https://bugs.webkit.org/show_bug.cgi?id=196149
534
535         Reviewed by Brady Eidson.
536
537         Implement WebProcess freezer opt-in completely on WebContent process side, we do not need
538         to involve the UIProcess with this and rely on IPC which may be fragile.
539
540         In the future, we may want to set freezable state from the UIProcess when the API supports
541         it. We can move the logic to be fully on the UIProcess side then. In the mean time, it is
542         likely best not to rely on IPC and process coordination for this.
543
544         * UIProcess/WebProcessProxy.cpp:
545         (WebKit::globalPageMap):
546         (WebKit::WebProcessProxy::WebProcessProxy):
547         (WebKit::WebProcessProxy::setIsInProcessCache):
548         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
549         (WebKit::WebProcessProxy::didFinishLaunching):
550         (WebKit::WebProcessProxy::validateFreezerStatus): Deleted.
551         * UIProcess/WebProcessProxy.h:
552         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
553         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap): Deleted.
554         (WebKit::WebProcessProxy::WebPageProxyMap::size const): Deleted.
555         (WebKit::WebProcessProxy::WebPageProxyMap::values): Deleted.
556         (WebKit::WebProcessProxy::WebPageProxyMap::values const): Deleted.
557         (WebKit::WebProcessProxy::WebPageProxyMap::begin): Deleted.
558         (WebKit::WebProcessProxy::WebPageProxyMap::end): Deleted.
559         (WebKit::WebProcessProxy::WebPageProxyMap::get): Deleted.
560         (WebKit::WebProcessProxy::WebPageProxyMap::contains const): Deleted.
561         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const): Deleted.
562         (WebKit::WebProcessProxy::WebPageProxyMap::set): Deleted.
563         (WebKit::WebProcessProxy::WebPageProxyMap::take): Deleted.
564         * WebProcess/WebProcess.cpp:
565         (WebKit::WebProcess::setIsInProcessCache):
566         (WebKit::WebProcess::markIsNoLongerPrewarmed):
567         (WebKit::WebProcess::actualPrepareToSuspend):
568         (WebKit::WebProcess::setFreezable): Deleted.
569         * WebProcess/WebProcess.h:
570         * WebProcess/WebProcess.messages.in:
571         * WebProcess/cocoa/WebProcessCocoa.mm:
572         (WebKit::WebProcess::updateProcessName):
573         (WebKit::WebProcess::shouldFreezeOnSuspension const):
574         (WebKit::WebProcess::updateFreezerStatus):
575
576 2019-03-22  Chris Dumez  <cdumez@apple.com>
577
578         Prewarmed processes should be usable with any website data store
579         https://bugs.webkit.org/show_bug.cgi?id=196104
580
581         Reviewed by Alex Christensen.
582
583         Split WebsiteDataStore-specific data out of WebProcessCreationParameters and into a new
584         WebProcessDataStoreParameters struct so that we do not need a WebsiteDataStore in order
585         to lauch and initialize a WebProcess. When the process finally gets used and we thus
586         know which WebsiteDataStore they will be used for, we send the WebProcessDataStoreParameters
587         to the process to that it can do its data store-specific initialization.
588
589         This allows prewarmed processes not not have a WebsiteDataStore assocated with them. They
590         can then be used for any WebsiteDataStore when we need them.
591
592         This is also used by our dummy WebProcessProxy since it does not have a backing process and
593         thus has no associated WebsiteDataStore.
594
595         * Shared/WebProcessCreationParameters.cpp:
596         (WebKit::WebProcessCreationParameters::encode const):
597         (WebKit::WebProcessCreationParameters::decode):
598         * Shared/WebProcessCreationParameters.h:
599         * Shared/WebProcessDataStoreParameters.h: Added.
600         (WebKit::WebProcessDataStoreParameters::encode const):
601         (WebKit::WebProcessDataStoreParameters::decode):
602         * UIProcess/API/C/WKContext.cpp:
603         (WKContextWarmInitialProcess):
604         * UIProcess/API/Cocoa/WKProcessPool.mm:
605         (-[WKProcessPool _warmInitialProcess]):
606         * UIProcess/ServiceWorkerProcessProxy.cpp:
607         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
608         * UIProcess/WebPageProxy.cpp:
609         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
610         * UIProcess/WebProcessPool.cpp:
611         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
612         (WebKit::WebProcessPool::createNewWebProcess):
613         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
614         (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
615         (WebKit::WebProcessPool::initializeNewWebProcess):
616         (WebKit::WebProcessPool::prewarmProcess):
617         (WebKit::WebProcessPool::processForRegistrableDomain):
618         (WebKit::WebProcessPool::createWebPage):
619         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
620         * UIProcess/WebProcessPool.h:
621         (WebKit::WebProcessPool::sendToOneProcess):
622         * UIProcess/WebProcessProxy.cpp:
623         (WebKit::WebProcessProxy::create):
624         (WebKit::WebProcessProxy::WebProcessProxy):
625         (WebKit::WebProcessProxy::setWebsiteDataStore):
626         (WebKit::WebProcessProxy::addExistingWebPage):
627         * UIProcess/WebProcessProxy.h:
628         (WebKit::WebProcessProxy::websiteDataStore const):
629         * WebKit.xcodeproj/project.pbxproj:
630         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
631         (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
632         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
633         * WebProcess/WebProcess.cpp:
634         (WebKit::WebProcess::initializeWebProcess):
635         (WebKit::WebProcess::setWebsiteDataStoreParameters):
636         * WebProcess/WebProcess.h:
637         * WebProcess/WebProcess.messages.in:
638         * WebProcess/WebProcessSupplement.h:
639         (WebKit::WebProcessSupplement::initialize):
640         (WebKit::WebProcessSupplement::setWebsiteDataStore):
641         * WebProcess/cocoa/WebProcessCocoa.mm:
642         (WebKit::WebProcess::platformInitializeWebProcess):
643         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
644         * WebProcess/win/WebProcessWin.cpp:
645         (WebKit::WebProcess::platformInitializeWebProcess):
646         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
647
648 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
649
650         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
651         https://bugs.webkit.org/show_bug.cgi?id=196126
652         rdar://problem/49095791
653
654         Reviewed by Antti Koivisto.
655
656         The scrolling tree doesn't have an accurate picture of the main view's scroll position
657         during pinch-zooming, so don't have it apply layer positions if a transient zoom is
658         in progress.
659
660         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
661         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
662         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
663         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
664
665 2019-03-22  Antti Koivisto  <antti@apple.com>
666
667         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
668         https://bugs.webkit.org/show_bug.cgi?id=196100
669         <rdar://problem/49117933>
670
671         Reviewed by Simon Fraser.
672
673         Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
674
675         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
676         (WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const):
677         (WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const):
678
679         Make more generic and save the associated positioning behavior.
680
681         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const): Deleted.
682         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID): Deleted.
683         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs): Deleted.
684         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
685         (WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs):
686         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
687         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
688         (WebKit::isScrolledBy):
689
690         Stationary relationship means the layer won't scroll the scroller.
691
692         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
693         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
694
695 2019-03-22  Chris Dumez  <cdumez@apple.com>
696
697         REGRESSION (r243094): ePub files do not render or open in Books
698         https://bugs.webkit.org/show_bug.cgi?id=196119
699         <rdar://problem/49121686>
700
701         Reviewed by Brady Eidson.
702
703         Do not delay the WebProcess launch until a load when contructing a web view and the client
704         may observe when its injected bundle is loaded via WKProcessGroupDelegate's
705         didCreateConnectionToWebProcessPlugIn.
706
707         * UIProcess/API/Cocoa/WKProcessGroup.mm:
708         (-[WKProcessGroup setDelegate:]):
709         * UIProcess/WebInspectorUtilities.cpp:
710         (WebKit::inspectorProcessPool):
711         * UIProcess/WebProcessPool.cpp:
712         (WebKit::WebProcessPool::createWebPage):
713         * UIProcess/WebProcessPool.h:
714
715 2019-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>
716
717         REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()
718         https://bugs.webkit.org/show_bug.cgi?id=196140
719
720         Reviewed by Chris Dumez.
721
722         Since r243094, the WebPageProxy fullscreen manager is not created in the constructor, but once the page has a
723         process launched.
724
725         * UIProcess/Automation/WebAutomationSession.cpp:
726         (WebKit::WebAutomationSession::exitFullscreenWindowForPage): Null check WebPageProxy::fullScreenManager() before
727         using it.
728
729 2019-03-22  Timothy Hatcher  <timothy@apple.com>
730
731         Change macosx() to macos() in WK_API... and JSC_API... macros.
732         https://bugs.webkit.org/show_bug.cgi?id=196106
733
734         Reviewed by Brian Burg.
735
736         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
737         * Shared/API/Cocoa/WKDragDestinationAction.h:
738         * Shared/API/Cocoa/WKMain.h:
739         * Shared/API/Cocoa/_WKFrameHandle.h:
740         * Shared/API/Cocoa/_WKHitTestResult.h:
741         * Shared/API/Cocoa/_WKNSWindowExtras.h:
742         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
743         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
744         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
745         * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
746         * UIProcess/API/C/WKPage.h:
747         * UIProcess/API/Cocoa/NSAttributedString.h:
748         * UIProcess/API/Cocoa/WKBackForwardList.h:
749         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
750         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
751         * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
752         * UIProcess/API/Cocoa/WKContentRuleList.h:
753         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
754         * UIProcess/API/Cocoa/WKError.h:
755         * UIProcess/API/Cocoa/WKErrorPrivate.h:
756         * UIProcess/API/Cocoa/WKFrameInfo.h:
757         * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
758         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
759         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
760         * UIProcess/API/Cocoa/WKNavigation.h:
761         * UIProcess/API/Cocoa/WKNavigationAction.h:
762         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
763         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
764         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
765         * UIProcess/API/Cocoa/WKNavigationResponse.h:
766         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
767         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
768         * UIProcess/API/Cocoa/WKPreferences.h:
769         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
770         * UIProcess/API/Cocoa/WKProcessPool.h:
771         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
772         * UIProcess/API/Cocoa/WKScriptMessage.h:
773         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
774         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
775         * UIProcess/API/Cocoa/WKUIDelegate.h:
776         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
777         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
778         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
779         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
780         * UIProcess/API/Cocoa/WKUserContentController.h:
781         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
782         * UIProcess/API/Cocoa/WKUserScript.h:
783         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
784         * UIProcess/API/Cocoa/WKViewPrivate.h:
785         * UIProcess/API/Cocoa/WKWebView.h:
786         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
787         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
788         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
789         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
790         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
791         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
792         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
793         * UIProcess/API/Cocoa/WKWindowFeatures.h:
794         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
795         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
796         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
797         * UIProcess/API/Cocoa/_WKAttachment.h:
798         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
799         * UIProcess/API/Cocoa/_WKAutomationSession.h:
800         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
801         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
802         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
803         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
804         * UIProcess/API/Cocoa/_WKDownload.h:
805         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
806         * UIProcess/API/Cocoa/_WKElementAction.h:
807         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
808         * UIProcess/API/Cocoa/_WKFindOptions.h:
809         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
810         * UIProcess/API/Cocoa/_WKFormInputSession.h:
811         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
812         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
813         * UIProcess/API/Cocoa/_WKInspector.h:
814         * UIProcess/API/Cocoa/_WKInspectorWindow.h:
815         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
816         * UIProcess/API/Cocoa/_WKLayoutMode.h:
817         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
818         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
819         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
820         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
821         * UIProcess/API/Cocoa/_WKSessionState.h:
822         * UIProcess/API/Cocoa/_WKTextInputContext.h:
823         * UIProcess/API/Cocoa/_WKThumbnailView.h:
824         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
825         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
826         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
827         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
828         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
829         * UIProcess/API/Cocoa/_WKUserInitiatedAction.h:
830         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
831         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
832         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
833         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
834         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
835         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
836         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
837         * WebProcess/API/Cocoa/WKWebProcess.h:
838         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
839         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
840         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
841         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
842         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
843         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
844         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
845         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
846         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
847         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
848         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
849         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
850         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
851         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
852         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
853         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
854         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
855
856 2019-03-22  Yousuke Kimoto  <Yousuke.Kimoto@sony.com>
857
858         Unreviewed build fix.
859
860         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
861
862 2019-03-22  Tim Horton  <timothy_horton@apple.com>
863
864         Fix the build after r243354
865         https://bugs.webkit.org/show_bug.cgi?id=196138
866         <rdar://problem/49145951>
867
868         * Platform/spi/ios/UIKitSPI.h:
869         * Shared/DocumentEditingContext.mm:
870         (WebKit::DocumentEditingContext::toPlatformContext):
871         * UIProcess/ios/WKContentViewInteraction.mm:
872
873 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
874
875         Clean up some TiledCoreAnimationDrawingArea members
876         https://bugs.webkit.org/show_bug.cgi?id=196124
877
878         Reviewed by Tim Horton.
879
880         The giant m_transform was unused.
881         
882         Group the bools etc.
883
884         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
885         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
886         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
887         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
888
889 2019-03-21  Brady Eidson  <beidson@apple.com>
890
891         Certain WebProcesses should opt-out of the freezer.
892         <rdar://problem/42846139> and https://bugs.webkit.org/show_bug.cgi?id=196062
893
894         Reviewed by Andy Estes.
895
896         WebProcesses should opt-in and opt-out of the freezer as is appropriate.
897         By default a WebProcess is freezer eligible.
898         If any of the following become true then it should become ineligible:
899         - The WebProcess is a pre-warmed process.
900         - The WebProcess is in the process cache.
901         - The WebProcess is not actively hosting any web pages (e.g. it only has suspending web pages)
902
903         The most complicated part of the above is guaranteeing that any operation that changes
904         the active pages hosted by the process causes a recalculation of the freezer opt-in state.
905
906         To do that this replaces the basic WebPageProxyMap with a custom class.
907
908         * UIProcess/WebProcessProxy.cpp:
909         (WebKit::globalPageMap):
910         (WebKit::WebProcessProxy::WebProcessProxy):
911         (WebKit::WebProcessProxy::validateFreezerStatus):
912         (WebKit::WebProcessProxy::setIsInProcessCache):
913         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
914         (WebKit::WebProcessProxy::didFinishLaunching):
915         * UIProcess/WebProcessProxy.h:
916         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap):
917         (WebKit::WebProcessProxy::WebPageProxyMap::size const):
918         (WebKit::WebProcessProxy::WebPageProxyMap::values):
919         (WebKit::WebProcessProxy::WebPageProxyMap::values const):
920         (WebKit::WebProcessProxy::WebPageProxyMap::begin):
921         (WebKit::WebProcessProxy::WebPageProxyMap::end):
922         (WebKit::WebProcessProxy::WebPageProxyMap::get):
923         (WebKit::WebProcessProxy::WebPageProxyMap::contains const):
924         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const):
925         (WebKit::WebProcessProxy::WebPageProxyMap::set):
926         (WebKit::WebProcessProxy::WebPageProxyMap::take):
927
928         * WebProcess/WebProcess.cpp:
929         (WebKit::WebProcess::setFreezable):
930         * WebProcess/WebProcess.h:
931         * WebProcess/WebProcess.messages.in:
932
933 2019-03-21  Tim Horton  <timothy_horton@apple.com>
934
935         Adopt UIWKDocumentContext
936         https://bugs.webkit.org/show_bug.cgi?id=196040
937         <rdar://problem/48642440>
938
939         Reviewed by Ryosuke Niwa.
940
941         * Platform/spi/ios/UIKitSPI.h:
942         * Scripts/webkit/messages.py:
943         * Shared/DocumentEditingContext.h: Added.
944         * Shared/DocumentEditingContext.mm: Added.
945         (WebKit::toNSRange):
946         (WebKit::DocumentEditingContext::toPlatformContext):
947         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::encode):
948         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::decode):
949         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::encode):
950         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::decode):
951         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::encode):
952         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::decode):
953         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::encode):
954         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
955         Add DocumentEditingContext(Request), and coders.
956         Also expose DocumentEditingContext::toPlatformContext, which populates
957         a UIWKDocumentContext with the relevant values.
958
959         * SourcesCocoa.txt:
960         * UIProcess/WebPageProxy.h:
961         * UIProcess/ios/WKContentViewInteraction.mm:
962         (toWebDocumentRequestOptions):
963         (toWebRequest):
964         (-[WKContentView adjustSelectionWithDelta:completionHandler:]):
965         (-[WKContentView requestDocumentContext:completionHandler:]):
966         (-[WKContentView selectPositionAtPoint:withContextRequest:completionHandler:]):
967         * UIProcess/ios/WebPageProxyIOS.mm:
968         (WebKit::WebPageProxy::adjustSelectionWithDelta):
969         (WebKit::WebPageProxy::requestDocumentEditingContext):
970         * WebKit.xcodeproj/project.pbxproj:
971         * WebProcess/WebPage/WebPage.h:
972         * WebProcess/WebPage/WebPage.messages.in:
973         Plumb DocumentEditingContext(Request) around.
974
975         * WebProcess/WebPage/ios/WebPageIOS.mm:
976         (WebKit::WebPage::adjustSelectionWithDelta):
977         Adjust the current selection given deltas to apply to the location and length.
978
979         (WebKit::visiblePositionAdjacentToVisiblePosition):
980         (WebKit::visiblePositionForPointInRootViewCoordinates):
981         (WebKit::WebPage::requestDocumentEditingContext):
982         Retrieve the relevant part of the selection, as well as the context,
983         given either the selection, or a rect.
984         If we're collecting context for a rect, we split the context between
985         before and after (except for the part that intersects the selection).
986         The three strings will always be directly adjacent, and any of the three
987         can sometimes be null.
988
989 2019-03-21  James Magahern  <jmagahern@apple.com>
990
991         Long press gesture recognizers in WKWebView are conflicting with internal scroll view long press gesture recognizers
992         https://bugs.webkit.org/show_bug.cgi?id=195726
993         rdar://problem/48582449
994
995         Reviewed by Megan Gardner.
996
997         We just need to add another clause to WKContentViewInteraction's
998         canPreventGestureRecognizer whitelist. 
999
1000         * UIProcess/ios/WKContentViewInteraction.mm:
1001         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
1002
1003 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
1004
1005         [iOS WK2] Turn on async overflow scrolling by default
1006         https://bugs.webkit.org/show_bug.cgi?id=196011
1007         rdar://problem/48453859
1008
1009         Reviewed by Antti Koivisto.
1010
1011         * Shared/WebPreferences.yaml:
1012         * Shared/WebPreferencesDefaultValues.h:
1013
1014 2019-03-21  Alex Christensen  <achristensen@webkit.org>
1015
1016         Remove last use of LegacySync IPC messages
1017         https://bugs.webkit.org/show_bug.cgi?id=196113
1018
1019         Reviewed by Chris Dumez.
1020
1021         Also rename "Delayed" to "Synchronous" now that there's only one type of synchronous message.
1022
1023         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1024         * NetworkProcess/NetworkProcess.messages.in:
1025         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1026         (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient):
1027         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1028         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
1029         * Platform/IPC/Connection.cpp:
1030         (IPC::Connection::dispatchMessage):
1031         * Platform/IPC/HandleMessage.h:
1032         (IPC::handleMessageSynchronous):
1033         (IPC::handleMessageSynchronousWantsConnection):
1034         (IPC::handleMessageLegacySync): Deleted.
1035         (IPC::handleMessageDelayed): Deleted.
1036         (IPC::handleMessageDelayedWantsConnection): Deleted.
1037         * PluginProcess/PluginControllerProxy.messages.in:
1038         * PluginProcess/WebProcessConnection.messages.in:
1039         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
1040         (WebKit::WebPage::didReceiveSyncWebPageMessage):
1041         * Scripts/webkit/MessageReceiver-expected.cpp:
1042         (WebKit::WebPage::didReceiveSyncMessage):
1043         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
1044         (Messages::WebPage::TestSyncMessage::send):
1045         (Messages::WebPage::TestSynchronousMessage::send):
1046         (WebKit::WebPage::didReceiveSyncMessage):
1047         (Messages::WebPage::TestDelayedMessage::send): Deleted.
1048         * Scripts/webkit/MessagesSuperclass-expected.h:
1049         (Messages::WebPage::TestSynchronousMessage::name):
1050         (Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
1051         (Messages::WebPage::TestDelayedMessage::receiverName): Deleted.
1052         (Messages::WebPage::TestDelayedMessage::name): Deleted.
1053         (Messages::WebPage::TestDelayedMessage::TestDelayedMessage): Deleted.
1054         (Messages::WebPage::TestDelayedMessage::arguments const): Deleted.
1055         * Scripts/webkit/messages.py:
1056         * Scripts/webkit/messages_unittest.py:
1057         * Scripts/webkit/test-legacy-messages.in:
1058         * Scripts/webkit/test-messages.in:
1059         * Scripts/webkit/test-superclass-messages.in:
1060         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1061         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
1062         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1063         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1064         * UIProcess/WebFullScreenManagerProxy.messages.in:
1065         * UIProcess/WebPageProxy.messages.in:
1066         * UIProcess/WebPasteboardProxy.messages.in:
1067         * UIProcess/WebProcessPool.messages.in:
1068         * UIProcess/WebProcessProxy.messages.in:
1069         * UIProcess/WebStorage/StorageManager.messages.in:
1070         * UIProcess/mac/SecItemShimProxy.messages.in:
1071         * WebProcess/Plugins/PluginProcessConnection.messages.in:
1072         * WebProcess/Plugins/PluginProxy.messages.in:
1073         * WebProcess/Storage/WebSWClientConnection.cpp:
1074         (WebKit::WebSWClientConnection::syncTerminateWorker):
1075         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1076         * WebProcess/WebPage/WebPage.messages.in:
1077         * WebProcess/WebProcess.messages.in:
1078
1079 2019-03-21  Brian Burg  <bburg@apple.com>
1080
1081         Web Automation: support uploading non-local file paths
1082         https://bugs.webkit.org/show_bug.cgi?id=196081
1083         <rdar://problem/45819897>
1084
1085         Reviewed by Devin Rousso and Joseph Pecoraro.
1086
1087         To support cases where supplied file paths do not exist on the session host, add support for
1088         receiving file contents via Automation.setFilesToSelectForFileUpload.
1089
1090         * UIProcess/Automation/Automation.json: Add new parameter.
1091
1092         * UIProcess/Automation/WebAutomationSession.h:
1093         * UIProcess/Automation/WebAutomationSession.cpp:
1094         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
1095         Add support for receiving and saving file contents to a temporary directory. Rewrite the used paths so
1096         that WebCore knows to look at the revised paths where the file contents have been saved.
1097
1098         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
1099         Since WebKit does not have usable FileSystem implementations for all ports, shell out the actual
1100         saving of base64-encoded file data. Provide a Cocoa implementation, since that's what I can test.
1101
1102         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
1103         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
1104         Use WTF::FileSystem to create a temporary directory, and use Cocoa methods to actually write the file.
1105
1106 2019-03-21  Youenn Fablet  <youenn@apple.com>
1107
1108         Cache API and IDB space usages should be initialized on first quota check
1109         https://bugs.webkit.org/show_bug.cgi?id=195707
1110
1111         Reviewed by Chris Dumez.
1112
1113         When the quota manager is created, make sure it delays quota check decisions until IDB and Cache API quota users are initialized.
1114         For IDB, the creation is synchronous but it may not be synchronous for Cache API.
1115         For that purpose, add a temporary quota user that will stay uninitialized until these two quota users are added.
1116         Once added, the temporary quota user is removed.
1117         The addition of the real users is made asynchronously as this is triggered by the creation of one of the two quota users.
1118
1119         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.
1120
1121         * NetworkProcess/NetworkProcess.cpp:
1122         (WebKit::QuotaUserInitializer::initialize):
1123         (WebKit::QuotaUserInitializer::~QuotaUserInitializer):
1124         (WebKit::QuotaUserInitializer::QuotaUserInitializer):
1125         (WebKit::NetworkProcess::storageQuotaManager):
1126         * NetworkProcess/cache/CacheStorageEngine.cpp:
1127         (WebKit::CacheStorage::Engine::initializeQuotaUser):
1128         * NetworkProcess/cache/CacheStorageEngine.h:
1129         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1130         (WebKit::CacheStorage::Caches::clear):
1131
1132 2019-03-21  Per Arne Vollan  <pvollan@apple.com>
1133
1134         [iOS][macOS] Fix sandbox call violations
1135         https://bugs.webkit.org/show_bug.cgi?id=195809
1136         <rdar://problem/48829655>
1137
1138         Reviewed by Brent Fulgham.
1139
1140         An additional syscall needs to be added to the sandbox allow list.
1141
1142         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1143         * WebProcess/com.apple.WebProcess.sb.in:
1144
1145 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
1146
1147         Add UI process WebRTC runtime logging.
1148         https://bugs.webkit.org/show_bug.cgi?id=196020
1149         <rdar://problem/49071443>
1150
1151         Reviewed by Youenn Fablet.
1152
1153         * Platform/Logging.cpp:
1154         (WebKit::getLogChannel): New.
1155         * Platform/Logging.h:
1156         * Shared/WebCoreArgumentCoders.h: Add coders for WTFLogChannelState and WTFLogLevel.
1157
1158         Add runtime logging.
1159         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1160         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
1161         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture):
1162         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
1163         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState):
1164         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
1165         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
1166         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1167         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
1168         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
1169         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1170         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
1171         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
1172         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
1173         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
1174         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1175         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
1176         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired):
1177         (WebKit::UserMediaPermissionRequestManagerProxy::logChannel const):
1178         (WebKit::convertEnumerationToString):
1179
1180         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1181         (WTF::LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction>::toString):
1182         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1183         (WebKit::convertEnumerationToString): Add an enum specialization for logging.
1184
1185         * UIProcess/UserMediaPermissionRequestProxy.h:
1186         (WTF::LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason>::toString): Ditto.
1187
1188         * UIProcess/WebPageProxy.cpp:
1189         (WebKit::WebPageProxy::logger):
1190         (WebKit::WebPageProxy::configureLoggingChannel):
1191         * UIProcess/WebPageProxy.h:
1192         * UIProcess/WebPageProxy.messages.in:
1193
1194         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1195         (WebKit::WebChromeClient::configureLoggingChannel):
1196         * WebProcess/WebCoreSupport/WebChromeClient.h:
1197         * WebProcess/WebPage/WebPage.cpp:
1198         (WebKit::WebPage::configureLoggingChannel):
1199         * WebProcess/WebPage/WebPage.h:
1200
1201 2019-03-21  Alex Christensen  <achristensen@webkit.org>
1202
1203         Stop using LegacySync messages in WebPageProxy
1204         https://bugs.webkit.org/show_bug.cgi?id=196056
1205
1206         Reviewed by Chris Dumez.
1207
1208         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1209         (WebKit::WebPageProxy::loadRecentSearches):
1210         * UIProcess/ProvisionalPageProxy.cpp:
1211         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
1212         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
1213         * UIProcess/ProvisionalPageProxy.h:
1214         * UIProcess/WebPageProxy.cpp:
1215         (WebKit::WebPageProxy::handleSynchronousMessage):
1216         (WebKit::WebPageProxy::hasInsecureContent):
1217         (WebKit::WebPageProxy::accessibilityScreenToRootView):
1218         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
1219         (WebKit::WebPageProxy::printFrame):
1220         (WebKit::WebPageProxy::backForwardGoToItem):
1221         (WebKit::WebPageProxy::backForwardGoToItemShared):
1222         (WebKit::WebPageProxy::backForwardItemAtIndex):
1223         (WebKit::WebPageProxy::backForwardBackListCount):
1224         (WebKit::WebPageProxy::backForwardForwardListCount):
1225         (WebKit::WebPageProxy::canUndoRedo):
1226         (WebKit::WebPageProxy::executeUndoRedo):
1227         (WebKit::WebPageProxy::checkTextOfParagraph):
1228         (WebKit::WebPageProxy::checkSpellingOfString):
1229         (WebKit::WebPageProxy::checkGrammarOfString):
1230         (WebKit::WebPageProxy::spellingUIIsShowing):
1231         (WebKit::WebPageProxy::getGuessesForWord):
1232         (WebKit::WebPageProxy::substitutionsPanelIsShowing):
1233         (WebKit::WebPageProxy::showCorrectionPanel):
1234         (WebKit::WebPageProxy::dismissCorrectionPanel):
1235         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
1236         (WebKit::WebPageProxy::recordAutocorrectionResponse):
1237         (WebKit::WebPageProxy::dictationAlternatives):
1238         (WebKit::WebPageProxy::wrapCryptoKey):
1239         (WebKit::WebPageProxy::unwrapCryptoKey):
1240         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
1241         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
1242         (WebKit::WebPageProxy::speechSynthesisVoiceList):
1243         (WebKit::WebPageProxy::printMainFrame): Deleted.
1244         * UIProcess/WebPageProxy.h:
1245         * UIProcess/WebPageProxy.messages.in:
1246         * UIProcess/gtk/WebPageProxyGtk.cpp:
1247         (WebKit::WebPageProxy::createPluginContainer):
1248         * UIProcess/ios/WebPageProxyIOS.mm:
1249         (WebKit::WebPageProxy::interpretKeyEvent):
1250         * UIProcess/mac/WebPageProxyMac.mm:
1251         (WebKit::WebPageProxy::getIsSpeaking):
1252         (WebKit::WebPageProxy::executeSavedCommandBySelector):
1253         (WebKit::WebPageProxy::showPDFContextMenu):
1254
1255 2019-03-21  Alex Christensen  <achristensen@webkit.org>
1256
1257         Stop using LegacySync messages in WebPage
1258         https://bugs.webkit.org/show_bug.cgi?id=196057
1259
1260         Reviewed by Chris Dumez.
1261
1262         * WebProcess/WebPage/WebPage.h:
1263         (WebKit::WebPage::markLayersVolatile):
1264         * WebProcess/WebPage/WebPage.messages.in:
1265         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1266         (WebKit::WebPage::getCenterForZoomGesture):
1267         * WebProcess/WebPage/ios/WebPageIOS.mm:
1268         (WebKit::WebPage::readSelectionFromPasteboard):
1269         (WebKit::WebPage::getStringSelectionForPasteboard):
1270         (WebKit::WebPage::getDataSelectionForPasteboard):
1271         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
1272         (WebKit::WebPage::acceptsFirstMouse):
1273         * WebProcess/WebPage/mac/WebPageMac.mm:
1274         (WebKit::WebPage::replaceSelectionWithPasteboardData):
1275         (WebKit::WebPage::readSelectionFromPasteboard):
1276         (WebKit::WebPage::getStringSelectionForPasteboard):
1277         (WebKit::WebPage::getDataSelectionForPasteboard):
1278         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
1279         (WebKit::WebPage::acceptsFirstMouse):
1280
1281 2019-03-21  Alex Christensen  <achristensen@webkit.org>
1282
1283         Stop using LegacySync messages in WebPasteboardProxy
1284         https://bugs.webkit.org/show_bug.cgi?id=196060
1285
1286         Reviewed by Chris Dumez.
1287
1288         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1289         (WebKit::WebPasteboardProxy::getPasteboardTypes):
1290         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
1291         (WebKit::WebPasteboardProxy::getPasteboardStringForType):
1292         (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
1293         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
1294         (WebKit::WebPasteboardProxy::pasteboardCopy):
1295         (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
1296         (WebKit::WebPasteboardProxy::getPasteboardUniqueName):
1297         (WebKit::WebPasteboardProxy::getPasteboardColor):
1298         (WebKit::WebPasteboardProxy::getPasteboardURL):
1299         (WebKit::WebPasteboardProxy::addPasteboardTypes):
1300         (WebKit::WebPasteboardProxy::setPasteboardTypes):
1301         (WebKit::WebPasteboardProxy::setPasteboardURL):
1302         (WebKit::WebPasteboardProxy::setPasteboardColor):
1303         (WebKit::WebPasteboardProxy::setPasteboardStringForType):
1304         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
1305         (WebKit::WebPasteboardProxy::getNumberOfFiles):
1306         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
1307         (WebKit::WebPasteboardProxy::writeCustomData):
1308         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
1309         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
1310         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
1311         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
1312         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
1313         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
1314         * UIProcess/WebPasteboardProxy.cpp:
1315         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
1316         (WebKit::WebPasteboardProxy::writeCustomData):
1317         * UIProcess/WebPasteboardProxy.h:
1318         * UIProcess/WebPasteboardProxy.messages.in:
1319         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
1320         (WebKit::WebPasteboardProxy::writeToClipboard):
1321         (WebKit::WebPasteboardProxy::readFromClipboard):
1322         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
1323         (WebKit::WebPasteboardProxy::getPasteboardTypes):
1324         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
1325         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
1326         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
1327
1328 2019-03-21  Andy Estes  <aestes@apple.com>
1329
1330         [iOS] Apple Pay should be available in documents with no user agent scripts
1331         https://bugs.webkit.org/show_bug.cgi?id=196061
1332         <rdar://problem/48649391>
1333
1334         Reviewed by Brady Eidson.
1335
1336         * Shared/AuxiliaryProcess.h:
1337         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
1338         (WebKit::AuxiliaryProcess::parentProcessHasEntitlement):
1339
1340         Added a convenience function for checking parent process entitlements.
1341
1342         * Shared/WebPreferences.yaml:
1343         * Shared/WebPreferencesDefaultValues.h:
1344         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1345         (-[WKWebViewConfiguration init]):
1346
1347         Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
1348
1349         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1350         (WebKit::WebPaymentCoordinator::supportsUnrestrictedApplePay const):
1351         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1352
1353         Implemented supportsUnrestrictedApplePay by checking for the
1354         com.apple.private.WebKit.UnrestrictedApplePay entitlement on platforms that enable
1355         APPLE_PAY_REMOTE_UI.
1356
1357         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
1358         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1359         (didClearWindowObjectForFrame):
1360         (setUpPageLoaderClient):
1361
1362         Added injected bundle SPI that TestWebKitAPI uses to inject the WebCore Internals interface.
1363
1364         * WebProcess/WebPage/WebPage.cpp:
1365         (WebKit::WebPage::runJavaScript):
1366
1367         Changed to call ScriptController::executeUserAgentScriptInWorld.
1368
1369 2019-03-21  Chris Dumez  <cdumez@apple.com>
1370
1371         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store
1372         https://bugs.webkit.org/show_bug.cgi?id=196041
1373         <rdar://problem/49083230>
1374
1375         Reviewed by Alex Christensen.
1376
1377         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store.
1378         We do not support having several WebsiteDataStores sharing the same WebProcess.
1379
1380         * UIProcess/API/Cocoa/WKWebView.mm:
1381         (-[WKWebView _initializeWithConfiguration:]):
1382         * UIProcess/WebProcessPool.cpp:
1383         (WebKit::WebProcessPool::createWebPage):
1384
1385 2019-03-21  Alex Christensen  <achristensen@webkit.org>
1386
1387         Add SPI to inform applications of WKContentRuleList actions
1388         https://bugs.webkit.org/show_bug.cgi?id=195965
1389         <rdar://problem/42664365>
1390
1391         Reviewed by Geoff Garen.
1392
1393         * NetworkProcess/NetworkLoadChecker.cpp:
1394         (WebKit::NetworkLoadChecker::checkRequest):
1395         (WebKit::NetworkLoadChecker::processContentRuleListsForLoad):
1396         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): Deleted.
1397         * NetworkProcess/NetworkLoadChecker.h:
1398         * UIProcess/API/APINavigationClient.h:
1399         (API::NavigationClient::contentRuleListNotification):
1400         * UIProcess/API/C/WKPage.cpp:
1401         (WKPageSetPageNavigationClient):
1402         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1403         * UIProcess/Cocoa/NavigationState.h:
1404         * UIProcess/Cocoa/NavigationState.mm:
1405         (WebKit::NavigationState::setNavigationDelegate):
1406         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
1407         * UIProcess/WebPageProxy.cpp:
1408         (WebKit::WebPageProxy::contentRuleListNotification):
1409         * UIProcess/WebPageProxy.h:
1410         * UIProcess/WebPageProxy.messages.in:
1411         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1412         (WebKit::WebChromeClient::contentRuleListNotification):
1413         * WebProcess/WebCoreSupport/WebChromeClient.h:
1414
1415 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
1416
1417         Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
1418         https://bugs.webkit.org/show_bug.cgi?id=196058
1419         rdar://problem/49078202
1420
1421         Reviewed by Antti Koivisto.
1422
1423         Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
1424         on by default.
1425
1426         * Shared/WebPreferences.yaml:
1427
1428 2019-03-21  Antti Koivisto  <antti@apple.com>
1429
1430         UI-process hit-testing needs to know about containing block relationships
1431         https://bugs.webkit.org/show_bug.cgi?id=195845
1432         <rdar://problem/48949633>
1433
1434         Reviewed by Simon Fraser.
1435
1436         Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
1437
1438         When an overflow scroller contains a positioned element the element may not be on a descendant layer of the scroller,
1439         yet should move along with it. This needs to be taken into account in UI-side hit testing.
1440
1441         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
1442         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const):
1443         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID):
1444         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs):
1445
1446         Maintain non-ancestor scrolling relationships for layers.
1447
1448         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1449         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
1450         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
1451         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1452         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
1453         (WebKit::isScrolledBy):
1454
1455         Helper to figure out who scrolls who.
1456
1457         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
1458         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1459         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
1460
1461         After commit, pull the non-ancestor scrolling relationships from the scrolling tree and update the layer tree.
1462
1463 2019-03-21  Daniel Bates  <dabates@apple.com>
1464
1465         [iOS] Inline -_ensureFormAccessoryView into -formAccessoryView and have -_updateAccessory ensure we have a form accessory
1466         https://bugs.webkit.org/show_bug.cgi?id=196021
1467
1468         Reviewed by Wenson Hsieh.
1469
1470         Every caller of -_ensureFormAccessoryView, except -formAccessoryView, immediately follows the call
1471         with a call to -_updateAccessory. Let's just have -_updateAccessory ensure we have a form accessory
1472         view and inline the implementation of -_ensureFormAccessoryView into -formAccessoryView so we can
1473         remove one method.
1474
1475         * UIProcess/ios/WKContentViewInteraction.mm:
1476         (-[WKContentView inputView]): Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
1477         the equivalent work for us.
1478         (-[WKContentView formAccessoryView]): Moved implementation of -_ensureFormAccessoryView into here.
1479         (-[WKContentView _updateAccessory]): Call self.formAccessoryView to ensure we have a form accessory view.
1480         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1481         Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
1482         the equivalent work for us.
1483         (-[WKContentView _ensureFormAccessoryView]): Deleted.
1484
1485 2019-03-21  Shawn Roberts  <sroberts@apple.com>
1486
1487         Unreviewed, rolling out r243250.
1488
1489         Causing 109 Failures and 2 crashes on iOS Sim Debug
1490         OpenSource/Internal queues
1491
1492         Reverted changeset:
1493
1494         "[iOS WK2] Turn on async overflow scrolling by default"
1495         https://bugs.webkit.org/show_bug.cgi?id=196011
1496         https://trac.webkit.org/changeset/243250
1497
1498 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
1499
1500         Fix possible memory leak when dismissing a color picker
1501         https://bugs.webkit.org/show_bug.cgi?id=196026
1502         <rdar://problem/48778568>
1503
1504         Reviewed by Wenson Hsieh.
1505
1506         Fix a problem with WebPageProxy::endColorPicker where an early return could leave a color picker
1507         with a +1 reference count after dismissing it.
1508
1509         * UIProcess/WebColorPicker.cpp:
1510         (WebKit::WebColorPicker::endPicker):
1511         * UIProcess/WebPageProxy.cpp:
1512         (WebKit::WebPageProxy::endColorPicker):
1513         (WebKit::WebPageProxy::didEndColorPicker):
1514
1515 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1516
1517         [GTK][WPE] Add API to provide geolocation information
1518         https://bugs.webkit.org/show_bug.cgi?id=195940
1519
1520         Reviewed by Michael Catanzaro.
1521
1522         Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
1523         been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.
1524
1525         * PlatformGTK.cmake:
1526         * PlatformWPE.cmake:
1527         * SourcesGTK.txt:
1528         * SourcesWPE.txt:
1529         * UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
1530         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
1531         (webkit_geolocation_position_new):
1532         (webkit_geolocation_position_copy):
1533         (webkit_geolocation_position_free):
1534         (webkit_geolocation_position_set_timestamp):
1535         (webkit_geolocation_position_set_altitude):
1536         (webkit_geolocation_position_set_altitude_accuracy):
1537         (webkit_geolocation_position_set_heading):
1538         (webkit_geolocation_position_set_speed):
1539         (webkitGeolocationManagerStop):
1540         (webkitGeolocationManagerSetEnableHighAccuracy):
1541         (webkitGeolocationManagerCreate):
1542         (webkitGeolocationManagerGetProperty):
1543         (webkit_geolocation_manager_class_init):
1544         (webkit_gelocation_manager_update_position):
1545         (webkit_gelocation_manager_failed):
1546         (webkit_geolocation_manager_get_enable_high_accuracy):
1547         * UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
1548         * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
1549         * UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
1550         * UIProcess/API/glib/WebKitWebContext.cpp:
1551         (webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
1552         (webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
1553         * UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
1554         * UIProcess/API/gtk/WebKitWebContext.h:
1555         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1556         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
1557         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1558         * UIProcess/API/gtk/webkit2.h:
1559         * UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
1560         * UIProcess/API/wpe/WebKitWebContext.h:
1561         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
1562         * UIProcess/API/wpe/docs/wpe-docs.sgml:
1563         * UIProcess/API/wpe/webkit.h:
1564
1565 2019-03-20  Youenn Fablet  <youenn@apple.com>
1566
1567         Compute quota after network process restart based on default quota and space used
1568         https://bugs.webkit.org/show_bug.cgi?id=195804
1569
1570         Reviewed by Chris Dumez.
1571
1572         Make sure that Cache Storage quota user waits to declare as initialized to its manager
1573         until all data is loaded so that it can report a valid space used from the start.
1574
1575         Add test API to reset the quota to its default value and compute it according current space use.
1576
1577         * NetworkProcess/NetworkProcess.cpp:
1578         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
1579         * NetworkProcess/NetworkProcess.h:
1580         * NetworkProcess/NetworkProcess.messages.in:
1581         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1582         (WebKit::CacheStorage::Caches::create):
1583         (WebKit::CacheStorage::Caches::Caches):
1584         (WebKit::CacheStorage::Caches::whenInitialized):
1585         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1586         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1587         (WebKit::CacheStorageEngineConnection::dereference):
1588         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1589         (WebKit::WebCacheStorageConnection::setQuotaBasedOnSpaceUsage):
1590         * WebProcess/Cache/WebCacheStorageConnection.h:
1591
1592 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
1593
1594         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
1595         https://bugs.webkit.org/show_bug.cgi?id=196049
1596
1597         Reviewed by Tim Horton.
1598
1599         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
1600         overflow scrolling in general, so rename it.
1601
1602         * Configurations/FeatureDefines.xcconfig:
1603
1604 2019-03-20  Jiewen Tan  <jiewen_tan@apple.com>
1605
1606         Extend Networking Process sandbox for some system frameworks
1607         https://bugs.webkit.org/show_bug.cgi?id=196036
1608         <rdar://problem/47594150>
1609
1610         Reviewed by Brent Fulgham.
1611
1612         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1613         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1614
1615 2019-03-20  Alex Christensen  <achristensen@webkit.org>
1616
1617         Reduce use of LegacySync IPC message type
1618         https://bugs.webkit.org/show_bug.cgi?id=194835
1619
1620         Reviewed by Darin Adler.
1621
1622         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1623         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1624         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1625         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
1626         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
1627         (WebKit::NetworkConnectionToWebProcess::blobSize):
1628         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
1629         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
1630         * NetworkProcess/NetworkConnectionToWebProcess.h:
1631         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest):
1632         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationResponse):
1633         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadIntermediateInformation):
1634         (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
1635         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1636         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1637         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1638         (WebKit::UserMediaCaptureManagerProxy::capabilities):
1639         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1640         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1641         * UIProcess/Plugins/PluginProcessProxy.h:
1642         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1643         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1644         (WebKit::PluginProcessProxy::launchProcess):
1645         (WebKit::PluginProcessProxy::launchApplicationAtURL):
1646         (WebKit::PluginProcessProxy::openURL):
1647         (WebKit::PluginProcessProxy::openFile):
1648         * UIProcess/WebFullScreenManagerProxy.cpp:
1649         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
1650         * UIProcess/WebFullScreenManagerProxy.h:
1651         * UIProcess/WebFullScreenManagerProxy.messages.in:
1652         * WebProcess/WebProcess.cpp:
1653         (WebKit::WebProcess::fetchWebsiteData):
1654         (WebKit::WebProcess::deleteWebsiteData):
1655         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
1656         (WebKit::WebProcess::processWillSuspendImminently):
1657         * WebProcess/WebProcess.h:
1658         * WebProcess/WebProcess.messages.in:
1659
1660 2019-03-20  Keith Rollin  <krollin@apple.com>
1661
1662         Update checks that determine if WebKit is system WebKit
1663         https://bugs.webkit.org/show_bug.cgi?id=195756
1664
1665         Unreviewed tweak of r243251 after unreviewed build fix after r243230.
1666
1667         * Shared/mac/AuxiliaryProcessMac.mm:
1668         (WebKit::AuxiliaryProcess::isSystemWebKit):
1669
1670 2019-03-20  Keith Rollin  <krollin@apple.com>
1671
1672         Update checks that determine if WebKit is system WebKit
1673         https://bugs.webkit.org/show_bug.cgi?id=195756
1674
1675         Unreviewed build fix after r243230.
1676
1677         * Shared/mac/AuxiliaryProcessMac.mm:
1678         (WebKit::AuxiliaryProcess::isSystemWebKit):
1679
1680 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
1681
1682         [iOS WK2] Turn on async overflow scrolling by default
1683         https://bugs.webkit.org/show_bug.cgi?id=196011
1684         rdar://problem/48453859
1685
1686         Reviewed by Antti Koivisto.
1687
1688         Turn async overflow scroll on by default for iOS WK2.
1689
1690         * Shared/WebPreferences.yaml:
1691         * Shared/WebPreferencesDefaultValues.h:
1692
1693 2019-03-20  Youenn Fablet  <youenn@apple.com>
1694
1695         Have smaller default quotas for third party frames
1696         https://bugs.webkit.org/show_bug.cgi?id=195841
1697
1698         Reviewed by Geoffrey Garen.
1699
1700         * NetworkProcess/NetworkProcess.cpp:
1701         (WebKit::NetworkProcess::storageQuotaManager):
1702         For third party iframes, use the default quota divided by 10.
1703
1704 2019-03-20  Dean Jackson  <dino@apple.com>
1705
1706         [iOS] Enable fast clicking everywhere
1707         https://bugs.webkit.org/show_bug.cgi?id=196023
1708         <rdar://problem/49073589>
1709
1710         Reviewed by Wenson Hsieh.
1711
1712         Set FastClicksEverywhere to on by default for iPhone & iPad.
1713
1714         * Shared/WebPreferences.yaml:
1715         * Shared/WebPreferencesDefaultValues.h:
1716
1717 2019-03-20  Chris Dumez  <cdumez@apple.com>
1718
1719         Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS
1720         https://bugs.webkit.org/show_bug.cgi?id=196029
1721         <rdar://problem/48954651>
1722
1723         Reviewed by Tim Horton.
1724
1725         If there is a ViewGestureController when process swapping, make sure we disconnect it
1726         from the old process and reconnect it to the new one. This matches what is done in
1727         WebViewImpl for macOS (see r238356).
1728
1729         * UIProcess/API/Cocoa/WKWebView.mm:
1730         (-[WKWebView _processWillSwap]):
1731         (-[WKWebView _processDidExit]):
1732         (-[WKWebView _didRelaunchProcess]):
1733
1734 2019-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1735
1736         [GTK] REGRESSION(r243094): crash when launching minibrowser
1737         https://bugs.webkit.org/show_bug.cgi?id=195951
1738
1739         Reviewed by Joseph Pecoraro.
1740
1741         Always return the inspector from WebPageProxy::inspector() when the page hasn't been closed. The inspector is
1742         created in WebPageProxy constructor and it's safe to use even before a process has been launched, because
1743         m_inspectedPage is null-checked everywhere.
1744
1745         * UIProcess/WebPageProxy.cpp:
1746         (WebKit::WebPageProxy::inspector const):
1747
1748 2019-03-20  Keith Rollin  <krollin@apple.com>
1749
1750         Update checks that determine if WebKit is system WebKit
1751         https://bugs.webkit.org/show_bug.cgi?id=195756
1752
1753         Reviewed by Alexey Proskuryakov.
1754
1755         The system WebKit can be installed in additional locations, so check
1756         for and allow those, too.
1757
1758         * Shared/mac/AuxiliaryProcessMac.mm:
1759         (WebKit::AuxiliaryProcess::isSystemWebKit):
1760
1761 2019-03-20  Per Arne Vollan  <pvollan@apple.com>
1762
1763         [iOS] Unable to PiP web videos in Safari due to sandbox violation
1764         https://bugs.webkit.org/show_bug.cgi?id=196015
1765         <rdar://problem/48867037>
1766
1767         Reviewed by Brent Fulgham.
1768
1769         The sandbox should allow getting the iokit property 'ui-pip'.
1770
1771         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1772
1773 2019-03-20  John Wilander  <wilander@apple.com>
1774
1775         (Test fix) Override minimumTimeBetweenDataRecordsRemoval in ResourceLoadStatisticsStore::shouldRemoveDataRecord() during layout tests
1776         https://bugs.webkit.org/show_bug.cgi?id=196017
1777
1778         Unreviewed test fix.
1779
1780         This patch adds a check of parameters().isRunningTest to the return of
1781         ResourceLoadStatisticsStore::shouldRemoveDataRecord() to allow successive
1782         layout tests to remove website data, effectively overriding the
1783         minimumTimeBetweenDataRecordsRemoval setting.
1784
1785         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
1786         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
1787
1788 2019-03-20  Daniel Bates  <dabates@apple.com>
1789
1790         [iOS] Group UIWebFormAccessoryDelegate-related code and tighten it up a bit
1791         https://bugs.webkit.org/show_bug.cgi?id=196018
1792
1793         Reviewed by Wenson Hsieh.
1794
1795         * UIProcess/ios/WKContentViewInteraction.mm:
1796         (-[WKContentView accessoryClear]): Use uniform initializer syntax. Code could send the empty
1797         string, but I resisted since null string, as we do now, likely encodes more compactly and we
1798         avoid a per-process alloc.
1799         (-[WKContentView accessoryTab:]): Fix style nit; missing space between capture list and arguments
1800         in lambda. Also use lamdba capture initializer syntax and remove a local.
1801         (-[WKContentView _updateAccessory]): Remove a FIXME as it can't be satified with the current
1802         design without more bookkeeping. The design for showing and hiding an AutoFill button added in
1803         r166933 requires knowing the title for the button when showing it via -setAccessoryViewCustomButtonTitle.
1804         We could re-implement such that -setAccessoryViewCustomButtonTitle: stores the title and calls
1805         -_updateAccessory, but that has the disadvantage of increasing the memory footprint of WKContentView
1806         for the stored title and that seems worse than centralizing the logic in _updateAccessory. So,
1807         let's not fix this FIXME. Now that we are removing the FIXME, change to use an early return style.
1808         (-[WKContentView _hideKeyboard]): Micro optimization; only call _updateAccessory if we have
1809         a form accessory view. This method is called everytime we load a page (more precisely when we
1810         commit the load for a page) in addition to everytime we blur (defocus) an element. No need to
1811         update an accessory if we don't have one.
1812  
1813 2019-03-20  Olivier Robin  <olivierrobin@chromium.org>
1814
1815         Fix _getContentsAsAttributedStringWithCompletionHandler availability for iOS.
1816         https://bugs.webkit.org/show_bug.cgi?id=195999
1817
1818         Reviewed by Tim Horton.
1819
1820         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1821
1822 2019-03-20  Brent Fulgham  <bfulgham@apple.com>
1823
1824         Adopt RegistrableDomain in the Storage Access API prompt code paths
1825         https://bugs.webkit.org/show_bug.cgi?id=195957
1826         <rdar://problem/49048028>
1827
1828         Reviewed by Chris Dumez.
1829
1830         While making the code changes in Bug 195866 we noticed that strings were being
1831         used to pass the origins for the API calls. We should adopt the RegistrableDomain
1832         class to improve type safety and avoid introducing bugs in the future.
1833
1834         * UIProcess/API/APIUIClient.h:
1835         (API::UIClient::requestStorageAccessConfirm):
1836         * UIProcess/API/C/WKPage.cpp:
1837         (WKPageSetPageUIClient):
1838         * UIProcess/Cocoa/UIDelegate.h:
1839         * UIProcess/Cocoa/UIDelegate.mm:
1840         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
1841         * UIProcess/Cocoa/WKStorageAccessAlert.h:
1842         * UIProcess/Cocoa/WKStorageAccessAlert.mm:
1843         (WebKit::presentStorageAccessAlert):
1844         * UIProcess/WebPageProxy.cpp:
1845         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1846
1847 2019-03-20  Chris Dumez  <cdumez@apple.com>
1848
1849         Unreviewed, fix typo in comment added in r243156.
1850
1851         * UIProcess/WebPageProxy.cpp:
1852         (WebKit::WebPageProxy::postMessageToInjectedBundle):
1853
1854 2019-03-20  Chris Dumez  <cdumez@apple.com>
1855
1856         Unreviewed, drop invalid assertions landed in r243163.
1857
1858         Those assertions were causing some API tests to crash.
1859         Also include some post-review suggestions from Darin.
1860
1861         * Shared/CallbackID.h:
1862         (WebKit::CallbackID::operator=):
1863         * Shared/OptionalCallbackID.h:
1864         (WebKit::OptionalCallbackID::operator=):
1865
1866 2019-03-20  Chris Dumez  <cdumez@apple.com>
1867
1868         Unreviewed, fix assertion failures in API tests after r243159.
1869
1870         * UIProcess/VisitedLinkStore.cpp:
1871         (WebKit::VisitedLinkStore::removeProcess):
1872
1873 2019-03-20  Tim Horton  <timothy_horton@apple.com>
1874
1875         Add an platform-driven spell-checking mechanism
1876         https://bugs.webkit.org/show_bug.cgi?id=195795
1877
1878         Reviewed by Ryosuke Niwa.
1879
1880         * DerivedSources-input.xcfilelist:
1881         * DerivedSources-output.xcfilelist:
1882         * DerivedSources.make:
1883         * SourcesCocoa.txt:
1884         * UIProcess/Cocoa/TextCheckingController.h: Added.
1885         * UIProcess/Cocoa/TextCheckingController.mm: Added.
1886         (WebKit::TextCheckingController::TextCheckingController):
1887         (WebKit::TextCheckingController::replaceRelativeToSelection):
1888         (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
1889         * UIProcess/ios/WKContentViewInteraction.h:
1890         * UIProcess/ios/WKContentViewInteraction.mm:
1891         (-[WKContentView setupInteraction]):
1892         (-[WKContentView replaceSelectionOffset:length:withAnnotatedString:relativeReplacementRange:]):
1893         (-[WKContentView removeAnnotation:forSelectionOffset:length:]):
1894         * WebKit.xcodeproj/project.pbxproj:
1895         * WebProcess/WebPage/WebPage.cpp:
1896         * WebProcess/WebPage/WebPage.h:
1897         (WebKit::WebPage::textCheckingController):
1898         Plumb two UITextInput methods through to the Web Content process.
1899         I added a new object instead of just sticking things on WebPage
1900         because there are quite a few more related ones coming down the pipeline,
1901         and will also end up being messages going in the opposite direction.
1902
1903         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: Added.
1904         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in: Added.
1905         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm: Added.
1906         (WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
1907         (WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
1908         (WebKit::relevantMarkerTypes):
1909         (WebKit::TextCheckingControllerProxy::rangeAndOffsetRelativeToSelection):
1910         (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
1911         (WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection):
1912         Make it possible for the platform to maintain arbitrary key-value pairs
1913         attached to document ranges, as a way for it to keep track of various
1914         text checking context (e.g. if something has been checked, replaced,
1915         what language it might be, ...).
1916
1917         Allow it to replace the text of a range and the annotations in that range,
1918         or remove annotations in a range. Ranges are specified relative to
1919         the selection.
1920
1921         One large missing piece is giving the platform the ability to retrieve
1922         annotations in a range; that is coming in a future patch.
1923
1924         We translate certain annotations into traditional WebCore spelling
1925         and grammar document markers, for normal display-time treatment.
1926
1927         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1928         (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
1929         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
1930         Unified sources fixes.
1931
1932 2019-03-19  Jiewen Tan  <jiewen_tan@apple.com>
1933
1934         [WebAuthN] Implement FIDO AppID extension
1935         https://bugs.webkit.org/show_bug.cgi?id=143491
1936         <rdar://problem/48298273>
1937
1938         Reviewed by Brent Fulgham.
1939
1940         In U2fHidAuthenticator::continueSignCommandAfterResponseReceived, it will retry the current command
1941         with the AppID if it exists when SW_WRONG_DATA is received from devices. Noted, it will not set
1942         the AuthenticationExtensionsClientOutputs::appid to false in any circumstances. In other words, the
1943         field will be empty if AppID is supplied in AuthenticationExtensionsClientInputs and not used.
1944
1945         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1946         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
1947         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
1948         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
1949         (WebKit::U2fHidAuthenticator::issueSignCommand):
1950         (WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
1951         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h:
1952
1953 2019-03-19  Ross Kirsling  <ross.kirsling@sony.com>
1954
1955         Unreviewed adjustment to r242842 per Darin's request.
1956
1957         * Platform/win/LoggingWin.cpp:
1958         (WebKit::logLevelString):
1959
1960 2019-03-19  Gyuyoung Kim  <gyuyoung.kim@lge.com>
1961
1962         [WPE] Fix build warnings because of missing an argument when initializing wpe_input_axis_event
1963         https://bugs.webkit.org/show_bug.cgi?id=195931
1964
1965         Reviewed by Michael Catanzaro.
1966
1967         There are still build warnings when building wpe port. It looks like
1968         these build warnings have been caused by missing to set an argument
1969         for the modifier parameter of wpe_input_axis_event. This patch sets 0
1970         for the modifier argument to avoid the build warnings.
1971
1972         * UIProcess/API/wpe/ScrollGestureController.cpp:
1973         (WebKit::ScrollGestureController::handleEvent):
1974
1975 2019-03-19  John Wilander  <wilander@apple.com>
1976
1977         Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
1978         https://bugs.webkit.org/show_bug.cgi?id=195923
1979         <rdar://problem/49001272>
1980
1981         Reviewed by Alex Christensen.
1982
1983         Cross-site trackers abuse link query parameters to transport user identifiers and then store
1984         them in first-party storage space. To address this, we've done three things:
1985         - r236448 capped all persistent client-side cookies to seven days of storage.
1986         - r242288 further capped persistent client-side cookies for navigations with link decoration from prevalent resources.
1987         - r242603 added logging of navigations with link decoration from prevalent resources.
1988
1989         This patch introduces an experimental feature that removes non-cookie website data for sites
1990         that have been navigated to, with link decoration, by a prevalent resource.
1991
1992         To achieve this, resource domains to remove website data for are now marked with an enum called
1993         WebsiteDataToRemove with values All, AllButHttpOnlyCookies, AllButCookies. As resources are
1994         iterated, they are marked for either of these values and the new function
1995         ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor() leads to the marking with
1996         WebsiteDataToRemove::AllButCookies.
1997
1998         Then NetworkProcess::deleteWebsiteDataForRegistrableDomains() looks at this setting and removes
1999         website data accordingly.
2000
2001         The thinking behind this is that the lifetime cap applied in r236448 and r242288 take care of
2002         script writable cookies, and this patch takes care of all other script writable storage.
2003
2004         The infrastructure to handle user interaction expiration is now parameterized so that multiple
2005         expiries can be applied. In this particular case, seven days of browser use.
2006
2007         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2008         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
2009         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
2010         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
2011         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const):
2012         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const):
2013         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
2014         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2015         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2016         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
2017         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
2018         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllWebsiteDataFor const):
2019         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
2020         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
2021         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2022         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
2023         (WebKit::domainsToString):
2024         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
2025         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
2026         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
2027         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
2028         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
2029         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2030         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2031         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2032         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
2033         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
2034            Renamed to reflect that it actually takes a parameter for which types of data to remove.
2035         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2036         * NetworkProcess/NetworkProcess.cpp:
2037         (WebKit::NetworkProcess::initializeNetworkProcess):
2038         (WebKit::NetworkProcess::setCrossSiteLoadWithLinkDecorationForTesting):
2039         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2040         (WebKit::NetworkProcess::deleteCookiesForTesting):
2041         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
2042            Renamed to reflect that it actually takes a parameter for which types of data to remove.
2043         * NetworkProcess/NetworkProcess.h:
2044         * NetworkProcess/NetworkProcess.messages.in:
2045         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2046         (WebKit::NetworkProcessCreationParameters::encode const):
2047         (WebKit::NetworkProcessCreationParameters::decode):
2048         * NetworkProcess/NetworkProcessCreationParameters.h:
2049         * NetworkProcess/NetworkSession.cpp:
2050         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
2051         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
2052            Renamed to reflect that it actually takes a parameter for which types of data to remove.
2053         * NetworkProcess/NetworkSession.h:
2054         * Shared/WebPreferences.yaml:
2055         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2056         (WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
2057         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
2058         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
2059         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2060         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2061         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2062         * UIProcess/Network/NetworkProcessProxy.cpp:
2063         (WebKit::NetworkProcessProxy::setCrossSiteLoadWithLinkDecorationForTesting):
2064         * UIProcess/Network/NetworkProcessProxy.h:
2065         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2066         (WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
2067         * UIProcess/WebsiteData/WebsiteDataStore.h:
2068
2069 2019-03-19  Chris Dumez  <cdumez@apple.com>
2070
2071         Unreviewed build fix after r243173.
2072
2073         * UIProcess/Cocoa/UIDelegate.mm:
2074         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
2075
2076 2019-03-19  Brent Fulgham  <bfulgham@apple.com>
2077
2078         Add default prompt implementation for the Storage Access API
2079         https://bugs.webkit.org/show_bug.cgi?id=195866
2080         <rdar://problem/45150009>
2081
2082         Reviewed by Chris Dumez.
2083
2084         This patch revises the UIDelegate implementation with a default permission dialog
2085         for the Storage Access API. This allows us to use and test the API in MiniBrowser,
2086         rather than requiring a full-fledged web browser to drive testing.
2087  
2088         * UIProcess/Cocoa/UIDelegate.h:
2089         * UIProcess/Cocoa/UIDelegate.mm:
2090         (WebKit::UIDelegate::UIClient::presentStorageAccessConfirmDialog): Added.
2091         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm): Modify to call new default
2092         implementation if the WKWebVIew client doesn't implement the necessary SPI.
2093         * UIProcess/Cocoa/WKStorageAccessAlert.h: Added.
2094         * UIProcess/Cocoa/WKStorageAccessAlert.mm: Added.
2095         (WebKit::presentStorageAccessAlert):
2096         * WebKit.xcodeproj/project.pbxproj:
2097
2098 2019-03-19  Conrad Shultz  <conrad_shultz@apple.com>
2099
2100         REGRESSION (r242369): Only use picker-supported UTIs when creating image picker
2101         https://bugs.webkit.org/show_bug.cgi?id=195955
2102
2103         Reviewed by Chris Dumez and Wenson Hsieh.
2104
2105         r242369 started passing UTIs to -[UIImagePickerController setMediaTypes:] that correspond to types accepted by the
2106         file input element. However, UIImagePickerController expects a specific subset of UTIs. In the worst case, if no
2107         expected types are passed, this can cause a crash.
2108
2109         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2110         (UTIsForMIMETypes):
2111         Return a set rather than an array.
2112         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
2113         Rather than hardcode specific UTIs, ask UIImagePickerController for its available types. If an accepted type
2114         is in the list of available types, use it. Otherwise, if an accepted type conforms to an available type,
2115         use the available type. This is an O(n^2) process, but there typically are only a handful of types, so
2116         this seems acceptable.
2117         (-[WKFileUploadPanel _showDocumentPickerMenu]):
2118         Convert the set from UTIsForMIMETypes() to an array.
2119
2120 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2121
2122         Build cleanly with GCC 9
2123         https://bugs.webkit.org/show_bug.cgi?id=195920
2124
2125         Reviewed by Chris Dumez.
2126
2127         WebKit triggers three new GCC 9 warnings:
2128
2129         """
2130         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
2131         declared copy constructor and assignment operator if one of them is user-provided.
2132         """
2133
2134         Solution is to either add a copy constructor or copy assignment operator, if required, or
2135         else remove one if it is redundant.
2136
2137         """
2138         -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
2139         -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
2140         """
2141
2142         These account for most of this patch. Solution is to just remove the bad WTFMove().
2143
2144         Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
2145         These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
2146         would be safer to not use memcpy on nontrivial types, but that's too complex for this
2147         patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
2148
2149         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2150         (WebKit::CacheStorage::Cache::decode):
2151         * Platform/IPC/ArgumentCoders.h:
2152         * Shared/CallbackID.h:
2153         (WebKit::CallbackID::operator=):
2154         * Shared/OptionalCallbackID.h:
2155         (WebKit::OptionalCallbackID::operator=):
2156         * Shared/Plugins/NPIdentifierData.cpp:
2157         (WebKit::NPIdentifierData::decode):
2158         * Shared/Plugins/NPVariantData.cpp:
2159         (WebKit::NPVariantData::decode):
2160         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2161         (WebKit::NetscapePluginModule::getOrCreate):
2162         * Shared/RTCNetwork.cpp:
2163         (WebKit::RTCNetwork::IPAddress::decode):
2164         * Shared/SessionState.cpp:
2165         (WebKit::HTTPBody::Element::decode):
2166         (WebKit::FrameState::decode):
2167         (WebKit::BackForwardListItemState::decode):
2168         * Shared/WebCompiledContentRuleListData.cpp:
2169         (WebKit::WebCompiledContentRuleListData::decode):
2170         * Shared/WebCoreArgumentCoders.cpp:
2171         (IPC::ArgumentCoder<FloatPoint>::decode):
2172         (IPC::ArgumentCoder<FloatRect>::decode):
2173         (IPC::ArgumentCoder<FloatQuad>::decode):
2174         (IPC::ArgumentCoder<ViewportArguments>::decode):
2175         (IPC::ArgumentCoder<IntPoint>::decode):
2176         (IPC::ArgumentCoder<IntRect>::decode):
2177         (IPC::ArgumentCoder<IntSize>::decode):
2178         (IPC::ArgumentCoder<MimeClassInfo>::decode):
2179         (IPC::ArgumentCoder<PluginInfo>::decode):
2180         (IPC::ArgumentCoder<SelectionRect>::decode):
2181         (IPC::ArgumentCoder<CompositionUnderline>::decode):
2182         (IPC::ArgumentCoder<BlobPart>::decode):
2183         (IPC::ArgumentCoder<TextIndicatorData>::decode):
2184         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2185         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
2186         * Shared/WebPageCreationParameters.cpp:
2187         (WebKit::WebPageCreationParameters::decode):
2188         * Shared/WebPlatformTouchPoint.cpp:
2189         (WebKit::WebPlatformTouchPoint::decode):
2190         * Shared/WebsiteData/WebsiteData.cpp:
2191         (WebKit::WebsiteData::Entry::decode):
2192         * Shared/WebsiteDataStoreParameters.cpp:
2193         (WebKit::WebsiteDataStoreParameters::decode):
2194         * UIProcess/API/APIContentRuleListStore.cpp:
2195         (API::decodeContentRuleListMetaData):
2196         * UIProcess/WebPageProxy.cpp:
2197         (WebKit::WebPageProxy::launchProcessForReload):
2198         (WebKit::WebPageProxy::launchProcessWithItem):
2199         (WebKit::WebPageProxy::loadRequest):
2200         (WebKit::WebPageProxy::loadFile):
2201         (WebKit::WebPageProxy::loadData):
2202         (WebKit::WebPageProxy::reload):
2203         * UIProcess/WebProcessCache.cpp:
2204         (WebKit::WebProcessCache::takeProcess):
2205         * UIProcess/WebProcessPool.cpp:
2206         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
2207         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
2208         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
2209         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2210         (WebKit::InjectedBundleRangeHandle::getOrCreate):
2211         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2212         (WebKit::InjectedBundle::create):
2213         * WebProcess/Network/WebLoaderStrategy.cpp:
2214         (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
2215         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2216         (WebKit::CompositingCoordinator::createGraphicsLayer):
2217         * WebProcess/WebPage/WebPage.cpp:
2218         (WebKit::WebPage::pdfSnapshotAtSize):
2219         (WebKit::WebPage::createDocumentLoader):
2220         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2221         (WebKit::StorageNamespaceImpl::copy):
2222
2223 2019-03-19  Chris Dumez  <cdumez@apple.com>
2224
2225         Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
2226         https://bugs.webkit.org/show_bug.cgi?id=194787
2227         <rdar://problem/48175520>
2228
2229         Reviewed by Geoff Garen.
2230
2231         The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
2232         when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
2233         given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
2234         side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.
2235
2236         In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
2237         WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
2238         as soon as the WebPage object has been created on the WebProcess side. This part was fine.
2239         However, unregistration from the visitedLinkStores would only happen when either the
2240         visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
2241         WebProcess could stay registered with a visitedLinkStore even after the page that was using it
2242         has been closed, which would lead to such logging.
2243
2244         To address the issue, the WebProcessProxy now keeps track for which pages are using which
2245         visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
2246         WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
2247         using a given visitedLinkStore is closed, the process unregisters itself from the
2248         visitedLinkStore, thus avoiding the bug.
2249
2250         I also simplified a lot the logic for having a page telling the WebProcessProxy it started
2251         using a visitedLinkStore. Previously, it would have to wait until the process is done launching
2252         before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
2253         that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
2254         WebProcess (no matter if the process is still launching or not). At this point, the
2255         WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
2256         until it is done launching before registering itself with the visitedLinkStore.
2257
2258         * UIProcess/ProvisionalPageProxy.cpp:
2259         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
2260         (WebKit::ProvisionalPageProxy::initializeWebPage):
2261         (WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
2262         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
2263         * UIProcess/ProvisionalPageProxy.h:
2264         * UIProcess/VisitedLinkStore.cpp:
2265         (WebKit::VisitedLinkStore::~VisitedLinkStore):
2266         (WebKit::VisitedLinkStore::addProcess):
2267         * UIProcess/WebPageProxy.cpp:
2268         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2269         (WebKit::WebPageProxy::initializeWebPage):
2270         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2271         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
2272         (WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
2273         * UIProcess/WebPageProxy.h:
2274         * UIProcess/WebProcessProxy.cpp:
2275         (WebKit::WebProcessProxy::shutDown):
2276         (WebKit::WebProcessProxy::removeWebPage):
2277         (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
2278         (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
2279         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
2280         (WebKit::WebProcessProxy::didFinishLaunching):
2281         (WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
2282         (WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
2283         * UIProcess/WebProcessProxy.h:
2284
2285 2019-03-19  Chris Dumez  <cdumez@apple.com>
2286
2287         REGRESSION (r243094): internal media test fairplay-hls-error.html is failing
2288         https://bugs.webkit.org/show_bug.cgi?id=195954
2289         <rdar://problem/49005981>
2290
2291         Reviewed by Geoffrey Garen.
2292
2293         TestController::resetStateToConsistentValues() tries to send a "reset" message to its
2294         injected bundle. Part of the "reset" message sets the external hosts that we're allowed
2295         to load. If there is no WebProcess yet when WKPagePostMessageToInjectedBundle() is called,
2296         then this message does not get sent and the allowed hosts do not get set, causing this
2297         test failure.
2298
2299         To address the issue, make sure we launch the initial process if necessary when
2300         WebPageProxy::postMessageToInjectedBundle() is called, in order to maintain backward
2301         compatibility.
2302
2303         * UIProcess/WebPageProxy.cpp:
2304         (WebKit::WebPageProxy::postMessageToInjectedBundle):
2305
2306 2019-03-19  Chris Dumez  <cdumez@apple.com>
2307
2308         Unreviewed, rolling out r243142.
2309
2310         Caused assertion hits in WK2 Debug
2311
2312         Reverted changeset:
2313
2314         "Spew: Unhandled web process message
2315         'VisitedLinkTableController:VisitedLinkStateChanged'"
2316         https://bugs.webkit.org/show_bug.cgi?id=194787
2317         https://trac.webkit.org/changeset/243142
2318
2319 2019-03-19  Daniel Bates  <dabates@apple.com>
2320
2321         [iOS] Focus not preserved when switching between tabs
2322         https://bugs.webkit.org/show_bug.cgi?id=195820
2323         <rdar://problem/43614450>
2324
2325         Reviewed by Brent Fulgham.
2326
2327         Fixes a usability annoyance when using a hardware keyboard; focus is not preserved when switching between tabs.
2328         Do not unconditionally tell the WebProcess to blur the currently focused element when the content view (WKContentView)
2329         resigns first responder. Instead only tell it to blur when the content view is resigning because either the
2330         accessory view was dismissed (Done button was pressed) or the keyboard was dismissed (the hide keyboard button
2331         was pressed).
2332
2333         * UIProcess/ios/WKContentViewInteraction.h:
2334         * UIProcess/ios/WKContentViewInteraction.mm: Add new ivar to track whether the content view is resigning
2335         first responder status because the accessory view is being dismissed.
2336         (-[WKContentView resignFirstResponderForWebView]): Only tell WebKit to blur the focused element if we are
2337         resigning because the accessory view is being dismissed or the keyboard was hidden. We continue to do all
2338         other steps when resigning, including hiding the keyboard. Note that by not telling WebKit to blur the
2339         focused element we let it's focus controller manage the focused element with respect to the current
2340         page activation state (i.e. whether the content view is first responder or not). When the content view
2341         becomes the first responder then WebKit's focus controller will be told that the page has become activated
2342         and will tell the UIProcess to focus the currently focused element, which will bring up the keyboard.
2343         (-[WKContentView accessoryDone]): Update state so we know that a subsequent call to resign first responder
2344         was due to the accessory view being dismissed.
2345
2346 2019-03-19  Per Arne Vollan  <pvollan@apple.com>
2347
2348         [iOS] Remove overridden rules in sandbox
2349         https://bugs.webkit.org/show_bug.cgi?id=193840
2350         <rdar://problem/47558526>
2351
2352         Reviewed by Brent Fulgham.
2353
2354         On iOS, there are some rules overridden in the same sandbox file. The overridden rules
2355         should be removed.
2356
2357         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2358
2359 2019-03-19  Timothy Hatcher  <timothy@apple.com>
2360
2361         Make WebKit/NSAttributedString.h a public header.
2362         https://bugs.webkit.org/show_bug.cgi?id=195944
2363
2364         Reviewed by Dean Jackson.
2365
2366         * WebKit.xcodeproj/project.pbxproj:
2367
2368 2019-03-19  Chris Dumez  <cdumez@apple.com>
2369
2370         Drop NetworkCacheStatistics code
2371         https://bugs.webkit.org/show_bug.cgi?id=195910
2372
2373         Reviewed by Antti Koivisto.
2374
2375         Drop NetworkCacheStatistics code. It was a temporary experiment and has not been used in a long time.
2376
2377         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2378         (WebKit::NetworkProcessCreationParameters::encode const):
2379         (WebKit::NetworkProcessCreationParameters::decode):
2380         * NetworkProcess/NetworkProcessCreationParameters.h:
2381         * NetworkProcess/cache/NetworkCache.cpp:
2382         (WebKit::NetworkCache::Cache::Cache):
2383         (WebKit::NetworkCache::Cache::retrieve):
2384         (WebKit::NetworkCache::Cache::store):
2385         (WebKit::NetworkCache::Cache::storeRedirect):
2386         (WebKit::NetworkCache::Cache::update):
2387         (WebKit::NetworkCache::Cache::clear):
2388         * NetworkProcess/cache/NetworkCache.h:
2389         * NetworkProcess/cache/NetworkCacheStatistics.cpp: Removed.
2390         * NetworkProcess/cache/NetworkCacheStatistics.h: Removed.
2391         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2392         (WebKit::NetworkCache::traverseRecordsFiles):
2393         * NetworkProcess/cache/NetworkCacheStorage.h:
2394         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2395         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2396         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2397         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2398         * Sources.txt:
2399         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2400         (WebKit::registerUserDefaultsIfNeeded):
2401         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2402         * UIProcess/soup/WebProcessPoolSoup.cpp:
2403         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2404         * WebKit.xcodeproj/project.pbxproj:
2405
2406 2019-03-19  Chris Dumez  <cdumez@apple.com>
2407
2408         Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
2409         https://bugs.webkit.org/show_bug.cgi?id=194787
2410         <rdar://problem/48175520>
2411
2412         Reviewed by Geoffrey Garen.
2413
2414         The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
2415         when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
2416         given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
2417         side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.
2418
2419         In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
2420         WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
2421         as soon as the WebPage object has been created on the WebProcess side. This part was fine.
2422         However, unregistration from the visitedLinkStores would only happen when either the
2423         visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
2424         WebProcess could stay registered with a visitedLinkStore even after the page that was using it
2425         has been closed, which would lead to such logging.
2426
2427         To address the issue, the WebProcessProxy now keeps track for which pages are using which
2428         visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
2429         WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
2430         using a given visitedLinkStore is closed, the process unregisters itself from the
2431         visitedLinkStore, thus avoiding the bug.
2432
2433         I also simplified a lot the logic for having a page telling the WebProcessProxy it started
2434         using a visitedLinkStore. Previously, it would have to wait until the process is done launching
2435         before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
2436         that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
2437         WebProcess (no matter if the process is still launching or not). At this point, the
2438         WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
2439         until it is done launching before registering itself with the visitedLinkStore.
2440
2441         * UIProcess/ProvisionalPageProxy.cpp:
2442         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
2443         (WebKit::ProvisionalPageProxy::initializeWebPage):
2444         (WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
2445         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
2446         * UIProcess/ProvisionalPageProxy.h:
2447         * UIProcess/VisitedLinkStore.cpp:
2448         (WebKit::VisitedLinkStore::~VisitedLinkStore):
2449         (WebKit::VisitedLinkStore::addProcess):
2450         * UIProcess/WebPageProxy.cpp:
2451         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2452         (WebKit::WebPageProxy::initializeWebPage):
2453         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2454         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
2455         (WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
2456         * UIProcess/WebPageProxy.h:
2457         * UIProcess/WebProcessProxy.cpp:
2458         (WebKit::WebProcessProxy::shutDown):
2459         (WebKit::WebProcessProxy::removeWebPage):
2460         (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
2461         (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
2462         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
2463         (WebKit::WebProcessProxy::didFinishLaunching):
2464         (WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
2465         (WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
2466         * UIProcess/WebProcessProxy.h:
2467
2468 2019-03-19  Alex Christensen  <achristensen@webkit.org>
2469
2470         Make WTFLogChannelState and WTFLogLevel enum classes
2471         https://bugs.webkit.org/show_bug.cgi?id=195904
2472
2473         Reviewed by Eric Carlson.
2474
2475         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2476         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
2477         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2478         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
2479
2480 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2481
2482         Unreviewed, rolling out r243132.
2483
2484         Broke GTK build
2485
2486         Reverted changeset:
2487
2488         "Make WTFLogChannelState and WTFLogLevel enum classes"
2489         https://bugs.webkit.org/show_bug.cgi?id=195904
2490         https://trac.webkit.org/changeset/243132
2491
2492 2019-03-19  Antti Koivisto  <antti@apple.com>
2493
2494         Layer with no backing store should still hit-test over a scroller
2495         https://bugs.webkit.org/show_bug.cgi?id=195378
2496         <rdar://problem/48652078>
2497
2498         Reviewed by Simon Fraser.
2499
2500         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2501         (WebKit::RemoteLayerTreeHost::makeNode):
2502         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
2503         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2504         (WebKit::collectDescendantViewsAtPoint):
2505
2506         No need for special WKTiledBackingView, tiled views now have correct event regions.
2507
2508 2019-03-18  Alex Christensen  <achristensen@webkit.org>
2509
2510         Make WTFLogChannelState and WTFLogLevel enum classes
2511         https://bugs.webkit.org/show_bug.cgi?id=195904
2512
2513         Reviewed by Eric Carlson.
2514
2515         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2516         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
2517         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2518         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
2519
2520 2019-03-18  Commit Queue  <commit-queue@webkit.org>
2521
2522         Unreviewed, rolling out r243092 and r243096.
2523         https://bugs.webkit.org/show_bug.cgi?id=195926
2524
2525         Caused assertions in tests (Requested by smfr on #webkit).
2526
2527         Reverted changesets:
2528
2529         "Layer with no backing store should still hit-test over a
2530         scroller"
2531         https://bugs.webkit.org/show_bug.cgi?id=195378
2532         https://trac.webkit.org/changeset/243092
2533
2534         "Try to fix Windows build."
2535         https://trac.webkit.org/changeset/243096
2536
2537 2019-03-18  Timothy Hatcher  <timothy@apple.com>
2538
2539         WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
2540         https://bugs.webkit.org/show_bug.cgi?id=195916
2541
2542         Reviewed by Tim Horton.
2543
2544         Add direct support for UIColor so it does not try to use the NSSecureCoding path.
2545         This avoids needs to list the classes when decoding the attributes NSDictionary
2546         and matches the macOS NSColor encoder/decoder.
2547
2548         * Shared/Cocoa/ArgumentCodersCocoa.mm:
2549         (IPC::typeFromObject):
2550         (IPC::encodeColorInternal):
2551         (IPC::decodeColorInternal):
2552         (IPC::encodeObject):
2553         (IPC::decodeObject):
2554
2555 2019-03-18  Timothy Hatcher  <timothy@apple.com>
2556
2557         Add new NSAttributedString API for converting HTML.
2558         https://bugs.webkit.org/show_bug.cgi?id=195636
2559         rdar://problem/45055697
2560
2561         Reviewed by Tim Horton.
2562
2563         * Platform/spi/ios/UIKitSPI.h:
2564         * SourcesCocoa.txt:
2565         * UIProcess/API/Cocoa/NSAttributedString.h: Added.
2566         * UIProcess/API/Cocoa/NSAttributedString.mm: Added.
2567         (-[_WKAttributedStringNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
2568         (-[_WKAttributedStringNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
2569         (-[_WKAttributedStringNavigationDelegate webView:didFailNavigation:withError:]):
2570         (-[_WKAttributedStringNavigationDelegate webView:didFinishNavigation:]):
2571         (+[_WKAttributedStringWebViewCache cache]):
2572         (+[_WKAttributedStringWebViewCache configuration]):
2573         (+[_WKAttributedStringWebViewCache clearConfiguration]):
2574         (+[_WKAttributedStringWebViewCache retrieveOrCreateWebView]):
2575         (+[_WKAttributedStringWebViewCache cacheWebView:]):
2576         (+[_WKAttributedStringWebViewCache resetPurgeDelay]):
2577         (+[_WKAttributedStringWebViewCache purgeSingleWebView]):
2578         (+[_WKAttributedStringWebViewCache purgeAllWebViews]):
2579         (+[NSAttributedString _loadFromHTMLWithOptions:contentLoader:completionHandler:]):
2580         (+[NSAttributedString loadFromHTMLWithRequest:options:completionHandler:]):
2581         (+[NSAttributedString loadFromHTMLWithFileURL:options:completionHandler:]):
2582         (+[NSAttributedString loadFromHTMLWithString:options:completionHandler:]):
2583         (+[NSAttributedString loadFromHTMLWithData:options:completionHandler:]):
2584         * UIProcess/API/Cocoa/NSAttributedStringPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKErrorInternal.h.
2585         * UIProcess/API/Cocoa/WKError.h:
2586         * UIProcess/API/Cocoa/WKError.mm:
2587         (localizedDescriptionForErrorCode):
2588         (createNSError):
2589         * UIProcess/API/Cocoa/WKErrorInternal.h:
2590         * WebKit.xcodeproj/project.pbxproj:
2591         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2592         (WebKit::WebPage::getContentsAsAttributedString):
2593
2594 2019-03-18  Alex Christensen  <achristensen@webkit.org>
2595
2596         Implement DownloadMonitor to prevent long-running slow downloads from background apps
2597         https://bugs.webkit.org/show_bug.cgi?id=195785
2598
2599         Reviewed by Geoffrey Garen.
2600
2601         This is similar to what was updated in <rdar://problem/42677685> but for WebKit Downloads.
2602         To test it I implemented a throttled TCP server, SPI to speed up DownloadMonitor's timer,
2603         and SPI to synthesize the application going into the background and foreground, which
2604         NSNotificationCenter does on iOS.
2605
2606         * NetworkProcess/Downloads/Download.cpp:
2607         (WebKit::Download::didReceiveData):
2608         (WebKit::Download::didFinish):
2609         (WebKit::Download::didFail):
2610         (WebKit::Download::didCancel):
2611         * NetworkProcess/Downloads/Download.h:
2612         (WebKit::Download::applicationEnteredBackground):
2613         (WebKit::Download::applicationEnteredForeground):
2614         (WebKit::Download::manager const):
2615         * NetworkProcess/Downloads/DownloadManager.cpp:
2616         (WebKit::DownloadManager::downloadFinished):
2617         (WebKit::DownloadManager::applicationDidEnterBackground):
2618         (WebKit::DownloadManager::applicationWillEnterForeground):
2619         * NetworkProcess/Downloads/DownloadManager.h:
2620         * NetworkProcess/Downloads/DownloadMap.cpp:
2621         (WebKit::DownloadMap::values):
2622         * NetworkProcess/Downloads/DownloadMap.h:
2623         * NetworkProcess/Downloads/DownloadMonitor.cpp: Added.
2624         (WebKit::operator _kbps):
2625         (WebKit::timeUntilNextInterval):
2626         (WebKit::DownloadMonitor::DownloadMonitor):
2627         (WebKit::DownloadMonitor::measuredThroughputRate const):
2628         (WebKit::DownloadMonitor::downloadReceivedBytes):
2629         (WebKit::DownloadMonitor::applicationEnteredForeground):
2630         (WebKit::DownloadMonitor::applicationEnteredBackground):
2631         (WebKit::DownloadMonitor::speedMultiplier const):
2632         (WebKit::DownloadMonitor::timerFired):
2633         * NetworkProcess/Downloads/DownloadMonitor.h: Added.
2634         * NetworkProcess/NetworkProcess.cpp:
2635         (WebKit::NetworkProcess::initializeNetworkProcess):
2636         (WebKit::NetworkProcess::applicationDidEnterBackground):
2637         (WebKit::NetworkProcess::applicationWillEnterForeground):
2638         * NetworkProcess/NetworkProcess.h:
2639         * NetworkProcess/NetworkProcess.messages.in:
2640         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2641         (WebKit::NetworkProcessCreationParameters::encode const):
2642         (WebKit::NetworkProcessCreationParameters::decode):
2643         * NetworkProcess/NetworkProcessCreationParameters.h:
2644         * Sources.txt:
2645         * SourcesCocoa.txt:
2646         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2647         (API::ProcessPoolConfiguration::copy):
2648         * UIProcess/API/APIProcessPoolConfiguration.h:
2649         * UIProcess/API/C/WKContext.cpp:
2650         (WKContextDownloadURLRequest):
2651         (WKContextResumeDownload):
2652         * UIProcess/API/Cocoa/WKProcessPool.mm:
2653         (-[WKProcessPool _synthesizeAppIsBackground:]):
2654         (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
2655         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2656         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2657         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2658         (-[_WKProcessPoolConfiguration downloadMonitorSpeedMultiplier]):
2659         (-[_WKProcessPoolConfiguration setDownloadMonitorSpeedMultiplier:]):
2660         * UIProcess/Cocoa/DownloadProxyMapCocoa.mm: Added.
2661         (WebKit::DownloadProxyMap::platformCreate):
2662         (WebKit::DownloadProxyMap::platformDestroy):
2663         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2664         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2665         * UIProcess/Downloads/DownloadProxy.cpp:
2666         (WebKit::DownloadProxy::didFinish):
2667         (WebKit::DownloadProxy::didFail):
2668         (WebKit::DownloadProxy::didCancel):
2669         * UIProcess/Downloads/DownloadProxyMap.cpp:
2670         (WebKit::DownloadProxyMap::DownloadProxyMap):
2671         (WebKit::DownloadProxyMap::~DownloadProxyMap):
2672         (WebKit::DownloadProxyMap::platformCreate):
2673         (WebKit::DownloadProxyMap::platformDestroy):
2674         (WebKit::DownloadProxyMap::applicationDidEnterBackground):
2675         (WebKit::DownloadProxyMap::applicationWillEnterForeground):
2676         (WebKit::DownloadProxyMap::createDownloadProxy):
2677         (WebKit::DownloadProxyMap::downloadFinished):
2678         * UIProcess/Downloads/DownloadProxyMap.h:
2679         * UIProcess/Network/NetworkProcessProxy.cpp:
2680         (WebKit::NetworkProcessProxy::synthesizeAppIsBackground):
2681         (WebKit::NetworkProcessProxy::createDownloadProxy):
2682         * UIProcess/Network/NetworkProcessProxy.h:
2683         * UIProcess/PageClient.h:
2684         * UIProcess/WebPageProxy.cpp:
2685         (WebKit::WebPageProxy::receivedPolicyDecision):
2686         (WebKit::WebPageProxy::handleDownloadRequest):
2687         * UIProcess/WebPageProxy.h:
2688         * UIProcess/WebProcessPool.cpp:
2689         (WebKit::WebProcessPool::download):
2690         (WebKit::WebProcessPool::resumeDownload):
2691         (WebKit::WebProcessPool::createDownloadProxy):
2692         (WebKit::WebProcessPool::synthesizeAppIsBackground):
2693         * UIProcess/WebProcessPool.h:
2694         * UIProcess/ios/PageClientImplIOS.h:
2695         * UIProcess/ios/PageClientImplIOS.mm:
2696         (WebKit::PageClientImpl::handleDownloadRequest):
2697         * UIProcess/mac/PageClientImplMac.h:
2698         * UIProcess/mac/PageClientImplMac.mm:
2699         (WebKit::PageClientImpl::handleDownloadRequest):
2700         * WebKit.xcodeproj/project.pbxproj:
2701
2702 2019-03-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2703
2704         [iOS] Native selection views sometimes appear in hidden editable areas after losing focus
2705         https://bugs.webkit.org/show_bug.cgi?id=195894
2706         <rdar://problem/48849989>
2707
2708         Reviewed by Tim Horton.
2709
2710         On certain websites, focus is moved away from an editable element while maintaining a selection inside the
2711         editable element. In the case where the editable element is hidden, this currently breaks our text interaction
2712         suppression heuristics, which suppress text selection gestures and overlays inside focused hidden editable
2713         elements. To fix this, we refactor our text interaction suppression heuristics, such that they are not dependent
2714         on an editable element being focused. See changes below for more details.
2715
2716         Test: editing/selection/ios/hide-selection-in-non-focused-element.html
2717
2718         * Shared/EditorState.cpp:
2719         (WebKit::EditorState::PostLayoutData::encode const):
2720         (WebKit::EditorState::PostLayoutData::decode):
2721         * Shared/EditorState.h:
2722
2723         Rename elementIsTransparentOrFullyClipped to editableRootIsTransparentOrFullyClipped, and additionally compute
2724         this flag by checking whether the root editable element containing the selection is transparent or clipped,
2725         instead of using the currently focused element.
2726
2727         * Shared/FocusedElementInformation.cpp:
2728         (WebKit::FocusedElementInformation::encode const):
2729         (WebKit::FocusedElementInformation::decode):
2730         * Shared/FocusedElementInformation.h:
2731
2732         Remove the elementIsTransparentOrFullyClipped flag from FocusedElementInformation (see below for more detail).
2733
2734         * UIProcess/ios/WKContentViewInteraction.h:
2735
2736         Rename FocusedElementIsTransparentOrFullyClipped to EditableRootIsTransparentOrFullyClipped.
2737
2738         * UIProcess/ios/WKContentViewInteraction.mm:
2739         (-[WKContentView _zoomToRevealFocusedElement]):
2740         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2741
2742         Remove logic that currently uses state on FocusedElementInformation to determine whether to suppress platform
2743         text interactions; instead, only use EditorState to make this determination. This logic was originally added in
2744         the initial implementation of the text interaction suppression heuristic as a way to begin suppressing text
2745         selection state before zooming to reveal the focused element; however, since we now zoom to reveal the text
2746         selection when focusing editable elements, zooming is deferred until the next complete EditorState update
2747         arrives in the UI process so we don't need to worry about beginning to suppress text interactions prior to this
2748         initial editor state update.
2749
2750         (-[WKContentView _elementDidBlur]):
2751         (-[WKContentView _updateSelectionAssistantSuppressionState]):
2752
2753         Add a helper method that updates text selection suppression state using the current EditorState.
2754
2755         (-[WKContentView _selectionChanged]):
2756         (-[WKContentView _updateChangedSelection:]):
2757
2758         Always update text suppression state when receiving an EditorState, instead of only doing so when processing a
2759         text selection gesture.
2760
2761         (-[WKContentView _startSuppressingSelectionAssistantForReason:]):
2762
2763         Renamed from _beginSuppressingSelectionAssistantForReason:, to better match "start/end" terminology of
2764         _endSuppressingSelectionAssistantForReason:.
2765
2766         (-[WKContentView dropInteraction:performDrop:]):
2767         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]): Deleted.
2768         * UIProcess/ios/WebPageProxyIOS.mm:
2769         (WebKit::WebPageProxy::editorStateChanged):
2770
2771         Ensure that we run logic to zoom to the focused element *after* updating text selection suppression state, so we
2772         don't erroneously zoom to reveal hidden editable elements.
2773
2774         * WebProcess/WebPage/ios/WebPageIOS.mm:
2775         (WebKit::WebPage::platformEditorState const):
2776         (WebKit::WebPage::getFocusedElementInformation):
2777
2778 2019-03-18  Chris Dumez  <cdumez@apple.com>
2779
2780         Delay WebProcess launch until a load is triggered in a Web view
2781         https://bugs.webkit.org/show_bug.cgi?id=195758
2782         <rdar://problem/48126013>
2783
2784         Reviewed by Geoff Garen.
2785
2786         This is achieved by constructing WebPageProxy objects with a WebProcessProxy that is in
2787         terminated state (because it never launched its process). This is convenient because
2788         it is a state that the WebPageProxy supports, which normally happened by the WebProcess
2789         crashes. When trying to do a load, we were already checking if the WebPageProxy's process
2790         was running (via an isValid() check) and we would re-launch the WebProcess if necessary
2791         by calling reattachToWebProcess(). For clarity, given that this state is no longer
2792         indicating that the WebProcess crashed, I renamed isValid() to hasRunningProcess() and
2793         reattachToWebProcess() to launchProcess().
2794
2795         The reason delaying the WebProcess launch until the first load is useful is because it
2796         allows us to leverage the WebProcessCache given that we now know which registrable
2797         domain is going to be loaded in the process.
2798
2799         This is a progression from a power usage standpoint. When it comes to page load time,
2800         it would be a progression if we found a suitable process in the cache. I do not expect
2801         a performance hit when no process is found in the cache because of process prewarming.
2802
2803         * Shared/API/Cocoa/RemoteObjectRegistry.h:
2804         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
2805         (WebKit::m_launchInitialProcessIfNecessary):
2806         (WebKit::RemoteObjectRegistry::sendInvocation):
2807         * UIProcess/API/Cocoa/WKProcessPool.mm:
2808         (-[WKProcessPool _processCacheSize]):
2809         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2810         * UIProcess/API/Cocoa/WKWebView.mm:
2811         (-[WKWebView _isValid]):
2812         * UIProcess/Automation/WebAutomationSession.cpp:
2813         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
2814         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2815         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2816         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2817         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
2818         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
2819         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
2820         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
2821         * UIProcess/DrawingAreaProxy.cpp:
2822         (WebKit::DrawingAreaProxy::setViewExposedRect):
2823         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
2824         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
2825         (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
2826         * UIProcess/InspectorTargetProxy.cpp:
2827         (WebKit::InspectorTargetProxy::connect):
2828         (WebKit::InspectorTargetProxy::disconnect):
2829         (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
2830         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2831         (WebKit::RemoteLayerTreeDrawingAreaProxy::sizeDidChange):
2832         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2833         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2834         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2835         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2836         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2837         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
2838         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2839         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2840         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
2841         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2842         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
2843         * UIProcess/ViewGestureController.cpp:
2844         (WebKit::ViewGestureController::ViewGestureController):
2845         * UIProcess/WebBackForwardList.cpp:
2846         (WebKit::WebBackForwardList::~WebBackForwardList):
2847         * UIProcess/WebCookieManagerProxy.cpp:
2848         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
2849         * UIProcess/WebEditCommandProxy.cpp:
2850         (WebKit::WebEditCommandProxy::unapply):
2851         (WebKit::WebEditCommandProxy::reapply):
2852         * UIProcess/WebFrameProxy.cpp:
2853         (WebKit::WebFrameProxy::stopLoading const):
2854         * UIProcess/WebInspectorProxy.cpp:
2855         (WebKit::WebInspectorProxy::WebInspectorProxy):
2856         * UIProcess/WebPageProxy.cpp:
2857         (WebKit::m_resetRecentCrashCountTimer):
2858         (WebKit::WebPageProxy::hasRunningProcess const):
2859         (WebKit::WebPageProxy::setUIClient):
2860         (WebKit::WebPageProxy::setIconLoadingClient):
2861         (WebKit::WebPageProxy::launchProcess):
2862         (WebKit::WebPageProxy::swapToWebProcess):
2863         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2864         (WebKit::WebPageProxy::didAttachToRunningProcess):
2865         (WebKit::WebPageProxy::launchProcessForReload):
2866         (WebKit::WebPageProxy::launchProcessWithItem):
2867         (WebKit::WebPageProxy::initializeWebPage):
2868         (WebKit::WebPageProxy::tryClose):
2869         (WebKit::WebPageProxy::loadRequest):
2870         (WebKit::WebPageProxy::loadFile):
2871         (WebKit::WebPageProxy::loadData):
2872         (WebKit::WebPageProxy::loadAlternateHTML):
2873         (WebKit::WebPageProxy::loadWebArchiveData):
2874         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
2875         (WebKit::WebPageProxy::stopLoading):
2876         (WebKit::WebPageProxy::reload):
2877         (WebKit::WebPageProxy::goToBackForwardItem):
2878         (WebKit::WebPageProxy::tryRestoreScrollPosition):
2879         (WebKit::WebPageProxy::setControlledByAutomation):
2880         (WebKit::WebPageProxy::setIndicating):
2881         (WebKit::WebPageProxy::setBackgroundColor):
2882         (WebKit::WebPageProxy::setTopContentInset):
2883         (WebKit::WebPageProxy::setUnderlayColor):
2884         (WebKit::WebPageProxy::viewWillStartLiveResize):
2885         (WebKit::WebPageProxy::viewWillEndLiveResize):
2886         (WebKit::WebPageProxy::dispatchActivityStateChange):
2887         (WebKit::WebPageProxy::layerHostingModeDidChange):
2888         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
2889         (WebKit::WebPageProxy::setInitialFocus):
2890         (WebKit::WebPageProxy::clearSelection):
2891         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
2892         (WebKit::WebPageProxy::validateCommand):
2893         (WebKit::WebPageProxy::increaseListLevel):
2894         (WebKit::WebPageProxy::decreaseListLevel):
2895         (WebKit::WebPageProxy::changeListType):
2896         (WebKit::WebPageProxy::setBaseWritingDirection):
2897         (WebKit::WebPageProxy::setNeedsFontAttributes):
2898         (WebKit::WebPageProxy::executeEditCommand):
2899         (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
2900         (WebKit::WebPageProxy::setEditable):
2901         (WebKit::WebPageProxy::performDragControllerAction):
2902         (WebKit::WebPageProxy::dragEnded):
2903         (WebKit::WebPageProxy::didStartDrag):
2904         (WebKit::WebPageProxy::dragCancelled):
2905         (WebKit::WebPageProxy::handleMouseEvent):
2906         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
2907         (WebKit::WebPageProxy::handleWheelEvent):
2908         (WebKit::WebPageProxy::handleKeyboardEvent):
2909         (WebKit::WebPageProxy::handleGestureEvent):
2910         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2911         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
2912         (WebKit::WebPageProxy::handleTouchEvent):
2913         (WebKit::WebPageProxy::scrollBy):
2914         (WebKit::WebPageProxy::centerSelectionInVisibleArea):
2915         (WebKit::WebPageProxy::receivedPolicyDecision):
2916         (WebKit::WebPageProxy::setUserAgent):
2917         (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
2918         (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
2919         (WebKit::WebPageProxy::setCustomTextEncodingName):
2920         (WebKit::WebPageProxy::setTextZoomFactor):
2921         (WebKit::WebPageProxy::setPageZoomFactor):
2922         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
2923         (WebKit::WebPageProxy::scalePage):
2924         (WebKit::WebPageProxy::scalePageInViewCoordinates):
2925         (WebKit::WebPageProxy::scaleView):
2926         (WebKit::WebPageProxy::windowScreenDidChange):
2927         (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
2928         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
2929         (WebKit::WebPageProxy::updateAccessibilityEventsEnabled):
2930         (WebKit::WebPageProxy::setUseFixedLayout):
2931         (WebKit::WebPageProxy::setFixedLayoutSize):
2932         (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
2933         (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
2934         (WebKit::WebPageProxy::listenForLayoutMilestones):
2935         (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
2936         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
2937         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
2938         (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
2939         (WebKit::WebPageProxy::setPaginationMode):
2940         (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
2941         (WebKit::WebPageProxy::setPageLength):
2942         (WebKit::WebPageProxy::setGapBetweenPages):
2943         (WebKit::WebPageProxy::setPaginationLineGridEnabled):
2944         (WebKit::WebPageProxy::countStringMatches):
2945         (WebKit::WebPageProxy::replaceMatches):
2946         (WebKit::WebPageProxy::launchInitialProcessIfNecessary):
2947         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
2948         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
2949         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
2950         (WebKit::WebPageProxy::getSourceForFrame):
2951         (WebKit::WebPageProxy::getContentsAsString):
2952         (WebKit::WebPageProxy::getContentsAsAttributedString):
2953         (WebKit::WebPageProxy::getBytecodeProfile):
2954         (WebKit::WebPageProxy::getSamplingProfilerOutput):
2955         (WebKit::WebPageProxy::getContentsAsMHTMLData):
2956         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
2957         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
2958         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
2959         (WebKit::WebPageProxy::getResourceDataFromFrame):
2960         (WebKit::WebPageProxy::getWebArchiveOfFrame):
2961         (WebKit::WebPageProxy::forceRepaint):
2962         (WebKit::WebPageProxy::preferencesDidChange):
2963         (WebKit::WebPageProxy::setMediaVolume):
2964         (WebKit::WebPageProxy::setMuted):
2965         (WebKit::WebPageProxy::setMediaCaptureEnabled):
2966         (WebKit::WebPageProxy::stopMediaCapture):
2967         (WebKit::WebPageProxy::stopAllMediaPlayback):
2968         (WebKit::WebPageProxy::suspendAllMediaPlayback):
2969         (WebKit::WebPageProxy::resumeAllMediaPlayback):
2970         (WebKit::WebPageProxy::handleMediaEvent):
2971         (WebKit::WebPageProxy::setVolumeOfMediaElement):
2972         (WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
2973         (WebKit::WebPageProxy::didChooseColor):
2974         (WebKit::WebPageProxy::didEndColorPicker):
2975         (WebKit::WebPageProxy::didSelectOption):
2976         (WebKit::WebPageProxy::inspector const):
2977         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
2978         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
2979         (WebKit::WebPageProxy::didCancelForOpenPanel):
2980         (WebKit::WebPageProxy::removeEditCommand):
2981         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
2982         (WebKit::WebPageProxy::processDidBecomeResponsive):
2983         (WebKit::WebPageProxy::processDidTerminate):
2984         (WebKit::WebPageProxy::processWillBecomeSuspended):
2985         (WebKit::WebPageProxy::processWillBecomeForeground):
2986         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2987         (WebKit::WebPageProxy::setCanRunModal):
2988         (WebKit::WebPageProxy::canRunModal):
2989         (WebKit::WebPageProxy::computePagesForPrinting):
2990         (WebKit::WebPageProxy::drawRectToImage):
2991         (WebKit::WebPageProxy::drawPagesToPDF):
2992         (WebKit::WebPageProxy::drawPagesForPrinting):
2993         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
2994         (WebKit::WebPageProxy::setViewLayoutSize):
2995         (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
2996         (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
2997         (WebKit::WebPageProxy::setComposition):
2998         (WebKit::WebPageProxy::confirmComposition):
2999         (WebKit::WebPageProxy::cancelComposition):
3000         (WebKit::WebPageProxy::setScrollPinningBehavior):
3001         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
3002         (WebKit::WebPageProxy::changeFontAttributes):
3003         (WebKit::WebPageProxy::changeFont):
3004         (WebKit::WebPageProxy::setTextAsync):
3005         (WebKit::WebPageProxy::insertTextAsync):
3006         (WebKit::WebPageProxy::getMarkedRangeAsync):
3007         (WebKit::WebPageProxy::getSelectedRangeAsync):
3008         (WebKit::WebPageProxy::characterIndexForPointAsync):
3009         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
3010         (WebKit::WebPageProxy::setCompositionAsync):
3011         (WebKit::WebPageProxy::confirmCompositionAsync):
3012         (WebKit::WebPageProxy::takeSnapshot):
3013         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
3014         (WebKit::WebPageProxy::setUseSystemAppearance):
3015         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
3016         (WebKit::WebPageProxy::setPlaybackTarget):
3017         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
3018         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
3019         (WebKit::WebPageProxy::clearWheelEventTestTrigger):
3020         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
3021         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
3022         (WebKit::WebPageProxy::getLoadDecisionForIcon):
3023         (WebKit::WebPageProxy::setResourceCachingDisabled):
3024         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
3025         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
3026         (WebKit::WebPageProxy::insertAttachment):
3027         (WebKit::WebPageProxy::updateAttachmentAttributes):
3028         (WebKit::WebPageProxy::getApplicationManifest):
3029         (WebKit::WebPageProxy::textInputContextsInRect):
3030         (WebKit::WebPageProxy::focusTextInputContext):
3031         * UIProcess/WebPageProxy.h:
3032         * UIProcess/WebProcessPool.cpp:
3033         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3034         (WebKit::WebProcessPool::initializeNewWebProcess):
3035         (WebKit::WebProcessPool::disconnectProcess):
3036         (WebKit::WebProcessPool::createWebPage):
3037         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
3038         * UIProcess/WebProcessPool.h:
3039         * UIProcess/WebProcessProxy.cpp:
3040         (WebKit::WebProcessProxy::create):
3041         (WebKit::WebProcessProxy::addExistingWebPage):
3042         (WebKit::WebProcessProxy::maybeShutDown):
3043         * UIProcess/WebProcessProxy.h:
3044         * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp:
3045         (WebKit::InstallMissingMediaPluginsPermissionRequest::allow):
3046         (WebKit::InstallMissingMediaPluginsPermissionRequest::didEndRequestInstallMissingMediaPlugins):
3047         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3048         (WebKit::WebInspectorProxy::platformDetach):
3049         * UIProcess/ios/WKContentViewInteraction.mm:
3050         (-[WKContentView setupInteraction]):
3051         (-[WKContentView _webTouchEventsRecognized:]):
3052         (-[WKContentView _hoverGestureRecognizerChanged:]):
3053         * UIProcess/ios/WebPageProxyIOS.mm:
3054         (WebKit::WebPageProxy::requestFocusedElementInformation):
3055         (WebKit::WebPageProxy::updateVisibleContentRects):
3056         (WebKit::WebPageProxy::updateStringForFind):
3057         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3058         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
3059         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
3060         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
3061         (WebKit::WebPageProxy::setDeviceOrientation):
3062         (WebKit::WebPageProxy::setOverrideViewportArguments):
3063         (WebKit::WebPageProxy::selectWithGesture):
3064         (WebKit::WebPageProxy::updateSelectionWithTouches):
3065         (WebKit::WebPageProxy::requestAutocorrectionData):
3066         (WebKit::WebPageProxy::applyAutocorrection):
3067         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
3068         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
3069         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
3070         (WebKit::WebPageProxy::selectPositionAtPoint):
3071         (WebKit::WebPageProxy::beginSelectionInDirection):
3072         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
3073         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
3074         (WebKit::WebPageProxy::requestDictationContext):
3075         (WebKit::WebPageProxy::getSelectionContext):
3076         (WebKit::WebPageProxy::selectWithTwoTouches):
3077         (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
3078         (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
3079         (WebKit::WebPageProxy::moveSelectionByOffset):
3080         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
3081         (WebKit::WebPageProxy::focusNextFocusedElement):
3082         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
3083         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
3084         (WebKit::WebPageProxy::requestDragStart):
3085         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
3086         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3087         (WebKit::TiledCoreAnimationDrawingAreaProxy::sizeDidChange):
3088         (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
3089         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
3090         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3091         * UIProcess/mac/WebPageProxyMac.mm:
3092         (WebKit::WebPageProxy::windowAndViewFramesChanged):
3093         (WebKit::WebPageProxy::setMainFrameIsScrollable):
3094         (WebKit::WebPageProxy::insertDictatedTextAsync):
3095         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
3096         (WebKit::WebPageProxy::fontAtSelection):
3097         (WebKit::WebPageProxy::stringSelectionForPasteboard):
3098         (WebKit::WebPageProxy::dataSelectionForPasteboard):
3099         (WebKit::WebPageProxy::readSelectionFromPasteboard):
3100         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
3101         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
3102         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
3103         (WebKit::WebPageProxy::acceptsFirstMouse):
3104         * UIProcess/win/WebInspectorProxyWin.cpp:
3105         (WebKit::WebInspectorProxy::platformDetach):
3106         * UIProcess/win/WebView.cpp:
3107         (WebKit::WebView::cursorToShow const):
3108         * WebProcess/WebPage/WebPage.cpp:
3109         (WebKit::m_hostFileDescriptor):
3110
3111 2019-03-18  Antti Koivisto  <antti@apple.com>
3112
3113         Layer with no backing store should still hit-test over a scroller
3114         https://bugs.webkit.org/show_bug.cgi?id=195378
3115         <rdar://problem/48652078>
3116
3117         Reviewed by Simon Fraser.
3118
3119         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3120         (WebKit::RemoteLayerTreeHost::makeNode):
3121         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
3122         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3123         (WebKit::collectDescendantViewsAtPoint):
3124
3125         No need for special WKTiledBackingView, tiled views now have correct event regions.
3126
3127 2019-03-18  Daniel Bates  <dabates@apple.com>
3128
3129         [iOS] No DOM keypress event emitted for cursor key commands when non-editable element is focused
3130         https://bugs.webkit.org/show_bug.cgi?id=195626
3131         <rdar://problem/48810626>
3132
3133         Reviewed by Wenson Hsieh.
3134
3135         Following the UIKit fix <rdar://problem/47333786> WebKit will be asked whether it can perform some
3136         more actions, including cursor movements and more editing actions. All such actions are only applicable
3137         to editable elements. By responding NO to UIKit for such actions when we are not in an editable element
3138         we avoid the need to do such bookkeeping ourselves as UIKit will forward our response back to us
3139         on return from -handleKeyTextCommandForCurrentEvent, called from -[WKContentView _interpretKeyEvent].
3140         WebKit is then in a position to try to handle the event or in the case of all standard text editing
3141         key commands at the time of writing (e.g. Control + a) tell WebCore that it did not handle the event
3142         so that WebCore can continue the DOM key event dispatch algorithm. For standard text editing key
3143         commands, such as Control + a, we will emit a DOM keypress event for the 'a'.
3144
3145         * UIProcess/ios/WKContentViewInteraction.mm:
3146         (-[WKContentView canPerformAction:withSender:]):
3147
3148 2019-03-18  Adrian Perez de Castro  <aperez@igalia.com>
3149
3150         [WPE] Bump public API to wpe-1.0
3151         https://bugs.webkit.org/show_bug.cgi?id=195887
3152
3153         Reviewed by Philippe Normand.
3154
3155         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: Renamed from Source/WebKit/UIProcess/API/wpe/docs/wpe-0.1-sections.txt.
3156         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt.
3157
3158 2019-03-18  Adrian Perez de Castro  <aperez@igalia.com>
3159
3160         [WPE] Bump dependencies to wpe-1.0 and wpebackend-fdo-1.0
3161         https://bugs.webkit.org/show_bug.cgi?id=195786
3162
3163         Reviewed by Philippe Normand.
3164
3165         * wpe/wpe-web-extension.pc.in: Change dependency to wpe-1.0
3166         * wpe/wpe-webkit.pc.in: Ditto.
3167
3168 2019-03-17  Fujii Hironori  <Hironori.Fujii@sony.com>
3169
3170         [iOS] Block the accessibility server when accessibility is not enabled.
3171         https://bugs.webkit.org/show_bug.cgi?id=195342
3172         <rdar://problem/48615720>
3173
3174         Unreviewed build fix for WinCairo.
3175
3176         * Shared/SandboxExtension.h: Use ProcessID instead of pid_t.
3177
3178 2019-03-16  Dean Jackson  <dino@apple.com>
3179
3180         ASSERT(gestureRecognizer == _doubleTapGestureRecognizer) in _doubleTapDidFail:
3181         https://bugs.webkit.org/show_bug.cgi?id=195857
3182         <rdar://problem/48954679>
3183
3184         Reviewed by Wenson Hsieh.
3185
3186         Reset an existing gesture recognizer before creating a new one.
3187
3188         * UIProcess/ios/WKContentViewInteraction.mm:
3189         (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
3190         (-[WKContentView _setDoubleTapGesturesEnabled:]):
3191
3192 2019-03-16  Jer Noble  <jer.noble@apple.com>
3193
3194         Add a new MediaCapabilitiesExtensionsEnabled setting
3195         https://bugs.webkit.org/show_bug.cgi?id=195843
3196
3197         Reviewed by Geoffrey Garen.
3198
3199         * Shared/WebPreferences.yaml:
3200
3201 2019-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3202
3203         [iOS] Software keyboard never appears when editing on some websites
3204         https://bugs.webkit.org/show_bug.cgi?id=195824
3205         <rdar://problem/48020610>
3206
3207         Reviewed by Ryosuke Niwa.
3208
3209         In the scenario where an element has already been programmatically focused but the UI process isn't showing an
3210         input view for it, there are a couple of different ways in which an input view may still be shown for that
3211         element:
3212
3213         1. If the page attempts to programmatically focus the element, we'll invoke elementDidRefocus to recompute
3214         information about the focused element and propagate it to the UI process. By default, if programmatic focus was
3215         triggered under the scope of user interaction, we'll allow the input view to appear.
3216
3217         2. In the case where page does not attempt to programmatically focus the element but a click is dispatched,
3218         there is logic in WebPage::completeSyntheticClick to send information about the already-focused element.
3219
3220         On the web page relevant to this bug, focus is programmatically moved to hidden contenteditable areas upon page
3221         load, and touchstart is also prevented; furthermore, the page does not attempt to programmatically refocus the
3222         hidden editable area upon receiving touchstart. This means that the user will never be able to bring up the
3223         keyboard, since the editable area is already programmatically focused and subsequent attempts to tap in the
3224         page do nothing, because the page has already focused the hidden editable area (with the expectation that the
3225         software keyboard should already be present).
3226
3227         To fix this, we bring some of the same logic in completeSyntheticClick over to dispatchTouchEvent, by sending
3228         focused element information to the UI process if the focused element did not change over the course of
3229         dispatching the touch event. Similar code was introduced in r167774 to fix the same type of issue (i.e.
3230         inability to bring up the software keyboard), but this was later reverted in r188405 due to causing bugs such as
3231         <rdar://problem/22204108>, wherein this logic to bring up the keyboard in dispatchTouchEvent would scroll and
3232         zoom the page, such that the click event fired after touchend would be dispatched in the wrong location and (in
3233         the case of <rdar://problem/22204108>) caused the focused element to immediately blur again.
3234
3235         To mitigate this issue, we add the additional constraint that we only send focused element info in the case
3236         where the touch won't also generate a click later down the road, by requiring that the dispatched event was
3237         handled by the page (i.e. prevented).
3238
3239         Test: fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html
3240
3241         * WebProcess/WebPage/WebPage.cpp:
3242         (WebKit::WebPage::dispatchTouchEvent):
3243
3244 2019-03-16  Zalan Bujtas  <zalan@apple.com>
3245
3246         Unable to close trending window on naver.com.
3247         https://bugs.webkit.org/show_bug.cgi?id=195842
3248         <rdar://problem/48067338>
3249
3250         Reviewed by Simon Fraser.
3251
3252         * WebProcess/WebPage/ios/WebPageIOS.mm:
3253         (WebKit::dispatchSyntheticMouseMove):
3254         (WebKit::WebPage::handleSyntheticClick):
3255         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
3256
3257 2019-03-16  Timothy Hatcher  <timothy@apple.com>
3258
3259         REGRESSION (r242807): Unified sources build failure from missing imports.
3260         https://bugs.webkit.org/show_bug.cgi?id=195852
3261
3262         Unreviewed speculative build fix.
3263
3264         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3265         Include <wtf/SoftLinking.h> and "UIKitSPI.h" on iOS.
3266
3267 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
3268
3269         [iOS] Block the accessibility server when accessibility is not enabled.
3270         https://bugs.webkit.org/show_bug.cgi?id=195342
3271
3272         Reviewed by Brent Fulgham.
3273
3274         By default, block the iOS accessibility server in the sandbox. If accessibility is enabled,
3275         let the UI process issue a mach extension to the WebContent process. The UI process will
3276         issue the mach extension the the WebContent process by its process identifier. The sandbox
3277         extension handle is sent to the WebContent process to be consumed. The message will be sent
3278         when the WebProcess has finished launching, and also when accessibility is turned on.
3279
3280         * Platform/spi/ios/AccessibilitySupportSPI.h:
3281         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3282         * Shared/SandboxExtension.h:
3283         * Shared/mac/SandboxExtensionMac.mm:
3284         (WebKit::SandboxExtensionImpl::create):
3285         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
3286         (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
3287         (WebKit::SandboxExtension::createHandleForMachLookupByPid):
3288         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3289         (WebKit::WebProcessPool::registerNotificationObservers):
3290         (WebKit::WebProcessPool::unregisterNotificationObservers):
3291         * UIProcess/WebProcessPool.h:
3292         * UIProcess/WebProcessProxy.cpp:
3293         (WebKit::WebProcessProxy::didFinishLaunching):
3294         * UIProcess/WebProcessProxy.h:
3295         * UIProcess/ios/WebProcessProxyIOS.mm:
3296         (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
3297         * WebProcess/WebProcess.cpp:
3298         (WebKit::WebProcess::unblockAccessibilityServer):
3299         * WebProcess/WebProcess.h:
3300         * WebProcess/WebProcess.messages.in:
3301
3302 2019-03-15  Timothy Hatcher  <timothy@apple.com>
3303
3304         Unreviewed speculative build fix for non-Cocoa ports after r243012.
3305
3306         * UIProcess/WebPageProxy.cpp:
3307         (WebKit::WebPageProxy::getContentsAsAttributedString):
3308         * UIProcess/WebPageProxy.h:
3309
3310 2019-03-15  Truitt Savell  <tsavell@apple.com>
3311
3312         Unreviewed, rolling out r243008.
3313
3314         This revision broke High Sierra builders
3315
3316         Reverted changeset:
3317
3318         "[iOS] Block the accessibility server when accessibility is
3319         not enabled."
3320         https://bugs.webkit.org/show_bug.cgi?id=195342
3321         https://trac.webkit.org/changeset/243008
3322
3323 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
3324
3325         All networking from WebKit.Networking fails when Network Extension content filter is enabled
3326         https://bugs.webkit.org/show_bug.cgi?id=195815
3327         <rdar://problem/47598758>
3328
3329         Reviewed by Brent Fulgham.
3330
3331         The sandbox needs to allow an associated mach lookup.
3332
3333         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3334         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3335
3336 2019-03-15  Sihui Liu  <sihui_liu@apple.com>
3337
3338         [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
3339         https://bugs.webkit.org/show_bug.cgi?id=190350
3340         <rdar://problem/45089503>
3341
3342         Reviewed by Geoffrey Garen.
3343
3344         * NetworkProcess/NetworkProcess.cpp:
3345         (WebKit::NetworkProcess::collectIndexedDatabaseOriginsForVersion):
3346         (WebKit::NetworkProcess::indexedDatabaseOrigins):
3347         * NetworkProcess/NetworkProcess.h:
3348         * UIProcess/Network/NetworkProcessProxy.cpp:
3349         (WebKit::NetworkProcessProxy::addSession):
3350         (WebKit::NetworkProcessProxy::createSymLinkForFileUpgrade): For efficientcy and atomicity, we choose to use
3351         symlink to create v0 folder. Because network process does not have the permission to create a symlink, we need 
3352         to do this in UI process. UI process would create v0 folder inside the IndexedDB directory if there isn't one.
3353         Also if there is a v0 directory but it doesn't have content, it means it's not a correct symlink and we need to 
3354         delete it and create again.
3355
3356         * UIProcess/Network/NetworkProcessProxy.h:
3357         * UIProcess/WebProcessPool.cpp:
3358         (WebKit::WebProcessPool::ensureNetworkProcess):
3359
3360 2019-03-15  Sihui Liu  <sihui_liu@apple.com>
3361
3362         [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
3363         https://bugs.webkit.org/show_bug.cgi?id=190350
3364         <rdar://problem/45089503>
3365
3366         Reviewed by Geoffrey Garen.
3367
3368         * NetworkProcess/NetworkProcess.cpp:
3369         (WebKit::NetworkProcess::collectIndexedDatabaseOriginsForVersion):
3370         (WebKit::NetworkProcess::indexedDatabaseOrigins):
3371         * NetworkProcess/NetworkProcess.h:
3372         * UIProcess/Network/NetworkProcessProxy.cpp:
3373         (WebKit::NetworkProcessProxy::addSession):
3374         (WebKit::NetworkProcessProxy::createSymLinkForFileUpgrade):
3375         * UIProcess/Network/NetworkProcessProxy.h:
3376         * UIProcess/WebProcessPool.cpp:
3377         (WebKit::WebProcessPool::ensureNetworkProcess):
3378
3379 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
3380
3381         [iOS] Restrict iokit-user-client-class "IOHIDLibUserClient" from WebKit
3382         https://bugs.webkit.org/show_bug.cgi?id=195821
3383         <rdar://problem/47606250>
3384
3385         Reviewed by Brent Fulgham.
3386
3387         This should be removed from the WebContent sandbox on iOS.
3388
3389         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3390
3391 2019-03-15  Alex Christensen  <achristensen@webkit.org>
3392
3393         _WKDownload should conform to NSCopying protocol
3394         https://bugs.webkit.org/show_bug.cgi?id=195718
3395
3396         Reviewed by Tim Horton.
3397
3398         This will allow us to use it as keys in NSMutableDictionaries, which Safari already kind of does.
3399
3400         * UIProcess/API/Cocoa/_WKDownload.h:
3401         * UIProcess/API/Cocoa/_WKDownload.mm:
3402         (-[_WKDownload copyWithZone:]):
3403
3404 2019-03-15  Dean Jackson  <dino@apple.com>
3405
3406         Provide an option for an always-on fast click mode in iOS
3407         https://bugs.webkit.org/show_bug.cgi?id=195822
3408         <rdar://problem/48939357>
3409
3410         Reviewed by Sam Weinig.
3411
3412         Add an option that will always trigger a click and never
3413         wait for a double tap to zoom. It is disabled by default.