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