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