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