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