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