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