df0468909607eab83621e63d3ca552bfc9124ebf
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Crash when attempting to change input type while dismissing datalist suggestions
4         https://bugs.webkit.org/show_bug.cgi?id=195384
5         <rdar://problem/48563718>
6
7         Reviewed by Brent Fulgham.
8
9         See WebCore ChangeLog for more details.
10
11         * WebProcess/WebPage/WebPage.cpp:
12         (WebKit::WebPage::setActiveDataListSuggestionPicker):
13         (WebKit::WebPage::didSelectDataListOption):
14         (WebKit::WebPage::didCloseSuggestions):
15         * WebProcess/WebPage/WebPage.h:
16
17         Turn m_activeDataListSuggestionPicker from a raw pointer into a WeakPtr.
18
19 2019-03-06  Chris Dumez  <cdumez@apple.com>
20
21         [iOS] ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent
22         https://bugs.webkit.org/show_bug.cgi?id=195382
23         <rdar://problem/48642739>
24
25         Reviewed by Geoffrey Garen.
26
27         ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent. Previously,
28         we only send ProcessDidResume() to the WebProcess if PrepareToSuspend() was sent, not when the more urgent
29         ProcessWillSuspendImminently() IPC was sent.
30
31         This mismatch has lead to bugs because the WebProcess does not know it got resumed and failed to unfreeze the
32         layers it froze upon suspension.
33
34         * UIProcess/ProcessAssertion.h:
35         (WebKit::ProcessAssertionClient::~ProcessAssertionClient):
36
37         * UIProcess/ProcessThrottler.cpp:
38         (WebKit::ProcessThrottler::updateAssertion):
39         (WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
40         (WebKit::ProcessThrottler::assertionWillExpireImminently): Deleted.
41
42         * UIProcess/ProcessThrottler.h:
43         * UIProcess/ios/ProcessAssertionIOS.mm:
44         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
45         (WebKit::ProcessAssertion::~ProcessAssertion):
46         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
47         (WebKit::ProcessAndUIAssertion::setClient):
48
49         * WebProcess/WebPage/WebPage.cpp:
50         (WebKit::WebPage::didCompletePageTransition):
51         Revert change that was landed in r242098 to work around this ProcessThrottler bug.
52
53         * WebProcess/WebPage/ios/WebPageIOS.mm:
54         (WebKit::WebPage::applicationWillEnterForeground):
55         Revert change that was landed in r242554 to work around this ProcessThrottler bug.
56
57 2019-03-06  Alex Christensen  <achristensen@webkit.org>
58
59         Add gettid to allowed syscalls on Mac
60         https://bugs.webkit.org/show_bug.cgi?id=195386
61         <rdar://problem/48651255>
62
63         Reviewed by Brent Fulgham.
64
65         * WebProcess/com.apple.WebProcess.sb.in:
66
67 2019-03-06  Per Arne Vollan  <pvollan@apple.com>
68
69         [macOS] Sandbox call violation causes WebContent process to crash
70         https://bugs.webkit.org/show_bug.cgi?id=195379
71         <rdar://problem/48647263>
72
73         Reviewed by Brent Fulgham.
74
75         A new call needs to be added to the allow list in the WebContent process' sandbox.
76
77         * WebProcess/com.apple.WebProcess.sb.in:
78
79 2019-03-06  Antti Koivisto  <antti@apple.com>
80
81         [iOS] Basic hit testing for content overlapping fast-scrollable overflow
82         https://bugs.webkit.org/show_bug.cgi?id=195360
83
84         Reviewed by Simon Fraser.
85
86         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
87         (WebKit::RemoteLayerTreeHost::makeNode):
88
89         Use new UIView subclass for tiled layer hosting (so we know they have content even when contents property is nil).
90
91         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
92         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
93         (collectDescendantViewsAtPoint):
94
95         Factor collection step into a function.
96         Do basic skipping of event-transparent layers.
97
98         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
99
100         To handle overlap cases, find the scroll view that has the deepest non-transparent view hit as its descendant.
101
102         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]): Deleted.
103
104 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
105
106         Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
107         https://bugs.webkit.org/show_bug.cgi?id=195300
108
109         Reviewed by Simon Fraser.
110
111         Refactor some logic to use isTransparentOrFullyClippedRespectingParentFrames on RenderLayer rather than
112         RenderObject; introduce a helper method to ask whether the enclosing layer of a renderer is transparent or
113         clipped.
114
115         * WebProcess/WebPage/ios/WebPageIOS.mm:
116         (WebKit::enclosingLayerIsTransparentOrFullyClipped):
117         (WebKit::WebPage::platformEditorState const):
118         (WebKit::WebPage::requestEvasionRectsAboveSelection):
119         (WebKit::WebPage::getFocusedElementInformation):
120
121 2019-03-06  Chris Dumez  <cdumez@apple.com>
122
123         REGRESSION (r238490): YouTube.com: Returning PiP to Safari after sleeping device loses page
124         https://bugs.webkit.org/show_bug.cgi?id=195364
125         <rdar://problem/48538837>
126
127         Reviewed by Geoffrey Garen.
128
129         Make sure we unset the LayerTreeFreezeReason::ProcessSuspended layer tree freeze reason
130         when WebPage::applicationWillEnterForeground() is called. This restores pre-r238490
131         behavior and addresses the issue with PiP on youtube.com.
132
133         * WebProcess/WebPage/ios/WebPageIOS.mm:
134         (WebKit::WebPage::applicationWillEnterForeground):
135
136 2019-03-05  Dean Jackson  <dino@apple.com>
137
138         Fix WKPasswordView compilation on iOS
139         https://bugs.webkit.org/show_bug.cgi?id=195344
140         <rdar://problem/48620066>
141
142         Reviewed by Dan Bates.
143
144         Use WebKitAdditions.
145
146         * UIProcess/ios/WKPasswordView.mm:
147         (-[WKPasswordView showInScrollView:]):
148
149 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
150
151         [iOS] Frequent 1 second IPC deadlocks when showing a paste callout
152         https://bugs.webkit.org/show_bug.cgi?id=195354
153         <rdar://problem/48624675>
154
155         Reviewed by Tim Horton.
156
157         When triggering programmatic paste, we frequently hit deadlocks due to sync IPC going from the UI process to the
158         web process and vice versa. What happens in this scenario is that prior to triggering programmatic paste, the
159         page may try to move focus to a different element (e.g. a hidden editable area) before calling `execCommand`.
160         This causes us to send an ElementDidFocus message to the UI process, followed by RequestDOMPasteAccess.
161
162         However, upon receiving ElementDidFocus, we reload input views and (in the process) UIKit requests the
163         autocorrection context, which we implement in WebKit using a sync message to the web process due to
164         <rdar://problem/16207002> and its blocking bug <rdar://problem/48383001>. This means we'll end up in a state
165         where both the UI process and web process are blocked on each other waiting for a sync IPC response, and the UI
166         process is hung for a second until the IPC message times out.
167
168         Ideally, we should fix this by addressing <rdar://problem/16207002>. However, this requires potentially large
169         changes in UIKit (<rdar://problem/48383001>); for the time being, work around this deadlock by refactoring
170         synchronous autocorrection context requests such that they can be resolved by an out-of-band IPC response
171         (HandleAutocorrectionContext). Then prior to requesting DOM paste access, preemptively send a
172         HandleAutocorrectionContext message to the UI process to unblock any pending synchronous autocorrection context
173         requests.
174
175         * UIProcess/PageClient.h:
176         * UIProcess/WebPageProxy.h:
177         * UIProcess/WebPageProxy.messages.in:
178         * UIProcess/ios/PageClientImplIOS.h:
179         * UIProcess/ios/PageClientImplIOS.mm:
180         (WebKit::PageClientImpl::handleAutocorrectionContext):
181         * UIProcess/ios/WKContentViewInteraction.h:
182
183         Make it possible for WKContentView to remember its current pending autocorrection context completion handler.
184         This is invoked and cleared out in `-_invokePendingAutocorrectionContextHandler:`.
185
186         * UIProcess/ios/WKContentViewInteraction.mm:
187         (-[WKContentView _invokePendingAutocorrectionContextHandler:]):
188         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
189         (-[WKContentView _handleAutocorrectionContext:]):
190
191         Handle an autocorrection context response. This is invoked when the web process either handles an autocorrection
192         context message, or when it preemptively sends an autocorrection context before requesting DOM paste access.
193
194         (+[WKAutocorrectionContext emptyAutocorrectionContext]):
195
196         Add a helper to create an empty autocorrection context.
197
198         * UIProcess/ios/WebPageProxyIOS.mm:
199         (WebKit::WebPageProxy::requestAutocorrectionContext):
200         (WebKit::WebPageProxy::handleAutocorrectionContext):
201         (WebKit::WebPageProxy::autocorrectionContextSync): Deleted.
202
203         Removed this sync version, since we now only have requestAutocorrectionContext.
204
205         * WebProcess/WebPage/WebPage.cpp:
206         (WebKit::WebPage::requestDOMPasteAccess):
207
208         Send WebPageProxy::HandleAutocorrectionContext, and add a FIXME referencing <rdar://problem/16207002>.
209
210         * WebProcess/WebPage/WebPage.h:
211         * WebProcess/WebPage/WebPage.messages.in:
212
213         Split AutocorrectionContextSync into RequestAutocorrectionContext and HandleAutocorrectionContext; additionally,
214         remove the existing RequestAutocorrectionContext message.
215
216         * WebProcess/WebPage/ios/WebPageIOS.mm:
217         (WebKit::WebPage::requestAutocorrectionContext):
218         (WebKit::WebPage::autocorrectionContextSync): Deleted.
219
220 2019-03-06  Rob Buis  <rbuis@igalia.com>
221
222         Consider supporting the `referrerpolicy` attribute.
223         https://bugs.webkit.org/show_bug.cgi?id=179053
224
225         Reviewed by Darin Adler.
226
227         Add a runtime flag for referrerpolicy attribute.
228
229         * Shared/WebPreferences.yaml:
230         * UIProcess/API/C/WKPreferences.cpp:
231         (WKPreferencesSetReferrerPolicyAttributeEnabled):
232         (WKPreferencesGetReferrerPolicyAttributeEnabled):
233         * UIProcess/API/C/WKPreferencesRefPrivate.h:
234         * WebProcess/Network/WebLoaderStrategy.cpp:
235         (WebKit::WebLoaderStrategy::loadResource): do not hardcode choosing
236         the document referrer policy.
237
238 2019-03-06  Philippe Normand  <pnormand@igalia.com>
239
240         Unreviewed, WPE build fix after r242503
241
242         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
243         ServiceWorker messages moved from network process to another
244         header, so it needs to be included.
245
246 2019-03-05  David Quesada  <david_quesada@apple.com>
247
248         [WK2] It should be possible to follow links with 'download' attributes
249         https://bugs.webkit.org/show_bug.cgi?id=195145
250         rdar://problem/48462642
251
252         Reviewed by Alex Christensen.
253
254         When a link with a 'download' attribute is clicked and the navigation client
255         says to allow the navigation (i.e. provides PolicyAction::Use),
256         WebPageProxy::receivedNavigationPolicyDecision() should stop overriding this
257         decision and downloading the link instead. Instead, web view should honor the
258         policy chosen by the navigation delegate. This supports clients that want to
259         offer the user the ability to view, rather than download, the contents of
260         such links, which is permitted per the HTML spec.
261
262         This change is only made on Cocoa platforms for now since no other ports
263         expose an API on their navigation action to express whether the page intends
264         to download the linked resource.
265
266         * UIProcess/API/APINavigation.h:
267         (API::Navigation::shouldPerformDownload const):
268             Rename this to be in line with APINavigationAction's shouldPerformDownload()
269             for consistency. 'Force' seems like too strong of a word for this property
270             considering that 'forcing' the download isn't really an attribute inherent
271             to the navigation, but a behavior implemented by the web page proxy.
272         (API::Navigation::shouldForceDownload const): Deleted.
273         * UIProcess/Cocoa/VersionChecks.h:
274         * UIProcess/WebPageProxy.cpp:
275         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
276
277 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
278
279         [Curl] Implement Cookie Accept Policy.
280         https://bugs.webkit.org/show_bug.cgi?id=191645
281
282         Reviewed by Fujii Hironori.
283
284         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
285         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
286         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
287         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
288         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
289         (WebKit::NetworkDataTaskCurl::handleCookieHeaders):
290         * NetworkProcess/curl/NetworkDataTaskCurl.h:
291
292 2019-03-05  Youenn Fablet  <youenn@apple.com>
293
294         Introduce ServiceWorkerFetchTask
295         https://bugs.webkit.org/show_bug.cgi?id=195130
296
297         Reviewed by Chris Dumez.
298
299         ServiceWorkerFetchTask is added to represent NetworkProcess side of an ongoing fetch intercepted by service worker.
300         This patch should not change existing behavior.
301
302         * CMakeLists.txt:
303         * DerivedSources-input.xcfilelist:
304         * DerivedSources-output.xcfilelist:
305         * DerivedSources.make:
306         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
307         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
308         * NetworkProcess/NetworkProcess.cpp:
309         (WebKit::NetworkProcess::didFailFetch): Deleted.
310         (WebKit::NetworkProcess::didNotHandleFetch): Deleted.
311         (WebKit::NetworkProcess::didReceiveFetchRedirectResponse): Deleted.
312         (WebKit::NetworkProcess::didReceiveFetchResponse): Deleted.
313         (WebKit::NetworkProcess::didReceiveFetchData): Deleted.
314         (WebKit::NetworkProcess::didReceiveFetchFormData): Deleted.
315         (WebKit::NetworkProcess::didFinishFetch): Deleted.
316         * NetworkProcess/NetworkProcess.h:
317         * NetworkProcess/NetworkProcess.messages.in:
318         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
319         (WebKit::WebSWServerConnection::cancelFetch):
320         (WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
321         (WebKit::WebSWServerConnection::startFetch):
322         (WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse): Deleted.
323         (WebKit::WebSWServerConnection::didReceiveFetchResponse): Deleted.
324         (WebKit::WebSWServerConnection::didReceiveFetchData): Deleted.
325         (WebKit::WebSWServerConnection::didReceiveFetchFormData): Deleted.
326         (WebKit::WebSWServerConnection::didFinishFetch): Deleted.
327         (WebKit::WebSWServerConnection::didFailFetch): Deleted.
328         (WebKit::WebSWServerConnection::didNotHandleFetch): Deleted.
329         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
330         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
331         (WebKit::WebSWServerToContextConnection::connectionClosed):
332         (WebKit::WebSWServerToContextConnection::startFetch):
333         (WebKit::WebSWServerToContextConnection::cancelFetch):
334         (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
335         (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
336         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
337         * SourcesCocoa.txt:
338         * WebKit.xcodeproj/project.pbxproj:
339         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
340         (WebKit::WebSWContextManagerConnection::startFetch):
341         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
342         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
343         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
344         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
345         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
346         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
347         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
348         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
349         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
350         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: Added.
351         (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
352         (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
353         (WebKit::ServiceWorkerFetchTask::didReceiveData):
354         (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
355         (WebKit::ServiceWorkerFetchTask::didFinish):
356         (WebKit::ServiceWorkerFetchTask::didFail):
357         (WebKit::ServiceWorkerFetchTask::didNotHandle):
358         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: Added.
359         (WebKit::ServiceWorkerFetchTask::create):
360         (WebKit::ServiceWorkerFetchTask::Identifier::hash const):
361         (WebKit::ServiceWorkerFetchTask::identifier const):
362         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
363         (WebKit::operator==):
364         (WTF::ServiceWorkerFetchTaskIdentifierHash::hash):
365         (WTF::ServiceWorkerFetchTaskIdentifierHash::equal):
366         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::emptyValue):
367         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::constructDeletedValue):
368         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::isDeletedValue):
369         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: Added.
370
371 2019-03-05  Youenn Fablet  <youenn@apple.com>
372
373         Rename requestCacheStorageSpace to requestStorageSpace
374         https://bugs.webkit.org/show_bug.cgi?id=195282
375
376         Reviewed by Chris Dumez.
377
378         Make the name more abstract as it might be used in the future for other storage
379         like IDB or service worker registrations.
380
381         * NetworkProcess/NetworkProcess.cpp:
382         (WebKit::NetworkProcess::requestStorageSpace):
383         (WebKit::NetworkProcess::requestCacheStorageSpace): Deleted.
384         * NetworkProcess/NetworkProcess.h:
385         * NetworkProcess/cache/CacheStorageEngine.cpp:
386         (WebKit::CacheStorage::Engine::requestSpace):
387         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
388         (WebsiteDataStoreClient::WebsiteDataStoreClient):
389         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
390         * UIProcess/Network/NetworkProcessProxy.cpp:
391         (WebKit::NetworkProcessProxy::requestStorageSpace):
392         (WebKit::NetworkProcessProxy::requestCacheStorageSpace): Deleted.
393         * UIProcess/Network/NetworkProcessProxy.h:
394         * UIProcess/Network/NetworkProcessProxy.messages.in:
395         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
396         (WebKit::WebsiteDataStoreClient::requestStorageSpace):
397         (WebKit::WebsiteDataStoreClient::requestCacheStorageSpace): Deleted.
398
399 2019-03-05  Chris Dumez  <cdumez@apple.com>
400
401         Drop cached WebProcesses for a given session when this session is destroyed
402         https://bugs.webkit.org/show_bug.cgi?id=195212
403         <rdar://problem/48301483>
404
405         Reviewed by Geoffrey Garen.
406
407         Drop cached WebProcesses for a give session when this session is destroyed. This way, when you close
408         your private browsing window, all the processes it used get cleared and it cannot leave any state
409         behind.
410
411         * UIProcess/WebProcessCache.cpp:
412         (WebKit::WebProcessCache::canCacheProcess const):
413         (WebKit::WebProcessCache::addProcessIfPossible):
414         (WebKit::WebProcessCache::addProcess):
415         (WebKit::WebProcessCache::clearAllProcessesForSession):
416         * UIProcess/WebProcessCache.h:
417         (WebKit::WebProcessCache::capacity const):
418         * UIProcess/WebProcessPool.cpp:
419         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
420         (WebKit::WebProcessPool::hasPagesUsingWebsiteDataStore const):
421         * UIProcess/WebProcessPool.h:
422
423 2019-03-05  Brady Eidson  <beidson@apple.com>
424
425         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
426         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
427
428         Reviewed by Tim Horton.
429
430         * WebProcess/WebPage/WebPage.cpp:
431         (WebKit::WebPage::SandboxExtensionTracker::shouldReuseCommittedSandboxExtension): If there is a pendingProvisionalSandboxExtension
432           then its existence should override our willingness to reuse the existing committed extension.
433         (WebKit::shouldReuseCommittedSandboxExtension): Deleted.
434         * WebProcess/WebPage/WebPage.h:
435
436 2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
437
438         Unreviewed, rolling out r242403.
439
440         Caused layout test crashes on iOS simulator.
441
442         Reverted changeset:
443
444         "[ContentChangeObserver] Introduce fixed duration content
445         observation"
446         https://bugs.webkit.org/show_bug.cgi?id=195295
447         https://trac.webkit.org/changeset/242403
448
449 2019-03-05  Loïc Yhuel  <loic.yhuel@softathome.com>
450
451         [WPE] Do not create a PlatformDisplay in the Service Worker process
452         https://bugs.webkit.org/show_bug.cgi?id=194830
453
454         Reviewed by Žan Doberšek.
455
456         It avoids opening the Wayland socket in this WPEWebProcess, which might cause issues
457         depending on the platform, and allocates unneeded resources.
458
459         * Shared/WebProcessCreationParameters.cpp:
460         (WebKit::WebProcessCreationParameters::encode const):
461         (WebKit::WebProcessCreationParameters::decode):
462         * Shared/WebProcessCreationParameters.h: Add new isServiceWorkerProcess parameter.
463         * UIProcess/WebProcessPool.cpp:
464         (WebKit::WebProcessPool::initializeNewWebProcess): Set isServiceWorkerProcess parameter.
465         * UIProcess/glib/WebProcessPoolGLib.cpp:
466         (WebKit::WebProcessPool::platformInitializeWebProcess): No implementationLibraryName and hostClientFileDescriptor for Service Worker.
467         * WebProcess/glib/WebProcessGLib.cpp:
468         (WebKit::WebProcess::platformInitializeWebProcess): No wpe_loader_init nor PlatformDisplayLibWPE for Service Worker.
469
470 2019-03-04  Brady Eidson  <beidson@apple.com>
471
472         Unreviewed, rolling out r242376.
473
474         Broke some tests
475
476         Reverted changeset:
477
478         "Correctly handle sandbox extensions when the same WKWebView
479         loads multiple file:// URLs."
480         https://bugs.webkit.org/show_bug.cgi?id=195291
481         https://trac.webkit.org/changeset/242376
482
483 2019-03-04  Fujii Hironori  <Hironori.Fujii@sony.com>
484
485         Use a SQLite database to hold the ResourceLoadStatistics data
486         https://bugs.webkit.org/show_bug.cgi?id=194867
487         <rdar://problem/24240854>
488
489         Unreviewed build fix for WinCairo.
490
491         ResourceLoadStatisticsDebug and RELEASE_LOG_INFO_IF are not
492         defined because WinCairo port defines RELEASE_LOG_DISABLED.
493
494         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
495         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): Enclosed RELEASE_LOG_INFO_IF with #if !RELEASE_LOG_DISABLED.
496         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Ditto.
497         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): Ditto.
498
499 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
500
501         Use a SQLite database to hold the ResourceLoadStatistics data
502         https://bugs.webkit.org/show_bug.cgi?id=194867
503         <rdar://problem/24240854>
504
505         Reviewed by Chris Dumez.
506
507         The ResourceLoadStatistics database plist is inefficient. It requires more memory use
508         than it needs, and forces lots of looping and string comparisons to find information.
509
510         This problem has already been solved in the form of relational databases. We use them
511         elsewhere in WebKit, and should do so for this storage as well.
512
513         This patch creates an optional SQLite database to handle ITP operations.
514
515         1. It adds a new internal experimental feature flag to activate it. It requires the user
516            exit and restart the process to take effect.
517         2. It populates itself from the existing plist file (if it exists).
518         3. It stops using the plist in favor of the database.
519         4. It does queries and other operations using the database instead of the old hash table
520            implementation.
521
522         This patch refactors the exisiting ResourceLoadStatisticsMemoryStore class into a base
523         ResourceLoadStatisticsStore class, which ResourceLoadStatisticsMemoryStore is based on.
524         It adds a new ResourceLoadStatisticsDatabaseStore that is implemented in terms of SQL
525         operations.
526
527         These code changes should not have any impact on existing operations, and when enabled
528         should produce the same test results.
529
530         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: Added.
531         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
532         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
533         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
534         (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
535         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
536         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationship):
537         (WebKit::ResourceLoadStatisticsDatabaseStore::confirmDomainDoesNotExist const):
538         (WebKit::ResourceLoadStatisticsDatabaseStore::domainIDFromString const):
539         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
540         (WebKit::ResourceLoadStatisticsDatabaseStore::databaseIsEmpty const):
541         (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
542         (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
543         (WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains):
544         (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
545         (WebKit::buildList):
546         (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent):
547         (WebKit::listToString):
548         (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
549         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
550         (WebKit::ResourceLoadStatisticsDatabaseStore::classifyPrevalentResources):
551         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageIfNeeded):
552         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageImmediately):
553         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
554         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
555         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
556         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
557         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
558         (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
559         (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
560         (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
561         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceLoading):
562         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
563         (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
564         (WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
565         (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
566         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
567         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
568         (WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent):
569         (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const):
570         (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
571         (WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
572         (WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
573         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubresourceUnder const):
574         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubFrameUnder const):
575         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsRedirectingTo const):
576         (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
577         (WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
578         (WebKit::ResourceLoadStatisticsDatabaseStore::isGrandfathered const):
579         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameOrigin):
580         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameOrigin):
581         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
582         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
583         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
584         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
585         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForPrimaryDomain):
586         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):
587         (WebKit::ResourceLoadStatisticsDatabaseStore::cookieTreatmentForOrigin const):
588         (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
589         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const):
590         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
591         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlockingForDomains):
592         (WebKit::ResourceLoadStatisticsDatabaseStore::clearBlockingStateForDomains):
593         (WebKit::ResourceLoadStatisticsDatabaseStore::processStatistics const):
594         (WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains const):
595         (WebKit::ResourceLoadStatisticsDatabaseStore::findExpiredUserInteractions const):
596         (WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredUserInteractions):
597         (WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering):
598         (WebKit::ResourceLoadStatisticsDatabaseStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
599         (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
600         (WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen):
601         (WebKit::ResourceLoadStatisticsDatabaseStore::setLastSeen):
602         (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
603         (WebKit::ResourceLoadStatisticsDatabaseStore::removeAllStorageAccess):
604         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: Added.
605         (WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const):
606         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
607         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
608         (WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
609         (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
610         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
611         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
612         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
613         (WebKit::domainsToString): Deleted.
614         (WebKit::OperatingDate::fromWallTime): Deleted.
615         (WebKit::OperatingDate::today): Deleted.
616         (WebKit::OperatingDate::secondsSinceEpoch const): Deleted.
617         (WebKit::OperatingDate::operator== const): Deleted.
618         (WebKit::OperatingDate::operator< const): Deleted.
619         (WebKit::OperatingDate::operator<= const): Deleted.
620         (WebKit::OperatingDate::OperatingDate): Deleted.
621         (WebKit::mergeOperatingDates): Deleted.
622         (WebKit::computeImportance): Deleted.
623         (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore): Deleted.
624         (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned): Deleted.
625         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval): Deleted.
626         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry): Deleted.
627         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords): Deleted.
628         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords): Deleted.
629         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData): Deleted.
630         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode): Deleted.
631         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode): Deleted.
632         (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary): Deleted.
633         (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest): Deleted.
634         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction): Deleted.
635         (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval): Deleted.
636         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime): Deleted.
637         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap): Deleted.
638         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap): Deleted.
639         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies): Deleted.
640         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap): Deleted.
641         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const): Deleted.
642         (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved): Deleted.
643         (WebKit::debugLogDomainsInBatches): Deleted.
644         (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary): Deleted.
645         (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const): Deleted.
646         (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries): Deleted.
647         (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo): Deleted.
648         (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues): Deleted.
649         (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent): Deleted.
650         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess): Deleted.
651         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
652         (WebKit::ResourceLoadStatisticsMemoryStore::data const):
653         (WebKit::ResourceLoadStatisticsMemoryStore::isDebugModeEnabled const): Deleted.
654         (WebKit::ResourceLoadStatisticsMemoryStore::store const): Deleted.
655         (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled): Deleted.
656         (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled): Deleted.
657         (): Deleted.
658         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Added.
659         (WebKit::domainsToString):
660         (WebKit::OperatingDate::fromWallTime):
661         (WebKit::OperatingDate::today):
662         (WebKit::OperatingDate::secondsSinceEpoch const):
663         (WebKit::OperatingDate::operator== const):
664         (WebKit::OperatingDate::operator< const):
665         (WebKit::OperatingDate::operator<= const):
666         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
667         (WebKit::ResourceLoadStatisticsStore::~ResourceLoadStatisticsStore):
668         (WebKit::ResourceLoadStatisticsStore::calculateAndSubmitTelemetry const):
669         (WebKit::ResourceLoadStatisticsStore::computeImportance):
670         (WebKit::ResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
671         (WebKit::ResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
672         (WebKit::ResourceLoadStatisticsStore::setShouldSubmitTelemetry):
673         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
674         (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
675         (WebKit::ResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
676         (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
677         (WebKit::ResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
678         (WebKit::ResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
679         (WebKit::ResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
680         (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
681         (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
682         (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
683         (WebKit::ResourceLoadStatisticsStore::setCacheMaxAgeCap):
684         (WebKit::ResourceLoadStatisticsStore::updateCacheMaxAgeCap):
685         (WebKit::ResourceLoadStatisticsStore::setAgeCapForClientSideCookies):
686         (WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
687         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
688         (WebKit::ResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
689         (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
690         (WebKit::ResourceLoadStatisticsStore::clearBlockingStateForDomains):
691         (WebKit::ResourceLoadStatisticsStore::processStatistics const):
692         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
693         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
694         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
695         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
696         (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
697         (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
698         (WebKit::ResourceLoadStatisticsStore::resetParametersToDefaultValues):
699         (WebKit::ResourceLoadStatisticsStore::logTestingEvent):
700         (WebKit::ResourceLoadStatisticsStore::removeAllStorageAccess):
701         (WebKit::ResourceLoadStatisticsStore::didCreateNetworkProcess):
702         (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
703         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: Copied from Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h.
704         (WebKit::OperatingDate::OperatingDate):
705         (WebKit::ResourceLoadStatisticsStore::isEmpty const):
706         (WebKit::ResourceLoadStatisticsStore::data const):
707         (WebKit::ResourceLoadStatisticsStore::isDebugModeEnabled const):
708         (WebKit::ResourceLoadStatisticsStore::store const):
709         (WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled):
710         (WebKit::ResourceLoadStatisticsStore::setDebugLogggingEnabled):
711         * NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm.
712         (WebKit::ResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
713         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
714         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
715         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
716         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
717         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
718         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
719         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
720         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
721         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
722         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
723         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
724         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
725         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
726         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
727         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
728         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
729         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
730         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
731         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
732         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
733         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
734         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
735         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
736         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
737         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
738         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
739         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
740         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
741         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
742         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
743         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
744         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
745         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
746         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
747         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
748         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
749         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
750         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
751         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
752         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
753         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
754         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
755         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
756         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
757         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
758         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
759         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
760         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
761         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
762         * NetworkProcess/NetworkProcess.cpp:
763         (WebKit::NetworkProcess::initializeNetworkProcess):
764         * NetworkProcess/NetworkProcessCreationParameters.cpp:
765         (WebKit::NetworkProcessCreationParameters::encode const):
766         (WebKit::NetworkProcessCreationParameters::decode):
767         * NetworkProcess/NetworkProcessCreationParameters.h:
768         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
769         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
770         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
771         * Shared/WebPreferences.yaml:
772         * Sources.txt:
773         * SourcesCocoa.txt:
774         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
775         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
776         * UIProcess/WebProcessPool.cpp:
777         * WebKit.xcodeproj/project.pbxproj:
778
779 2019-03-04  Zalan Bujtas  <zalan@apple.com>
780
781         [ContentChangeObserver] Introduce fixed duration content observation
782         https://bugs.webkit.org/show_bug.cgi?id=195295
783         <rdar://problem/48579913>
784
785         Reviewed by Simon Fraser.
786
787         * WebProcess/WebPage/ios/WebPageIOS.mm:
788         (WebKit::WebPage::handleSyntheticClick):
789
790 2019-03-04  Truitt Savell  <tsavell@apple.com>
791
792         Unreviewed, rolling out r242396.
793
794         Found issue to be unrelated. reverting my rollout.
795
796         Reverted changeset:
797
798         "Unreviewed, rolling out r242222."
799         https://bugs.webkit.org/show_bug.cgi?id=193683
800         https://trac.webkit.org/changeset/242396
801
802 2019-03-04  Jiewen Tan  <jiewen_tan@apple.com>
803
804         Unreviewed, a followup after r242336
805
806         * UIProcess/WebPageProxy.cpp:
807         (WebKit::WebPageProxy::webViewDidMoveToWindow):
808         Copy the list of observers before iterating it to avoid observers modifying the list.
809
810 2019-03-04  Truitt Savell  <tsavell@apple.com>
811
812         Unreviewed, rolling out r242222.
813
814         Broke internal debug testing
815
816         Reverted changeset:
817
818         "[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to
819         the UI process."
820         https://bugs.webkit.org/show_bug.cgi?id=193683
821         https://trac.webkit.org/changeset/242222
822
823 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
824
825         Unreviewed build fix after r242378
826
827         * UIProcess/ios/EditableImageController.mm:
828         (WebKit::EditableImageController::associateWithAttachment):
829
830 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
831
832         Check contextIDs when handling WebContent messages
833         https://bugs.webkit.org/show_bug.cgi?id=195289
834         <rdar://problem/48475870>
835
836         Reviewed by Alex Christensen.
837
838         The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
839         We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
840
841         This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
842
843         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
844         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
845         (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
846         (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
847         (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
848         (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
849         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
850         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
851         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
852         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
853         (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
854         (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
855         (WebKit::PlaybackSessionManagerProxy::mutedChanged):
856         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
857         (WebKit::PlaybackSessionManagerProxy::durationChanged):
858         (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
859         (WebKit::PlaybackSessionManagerProxy::rateChanged):
860         (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
861         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
862         (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
863         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
864         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
865         (WebKit::UserMediaCaptureManagerProxy::startProducingData):
866         (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
867         (WebKit::UserMediaCaptureManagerProxy::end):
868         (WebKit::UserMediaCaptureManagerProxy::capabilities):
869         (WebKit::UserMediaCaptureManagerProxy::setMuted):
870         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
871         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
872         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
873         (WebKit::VideoFullscreenManagerProxy::setHasVideo):
874         (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
875         (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
876         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
877         (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
878         (WebKit::VideoFullscreenManagerProxy::setInlineRect):
879         (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
880         (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
881         (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
882         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
883         * UIProcess/ios/EditableImageController.mm:
884         (WebKit::EditableImageController::didCreateEditableImage):
885         (WebKit::EditableImageController::didDestroyEditableImage):
886         (WebKit::EditableImageController::associateWithAttachment):
887
888 2019-03-04  Alex Christensen  <achristensen@webkit.org>
889
890         Fix crashes when NetworkResourceLoader/NetworkLoadChecker are destroyed during HTTPS upgrade check
891         https://bugs.webkit.org/show_bug.cgi?id=195238
892         <rdar://problem/47598656>
893
894         Reviewed by Chris Dumez.
895
896         * NetworkProcess/NetworkLoadChecker.cpp:
897         (WebKit::NetworkLoadChecker::checkRequest):
898
899 2019-03-04  Brady Eidson  <beidson@apple.com>
900
901         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
902         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
903
904         Reviewed by Andy Estes.
905
906         * WebProcess/WebPage/WebPage.cpp:
907         (WebKit::shouldReuseCommittedSandboxExtension): Only retain the previous sandbox extension if the file URL
908           we're currently loading is functionally equivalent to the previous one.
909
910 2019-03-04  Chris Dumez  <cdumez@apple.com>
911
912         Drop legacy userAgentForURL injected bundle SPI
913         https://bugs.webkit.org/show_bug.cgi?id=195222
914         <rdar://problem/46734147>
915
916         Reviewed by Darin Adler.
917
918         Drop legacy userAgentForURL injected bundle SPI. There are no longer any clients, and using
919         WebsitePolicies.customUserAgent is the way to go nowadays.
920
921         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
922         (API::InjectedBundle::PageLoaderClient::willDestroyFrame):
923         (API::InjectedBundle::PageLoaderClient::userAgentForURL const): Deleted.
924         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
925         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
926         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
927         (setUpPageLoaderClient):
928         (userAgentForURL): Deleted.
929         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
930         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL const): Deleted.
931         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
932         * WebProcess/WebPage/WebPage.cpp:
933         (WebKit::WebPage::userAgent const):
934
935 2019-03-04  Chris Dumez  <cdumez@apple.com>
936
937         Do not share WebProcesses between private and regular sessions
938         https://bugs.webkit.org/show_bug.cgi?id=195189
939         <rdar://problem/48421064>
940
941         Reviewed by Alex Christensen.
942
943         Do not share WebProcesses between private and regular sessions. There are some privacy concerns.
944         Also, some of the WebsiteDataStore informations are passed via WebProcessCreationParameters (e.g.
945         ApplicationCache path) and cannot be updated later.
946
947         There were 2 cases where this could happen and that are fixed in the patch:
948         - A process may be prewarmed with a given website data store and then later on used for a page
949           associated with a different data store. We now prevent this. While this is not necessary for
950           privacy reasons, it is still useful because our code currently does not support well uses
951           different sessions inside a single WebProcess, as mentioned above.
952         - The client can force a WebsiteDataStore swap when responding to the decidePolicyForNavigationAction,
953           via the WebsitePolicies. To address the issue, we now force a process swap whenever the client
954           makes such a change.
955
956         As a result, WebProcessProxy::websiteDataStore() now makes sense and is always correct. It can
957         also only contains pages whose WebPageProxy::websiteDataStore() returns the same store.
958
959         * UIProcess/API/C/WKContext.cpp:
960         (WKContextWarmInitialProcess):
961         * UIProcess/API/Cocoa/WKProcessPool.mm:
962         (-[WKProcessPool _warmInitialProcess]):
963         * UIProcess/ProvisionalPageProxy.cpp:
964         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
965         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
966         * UIProcess/WebPageProxy.cpp:
967         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
968         (WebKit::WebPageProxy::reattachToWebProcess):
969         (WebKit::WebPageProxy::swapToWebProcess):
970         (WebKit::WebPageProxy::close):
971         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
972         (WebKit::WebPageProxy::commitProvisionalPage):
973         (WebKit::WebPageProxy::creationParameters):
974         * UIProcess/WebPageProxy.h:
975         (WebKit::WebPageProxy::websiteDataStore):
976         * UIProcess/WebProcessPool.cpp:
977         (WebKit::WebProcessPool::ensureNetworkProcess):
978         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
979         (WebKit::WebProcessPool::prewarmProcess):
980         (WebKit::WebProcessPool::createWebPage):
981         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
982         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
983         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
984         (WebKit::WebProcessPool::processForNavigation):
985         (WebKit::WebProcessPool::processForNavigationInternal):
986         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
987         * UIProcess/WebProcessPool.h:
988         (WebKit::WebProcessPool::sendToOneProcess):
989         * UIProcess/WebProcessProxy.cpp:
990         (WebKit::WebProcessProxy::createWebPage):
991         (WebKit::WebProcessProxy::addExistingWebPage):
992         (WebKit::WebProcessProxy::removeWebPage):
993         * UIProcess/WebProcessProxy.h:
994
995 2019-03-04  Chris Dumez  <cdumez@apple.com>
996
997         [iOS] Improve our file picker
998         https://bugs.webkit.org/show_bug.cgi?id=195284
999         <rdar://problem/45655856>
1000
1001         Reviewed by Tim Horton and Wenson Hsieh.
1002
1003         Improve our file picker on iOS so that:
1004         - Accepted file extensions specified in the HTML (e.g. <input type="file"> accept=".pdf">) are now
1005           properly reflected in the file picker. Previously, we only we only supported MIME types in the
1006           accept attribute that only Image / Video ones.
1007         - If accepted types are specified in the HTML and not of them are Video or Image types, then bypass
1008           the UIDocumentMenuViewController and show the file picker directly (as if the user had tapped on
1009           "Browse..." on that menu). Other menu items such as "Take Photo or Video" and "Photo Library" do
1010           not make sense if the page only accepts PDF files for example.
1011
1012         Things that we should do but are not fixed in this patch:
1013         - Stop using UIDocumentMenuViewController entirely since it was deprecated in favor of using
1014           UIDocumentPickerViewController directly.
1015         - Add multiple selection support, which is supported both on the HTML side and in the
1016           UIDocumentPickerViewController API.
1017
1018         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1019         (arrayContainsUTIThatConformsTo):
1020         (-[WKFileUploadPanel dealloc]):
1021         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
1022         (UTIsForMIMETypes):
1023         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
1024         (-[WKFileUploadPanel _cameraButtonLabelAllowingPhoto:allowingVideo:]):
1025         (-[WKFileUploadPanel _showDocumentPickerMenu]):
1026
1027 2019-03-04  Alex Christensen  <achristensen@webkit.org>
1028
1029         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
1030         https://bugs.webkit.org/show_bug.cgi?id=194523
1031
1032         Reviewed by Ryosuke Niwa.
1033
1034         Attempt to work around a CFNetwork bug in the timing of tearing down tasks with upload streams.
1035         See rdar://problem/28233746.
1036
1037         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1038         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1039         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
1040         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1041         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
1042
1043 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1044
1045         [CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
1046         https://bugs.webkit.org/show_bug.cgi?id=195270
1047
1048         Reviewed by Don Olmstead.
1049
1050         Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
1051         painting is resumed and layer flush enabled.
1052
1053         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1054         (WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
1055         (WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
1056         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1057         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1058         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
1059         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
1060         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1061         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
1062         (WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
1063         (WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().
1064
1065 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
1066
1067         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
1068         https://bugs.webkit.org/show_bug.cgi?id=195258
1069
1070         Reviewed by Antti Koivisto.
1071
1072         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
1073         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
1074         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
1075         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
1076
1077         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
1078         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
1079         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
1080         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
1081         references to GraphicsLayers before that becomes safe).
1082         
1083         The actual fix that allows overflow scrollbars to show is the change in
1084         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
1085         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
1086
1087         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1088         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
1089         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1090         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
1091         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1092         * SourcesCocoa.txt:
1093         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1094         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1095         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1096         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
1097         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
1098         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
1099         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
1100         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
1101         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: Copied from Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
1102         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::create):
1103         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
1104         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::~ScrollingTreeOverflowScrollingNodeRemoteMac):
1105         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):
1106         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::repositionRelatedLayers):
1107         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent):
1108         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleMouseEvent):
1109         * WebKit.xcodeproj/project.pbxproj:
1110
1111 2019-03-04  Andy Estes  <aestes@apple.com>
1112
1113         [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
1114         https://bugs.webkit.org/show_bug.cgi?id=195080
1115         <rdar://problem/48421558>
1116
1117         Reviewed by Antti Koivisto.
1118
1119         * CMakeLists.txt:
1120         * DerivedSources-input.xcfilelist:
1121         * DerivedSources.make:
1122         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
1123         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
1124         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
1125         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
1126         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
1127         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
1128         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
1129         * Shared/mac/WebHitTestResultData.mm:
1130         * SourcesCocoa.txt:
1131         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
1132         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
1133         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
1134         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1135         * WebKit.xcodeproj/project.pbxproj:
1136
1137 2019-03-04  Jer Noble  <jer.noble@apple.com>
1138
1139         [iOS] Fullscreen "stay in page" option breaks video playback
1140         https://bugs.webkit.org/show_bug.cgi?id=195277
1141         <rdar://problem/48537317>
1142
1143         Reviewed by Eric Carlson.
1144
1145         Make sure we resume media playback when the user chooses "stay in page" from the deceptive
1146         website warning dialog.
1147
1148         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1149         (-[WKFullScreenViewController _showPhishingAlert]):
1150
1151 2019-03-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1152
1153         [WPE] Enable web process sandbox
1154         https://bugs.webkit.org/show_bug.cgi?id=195169
1155
1156         Reviewed by Daniel Bates.
1157
1158         * PlatformWPE.cmake:
1159         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1160         (WebKit::bubblewrapSpawn):
1161         * UIProcess/glib/WebProcessPoolGLib.cpp:
1162         (WebKit::WebProcessPool::platformInitialize):
1163
1164 2019-03-04  Adrian Perez de Castro  <aperez@igalia.com>
1165
1166         [GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
1167         https://bugs.webkit.org/show_bug.cgi?id=195245
1168
1169         Reviewed by Carlos Garcia Campos.
1170
1171         Changed license headers to contain the LGPL, which is the correct one for the GTK
1172         and WPE ports. The change was agreed by the contributors to the files involved.
1173
1174         * UIProcess/API/gtk/WebKitAutocleanups.h:
1175         * UIProcess/API/wpe/WebKitAutocleanups.h:
1176         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
1177         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:
1178
1179 2019-03-04  Commit Queue  <commit-queue@webkit.org>
1180
1181         Unreviewed, rolling out r242045.
1182         https://bugs.webkit.org/show_bug.cgi?id=195273
1183
1184         WE not ready to enable PSON yet (Requested by KaL on #webkit).
1185
1186         Reverted changeset:
1187
1188         "[GTK] Enable PSON"
1189         https://bugs.webkit.org/show_bug.cgi?id=194979
1190         https://trac.webkit.org/changeset/242045
1191
1192 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1193
1194         [CoordinatedGraphics] Unify DrawingArea classes
1195         https://bugs.webkit.org/show_bug.cgi?id=195167
1196
1197         Reviewed by Žan Doberšek.
1198
1199         Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
1200
1201         * PlatformGTK.cmake:
1202         * PlatformWPE.cmake:
1203         * PlatformWin.cmake:
1204         * Shared/DrawingAreaInfo.h:
1205         * SourcesGTK.txt:
1206         * SourcesWPE.txt:
1207         * UIProcess/API/gtk/PageClientImpl.cpp:
1208         (WebKit::PageClientImpl::createDrawingAreaProxy):
1209         (WebKit::PageClientImpl::viewSize):
1210         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1211         (webkitWebViewBaseRealize):
1212         (webkitWebViewBaseUnrealize):
1213         (webkitWebViewBaseDraw):
1214         (webkitWebViewBaseSizeAllocate):
1215         (webkitWebViewBaseDidRelaunchWebProcess):
1216         (webkitWebViewBasePageClosed):
1217         * UIProcess/API/wpe/PageClientImpl.cpp:
1218         (WebKit::PageClientImpl::createDrawingAreaProxy):
1219         * UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
1220         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
1221         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
1222         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
1223         (WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
1224         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
1225         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
1226         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
1227         (WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
1228         (WebKit::DrawingAreaProxyCoordinatedGraphics::update):
1229         (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
1230         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
1231         (WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
1232         (WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
1233         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
1234         (WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
1235         (WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
1236         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
1237         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
1238         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
1239         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
1240         (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
1241         (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
1242         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
1243         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
1244         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
1245         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
1246         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
1247         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
1248         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
1249         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
1250         * UIProcess/DrawingAreaProxyImpl.cpp: Removed.
1251         * UIProcess/DrawingAreaProxyImpl.h: Removed.
1252         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
1253         (WebKit::AcceleratedBackingStoreX11::update):
1254         * UIProcess/win/PageClientImpl.cpp:
1255         (WebKit::PageClientImpl::createDrawingAreaProxy):
1256         * UIProcess/win/WebView.cpp:
1257         (WebKit::WebView::paint):
1258         * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
1259         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
1260         (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
1261         (WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
1262         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
1263         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
1264         (WebKit::DrawingAreaCoordinatedGraphics::scroll):
1265         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
1266         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
1267         (WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
1268         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
1269         (WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
1270         (WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
1271         (WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
1272         (WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
1273         (WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
1274         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
1275         (WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
1276         (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
1277         (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
1278         (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
1279         (WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
1280         (WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
1281         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
1282         (WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
1283         (WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
1284         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
1285         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
1286         (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
1287         (WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
1288         (WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
1289         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
1290         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
1291         (WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
1292         (WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
1293         (WebKit::DrawingAreaCoordinatedGraphics::display):
1294         (WebKit::shouldPaintBoundsRect):
1295         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
1296         * WebProcess/WebPage/DrawingArea.cpp:
1297         (WebKit::DrawingArea::create):
1298         * WebProcess/WebPage/DrawingArea.h:
1299         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
1300         * WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
1301         * WebProcess/WebPage/DrawingAreaImpl.h: Removed.
1302
1303 2019-03-03  Zalan Bujtas  <zalan@apple.com>
1304
1305         [ContentChangeObserver] Content observation should be limited to the current document.
1306         https://bugs.webkit.org/show_bug.cgi?id=195256
1307         <rdar://problem/48544402>
1308
1309         Reviewed by Simon Fraser.
1310
1311         * WebProcess/WebPage/WebPage.h:
1312         * WebProcess/WebPage/ios/WebPageIOS.mm:
1313         (WebKit::WebPage::handleSyntheticClick):
1314         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1315         (WebKit::WebPage::completeSyntheticClick):
1316         (WebKit::WebPage::handleTap):
1317         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1318         (WebKit::WebPage::commitPotentialTap):
1319
1320 2019-03-03  Tim Horton  <timothy_horton@apple.com>
1321
1322         Rid the world of WK_API_ENABLED
1323         https://bugs.webkit.org/show_bug.cgi?id=195263
1324
1325         Reviewed by Dan Bernstein.
1326
1327         List of changed files elided because it's useless.
1328
1329 2019-03-03  Jiewen Tan  <jiewen_tan@apple.com>
1330
1331         Add a WebViewDidMoveToWindowObserver for WKWebView
1332         https://bugs.webkit.org/show_bug.cgi?id=195223
1333         <rdar://problem/48520161>
1334
1335         Reviewed by Darin Adler.
1336
1337         The load optimizer would only allow itself to optimize loads whenever the web view
1338         who owns the page is (visible && focused), otherwises it will wait until the web view
1339         becomes (visible && focused). Therefore, we need a way to notify the load optimizer
1340         changes of statuses.
1341
1342         * UIProcess/API/Cocoa/WKWebView.mm:
1343         (-[WKWebView didMoveToWindow]):
1344         * UIProcess/Cocoa/WebViewImpl.mm:
1345         (WebKit::WebViewImpl::viewDidMoveToWindow):
1346         * UIProcess/WebPageProxy.cpp:
1347         (WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
1348         (WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
1349         (WebKit::WebPageProxy::webViewDidMoveToWindow):
1350         * UIProcess/WebPageProxy.h:
1351         * UIProcess/WebViewDidMoveToWindowObserver.h: Added.
1352         * WebKit.xcodeproj/project.pbxproj:
1353
1354 2019-03-03  Andy Estes  <aestes@apple.com>
1355
1356         [Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
1357         https://bugs.webkit.org/show_bug.cgi?id=195219
1358         <rdar://problem/48518082>
1359
1360         Reviewed by Darin Adler.
1361
1362         Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
1363         WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.
1364
1365         In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.
1366
1367         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1368         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
1369         m_webPageProxy with m_client.
1370         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
1371         (WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
1372         IPC::MessageSender via m_client.
1373         (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
1374         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
1375         m_webPageProxy with m_client.
1376         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
1377         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
1378         MessageSender::send rather than going through m_webPageProxy.
1379         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
1380         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
1381         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
1382         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
1383         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
1384         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
1385         changed m_webPageProxy to m_client.
1386         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
1387         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1388         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
1389         m_webPageProxy with m_client.
1390         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
1391         (WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
1392         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
1393         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
1394         with m_client.
1395         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1396         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
1397         * UIProcess/AuxiliaryProcessProxy.h:
1398         (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
1399         * UIProcess/WebPageProxy.cpp:
1400         (WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
1401         (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
1402         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
1403         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
1404         (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
1405         * UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
1406         * UIProcess/ios/WebPageProxyIOS.mm:
1407         (WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
1408         (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
1409         * UIProcess/mac/WebPageProxyMac.mm:
1410         (WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
1411         * WebKit.xcodeproj/project.pbxproj:
1412
1413 2019-03-03  Tim Horton  <timothy_horton@apple.com>
1414
1415         Remove some more unused 32-bit code
1416         https://bugs.webkit.org/show_bug.cgi?id=195255
1417
1418         Reviewed by Darin Adler.
1419
1420         * Platform/Module.cpp:
1421         (WebKit::Module::Module):
1422         * Platform/Module.h:
1423         * Platform/cf/ModuleCF.cpp:
1424         (WebKit::Module::unload):
1425         (WebKit::Module::bundleResourceMap): Deleted.
1426         * PluginProcess/mac/PluginProcessMac.mm:
1427         (WebKit::initializeShim):
1428         (WebKit::PluginProcess::platformInitializeProcess):
1429         (WebKit::shouldCallRealDebugger): Deleted.
1430         (WebKit::isWindowActive): Deleted.
1431         (WebKit::getCurrentEventButtonState): Deleted.
1432         (WebKit::carbonWindowShown): Deleted.
1433         (WebKit::carbonWindowHidden): Deleted.
1434         (WebKit::openCFURLRef): Deleted.
1435         (WebKit::isMallocTinyMemoryTag): Deleted.
1436         (WebKit::shouldMapMemoryExecutable): Deleted.
1437         * PluginProcess/mac/PluginProcessShim.h:
1438         * PluginProcess/mac/PluginProcessShim.mm:
1439         (WebKit::shimDebugger): Deleted.
1440         (WebKit::shimGetCurrentEventButtonState): Deleted.
1441         (WebKit::shimIsWindowActive): Deleted.
1442         (WebKit::shimModalDialog): Deleted.
1443         (WebKit::shimAlert): Deleted.
1444         (WebKit::shimShowWindow): Deleted.
1445         (WebKit::shimHideWindow): Deleted.
1446         (WebKit::shimLSOpenCFURLRef): Deleted.
1447         (WebKit::shimMachVMMap): Deleted.
1448         * Shared/API/Cocoa/WKFoundation.h:
1449         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1450         (WebKit::XPCServiceMain):
1451         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1452         (WebKit::NetscapePluginModule::tryLoad):
1453         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1454         (WebKit::getPluginArchitecture):
1455         (WebKit::NetscapePluginModule::determineQuirks):
1456         * Shared/Plugins/PluginQuirks.h:
1457         * Shared/cf/ArgumentCodersCF.cpp:
1458         (IPC::sizeForNumberType):
1459         * Shared/mac/WebEventFactory.mm:
1460         (WebKit::mouseButtonForEvent):
1461         (WebKit::globalPointForEvent):
1462         (WebKit::pointForEvent):
1463         (WebKit::WebEventFactory::createWebMouseEvent):
1464         * UIProcess/API/C/mac/WKPagePrivateMac.h:
1465         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1466         (WKPageLoadFileReturningNavigation):
1467         * UIProcess/Cocoa/WebViewImpl.mm:
1468         (WebKit::WebViewImpl::pressureChangeWithEvent):
1469         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
1470         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
1471         * UIProcess/mac/ServicesController.mm:
1472         (WebKit::ServicesController::ServicesController):
1473         * UIProcess/mac/WebContextMenuProxyMac.mm:
1474         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
1475         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1476         (WebKit::NPN_GetValue):
1477         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1478         (WebKit::NetscapePlugin::NetscapePlugin):
1479         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1480         (WebKit::NetscapePlugin::isWindowActive const): Deleted.
1481         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1482         (WebKit::NetscapePlugin::setDrawingModel):
1483         (WebKit::NetscapePlugin::setEventModel):
1484         (WebKit::NetscapePlugin::platformPostInitialize):
1485         (WebKit::NetscapePlugin::platformDestroy):
1486         (WebKit::NetscapePlugin::platformGeometryDidChange):
1487         (WebKit::NetscapePlugin::platformPaint):
1488         (WebKit::NetscapePlugin::platformHandleMouseEvent):
1489         (WebKit::NetscapePlugin::platformHandleWheelEvent):
1490         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
1491         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
1492         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
1493         (WebKit::NetscapePlugin::platformSetFocus):
1494         (WebKit::NetscapePlugin::windowFocusChanged):
1495         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
1496         (WebKit::NetscapePlugin::sendComplexTextInput):
1497         (): Deleted.
1498         (WebKit::windowMap): Deleted.
1499         (WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
1500         (WebKit::NetscapePlugin::windowRef const): Deleted.
1501         (WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
1502         (WebKit::NetscapePlugin::buttonState): Deleted.
1503         (WebKit::initializeEventRecord): Deleted.
1504         (WebKit::anyMouseButtonIsDown): Deleted.
1505         (WebKit::rightMouseButtonIsDown): Deleted.
1506         (WebKit::modifiersForEvent): Deleted.
1507         (WebKit::convertStringToKeyCodes): Deleted.
1508         (WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
1509         (WebKit::NetscapePlugin::nullEventTimerFired): Deleted.
1510
1511 2019-03-02  Zalan Bujtas  <zalan@apple.com>
1512
1513         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
1514         https://bugs.webkit.org/show_bug.cgi?id=195252
1515         <rdar://problem/48539446>
1516
1517         Reviewed by Simon Fraser.
1518
1519         * WebProcess/WebPage/ios/WebPageIOS.mm:
1520         (WebKit::WebPage::handleSyntheticClick):
1521
1522 2019-03-02  Tim Horton  <timothy_horton@apple.com>
1523
1524         Move EditingRange <-> Range methods to EditingRange instead of WebPage
1525         https://bugs.webkit.org/show_bug.cgi?id=195201
1526
1527         Reviewed by Sam Weinig.
1528
1529         * Shared/EditingRange.h:
1530         * Shared/EditingRange.cpp:
1531         Also, modernize the coders.
1532
1533         * Sources.txt:
1534         * WebKit.xcodeproj/project.pbxproj:
1535         * WebProcess/WebPage/WebPage.cpp:
1536         (WebKit::WebPage::insertTextAsync):
1537         (WebKit::WebPage::getMarkedRangeAsync):
1538         (WebKit::WebPage::getSelectedRangeAsync):
1539         (WebKit::WebPage::characterIndexForPointAsync):
1540         (WebKit::WebPage::firstRectForCharacterRangeAsync):
1541         (WebKit::WebPage::setCompositionAsync):
1542         (WebKit::WebPage::rangeFromEditingRange): Deleted.
1543         * WebProcess/WebPage/mac/WebPageMac.mm:
1544         (WebKit::WebPage::insertDictatedTextAsync):
1545         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
1546
1547 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1548
1549         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
1550         https://bugs.webkit.org/show_bug.cgi?id=195053
1551         <rdar://problem/48134710>
1552
1553         Reviewed by Ryosuke Niwa.
1554
1555         Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
1556         document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
1557         UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
1558         process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
1559         items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
1560         pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
1561         immediately invoke the programmatic paste handler.
1562
1563         * Scripts/webkit/messages.py:
1564         * UIProcess/API/gtk/PageClientImpl.cpp:
1565         (WebKit::PageClientImpl::requestDOMPasteAccess):
1566         * UIProcess/API/gtk/PageClientImpl.h:
1567         * UIProcess/API/wpe/PageClientImpl.cpp:
1568         (WebKit::PageClientImpl::requestDOMPasteAccess):
1569         * UIProcess/API/wpe/PageClientImpl.h:
1570         * UIProcess/PageClient.h:
1571         * UIProcess/WebPageProxy.cpp:
1572         (WebKit::WebPageProxy::requestDOMPasteAccess):
1573         * UIProcess/WebPageProxy.h:
1574         * UIProcess/WebPageProxy.messages.in:
1575
1576         Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
1577
1578         * UIProcess/ios/PageClientImplIOS.h:
1579         * UIProcess/ios/PageClientImplIOS.mm:
1580         (WebKit::PageClientImpl::requestDOMPasteAccess):
1581         * UIProcess/ios/WKContentViewInteraction.h:
1582         * UIProcess/ios/WKContentViewInteraction.mm:
1583         (-[WKContentView cleanupInteraction]):
1584         (-[WKContentView resignFirstResponderForWebView]):
1585         (-[WKContentView _webTouchEventsRecognized:]):
1586         (-[WKContentView _willHideMenu:]):
1587         (-[WKContentView pasteForWebView:]):
1588         (-[WKContentView _handleDOMPasteRequestWithResult:]):
1589         (-[WKContentView _willPerformAction:sender:]):
1590         (-[WKContentView _didPerformAction:sender:]):
1591         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
1592         (allPasteboardItemOriginsMatchOrigin):
1593         (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
1594         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
1595
1596         Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
1597         this happens, we only grant access for the current paste command, rather than granting access for the user
1598         gesture token.
1599
1600         * UIProcess/mac/PageClientImplMac.h:
1601         * UIProcess/win/PageClientImpl.cpp:
1602         (WebKit::PageClientImpl::requestDOMPasteAccess):
1603         * UIProcess/win/PageClientImpl.h:
1604         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1605         (WebKit::WebEditorClient::requestDOMPasteAccess):
1606         * WebProcess/WebCoreSupport/WebEditorClient.h:
1607         * WebProcess/WebPage/WebPage.cpp:
1608         (WebKit::WebPage::requestDOMPasteAccess):
1609         * WebProcess/WebPage/WebPage.h:
1610
1611 2019-02-27  Darin Adler  <darin@apple.com>
1612
1613         Fixed makeString(float) to do shortest-form serialization without first converting to double
1614         https://bugs.webkit.org/show_bug.cgi?id=195142
1615
1616         Reviewed by Daniel Bates.
1617
1618         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.
1619
1620 2019-03-02  Adrian Perez de Castro  <aperez@igalia.com>
1621
1622         [WPE] Public API headers are missing autocleanup definitions
1623         https://bugs.webkit.org/show_bug.cgi?id=195211
1624
1625         Reviewed by Philippe Normand.
1626
1627         * PlatformWPE.cmake: List new API headers as installable.
1628         * UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
1629         port, adapted to fit the WPE port.
1630         * UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
1631         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
1632         from the equivalent header of the GTK port.
1633         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
1634         WebKitWebExtensionAutocleanups.h
1635
1636 2019-03-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1637
1638         Remove unused WebPageProxy::m_navigationID
1639         https://bugs.webkit.org/show_bug.cgi?id=195209
1640
1641         Reviewed by Darin Adler.
1642
1643         WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
1644         debug LOG(). It must be a refactoring mistake.
1645
1646         * UIProcess/WebPageProxy.cpp:
1647         (WebKit::WebPageProxy::didCommitLoadForFrame):
1648         * UIProcess/WebPageProxy.h:
1649
1650 2019-03-01  Darin Adler  <darin@apple.com>
1651
1652         Finish removing String::format
1653         https://bugs.webkit.org/show_bug.cgi?id=194893
1654
1655         Reviewed by Daniel Bates.
1656
1657         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1658         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
1659         a problem where we passed an NSData * to format with a "%s"."
1660
1661 2019-03-01  Chris Dumez  <cdumez@apple.com>
1662
1663         Unreviewed Windows build fix after r242302.
1664
1665         * UIProcess/WebProcessPool.cpp:
1666         (WebKit::WebProcessPool::ensureNetworkProcess):
1667
1668 2019-03-01  Alex Christensen  <achristensen@webkit.org>
1669
1670         NetworkDataTask redirection should not keep alive its NetworkSession
1671         https://bugs.webkit.org/show_bug.cgi?id=194927
1672
1673         Reviewed by Darin Adler.
1674
1675         This should fix rdar://problem/47580502
1676
1677         * NetworkProcess/NetworkDataTask.h:
1678         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1679         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1680
1681 2019-03-01  Alex Christensen  <achristensen@webkit.org>
1682
1683         Revert r241223, r241235, and r241287
1684         https://bugs.webkit.org/show_bug.cgi?id=194427
1685         <rdar://48045861>
1686
1687         This caused crashes, and feature design has evolved away from needing the daemon in this form.
1688
1689         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
1690         (WebKit::DaemonMain):
1691         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
1692         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1693         (WebKit::XPCServiceEventHandler):
1694         (WebKit::XPCServiceMain):
1695         (WebKit::XPCEventHandler): Deleted.
1696         (WebKit::XPCInitializationHandler): Deleted.
1697         * UIProcess/API/APIProcessPoolConfiguration.h:
1698         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1699         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1700         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
1701         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
1702         * UIProcess/AuxiliaryProcessProxy.cpp:
1703         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
1704         * UIProcess/Launcher/ProcessLauncher.h:
1705         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1706         (WebKit::serviceName):
1707         (WebKit::ProcessLauncher::launchProcess):
1708         * UIProcess/Network/NetworkProcessProxy.cpp:
1709         (WebKit::NetworkProcessProxy::getLaunchOptions):
1710         * UIProcess/WebProcessPool.cpp:
1711         (WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
1712         * UIProcess/WebProcessPool.h:
1713
1714 2019-03-01  Alex Christensen  <achristensen@webkit.org>
1715
1716         Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
1717         https://bugs.webkit.org/show_bug.cgi?id=195229
1718         <rdar://problem/48520362>
1719
1720         Reviewed by Chris Dumez.
1721
1722         Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
1723         but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.
1724
1725         Functionality verified by manual testing.  See radar.
1726         Added an API test that verifies the setter restrictions work as expected.
1727
1728         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1729         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
1730         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
1731         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
1732         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
1733         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1734         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1735         (WebKit::toPKPaymentRequest):
1736         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1737         (WebKit::WebsiteDataStore::parameters):
1738         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1739         (WebKit::WebsiteDataStore::WebsiteDataStore):
1740         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
1741         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
1742         * UIProcess/WebsiteData/WebsiteDataStore.h:
1743         (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
1744         (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):
1745
1746 2019-03-01  Antoine Quint  <graouts@apple.com>
1747
1748         [iOS] Turn mouse event simulation on by default
1749         https://bugs.webkit.org/show_bug.cgi?id=195218
1750         <rdar://problem/48516794>
1751
1752         Reviewed by Dean Jackson.
1753
1754         * Shared/WebPreferences.yaml:
1755
1756 2019-03-01  Ross Kirsling  <ross.kirsling@sony.com>
1757
1758         EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
1759         https://bugs.webkit.org/show_bug.cgi?id=194612
1760
1761         Reviewed by Alex Christensen.
1762
1763         This API test really shouldn't be verifying that the actual environment was successfully modified.
1764
1765         At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
1766         simple functions -- one for string processing, one for environment processing -- the API test only needs to
1767         worry about the former.
1768
1769         * Platform/unix/EnvironmentUtilities.cpp:
1770         (WebKit::EnvironmentUtilities::stripEntriesEndingWith):
1771         (WebKit::EnvironmentUtilities::removeValuesEndingWith):
1772         (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
1773         * Platform/unix/EnvironmentUtilities.h:
1774         Replace old function with a pair of simpler ones.
1775
1776         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
1777         (NetworkServiceInitializer):
1778         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
1779         (PluginServiceInitializer):
1780         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
1781         (WebContentServiceInitializer):
1782         Update function name.
1783
1784 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
1785
1786         Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
1787         https://bugs.webkit.org/show_bug.cgi?id=194844
1788
1789         Reviewed by Youenn Fablet.
1790
1791         Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
1792         append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
1793         a crash in Windows when running a Service Worker.
1794
1795         * UIProcess/API/APIWebsiteDataStore.cpp:
1796         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
1797         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1798         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1799         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
1800         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
1801         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1802         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
1803         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
1804         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
1805         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
1806
1807 2019-03-01  John Wilander  <wilander@apple.com>
1808
1809         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
1810         https://bugs.webkit.org/show_bug.cgi?id=195196
1811         <rdar://problem/48006419>
1812
1813         Reviewed by Brent Fulgham.
1814
1815         Trackers abuse link query parameters to transport user identifiers cross-site.
1816         This patch detects such navigations and applies further restrictions to
1817         client-site cookies on the destination page.
1818
1819         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1820         (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
1821         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
1822             Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
1823         * NetworkProcess/NetworkConnectionToWebProcess.h:
1824         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1825         * NetworkProcess/NetworkProcess.cpp:
1826         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
1827             Reporting IPC message when a link decorated cross-site navigation happens.
1828         (WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
1829         * NetworkProcess/NetworkProcess.h:
1830         * NetworkProcess/NetworkProcess.messages.in:
1831         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1832         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1833             Added clearing of the new state between test runs.
1834         * UIProcess/Network/NetworkProcessProxy.cpp:
1835         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
1836             Test infrastructure.
1837         * UIProcess/Network/NetworkProcessProxy.h:
1838         * UIProcess/WebPageProxy.cpp:
1839         (WebKit::isNonUniqueNavigationWithLinkDecoration):
1840             Convenience function.
1841         (WebKit::WebPageProxy::didCommitLoadForFrame):
1842             This function now reports to the network process when a link decorated
1843             cross-site navigation happens.
1844         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1845         (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
1846             Test infrastructure.
1847         * UIProcess/WebsiteData/WebsiteDataStore.h:
1848         * WebProcess/WebPage/WebPage.cpp:
1849         (WebKit::WebPage::close):
1850             Name change of function called.
1851
1852 2019-03-01  Tim Horton  <timothy_horton@apple.com>
1853
1854         Remove unused code in WebKitLegacy
1855         https://bugs.webkit.org/show_bug.cgi?id=189614
1856
1857         Reviewed by Simon Fraser.
1858
1859         * mac/MigrateHeadersFromWebKitLegacy.make:
1860
1861 2019-03-01  Tim Horton  <timothy_horton@apple.com>
1862
1863         Modernize WebKit::AttributedString a little bit
1864         https://bugs.webkit.org/show_bug.cgi?id=195200
1865
1866         Reviewed by Wenson Hsieh.
1867
1868         * Shared/mac/AttributedString.h:
1869         (WebKit::AttributedString::AttributedString):
1870         (WebKit::AttributedString::operator NSAttributedString * const):
1871         * Shared/mac/AttributedString.mm:
1872         (IPC::ArgumentCoder<WebKit::AttributedString>::encode):
1873         (IPC::ArgumentCoder<WebKit::AttributedString>::decode):
1874         (WebKit::AttributedString::encode const): Deleted.
1875         (WebKit::AttributedString::decode): Deleted.
1876         * UIProcess/Cocoa/WebViewImpl.mm:
1877         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
1878         * WebProcess/WebPage/mac/WebPageMac.mm:
1879         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
1880         Modern coders, and a constructor and cast operator to/from NSAttributedString.
1881         Also adopt those in a few places just for fun.
1882
1883 2019-03-01  Youenn Fablet  <youenn@apple.com>
1884
1885         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
1886         https://bugs.webkit.org/show_bug.cgi?id=195213
1887
1888         Reviewed by Alex Christensen.
1889
1890         Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.
1891
1892         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1893         (WebKit::WebIDBConnectionToClient::putOrAdd):
1894         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
1895         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1896         * Scripts/webkit/messages.py:
1897         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1898         (WebKit::WebIDBConnectionToServer::putOrAdd):
1899
1900 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
1901
1902         [WinCairo] Enable service worker
1903         https://bugs.webkit.org/show_bug.cgi?id=188318
1904
1905         Reviewed by Youenn Fablet.
1906
1907         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1908         (WebKit::WebSWContextManagerConnection::terminateProcess):
1909         * WebProcess/Storage/WebSWContextManagerConnection.h:
1910         * config.h:
1911
1912 2019-03-01  Chris Dumez  <cdumez@apple.com>
1913
1914         Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
1915         https://bugs.webkit.org/show_bug.cgi?id=195110
1916
1917         Reviewed by Ryosuke Niwa.
1918
1919         The test was attempting to disable PageCache via view preferences instead of using the
1920         process pool configuration flag. This would fail to disable PageCache because the
1921         usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
1922         As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
1923         objects would get destroyed, which would lead to flakiness.
1924
1925         This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
1926         pages proxies when the usesPageCache preference is set to false.
1927
1928         * UIProcess/WebPageProxy.cpp:
1929         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1930
1931 2019-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1932
1933         [ThreadedCompositor] Simply the compositing run loop worker thread
1934         https://bugs.webkit.org/show_bug.cgi?id=195208
1935
1936         Reviewed by Don Olmstead.
1937
1938         We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
1939         process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
1940         so that the implementation is not specific to the generic WorkQueue implementation.
1941
1942         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1943         (WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
1944         (WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
1945         (WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
1946         (WebKit::CompositingRunLoop::performTask): Use m_runLoop.
1947         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
1948         (WebKit::WorkQueuePool::singleton): Deleted.
1949         (WebKit::WorkQueuePool::dispatch): Deleted.
1950         (WebKit::WorkQueuePool::runLoop): Deleted.
1951         (WebKit::WorkQueuePool::invalidate): Deleted.
1952         (WebKit::WorkQueuePool::WorkQueuePool): Deleted.
1953         (WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
1954         (): Deleted.
1955         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1956
1957 2019-03-01  Justin Fan  <justin_fan@apple.com>
1958
1959         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
1960         https://bugs.webkit.org/show_bug.cgi?id=195191
1961
1962         Rubber-stamped by Dean Jackson.
1963
1964         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
1965
1966         * Configurations/FeatureDefines.xcconfig:
1967
1968 2019-02-28  Chris Dumez  <cdumez@apple.com>
1969
1970         HTTPSUpgradeList.db database should be opened in readonly mode
1971         https://bugs.webkit.org/show_bug.cgi?id=195194
1972         <rdar://problem/47103889>
1973
1974         Reviewed by Youenn Fablet.
1975
1976         HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
1977         modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.
1978
1979         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
1980         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
1981
1982 2019-02-28  David Quesada  <david_quesada@apple.com>
1983
1984         Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
1985         https://bugs.webkit.org/show_bug.cgi?id=195121
1986         rdar://problem/48450302
1987
1988         Reviewed by Alex Christensen.
1989
1990         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1991         (-[WKNavigationAction _shouldPerformDownload]):
1992         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1993
1994 2019-02-28  Antoine Quint  <graouts@apple.com>
1995
1996         Disable Web Animations in Safari Technology Preview
1997         https://bugs.webkit.org/show_bug.cgi?id=194748
1998         <rdar://problem/48139481>
1999
2000         Reviewed by Dean Jackson.
2001
2002         The test runners already opt into that feature explicitly, so all that is needed is to turn
2003         the default setting value to false.
2004
2005         * Shared/WebPreferences.yaml:
2006
2007 2019-02-28  Antoine Quint  <graouts@apple.com>
2008
2009         Enable the Pointer Events runtime flag by default
2010         https://bugs.webkit.org/show_bug.cgi?id=195156
2011
2012         Reviewed by Dean Jackson.
2013
2014         * Shared/WebPreferences.yaml:
2015
2016 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
2017
2018         Revert r232263: it caused processes to crash because process was suspended with locked file
2019         https://bugs.webkit.org/show_bug.cgi?id=195122
2020         <rdar://problem/48444599>
2021
2022         Reviewed by Geoffrey Garen.
2023
2024         * NetworkProcess/NetworkProcess.cpp:
2025         (WebKit::NetworkProcess::NetworkProcess):
2026         * NetworkProcess/NetworkProcess.h:
2027         * Shared/WebSQLiteDatabaseTracker.cpp:
2028         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2029         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2030         * Shared/WebSQLiteDatabaseTracker.h:
2031         * WebProcess/WebProcess.cpp:
2032         (WebKit::m_webSQLiteDatabaseTracker):
2033         (WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
2034         * WebProcess/WebProcess.h:
2035
2036 2019-02-28  Per Arne Vollan  <pvollan@apple.com>
2037
2038         [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
2039         https://bugs.webkit.org/show_bug.cgi?id=193683
2040         <rdar://problem/47634345>
2041
2042         Reviewed by Brent Fulgham.
2043
2044         When a keyboard is attached/deattached or the application becomes foreground, send a message from
2045         the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
2046         cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
2047         to be expensive.
2048
2049         * UIProcess/API/Cocoa/WKWebView.mm:
2050         (hardwareKeyboardAvailabilityChangedCallback):
2051         * UIProcess/WebPageProxy.h:
2052         * UIProcess/WebProcessProxy.h:
2053         (WebKit::WebProcessProxy::setKeyboardIsAttached):
2054         (WebKit::WebProcessProxy::keyboardIsAttached const):
2055         * UIProcess/ios/WKContentViewInteraction.mm:
2056         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2057         * UIProcess/ios/WebPageProxyIOS.mm:
2058         (WebKit::WebPageProxy::applicationWillEnterForeground):
2059         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
2060         * WebProcess/WebPage/WebPage.h:
2061         * WebProcess/WebPage/WebPage.messages.in:
2062         * WebProcess/WebPage/ios/WebPageIOS.mm:
2063         (WebKit::WebPage::platformEditorState const):
2064         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
2065
2066 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2067
2068         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
2069         https://bugs.webkit.org/show_bug.cgi?id=195159
2070
2071         Reviewed by Don Olmstead.
2072
2073         Use COORDINATED_GRAPHICS instead.
2074
2075         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2076         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
2077         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2078         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
2079         * Shared/CoordinatedGraphics/SimpleViewportController.h:
2080         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2081         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2082         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2083         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2084         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
2085         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
2086         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2087         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
2088         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
2089         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
2090         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
2091         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2092         (WebKit::DrawingAreaImpl::updatePreferences):
2093         * WebProcess/WebPage/WebPage.cpp:
2094         (WebKit::WebPage::sendViewportAttributesChanged):
2095         (WebKit::WebPage::viewportPropertiesDidChange):
2096         * WebProcess/gtk/WebProcessMainGtk.cpp:
2097
2098 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
2099
2100         Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
2101         https://bugs.webkit.org/show_bug.cgi?id=194958
2102
2103         Reviewed by Geoffrey Garen.
2104
2105         ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.
2106
2107         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2108         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2109         * UIProcess/API/APIWebsiteDataStore.cpp:
2110         (API::WebsiteDataStore::createLegacy):
2111         (API::indexedDBDatabaseDirectory):
2112         * UIProcess/API/APIWebsiteDataStore.h:
2113         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2114         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
2115         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2116         * UIProcess/WebProcessPool.cpp:
2117         (WebKit::legacyWebsiteDataStoreConfiguration):
2118
2119 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2120
2121         [CoordinatedGraphics] Unify all LayerTreeHost classes
2122         https://bugs.webkit.org/show_bug.cgi?id=195094
2123
2124         Reviewed by Žan Doberšek.
2125
2126         There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
2127         ports.
2128
2129         * PlatformWin.cmake:
2130         * SourcesGTK.txt:
2131         * SourcesWPE.txt:
2132         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2133         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
2134         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
2135         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2136         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
2137         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
2138         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
2139         (WebKit::LayerTreeHost::LayerTreeHost):
2140         (WebKit::LayerTreeHost::~LayerTreeHost):
2141         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
2142         (WebKit::LayerTreeHost::scheduleLayerFlush):
2143         (WebKit::LayerTreeHost::cancelPendingLayerFlush):
2144         (WebKit::LayerTreeHost::layerFlushTimerFired):
2145         (WebKit::LayerTreeHost::setRootCompositingLayer):
2146         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
2147         (WebKit::LayerTreeHost::invalidate):
2148         (WebKit::LayerTreeHost::scrollNonCompositedContents):
2149         (WebKit::LayerTreeHost::forceRepaint):
2150         (WebKit::LayerTreeHost::forceRepaintAsync):
2151         (WebKit::LayerTreeHost::sizeDidChange):
2152         (WebKit::LayerTreeHost::pauseRendering):
2153         (WebKit::LayerTreeHost::resumeRendering):
2154         (WebKit::LayerTreeHost::graphicsLayerFactory):
2155         (WebKit::LayerTreeHost::contentsSizeChanged):
2156         (WebKit::LayerTreeHost::didChangeViewportAttributes):
2157         (WebKit::LayerTreeHost::didChangeViewport):
2158         (WebKit::LayerTreeHost::setIsDiscardable):
2159         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
2160         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
2161         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
2162         (WebKit::LayerTreeHost::didFlushRootLayer):
2163         (WebKit::LayerTreeHost::commitSceneState):
2164         (WebKit::LayerTreeHost::frameComplete):
2165         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
2166         (WebKit::LayerTreeHost::didDestroyGLContext):
2167         (WebKit::LayerTreeHost::willRenderFrame):
2168         (WebKit::LayerTreeHost::didRenderFrame):
2169         (WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
2170         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
2171         (WebKit::LayerTreeHost::renderNextFrame):
2172         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
2173         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2174         (WebKit::DrawingAreaImpl::setNeedsDisplay):
2175         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
2176         * WebProcess/WebPage/LayerTreeHost.cpp: Removed.
2177         * WebProcess/WebPage/LayerTreeHost.h: Removed.
2178         * WebPage/win/LayerTreeHost.h: Added.
2179
2180 2019-02-28  Justin Fan  <justin_fan@apple.com>
2181
2182         [Web GPU] Enable Web GPU only on 64-bit
2183         https://bugs.webkit.org/show_bug.cgi?id=195139
2184
2185         Because Metal is only supported on 64 bit apps.
2186
2187         Unreviewed build fix.
2188
2189         * Configurations/FeatureDefines.xcconfig:
2190
2191 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
2192
2193         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
2194
2195         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2196         (WebKit::LocalAuthenticator::getAssertion):
2197
2198 2019-02-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2199
2200         Unreviewed, fix -Wformat warning
2201
2202         * WebProcess/WebPage/WebPage.cpp:
2203         (WebKit::WebPage::didCompletePageTransition):
2204
2205 2019-02-27  Brent Fulgham  <bfulgham@apple.com>
2206
2207         REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
2208         https://bugs.webkit.org/show_bug.cgi?id=195072
2209
2210         Reviewed by Ryosuke Niwa.
2211
2212         ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
2213         the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
2214         a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
2215         was disconnected), just like we do for other message send cases.
2216
2217         This patch switches from using the m_networkProcessConnection member (which might be null) to use the
2218         'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
2219
2220         * WebProcess/WebProcess.cpp:
2221         (WebKit::WebProcess::initializeWebProcess):
2222
2223 2019-02-27  Chris Dumez  <cdumez@apple.com>
2224
2225         Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
2226         https://bugs.webkit.org/show_bug.cgi?id=194480
2227
2228         Reviewed by Brady Eidson.
2229
2230         The StorageManager would only start listening for IPC on a given connection when
2231         StorageManager::processWillOpenConnection() is called. This gets called from
2232         WebsiteDataStore::webProcessWillOpenConnection() which gets called from
2233         WebProcessLifetimeTracker::webPageEnteringWebProcess().
2234
2235         webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
2236         after process-swapping. This means that IPC comming from the *provisional* process
2237         would not get processed and we would only start processing IPC on the provisional
2238         process's connection when it would get committed.
2239
2240         To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
2241         now have several processes. We also make sure that webPageEnteringWebProcess() gets
2242         called for the provisional process as soon as we create the provisional page, instead
2243         of waiting for it to get committed.
2244
2245         * UIProcess/ProvisionalPageProxy.cpp:
2246         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
2247         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
2248         (WebKit::ProvisionalPageProxy::connectionWillOpen):
2249         * UIProcess/ProvisionalPageProxy.h:
2250         * UIProcess/WebPageProxy.cpp:
2251         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2252         (WebKit::WebPageProxy::connectionWillOpen):
2253         (WebKit::WebPageProxy::webProcessWillShutDown):
2254         (WebKit::WebPageProxy::processDidTerminate):
2255         * UIProcess/WebPageProxy.h:
2256         (WebKit::WebPageProxy::webProcessLifetimeTracker):
2257         * UIProcess/WebProcessLifetimeObserver.cpp:
2258         (WebKit::WebProcessLifetimeObserver::addWebPage):
2259         (WebKit::WebProcessLifetimeObserver::removeWebPage):
2260         * UIProcess/WebProcessLifetimeObserver.h:
2261         * UIProcess/WebProcessLifetimeTracker.cpp:
2262         (WebKit::WebProcessLifetimeTracker::addObserver):
2263         (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
2264         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
2265         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
2266         (WebKit::WebProcessLifetimeTracker::processIsRunning):
2267         * UIProcess/WebProcessLifetimeTracker.h:
2268         * UIProcess/WebProcessProxy.cpp:
2269         (WebKit::WebProcessProxy::connectionWillOpen):
2270         * UIProcess/WebStorage/StorageManager.cpp:
2271         (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
2272         (WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
2273         (WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
2274         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
2275         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
2276         (WebKit::StorageManager::processWillOpenConnection):
2277         (WebKit::StorageManager::processDidCloseConnection):
2278         (WebKit::StorageManager::createSessionStorageMap):
2279         (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
2280         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
2281         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
2282         * UIProcess/WebStorage/StorageManager.h:
2283         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2284         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
2285         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
2286
2287 2019-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2288
2289         [iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
2290         https://bugs.webkit.org/show_bug.cgi?id=195118
2291         <rdar://problem/43411940>
2292
2293         Reviewed by Tim Horton.
2294
2295         It's currently possible for websites to redirect focus into an editable element on the page by programmatically
2296         requesting focus within the "blur" event handler. This is because our current heuristics:
2297
2298         (1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
2299             the case where the page moves focus between different elements on the page.
2300         (2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
2301             the case where a focused element should show the keyboard when first responder is restored on a web view
2302             (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
2303             again).
2304
2305         In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
2306         becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
2307         by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
2308         focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.
2309
2310         To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
2311         before showing the keyboard due to activity state change or focused element change.
2312
2313         Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html
2314
2315         * UIProcess/ios/WKContentViewInteraction.h:
2316         * UIProcess/ios/WKContentViewInteraction.mm:
2317         (-[WKContentView setupInteraction]):
2318         (-[WKContentView textInputTraits]):
2319
2320         Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
2321         terminology used in WebKit.
2322
2323         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2324
2325         Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
2326         logic into a lambda function and using early returns. See above for more details.
2327
2328         (-[WKContentView _elementDidBlur]):
2329         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
2330
2331 2019-02-27  John Wilander  <wilander@apple.com>
2332
2333         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
2334         https://bugs.webkit.org/show_bug.cgi?id=195071
2335         <rdar://problem/48417690>
2336
2337         Reviewed by Alex Christensen and Brent Fulgham.
2338
2339         This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
2340         and makes the necessary infrastructure changes to support that.
2341
2342         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
2343         HashSets since we never used the counts for anything. This change simplified
2344         the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.
2345
2346         The patch also makes WebCore::RegistrableDomain's String constructor private.
2347         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
2348         is introduced to better signal to users that creating a registrable domain
2349         object with a string may create an object that doesn't match a registrable
2350         domain in a valid HTTP-family URL.
2351
2352         Finally, this patch harmonizes parameter and variable naming, going from
2353         "origin" to "domain" and "mainFrame" to "topFrame."
2354
2355         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2356         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
2357         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
2358         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
2359         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
2360         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
2361         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
2362         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
2363         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
2364         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
2365         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
2366         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
2367         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
2368         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
2369         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
2370         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
2371         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
2372         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
2373         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
2374         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
2375         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
2376         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
2377         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
2378         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2379         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2380         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
2381         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
2382         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
2383         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2384         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
2385         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
2386         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2387         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
2388         (WebKit::sortedPrevalentResourceTelemetry):
2389         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2390         * NetworkProcess/NetworkProcess.cpp:
2391         (WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
2392         (WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
2393         (WebKit::filterForRegistrableDomains):
2394         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2395         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2396         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
2397         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
2398         * NetworkProcess/NetworkProcess.h:
2399         * NetworkProcess/NetworkProcess.messages.in:
2400         * NetworkProcess/NetworkSession.cpp:
2401         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2402         * NetworkProcess/NetworkSession.h:
2403         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
2404         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
2405         * Shared/WebCoreArgumentCoders.cpp:
2406         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2407         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2408         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2409         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
2410         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
2411         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
2412         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2413         * UIProcess/Network/NetworkProcessProxy.cpp:
2414         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
2415         (WebKit::NetworkProcessProxy::isPrevalentResource):
2416         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
2417         (WebKit::NetworkProcessProxy::setPrevalentResource):
2418         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
2419         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
2420         (WebKit::NetworkProcessProxy::setLastSeen):
2421         (WebKit::NetworkProcessProxy::clearPrevalentResource):
2422         (WebKit::NetworkProcessProxy::logUserInteraction):
2423         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
2424         (WebKit::NetworkProcessProxy::clearUserInteraction):
2425         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
2426         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
2427         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
2428         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
2429         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
2430         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
2431         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
2432         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
2433         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
2434         (WebKit::NetworkProcessProxy::isGrandfathered):
2435         (WebKit::NetworkProcessProxy::setGrandfathered):
2436         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
2437         (WebKit::NetworkProcessProxy::hasStorageAccess):
2438         (WebKit::NetworkProcessProxy::requestStorageAccess):
2439         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
2440         (WebKit::NetworkProcessProxy::grantStorageAccess):
2441         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
2442         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
2443         * UIProcess/Network/NetworkProcessProxy.h:
2444         * UIProcess/Network/NetworkProcessProxy.messages.in:
2445         * UIProcess/WebPageProxy.cpp:
2446         (WebKit::WebPageProxy::requestStorageAccessConfirm):
2447         * UIProcess/WebPageProxy.h:
2448         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2449         (WebKit::WebsiteDataStore::isPrevalentResource):
2450         (WebKit::WebsiteDataStore::setPrevalentResource):
2451         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2452         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2453         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2454         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
2455         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2456         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
2457         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2458         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2459         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2460         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2461         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2462         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2463         (WebKit::WebsiteDataStore::clearPrevalentResource):
2464         (WebKit::WebsiteDataStore::setLastSeen):
2465         (WebKit::WebsiteDataStore::hasStorageAccess):
2466         (WebKit::WebsiteDataStore::requestStorageAccess):
2467         (WebKit::WebsiteDataStore::grantStorageAccess):
2468         (WebKit::WebsiteDataStore::logUserInteraction):
2469         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2470         (WebKit::WebsiteDataStore::clearUserInteraction):
2471         (WebKit::WebsiteDataStore::setGrandfathered):
2472         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
2473         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
2474         * UIProcess/WebsiteData/WebsiteDataStore.h:
2475         * WebProcess/WebPage/WebPage.cpp:
2476         (WebKit::WebPage::hasStorageAccess):
2477         (WebKit::WebPage::requestStorageAccess):
2478
2479 2019-02-27  Keith Rollin  <krollin@apple.com>
2480
2481         Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
2482         https://bugs.webkit.org/show_bug.cgi?id=195109
2483         <rdar://problem/48442272>
2484
2485         Reviewed by Alexey Proskuryakov.
2486
2487         In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
2488         added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
2489         Z's in hexadecimal strings). While these UUIDs haven't caused any
2490         problems in practice over the last six years, they are indeed invalid,
2491         and were discovered via an Xcode-project processing tool that did not
2492         anticipate their format. Fix this by removing the files from the
2493         project and re-adding them.
2494
2495         * WebKit.xcodeproj/project.pbxproj:
2496
2497 2019-02-27  Youenn Fablet  <youenn@apple.com>
2498
2499         Remove UserMediaProcessManager processState map
2500         https://bugs.webkit.org/show_bug.cgi?id=195056
2501
2502         Reviewed by Eric Carlson.
2503
2504         Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
2505         To improve on this model, this patch does the following:
2506         - Move the process state to WebProcessProxy.
2507         - Remove the map and replace it by a set of all manager proxies.
2508
2509         This simplifies the handling.
2510         On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
2511         This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.
2512
2513         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2514         (WebKit::UserMediaPermissionRequestManagerProxy::forEach):
2515         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
2516         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
2517         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
2518         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2519         * UIProcess/UserMediaProcessManager.cpp:
2520         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
2521         (WebKit::UserMediaProcessManager::willCreateMediaStream):
2522         (WebKit::UserMediaProcessManager::endedCaptureSession):
2523         (WebKit::UserMediaProcessManager::setCaptureEnabled):
2524         (WebKit::UserMediaProcessManager::captureDevicesChanged):
2525         (WebKit::ProcessState::ProcessState): Deleted.
2526         (WebKit::ProcessState::hasVideoExtension const): Deleted.
2527         (WebKit::ProcessState::grantVideoExtension): Deleted.
2528         (WebKit::ProcessState::revokeVideoExtension): Deleted.
2529         (WebKit::ProcessState::hasAudioExtension const): Deleted.
2530         (WebKit::ProcessState::grantAudioExtension): Deleted.
2531         (WebKit::ProcessState::revokeAudioExtension): Deleted.
2532         (WebKit::stateMap): Deleted.
2533         (WebKit::processState): Deleted.
2534         (WebKit::ProcessState::addRequestManager): Deleted.
2535         (WebKit::ProcessState::removeRequestManager): Deleted.
2536         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
2537         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
2538         (WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
2539         * UIProcess/UserMediaProcessManager.h:
2540         * UIProcess/WebProcessProxy.h:
2541         (WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
2542         (WebKit::WebProcessProxy::hasVideoCaptureExtension const):
2543         (WebKit::WebProcessProxy::grantVideoCaptureExtension):
2544         (WebKit::WebProcessProxy::revokeVideoCaptureExtension):
2545         (WebKit::WebProcessProxy::hasAudioCaptureExtension const):
2546         (WebKit::WebProcessProxy::grantAudioCaptureExtension):
2547         (WebKit::WebProcessProxy::revokeAudioCaptureExtension):
2548         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2549         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
2550         (WebKit::UserMediaPermissionRequestManager::clear): Deleted.
2551         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
2552         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
2553         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2554         * WebProcess/WebPage/WebPage.cpp:
2555         (WebKit::WebPage::close):
2556         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
2557         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
2558         * WebProcess/WebPage/WebPage.h:
2559         * WebProcess/WebPage/WebPage.messages.in:
2560         * WebProcess/WebProcess.cpp:
2561         (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
2562         (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
2563         * WebProcess/WebProcess.h:
2564         * WebProcess/WebProcess.messages.in:
2565
2566 2019-02-27  Per Arne Vollan  <pvollan@apple.com>
2567
2568         [macOS] Disable permissive call logging in sandbox
2569         https://bugs.webkit.org/show_bug.cgi?id=194061
2570         <rdar://problem/47686253>
2571
2572         Reviewed by Brent Fulgham.
2573
2574         Strict call filtering should be reenabled.
2575
2576         * WebProcess/com.apple.WebProcess.sb.in:
2577
2578 2019-02-27  Chris Dumez  <cdumez@apple.com>
2579
2580         [HTTPSUpgrade] Use open source database until the feature is ready
2581         https://bugs.webkit.org/show_bug.cgi?id=195069
2582         <rdar://problem/47838224>
2583
2584         Reviewed by Geoffrey Garen.
2585
2586         * DerivedSources-input.xcfilelist:
2587         * DerivedSources.make:
2588
2589 2019-02-27  Antoine Quint  <graouts@apple.com>
2590
2591         Support Pointer Events on macOS
2592         https://bugs.webkit.org/show_bug.cgi?id=195008
2593         <rdar://problem/47454419>
2594
2595         Reviewed by Dean Jackson.
2596
2597         * Configurations/FeatureDefines.xcconfig:
2598
2599 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
2600
2601         Network Process is put to suspended when holding locked IndexedDB files
2602         https://bugs.webkit.org/show_bug.cgi?id=195024
2603         <rdar://problem/45194169>
2604
2605         Reviewed by Geoffrey Garen.
2606
2607         * NetworkProcess/NetworkProcess.cpp:
2608         (WebKit::NetworkProcess::idbServer):
2609         (WebKit::NetworkProcess::notifyHoldingLockedFiles):
2610         * NetworkProcess/NetworkProcess.h:
2611         * UIProcess/Network/NetworkProcessProxy.cpp:
2612         (WebKit::NetworkProcessProxy::didClose):
2613         (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
2614         * UIProcess/Network/NetworkProcessProxy.h:
2615         * UIProcess/Network/NetworkProcessProxy.messages.in:
2616
2617 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
2618
2619         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
2620         https://bugs.webkit.org/show_bug.cgi?id=194973
2621
2622         Reviewed by Antti Koivisto.
2623
2624         This patch cleans up how the scrolling tree responds to scrolls.
2625
2626         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
2627         UI process scroll position.
2628
2629         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
2630         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
2631         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
2632         updates related layers on this node (counter-scrolling layers etc), and then tells the
2633         scrolling tree, which recurses through descendant nodes so they can adjust their layer
2634         positions.
2635
2636         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
2637         which does the above other than setting scrolledContentsLayer (since we're reacting to
2638         layer state changes, not producing them).
2639
2640         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
2641         ScrollingTree does the tree walk so classes don't have to implement
2642         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
2643         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
2644         need to cross frame boundaries).
2645
2646         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
2647         since the fixed state was computed with the "layout" scroll position, so we have to account
2648         for the scroll delta since the last committed position. It's possible we could improve this
2649         in future.
2650
2651         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2652         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2653         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2654         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
2655         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2656         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2657         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2658         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2659         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
2660         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2661         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
2662         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2663         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2664         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
2665         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
2666         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
2667         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
2668         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
2669         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
2670         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
2671         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
2672         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
2673         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
2674         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2675         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2676         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
2677         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
2678         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
2679         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
2680         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
2681         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2682         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2683         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
2684         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
2685         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
2686         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
2687         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
2688         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
2689         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
2690         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
2691         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
2692         (WebKit::ScrollerPairMac::updateValues):
2693         (WebKit::ScrollerPairMac::valuesForOrientation):
2694         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
2695         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
2696         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
2697         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
2698         * UIProcess/ios/WKContentView.mm:
2699         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2700
2701 2019-02-27  Alex Christensen  <achristensen@webkit.org>
2702
2703         Silence log after r242122
2704         https://bugs.webkit.org/show_bug.cgi?id=195074
2705
2706         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2707         (WebKit::LocalStorageDatabaseTracker::databasePath const):
2708         m_localStorageDirectory can now be null for ephemeral sessions.
2709         This is not a failure to create a directory and needs no log.
2710         This fixes the WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog API test.
2711
2712 2019-02-27  Timothy Hatcher  <timothy@apple.com>
2713
2714         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
2715         https://bugs.webkit.org/show_bug.cgi?id=195086
2716         rdar://problem/48419124
2717
2718         Reviewed by Tim Horton.
2719
2720         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
2721         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
2722
2723 2019-02-26  Chris Dumez  <cdumez@apple.com>
2724
2725         [PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
2726         https://bugs.webkit.org/show_bug.cgi?id=195089
2727
2728         Reviewed by Geoffrey Garen.
2729
2730         Add a convenient mechanism to clear suspended pages while bypassing the WebProcess
2731         cache since we need to do this on memory pressure and when clearing website data.
2732
2733         * UIProcess/WebPageProxy.cpp:
2734         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2735         * UIProcess/WebProcessCache.cpp:
2736         (WebKit::WebProcessCache::addProcessIfPossible):
2737         (WebKit::WebProcessCache::addProcess):
2738         (WebKit::WebProcessCache::takeProcess):
2739         (WebKit::WebProcessCache::CachedProcess::~CachedProcess):
2740         * UIProcess/WebProcessCache.h:
2741         (WebKit::WebProcessCache::setIsDisabled): Deleted.
2742         * UIProcess/WebProcessPool.cpp:
2743         (WebKit::WebProcessPool::handleMemoryPressureWarning):
2744         (WebKit::WebProcessPool::hasSuspendedPageFor const):
2745         (WebKit::WebProcessPool::clearSuspendedPages):
2746         * UIProcess/WebProcessPool.h:
2747         * UIProcess/WebProcessProxy.cpp:
2748         (WebKit::WebProcessProxy::maybeShutDown):
2749         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
2750         * UIProcess/WebProcessProxy.h:
2751         (WebKit::WebProcessProxy::suspendedPageCount const):
2752         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2753         (WebKit::WebsiteDataStore::removeData):
2754
2755 2019-02-26  Alex Christensen  <achristensen@webkit.org>
2756
2757         Move ephemeral local storage from WebProcess to UIProcess
2758         https://bugs.webkit.org/show_bug.cgi?id=195074
2759         <rdar://problem/47937975>
2760
2761         Reviewed by Geoff Garen.
2762
2763         Before PSON, a page could navigate to another domain that navigates back and still have its local storage.
2764         Since PSON makes it unreliable to retain the state in the WebProcess, move it to the process with the rest of the local storage.
2765         If it's ephemeral, we obviously can't use the SQLite on-disk storage implementation, so use the same WebCore::StorageMap we used to in the WebProcess.
2766
2767         * UIProcess/WebStorage/StorageManager.cpp:
2768         (WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
2769         (WebKit::StorageManager::StorageManager):
2770         (WebKit::StorageManager::createLocalStorageMap):
2771         (WebKit::StorageManager::createTransientLocalStorageMap):
2772         (WebKit::StorageManager::createSessionStorageMap):
2773         (WebKit::StorageManager::destroyStorageMap):
2774         (WebKit::StorageManager::getValues):
2775         (WebKit::StorageManager::setItem):
2776         (WebKit::StorageManager::removeItem):
2777         (WebKit::StorageManager::clear):
2778         * UIProcess/WebStorage/StorageManager.h:
2779         * UIProcess/WebStorage/StorageManager.messages.in:
2780         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2781         (WebKit::WebsiteDataStore::WebsiteDataStore):
2782         * WebProcess/WebStorage/StorageAreaMap.cpp:
2783         (WebKit::StorageAreaMap::StorageAreaMap):
2784         (WebKit::StorageAreaMap::setItem):
2785         (WebKit::StorageAreaMap::removeItem):
2786         (WebKit::StorageAreaMap::clear):
2787         (WebKit::StorageAreaMap::loadValuesIfNeeded):
2788         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2789         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
2790         (WebKit::StorageNamespaceImpl::storageArea):
2791         (WebKit::StorageNamespaceImpl::copy):
2792         (): Deleted.
2793         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): Deleted.
2794         * WebProcess/WebStorage/StorageNamespaceImpl.h:
2795
2796 2019-02-20  Jer Noble  <jer.noble@apple.com>
2797
2798         [Cocoa] Media elements will restart network buffering just before suspending
2799         https://bugs.webkit.org/show_bug.cgi?id=193691
2800
2801         Reviewed by Eric Carlson.
2802
2803         When the WebProcess receives a notification that the process is about to become
2804         suspended, it tells the MemoryPressureHandler to release all critical memory. This
2805         has the side effect of causing AVFoundation-backed media elements to dump their
2806         in-memory caches and start downloading media data again. Instead, media elements
2807         should all stop buffering media data during suspension. Add new testing SPI to
2808         simulate suspension and resume messages.
2809
2810         * UIProcess/API/Cocoa/WKWebView.mm:
2811         (-[WKWebView _processWillSuspendImminentlyForTesting]):
2812         (-[WKWebView _processDidResumeForTesting]):
2813         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2814         * UIProcess/WebProcessProxy.h:
2815         * UIProcess/ios/WKInkPickerView.mm:
2816         * WebProcess/WebPage/WebPage.cpp:
2817         (WebKit::WebPage::suspendAllMediaBuffering):
2818         (WebKit::WebPage::resumeAllMediaBuffering):
2819         * WebProcess/WebPage/WebPage.h:
2820         * WebProcess/WebProcess.cpp:
2821         (WebKit::WebProcess::actualPrepareToSuspend):
2822         (WebKit::WebProcess::cancelPrepareToSuspend):
2823         (WebKit::WebProcess::processDidResume):
2824         (WebKit::WebProcess::suspendAllMediaBuffering):
2825         (WebKit::WebProcess::resumeAllMediaBuffering):
2826         * WebProcess/WebProcess.h:
2827
2828 2019-02-26  Youenn Fablet  <youenn@apple.com>
2829
2830         Move service worker response validation from the service worker client to the service worker itself
2831         https://bugs.webkit.org/show_bug.cgi?id=194716
2832
2833         Reviewed by Geoffrey Garen.
2834
2835         Removed response validation as it is now done in service worker side.
2836
2837         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2838         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
2839         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2840
2841 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2842
2843         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
2844         https://bugs.webkit.org/show_bug.cgi?id=195066
2845         <rdar://problem/48411682>
2846
2847         Reviewed by Tim Horton.
2848
2849         * WebProcess/WebCoreSupport/WebChromeClient.h:
2850         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2851         (WebKit::WebChromeClient::clearContentChangeObservers): Deleted.
2852
2853 2019-02-26  Per Arne Vollan  <pvollan@apple.com>
2854
2855         [iOS] Sandbox should allow mach lookups related to media capturing
2856         https://bugs.webkit.org/show_bug.cgi?id=194951
2857
2858         Reviewed by Eric Carlson.
2859
2860         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2861
2862 2019-02-26  Brent Fulgham  <bfulgham@apple.com>
2863
2864         Update NetworkSession to use Session Cleanup when available
2865         https://bugs.webkit.org/show_bug.cgi?id=195019
2866         <rdar://problem/45149868>
2867
2868         Reviewed by Alex Christensen.
2869
2870         If the build environment supports Session Cleanup, initialize it.
2871
2872         No test changes since this doesn't do anything on the test systems at present.
2873
2874         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2875         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2876
2877 2019-02-26  Chris Dumez  <cdumez@apple.com>
2878
2879         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
2880         https://bugs.webkit.org/show_bug.cgi?id=195054
2881         <rdar://problem/48330549>
2882
2883         Reviewed by Geoff Garen.
2884
2885         We attempt to restore the scroll position twice, on first layout and then on load completion.
2886         Before PSON, the scroll position would fail to get restored on first layout but would succeed
2887         on load completion because the view is tall enough by then. With PSON however, we would
2888         fail to restore the scroll position on load completion because the view would not be tall
2889         enough yet by this point. The reason is that the dynamic resources would not be in the memory cache
2890         and would then get reloaded abd finish loading *after* the load event.
2891
2892         To address the issue, we now make sure to not purge the memory cache on process suspension on
2893         iOS if there is currently a SuspendedPageProxy in the UIProcess for this process.
2894
2895         * UIProcess/SuspendedPageProxy.cpp:
2896         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2897         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2898         * UIProcess/WebProcessProxy.cpp:
2899         (WebKit::WebProcessProxy::incrementSuspendedPageCount):
2900         (WebKit::WebProcessProxy::decrementSuspendedPageCount):
2901         * UIProcess/WebProcessProxy.h:
2902         * WebProcess/WebProcess.cpp:
2903         (WebKit::WebProcess::initializeWebProcess):
2904         (WebKit::WebProcess::setHasSuspendedPageProxy):
2905         * WebProcess/WebProcess.h:
2906         * WebProcess/WebProcess.messages.in:
2907
2908 2019-02-26  Ryosuke Niwa  <rniwa@webkit.org>
2909
2910         [iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
2911         https://bugs.webkit.org/show_bug.cgi?id=195037
2912         <rdar://problem/48154508>
2913
2914         Reviewed by Antti Koivisto.
2915
2916         Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
2917         as this has been an issue when I was able to reproduce the issue locally.
2918
2919         Also added release logging to help diagnose the issue in the future.
2920
2921         * WebProcess/WebPage/WebPage.cpp:
2922         (WebKit::WebPage::freezeLayerTree):
2923         (WebKit::WebPage::unfreezeLayerTree):
2924         (WebKit::WebPage::didCompletePageTransition):
2925         * WebProcess/WebProcess.cpp:
2926         (WebKit::WebProcess::freezeAllLayerTrees):
2927         (WebKit::WebProcess::unfreezeAllLayerTrees):
2928
2929 2019-02-26  Youenn Fablet  <youenn@apple.com>
2930
2931         Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
2932         https://bugs.webkit.org/show_bug.cgi?id=195051
2933
2934         Reviewed by Eric Carlson.
2935
2936         Before the patch, WebPageProxy::m_userMediaPermissionRequestManager was created
2937         in some methods to reset its state when main document is changing, view is becoming visible...
2938         This code is unnecessary if the page did not create it already using JS APIs such as getUserMedia/enumerateDevices/ondevicechange.
2939         This patch skips processing in the other cases if WebPageProxy::m_userMediaPermissionRequestManager is null.
2940
2941         * UIProcess/WebPageProxy.cpp:
2942         (WebKit::WebPageProxy::close): No need to nullify it since it will be done in resetState shortly after.
2943         (WebKit::WebPageProxy::didChangeMainDocument):
2944         (WebKit::WebPageProxy::viewIsBecomingVisible):
2945         (WebKit::WebPageProxy::clearUserMediaState):
2946         (WebKit::WebPageProxy::updatePlayingMediaDidChange): m_userMediaPermissionRequestManager should not be null here
2947         since there is or was some capturing done for the page.
2948
2949 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2950
2951         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
2952         https://bugs.webkit.org/show_bug.cgi?id=195023
2953         <rdar://problem/48381885>
2954
2955         Reviewed by Tim Horton.
2956
2957         * WebProcess/WebPage/ios/WebPageIOS.mm:
2958         (WebKit::WebPage::handleSyntheticClick):
2959
2960 2019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
2961
2962         [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
2963         https://bugs.webkit.org/show_bug.cgi?id=191652
2964
2965         Reviewed by Alex Christensen.
2966
2967         Test: http/tests/security/401-logout/401-logout.php
2968
2969         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2970         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
2971         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
2972         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2973
2974 2019-02-26  Youenn Fablet  <youenn@apple.com>
2975
2976         WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
2977         https://bugs.webkit.org/show_bug.cgi?id=195028
2978         <rdar://problem/48243733>
2979
2980         Reviewed by Eric Carlson.
2981
2982         Covered by API test.
2983
2984         * UIProcess/WebPageProxy.cpp:
2985         (WebKit::WebPageProxy::resetState):
2986
2987 2019-02-26  Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
2988
2989         [WPE] Add API for webview background color configuration
2990         https://bugs.webkit.org/show_bug.cgi?id=192305
2991
2992         Reviewed by Michael Catanzaro.
2993
2994         In the case of WPE we need to send the background color to the web process to be used as the background color of
2995         the page. This patch adapts the GTK+ implementation to do the same, since it's a lot simpler. The patch also
2996         removes the SetDrawsBackground message in favor of the new SetBackgroundColor message that receives an optional
2997         color.
2998
2999         * PlatformWPE.cmake: Add new WPE API for WebKitColor boxed type.
3000         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3001         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Remove background rendering and opacity handling.
3002         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3003         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3004         (WebKit::ThreadedCompositor::renderLayerTree): Remove drawsBakground and always clear the context with
3005         transparent color.
3006         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3007         * Shared/WebPageCreationParameters.cpp:
3008         (WebKit::WebPageCreationParameters::encode const): Replace drawsBackground with backgroundColor.
3009         (WebKit::WebPageCreationParameters::decode): Ditto.
3010         * Shared/WebPageCreationParameters.h:
3011         * SourcesWPE.txt:
3012         * UIProcess/API/glib/WebKitWebView.cpp:
3013         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
3014         (webkit_web_view_set_background_color):
3015         (webkit_web_view_get_background_color):
3016         * UIProcess/API/wpe/WebKitColor.cpp: Added.
3017         (webkit_color_copy):
3018         (webkit_color_free):
3019         (webkitColorToWebCoreColor):
3020         (webkitColorFillFromWebCoreColor):
3021         (webkit_color_parse):
3022         * UIProcess/API/wpe/WebKitColor.h: Added.
3023         * UIProcess/API/wpe/WebKitColorPrivate.h: Added.
3024         * UIProcess/API/wpe/WebKitWebView.h: Implement webkit_web_view_set_background_color API.
3025         * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Ditto.
3026         (webkit_web_view_set_background_color):
3027         (webkit_web_view_get_background_color):
3028         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Add new symbols.
3029         * UIProcess/WebPageProxy.cpp:
3030         (WebKit::WebPageProxy::setDrawsBackground): Set a transparent background color when false is passed.
3031         (WebKit::WebPageProxy::setBackgroundColor): Send background color to the WebProcess.
3032         (WebKit::WebPageProxy::creationParameters): Replace drawsBackground with backgroundColor.
3033         * UIProcess/WebPageProxy.h:
3034         (WebKit::WebPageProxy::drawsBackground const):
3035         (WebKit::WebPageProxy::backgroundColor const):
3036         * UIProcess/cairo/BackingStoreCairo.cpp:
3037         (WebKit::BackingStore::incorporateUpdate): Remove GTK+ code to handle background color.
3038         * UIProcess/gtk/AcceleratedBackingStore.cpp:
3039         * UIProcess/gtk/AcceleratedBackingStore.h: Make paint() pure virtual and remove the implementation.
3040         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
3041         (WebKit::AcceleratedBackingStoreWayland::paint): Dot not call AcceleratedBackingStore::paint() now that is pure virtual.
3042         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
3043         (WebKit::AcceleratedBackingStoreX11::paint): Ditto.
3044         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3045         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use background color as provided by the
3046         UIProcess when creating the FrameView.
3047         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3048         * WebProcess/WebPage/AcceleratedDrawingArea.h:
3049         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3050         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3051         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3052         (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable):
3053         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3054         * WebProcess/WebPage/DrawingArea.h:
3055         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3056         (WebKit::DrawingAreaImpl::display): Remove special case for transparent background.
3057         * WebProcess/WebPage/LayerTreeHost.h:
3058         * WebProcess/WebPage/WebPage.cpp:
3059         (WebKit::WebPage::setBackgroundColor): New API for background color configuration. Proxies to FrameView and DrawingArea.
3060         * WebProcess/WebPage/WebPage.h:
3061         (WebKit::WebPage::backgroundColor const): Read-only access to the current background color.
3062         * WebProcess/WebPage/WebPage.messages.in: Replace SetDrawsBackground message with SetBackgroundColor.
3063
3064 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
3065
3066         scalableNativeWebpageParameters() is not preserved on new page navigation.
3067         https://bugs.webkit.org/show_bug.cgi?id=194892
3068         <rdar://problem/47538280>
3069
3070         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
3071         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
3072         configuration until we derive the right values from viewport meta-tag.
3073
3074         Reviewed by Wenson Hsieh.
3075
3076         * WebProcess/WebPage/ios/WebPageIOS.mm:
3077         (WebKit::WebPage::resetViewportDefaultConfiguration): Use nativeWebpageParameters() instance method to
3078             get the appropriate default configuration.
3079
3080 2019-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3081
3082         [iOS] Adjust initial scale zooming heuristics when changing view scale
3083         https://bugs.webkit.org/show_bug.cgi?id=194995
3084
3085         Reviewed by Tim Horton.
3086
3087         Currently, we only zoom to the new initial scale iff we're exactly at initial scale before changing the view
3088         scale. This was done so that if a user zoomed in really far and then increased the view scale, we wouldn't end
3089         up zooming out as a result. However, this leads to confusing behavior in the case where the user has manually
3090         changed the zoom scale to something close to (but not exactly) initial scale, and then attempts to zoom in
3091         further using view scale. In this case, we'll end up keeping page scale the same, so it looks like nothing is
3092         happening.
3093
3094         To fix this, we tweak our heuristics for determining whether to jump to initial scale; if the view scale is
3095         increasing and the new initial scale is greater than the current scale, zoom to initial scale. Likewise, if the
3096         view scale is decreasing and the new initial scale is less than the current scale, zoom to initial scale.
3097
3098         Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
3099
3100         * WebProcess/WebPage/ios/WebPageIOS.mm:
3101         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
3102
3103 2019-02-25  John Wilander  <wilander@apple.com>
3104
3105         Introduce and adopt new class RegistrableDomain for eTLD+1
3106         https://bugs.webkit.org/show_bug.cgi?id=194791
3107         <rdar://problem/48179240>
3108
3109         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
3110
3111         A new API test was added. Plenty of existing layout tests under
3112         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
3113
3114         This patch introduces and adopts a new class called WebCore::RegistrableDomain
3115         which represents a domain's eTLD+1 (effective top level domain plus one) and is
3116         the basis for the term "site," as in same-site. Other popular names include
3117         high-level domain, primary domain, and top privately controlled/owned domain.
3118         Effective top level domains are enumerated on the Public Suffix List
3119         (https://publicsuffix.org).
3120
3121         This class just uses the full domain for when the Public Suffix List cannot help
3122         finding the registrable domain and for WebKit ports that haven't enabled
3123         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
3124         for the null or unique origin (this matches how these origins were handled
3125         before).
3126
3127         The implementation is a wrapper around a String and the functions and class
3128         members that now make use of this new class used to handle regular String
3129         objects which didn't help much in terms of type safety or guarantees that the
3130         string had already been converted to an eTLD+1.
3131
3132         We've at least two bad bugs in the Storage Access API because of confusion
3133         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
3134         will prohibit such bugs in the future.
3135
3136         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
3137         WebCore::RegistrableDomain for partitioning in a later patch.
3138
3139         This patch also enhances parameter naming by:
3140         - Removing parts that refer to "primary" as in primaryDomain.
3141         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
3142         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
3143         - Using the term "domain" consistently instead of e.g. "host."
3144
3145         A follow-up patch will continue backwards in call chains to create
3146         WebCore::RegistrableDomain objects as early as possible instead of using strings.
3147         I did not do that work here in the interest of patch size.
3148
3149         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3150         (WebKit::domainsToString):
3151         (WebKit::pruneResources):
3152         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
3153         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
3154         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
3155         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentDueToDebugMode):
3156         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
3157         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
3158         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
3159         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
3160         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
3161         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
3162         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
3163         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
3164         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
3165         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
3166         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
3167         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
3168         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
3169         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
3170         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
3171         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
3172         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
3173         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
3174         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
3175         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
3176         (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
3177         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
3178         (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
3179         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
3180         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
3181         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
3182         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
3183         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
3184         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
3185         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForRegistrableDomain):
3186         (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
3187         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
3188         (WebKit::debugLogDomainsInBatches):
3189         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
3190         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
3191         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
3192         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
3193         (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
3194         (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
3195         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
3196         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain): Deleted.
3197         (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Deleted.
3198         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
3199         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3200         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
3201         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
3202         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
3203         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
3204         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
3205         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
3206         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
3207         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
3208         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
3209         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
3210         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
3211         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
3212         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
3213         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3214         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3215         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3216         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
3217         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3218         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
3219         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
3220         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
3221         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
3222         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
3223         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
3224         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3225         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
3226         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
3227         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3228         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3229         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3230         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
3231         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
3232         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
3233         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
3234         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
3235         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
3236         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
3237         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
3238         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3239         (WebKit::WebResourceLoadStatisticsStore::registrableDomainsWithWebsiteData):
3240         (WebKit::isolatedPrimaryDomain): Deleted.
3241         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
3242         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
3243         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3244         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3245         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
3246         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
3247         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
3248         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
3249         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
3250         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
3251         * NetworkProcess/NetworkConnectionToWebProcess.h:
3252         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3253         * NetworkProcess/NetworkProcess.cpp:
3254         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
3255         (WebKit::NetworkProcess::isGrandfathered):
3256         (WebKit::NetworkProcess::isPrevalentResource):
3257         (WebKit::NetworkProcess::isVeryPrevalentResource):
3258         (WebKit::NetworkProcess::setGrandfathered):
3259         (WebKit::NetworkProcess::setPrevalentResource):
3260         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
3261         (WebKit::NetworkProcess::setVeryPrevalentResource):
3262         (WebKit::NetworkProcess::clearPrevalentResource):
3263         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
3264         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
3265         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
3266         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
3267         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
3268         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
3269         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
3270         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
3271         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
3272         (WebKit::NetworkProcess::setLastSeen):
3273         (WebKit::NetworkProcess::hasStorageAccessForFrame):
3274         (WebKit::NetworkProcess::hasStorageAccess):
3275         (WebKit::NetworkProcess::requestStorageAccess):
3276         (WebKit::NetworkProcess::requestStorageAccessGranted):
3277         (WebKit::NetworkProcess::grantStorageAccess):
3278         (WebKit::NetworkProcess::logFrameNavigation):
3279         (WebKit::NetworkProcess::logUserInteraction):
3280         (WebKit::NetworkProcess::hadUserInteraction):
3281         (WebKit::NetworkProcess::clearUserInteraction):
3282         (WebKit::NetworkProcess::removePrevalentDomains):
3283         (WebKit::filterForRegistrableDomains):
3284         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3285         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
3286         (WebKit::filterForTopLevelDomains): Deleted.
3287         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
3288         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
3289         * NetworkProcess/NetworkProcess.h:
3290         * NetworkProcess/NetworkProcess.messages.in:
3291         * NetworkProcess/NetworkResourceLoader.cpp:
3292         (WebKit::logCookieInformationInternal):
3293         * NetworkProcess/NetworkSession.cpp:
3294         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3295         (WebKit::NetworkSession::registrableDomainsWithWebsiteData):
3296         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
3297         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
3298         * NetworkProcess/NetworkSession.h:
3299         * Shared/WebCoreArgumentCoders.cpp:
3300         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3301         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3302         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
3303         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
3304         * UIProcess/Network/NetworkProcessProxy.cpp:
3305         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3306         (WebKit::NetworkProcessProxy::isPrevalentResource):
3307         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
3308         (WebKit::NetworkProcessProxy::setPrevalentResource):
3309         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
3310         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
3311         (WebKit::NetworkProcessProxy::setLastSeen):
3312         (WebKit::NetworkProcessProxy::clearPrevalentResource):
3313         (WebKit::NetworkProcessProxy::logUserInteraction):
3314         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
3315         (WebKit::NetworkProcessProxy::clearUserInteraction):
3316         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
3317         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
3318         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
3319         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
3320         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
3321         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
3322         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
3323         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
3324         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
3325         (WebKit::NetworkProcessProxy::isGrandfathered):
3326         (WebKit::NetworkProcessProxy::setGrandfathered):
3327         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
3328         (WebKit::NetworkProcessProxy::hasStorageAccess):
3329         (WebKit::NetworkProcessProxy::requestStorageAccess):
3330         (WebKit::NetworkProcessProxy::grantStorageAccess):
3331         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
3332         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
3333         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
3334         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
3335         * UIProcess/Network/NetworkProcessProxy.h:
3336         * UIProcess/Network/NetworkProcessProxy.messages.in:
3337         * UIProcess/WebPageProxy.cpp:
3338         (WebKit::WebPageProxy::logFrameNavigation):
3339         (WebKit::WebPageProxy::requestStorageAccessConfirm):
3340         * UIProcess/WebProcessProxy.cpp:
3341         (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed):
3342         (WebKit::WebProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
3343         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
3344         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
3345         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
3346         * UIProcess/WebProcessProxy.h:
3347         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
3348         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3349         (WebKit::WebsiteDataStore::isPrevalentResource):
3350         (WebKit::WebsiteDataStore::setPrevalentResource):
3351         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
3352         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
3353         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
3354         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
3355         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
3356         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
3357         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
3358         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
3359         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
3360         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
3361         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
3362         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
3363         (WebKit::WebsiteDataStore::clearPrevalentResource):
3364         (WebKit::WebsiteDataStore::setLastSeen):
3365         (WebKit::WebsiteDataStore::hasStorageAccess):
3366         (WebKit::WebsiteDataStore::requestStorageAccess):
3367         (WebKit::WebsiteDataStore::grantStorageAccess):
3368         (WebKit::WebsiteDataStore::logUserInteraction):
3369         (WebKit::WebsiteDataStore::hasHadUserInteraction):
3370         (WebKit::WebsiteDataStore::clearUserInteraction):
3371         (WebKit::WebsiteDataStore::setGrandfathered):
3372         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Deleted.
3373         * UIProcess/WebsiteData/WebsiteDataStore.h:
3374         * WebProcess/WebPage/WebPage.cpp:
3375         (WebKit::WebPage::hasStorageAccess):
3376         (WebKit::WebPage::requestStorageAccess):
3377         * WebProcess/WebProcess.cpp:
3378         (WebKit::m_nonVisibleProcessCleanupTimer):
3379         (WebKit::WebProcess::initializeWebProcess):
3380
3381 2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
3382
3383         [WPE] Bump WPEBackend-fdo requirement to API version 1.0
3384         https://bugs.webkit.org/show_bug.cgi?id=195001
3385
3386         Reviewed by Carlos Garcia Campos.
3387
3388         API version 1.0 always includes the functionality previously guarded with
3389         WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
3390         unconditionally.
3391
3392         * UIProcess/API/wpe/WPEView.cpp:
3393         (WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
3394         (WKWPE::m_backend): Ditto.
3395         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
3396         (WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
3397         library name, remove call to wpe_fdo_initialize_for_egl_display().
3398         (WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
3399         here, to bail out early in case initialization fails.
3400         * UIProcess/glib/WebProcessPoolGLib.cpp:
3401         (WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
3402         WPE_BACKEND_CHECK_VERSION().
3403
3404 2019-02-25  Per Arne Vollan  <pvollan@apple.com>
3405
3406         A prewarmed Web process should have a process assertion.
3407         https://bugs.webkit.org/show_bug.cgi?id=195006
3408
3409         Reviewed by Geoffrey Garen.
3410
3411         To make sure the prewarm message is handled in the Web process before the process is suspended,
3412         the process should have a process assertion. This can be fixed by sending the prewarm message
3413         inside WebProcessPool::initializeNewWebProcess, since all message sent inside this method are
3414         guaranteed to be handled before the WebContent process is suspended.
3415
3416         This patch is based on Chris Dumez' idea and obervation of the issue.
3417
3418         * UIProcess/WebProcessPool.cpp:
3419         (WebKit::WebProcessPool::createNewWebProcess):
3420         (WebKit::WebProcessPool::initializeNewWebProcess):
3421         * UIProcess/WebProcessPool.h:
3422
3423 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3424
3425         [GTK] Enable PSON
3426         https://bugs.webkit.org/show_bug.cgi?id=194979
3427
3428         Reviewed by Žan Doberšek.
3429
3430         It is expected that this may introduce unexpected regressions, so it's appropriate to do
3431         this at the start of a new release cycle.
3432
3433         * Shared/WebPreferencesDefaultValues.h:
3434
3435 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3436
3437         [WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
3438         https://bugs.webkit.org/show_bug.cgi?id=194614
3439
3440         Reviewed by Carlos Garcia Campos.
3441
3442         This environment variable is now enabled for WPE, not just for GTK.
3443
3444         It is now possible to use this environment variable to enable complex text, not just to
3445         disable it.
3446
3447         WebProcessPool::setAlwaysUsesComplexTextCodePath is fixed to be respected even when this
3448         environment variable is set, although WPE and GTK will never do so.
3449
3450         * UIProcess/glib/WebProcessPoolGLib.cpp:
3451         (WebKit::WebProcessPool::platformInitialize):
3452         (WebKit::WebProcessPool::platformInitializeWebProcess):
3453
3454 2019-02-24  Zalan Bujtas  <zalan@apple.com>
3455
3456         Introduce ContentChangeObserver class
3457         https://bugs.webkit.org/show_bug.cgi?id=194977
3458         <rdar://problem/48338115>
3459
3460         Reviewed by Simon Fraser.
3461
3462         * WebProcess/WebPage/ios/WebPageIOS.mm:
3463         (WebKit::WebPage::handleSyntheticClick):
3464         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
3465
3466 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
3467
3468         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
3469         https://bugs.webkit.org/show_bug.cgi?id=194984
3470
3471         Reviewed by Sam Weinig.
3472
3473         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
3474
3475         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
3476         current layout viewport rect. Instead, set the layout viewport on the root
3477         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
3478         
3479         Add a WK2 Scrolling log channel.
3480
3481         * Platform/Logging.h:
3482         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3483         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3484         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3485         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
3486         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3487         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3488         (WebKit::RemoteScrollingTree::fixedPositionRect): Deleted.
3489         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
3490         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3491         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
3492         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted.
3493         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
3494         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
3495         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
3496         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
3497         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
3498         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3499         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3500         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
3501         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
3502         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3503         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange):
3504         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
3505         * UIProcess/ios/WKContentView.mm:
3506         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3507
3508 2019-02-20  Darin Adler  <darin@apple.com>
3509
3510         Finish removing String::format
3511         https://bugs.webkit.org/show_bug.cgi?id=194893
3512
3513         Reviewed by Daniel Bates.
3514
3515         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
3516         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
3517         a problem where we passed an NSData * to format with a "%s"."
3518
3519 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3520
3521         [WPE] Install MemoryPressureHandler in UIProcess
3522         https://bugs.webkit.org/show_bug.cgi?id=194617
3523
3524         Reviewed by Žan Doberšek.
3525
3526         Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
3527         too.
3528
3529         We need @no-unify to avoid changing the unified source bundles under API/, which are
3530         notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)
3531
3532         * SourcesWPE.txt:
3533         * UIProcess/WebMemoryPressureHandler.cpp:
3534         (WebKit::installMemoryPressureHandler):
3535         * UIProcess/glib/WebProcessPoolGLib.cpp:
3536         (WebKit::WebProcessPool::platformInitialize):
3537
3538 2019-02-23  Chris Dumez  <cdumez@apple.com>
3539
3540         Give DrawingAreas their own identifiers
3541         https://bugs.webkit.org/show_bug.cgi?id=194969
3542         <rdar://problem/48154508>
3543
3544         Unreviewed, fix API test debug assertion failures after r241988.
3545         We do not support sending an ObjectIdentifier that is 0 via IPC so update WebPageProxy::CreateNewPage
3546         IPC to return an Optional<WebPageCreationParameters> instead of a WebPageCreationParameters. It returns
3547         nullopt when there this no UIClient or the client did not create the page, instead of returning a
3548         default-initialized WebPageCreationParameters.
3549
3550         * UIProcess/WebPageProxy.cpp:
3551         (WebKit::WebPageProxy::createNewPage):
3552         * UIProcess/WebPageProxy.messages.in:
3553         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3554         (WebKit::WebChromeClient::createWindow):
3555
3556 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
3557
3558         Remove remnants of iOS WK1 scrolling tree code
3559         https://bugs.webkit.org/show_bug.cgi?id=194980
3560
3561         Reviewed by Sam Weinig.
3562
3563         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.
3564
3565         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
3566         removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).
3567
3568         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3569         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
3570         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
3571         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
3572         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
3573         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
3574         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
3575         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
3576         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
3577         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
3578         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
3579         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
3580         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
3581         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
3582         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
3583         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3584
3585 2019-02-23  Keith Miller  <keith_miller@apple.com>
3586
3587         Add new mac target numbers
3588         https://bugs.webkit.org/show_bug.cgi?id=194955
3589
3590         Reviewed by Tim Horton.
3591
3592         * Configurations/Base.xcconfig:
3593         * Configurations/DebugRelease.xcconfig:
3594
3595 2019-02-22  Chris Dumez  <cdumez@apple.com>
3596
3597         Give DrawingAreas their own identifiers
3598         https://bugs.webkit.org/show_bug.cgi?id=194969
3599         <rdar://problem/48154508>
3600
3601         Reviewed by Geoffrey Garen.
3602
3603         Give DrawingAreas their own identifiers instead of using the pageID. It will make the IPC more robust now that a
3604         WebPageProxy can have several drawing areas with PSON.
3605
3606         * Shared/DrawingAreaInfo.h:
3607         * Shared/WebPageCreationParameters.cpp:
3608         (WebKit::WebPageCreationParameters::encode const):
3609         (WebKit::WebPageCreationParameters::decode):
3610         * Shared/WebPageCreationParameters.h:
3611         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
3612         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
3613         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
3614         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
3615         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
3616         * UIProcess/DrawingAreaProxy.cpp:
3617         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
3618         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
3619         (WebKit::DrawingAreaProxy::messageSenderConnection const):
3620         (WebKit::DrawingAreaProxy::sendMessage):
3621         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
3622         * UIProcess/DrawingAreaProxy.h:
3623         (WebKit::DrawingAreaProxy::identifier const):
3624         (WebKit::DrawingAreaProxy::process const):
3625         * UIProcess/DrawingAreaProxyImpl.cpp:
3626         (WebKit::DrawingAreaProxyImpl::update):
3627         * UIProcess/ProvisionalPageProxy.cpp:
3628         (WebKit::ProvisionalPageProxy::initializeWebPage):
3629         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3630         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3631         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
3632         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
3633         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
3634         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
3635         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
3636         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3637         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
3638         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3639         * UIProcess/WebPageProxy.cpp:
3640         (WebKit::WebPageProxy::initializeWebPage):
3641         (WebKit::WebPageProxy::createNewPage):
3642         (WebKit::WebPageProxy::creationParameters):
3643         * UIProcess/WebPageProxy.h:
3644         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3645         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
3646         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
3647         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
3648         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
3649         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
3650         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
3651         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3652         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3653         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
3654         (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
3655         (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
3656         * WebProcess/WebPage/DrawingArea.cpp:
3657         (WebKit::DrawingArea::DrawingArea):
3658         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
3659         * WebProcess/WebPage/DrawingArea.h:
3660         (WebKit::DrawingArea::identifier const):
3661         (WebKit::DrawingArea::send):
3662         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3663         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
3664         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
3665         (WebKit::DrawingAreaImpl::display):
3666         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3667         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3668         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
3669         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3670         * WebProcess/WebPage/WebPage.cpp:
3671         (WebKit::WebPage::reinitializeWebPage):
3672         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3673         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3674         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
3675         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
3676         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3677         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
3678         (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
3679
3680 2019-02-22  Andy Estes  <aestes@apple.com>
3681
3682         [Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
3683         https://bugs.webkit.org/show_bug.cgi?id=194971
3684         <rdar://problem/35786264>
3685
3686         Reviewed by Tim Horton.
3687
3688         sandbox_extension_issue_file is not actually deprecated.
3689
3690         * Shared/mac/SandboxExtensionMac.mm:
3691         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
3692
3693 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3694
3695         [iOS] Callout menu overlaps in-page controls when editing a comment in github.com's issue tracker
3696         https://bugs.webkit.org/show_bug.cgi?id=194873
3697         <rdar://problem/46701974>
3698
3699         Reviewed by Tim Horton.
3700
3701         On the topic of supporting web-based rich text editors on iOS, one problematic area has always been handling
3702         conflicts between platform UI (i.e., the system callout menu) and in-page text editing controls. This issue
3703         comes up in websites that don't use the "hidden contenteditable" approach to rich text editing, but also show
3704         additional controls in a toolbar or contextual menu above the selection. In these cases, what often happens is
3705         that system controls overlap controls in the page.
3706
3707         Luckily, the iOS callout menu (i.e. the private UICalloutBar) is capable of presenting with a list of "evasion
3708         rects" to avoid; if the callout bar would normally intersect with one of these rects, then a different
3709         orientation that does not intersect with one of these rects is chosen instead. Currently, the only rect added
3710         here by UIKit when presenting the callout menu is the bounding rect of the on-screen keyboard, but after
3711         <rdar://problem/48128337>, we now have a generalized mechanism for offering additional evasion rects before
3712         UIKit presents the callout menu.
3713
3714         This patch adopts the mechanism introduced in <rdar://problem/48128337>, and introduces a heuristic for
3715         determining the approximate location of controls in the page which might overlap the callout menu. This
3716         heuristic works by hit-testing for clickable (but non-editable) nodes above the bounds of the selection, which
3717         are additionally not hit-tested by advancing outwards from any of the other edges of the selection bounds.
3718         Additionally, any hit-tested nodes whose bounding rects are very large (relative to the content view size) are
3719         ignored (this deals with scenarios where the body or a large container element has a click handler). We then add
3720         the bounding rects of each of the nodes that fit this criteria to the list of rects for UIKit to avoid when
3721         presenting the system callout menu.
3722
3723         The result is that WebKit will, by default, avoid overlapping anything that looks like controls in the page when
3724         showing a callout menu in editable content. In practice, this fixes overlapping controls on most websites that
3725         roll their own context menu or toolbar in their rich text editor.
3726
3727         Test: editing/selection/ios/avoid-showing-callout-menu-over-controls.html
3728
3729         * Platform/spi/ios/UIKitSPI.h:
3730         * UIProcess/WebPageProxy.h:
3731         * UIProcess/ios/WKContentViewInteraction.mm:
3732         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
3733         (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
3734         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
3735
3736         Drive-by: handle null completion handler arguments more gracefully, by raising an NSException and bailing before
3737         attempting to invoke a nil block.
3738
3739         * UIProcess/ios/WebPageProxyIOS.mm:
3740         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
3741
3742         See above for more detail.
3743
3744         * WebProcess/WebPage/WebPage.h:
3745         * WebProcess/WebPage/WebPage.messages.in:
3746         * WebProcess/WebPage/ios/WebPageIOS.mm:
3747         (WebKit::WebPage::requestEvasionRectsAboveSelection):
3748
3749 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
3750
3751         Unreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.
3752
3753         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3754
3755 2019-02-22  Chris Dumez  <cdumez@apple.com>
3756
3757         Regression(PSON) Unable to preview password-protected documents on iCloud.com
3758         https://bugs.webkit.org/show_bug.cgi?id=194954
3759         <rdar://problem/48127957>
3760
3761         Reviewed by Alex Christensen.
3762
3763         Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related
3764         IPC on iOS.
3765
3766         * UIProcess/ProvisionalPageProxy.cpp:
3767         (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
3768         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3769         * UIProcess/ProvisionalPageProxy.h:
3770         * UIProcess/WebPageProxy.h:
3771         * UIProcess/ios/WebPageProxyIOS.mm:
3772         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
3773         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
3774
3775 2019-02-22  Per Arne Vollan  <pvollan@apple.com>
3776
3777         [iOS] Sandbox should allow mach lookups related to media capturing
3778         https://bugs.webkit.org/show_bug.cgi?id=194951
3779         <rdar://problem/48013875>
3780
3781         Reviewed by Brent Fulgham.
3782
3783         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3784
3785 2019-02-22  Alexander Mikhaylenko  <exalm7659@gmail.com>
3786
3787         [GTK] Navigation gesture improvements
3788         https://bugs.webkit.org/show_bug.cgi?id=194943
3789
3790         Reviewed by Michael Catanzaro.
3791
3792         Cancel the gesture if progress is less than 0.5 and velocity is not high enough.
3793
3794         Allow to continue the gesture during animation. Introduce finished state to be used
3795         when showing snapshot after the animation ends.
3796
3797         Fix duration calculation, also slow it down so that the initial velocity matches
3798         what it was during the gesture.
3799
3800         * UIProcess/ViewGestureController.h: Add shouldCancel() and State::Finishing to SwipeProgressTracker.
3801         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
3802         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
3803         Fix velocity calculation, allow scrolling during State::Animating.
3804         (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): Added.
3805         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): Use shouldCancel() and fix duration calculation.
3806         (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation): Set state to State::Finishing when the animation ends.
3807
3808 2019-02-22  Chris Dumez  <cdumez@apple.com>
3809
3810         REGRESSION(PSON) Scroll position is sometimes not restored on history navigation
3811         https://bugs.webkit.org/show_bug.cgi?id=194924
3812         <rdar://problem/48216125>
3813
3814         Reviewed by Geoffrey Garen.
3815
3816         When process-swapping, we would create a new WebPage in the new process, which would
3817         call restoreSessionInternal() to restore the HistoryItems based on the UIProcess's
3818         backforward list. The issue is that this session restoring would send HistoryItem
3819         updates back to the UIProcess. Without PSON, this would be unnecessary but harmless.
3820         With PSON though, this may end up overwriting values set by the previous process,
3821         such as the scroll position.
3822
3823         Address the issue by temporarily disabling the HistoryItem update notifications to
3824         the UIProcess while restoring a session.
3825
3826         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
3827         (-[WKBackForwardListItem _scrollPosition]):
3828         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
3829         * WebProcess/WebPage/WebPage.cpp:
3830         (WebKit::WebPage::restoreSessionInternal):
3831
3832 2019-02-21  Adrian Perez de Castro  <aperez@igalia.com>
3833
3834         [WPE][GTK] No API documentation generated for WebKitUserContentFilterStore
3835         https://bugs.webkit.org/show_bug.cgi?id=194908
3836
3837         Reviewed by Carlos Garcia Campos.
3838
3839         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add entry for webkit_user_content_filter_store_get_type().
3840         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add entry for WebKitUserContentFilterStore.
3841         * UIProcess/API/wpe/docs/wpe-docs.sgml: Ditto.
3842
3843 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3844
3845         wpewebkit-2.23.90 Failing to build on Fedora
3846         https://bugs.webkit.org/show_bug.cgi?id=194922
3847
3848         Unreviewed. Fix path to WebKitUserContentFilterStore.h in WPE_API_INSTALLED_HEADERS.
3849
3850         * PlatformWPE.cmake:
3851
3852 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
3853
3854         Hardcode Visual Viewports on everywhere except iOS WK1
3855         https://bugs.webkit.org/show_bug.cgi?id=194928
3856
3857         Reviewed by Zalan Bujtas.
3858
3859         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
3860         change the default value of the Setting to 'true', and hardcode WebView on iOS to
3861         set it to false. The setting has shipped for several years and there's no need to turn
3862         it off now.
3863
3864         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
3865         Visual Viewports are not enabled.
3866         
3867         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
3868         that only runs in WK2
3869
3870         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3871         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
3872         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
3873         * Shared/WebPreferences.yaml:
3874         * UIProcess/API/Cocoa/WKPreferences.mm:
3875         (-[WKPreferences _visualViewportEnabled]): Deleted.
3876         (-[WKPreferences _setVisualViewportEnabled:]): Deleted.
3877         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3878         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3879         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3880         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3881         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
3882         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3883         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
3884         * UIProcess/WebPageProxy.h:
3885         * UIProcess/ios/WKContentView.mm:
3886         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3887         * UIProcess/ios/WebPageProxyIOS.mm:
3888         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
3889         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3890         (WebKit::WebAutomationSessionProxy::computeElementLayout):
3891         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3892         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3893         * WebProcess/WebPage/ios/WebPageIOS.mm:
3894         (WebKit::WebPage::getFocusedElementInformation):
3895         (WebKit::WebPage::dynamicViewportSizeUpdate):
3896         (WebKit::WebPage::updateVisibleContentRects):
3897
3898 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3899
3900         [GTK] Epiphany searching for plugins even if plugins are disabled
3901         https://bugs.webkit.org/show_bug.cgi?id=194352
3902
3903         Reviewed by Michael Catanzaro.
3904
3905         Check pluginsEnabled setting before trying to get plugins from UI process.
3906
3907         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3908         (WebKit::WebPluginInfoProvider::populatePluginCache):
3909
3910 2019-02-21  Darin Adler  <darin@apple.com>
3911