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