9d935a843c88faf024b6c41ddc0428bb8f3d73c6
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-02-26  Per Arne Vollan  <pvollan@apple.com>
2
3         [iOS] Sandbox should allow mach lookups related to media capturing
4         https://bugs.webkit.org/show_bug.cgi?id=194951
5
6         Reviewed by Eric Carlson.
7
8         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
9
10 2019-02-26  Brent Fulgham  <bfulgham@apple.com>
11
12         Update NetworkSession to use Session Cleanup when available
13         https://bugs.webkit.org/show_bug.cgi?id=195019
14         <rdar://problem/45149868>
15
16         Reviewed by Alex Christensen.
17
18         If the build environment supports Session Cleanup, initialize it.
19
20         No test changes since this doesn't do anything on the test systems at present.
21
22         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
23         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
24
25 2019-02-26  Chris Dumez  <cdumez@apple.com>
26
27         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
28         https://bugs.webkit.org/show_bug.cgi?id=195054
29         <rdar://problem/48330549>
30
31         Reviewed by Geoff Garen.
32
33         We attempt to restore the scroll position twice, on first layout and then on load completion.
34         Before PSON, the scroll position would fail to get restored on first layout but would succeed
35         on load completion because the view is tall enough by then. With PSON however, we would
36         fail to restore the scroll position on load completion because the view would not be tall
37         enough yet by this point. The reason is that the dynamic resources would not be in the memory cache
38         and would then get reloaded abd finish loading *after* the load event.
39
40         To address the issue, we now make sure to not purge the memory cache on process suspension on
41         iOS if there is currently a SuspendedPageProxy in the UIProcess for this process.
42
43         * UIProcess/SuspendedPageProxy.cpp:
44         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
45         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
46         * UIProcess/WebProcessProxy.cpp:
47         (WebKit::WebProcessProxy::incrementSuspendedPageCount):
48         (WebKit::WebProcessProxy::decrementSuspendedPageCount):
49         * UIProcess/WebProcessProxy.h:
50         * WebProcess/WebProcess.cpp:
51         (WebKit::WebProcess::initializeWebProcess):
52         (WebKit::WebProcess::setHasSuspendedPageProxy):
53         * WebProcess/WebProcess.h:
54         * WebProcess/WebProcess.messages.in:
55
56 2019-02-26  Ryosuke Niwa  <rniwa@webkit.org>
57
58         [iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
59         https://bugs.webkit.org/show_bug.cgi?id=195037
60         <rdar://problem/48154508>
61
62         Reviewed by Antti Koivisto.
63
64         Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
65         as this has been an issue when I was able to reproduce the issue locally.
66
67         Also added release logging to help diagnose the issue in the future.
68
69         * WebProcess/WebPage/WebPage.cpp:
70         (WebKit::WebPage::freezeLayerTree):
71         (WebKit::WebPage::unfreezeLayerTree):
72         (WebKit::WebPage::didCompletePageTransition):
73         * WebProcess/WebProcess.cpp:
74         (WebKit::WebProcess::freezeAllLayerTrees):
75         (WebKit::WebProcess::unfreezeAllLayerTrees):
76
77 2019-02-26  Youenn Fablet  <youenn@apple.com>
78
79         Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
80         https://bugs.webkit.org/show_bug.cgi?id=195051
81
82         Reviewed by Eric Carlson.
83
84         Before the patch, WebPageProxy::m_userMediaPermissionRequestManager was created
85         in some methods to reset its state when main document is changing, view is becoming visible...
86         This code is unnecessary if the page did not create it already using JS APIs such as getUserMedia/enumerateDevices/ondevicechange.
87         This patch skips processing in the other cases if WebPageProxy::m_userMediaPermissionRequestManager is null.
88
89         * UIProcess/WebPageProxy.cpp:
90         (WebKit::WebPageProxy::close): No need to nullify it since it will be done in resetState shortly after.
91         (WebKit::WebPageProxy::didChangeMainDocument):
92         (WebKit::WebPageProxy::viewIsBecomingVisible):
93         (WebKit::WebPageProxy::clearUserMediaState):
94         (WebKit::WebPageProxy::updatePlayingMediaDidChange): m_userMediaPermissionRequestManager should not be null here
95         since there is or was some capturing done for the page.
96
97 2019-02-26  Zalan Bujtas  <zalan@apple.com>
98
99         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
100         https://bugs.webkit.org/show_bug.cgi?id=195023
101         <rdar://problem/48381885>
102
103         Reviewed by Tim Horton.
104
105         * WebProcess/WebPage/ios/WebPageIOS.mm:
106         (WebKit::WebPage::handleSyntheticClick):
107
108 2019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
109
110         [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
111         https://bugs.webkit.org/show_bug.cgi?id=191652
112
113         Reviewed by Alex Christensen.
114
115         Test: http/tests/security/401-logout/401-logout.php
116
117         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
118         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
119         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
120         * NetworkProcess/curl/NetworkDataTaskCurl.h:
121
122 2019-02-26  Youenn Fablet  <youenn@apple.com>
123
124         WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
125         https://bugs.webkit.org/show_bug.cgi?id=195028
126         <rdar://problem/48243733>
127
128         Reviewed by Eric Carlson.
129
130         Covered by API test.
131
132         * UIProcess/WebPageProxy.cpp:
133         (WebKit::WebPageProxy::resetState):
134
135 2019-02-26  Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
136
137         [WPE] Add API for webview background color configuration
138         https://bugs.webkit.org/show_bug.cgi?id=192305
139
140         Reviewed by Michael Catanzaro.
141
142         In the case of WPE we need to send the background color to the web process to be used as the background color of
143         the page. This patch adapts the GTK+ implementation to do the same, since it's a lot simpler. The patch also
144         removes the SetDrawsBackground message in favor of the new SetBackgroundColor message that receives an optional
145         color.
146
147         * PlatformWPE.cmake: Add new WPE API for WebKitColor boxed type.
148         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
149         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Remove background rendering and opacity handling.
150         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
151         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
152         (WebKit::ThreadedCompositor::renderLayerTree): Remove drawsBakground and always clear the context with
153         transparent color.
154         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
155         * Shared/WebPageCreationParameters.cpp:
156         (WebKit::WebPageCreationParameters::encode const): Replace drawsBackground with backgroundColor.
157         (WebKit::WebPageCreationParameters::decode): Ditto.
158         * Shared/WebPageCreationParameters.h:
159         * SourcesWPE.txt:
160         * UIProcess/API/glib/WebKitWebView.cpp:
161         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
162         (webkit_web_view_set_background_color):
163         (webkit_web_view_get_background_color):
164         * UIProcess/API/wpe/WebKitColor.cpp: Added.
165         (webkit_color_copy):
166         (webkit_color_free):
167         (webkitColorToWebCoreColor):
168         (webkitColorFillFromWebCoreColor):
169         (webkit_color_parse):
170         * UIProcess/API/wpe/WebKitColor.h: Added.
171         * UIProcess/API/wpe/WebKitColorPrivate.h: Added.
172         * UIProcess/API/wpe/WebKitWebView.h: Implement webkit_web_view_set_background_color API.
173         * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Ditto.
174         (webkit_web_view_set_background_color):
175         (webkit_web_view_get_background_color):
176         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Add new symbols.
177         * UIProcess/WebPageProxy.cpp:
178         (WebKit::WebPageProxy::setDrawsBackground): Set a transparent background color when false is passed.
179         (WebKit::WebPageProxy::setBackgroundColor): Send background color to the WebProcess.
180         (WebKit::WebPageProxy::creationParameters): Replace drawsBackground with backgroundColor.
181         * UIProcess/WebPageProxy.h:
182         (WebKit::WebPageProxy::drawsBackground const):
183         (WebKit::WebPageProxy::backgroundColor const):
184         * UIProcess/cairo/BackingStoreCairo.cpp:
185         (WebKit::BackingStore::incorporateUpdate): Remove GTK+ code to handle background color.
186         * UIProcess/gtk/AcceleratedBackingStore.cpp:
187         * UIProcess/gtk/AcceleratedBackingStore.h: Make paint() pure virtual and remove the implementation.
188         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
189         (WebKit::AcceleratedBackingStoreWayland::paint): Dot not call AcceleratedBackingStore::paint() now that is pure virtual.
190         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
191         (WebKit::AcceleratedBackingStoreX11::paint): Ditto.
192         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
193         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use background color as provided by the
194         UIProcess when creating the FrameView.
195         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
196         * WebProcess/WebPage/AcceleratedDrawingArea.h:
197         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
198         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
199         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
200         (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable):
201         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
202         * WebProcess/WebPage/DrawingArea.h:
203         * WebProcess/WebPage/DrawingAreaImpl.cpp:
204         (WebKit::DrawingAreaImpl::display): Remove special case for transparent background.
205         * WebProcess/WebPage/LayerTreeHost.h:
206         * WebProcess/WebPage/WebPage.cpp:
207         (WebKit::WebPage::setBackgroundColor): New API for background color configuration. Proxies to FrameView and DrawingArea.
208         * WebProcess/WebPage/WebPage.h:
209         (WebKit::WebPage::backgroundColor const): Read-only access to the current background color.
210         * WebProcess/WebPage/WebPage.messages.in: Replace SetDrawsBackground message with SetBackgroundColor.
211
212 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
213
214         scalableNativeWebpageParameters() is not preserved on new page navigation.
215         https://bugs.webkit.org/show_bug.cgi?id=194892
216         <rdar://problem/47538280>
217
218         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
219         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
220         configuration until we derive the right values from viewport meta-tag.
221
222         Reviewed by Wenson Hsieh.
223
224         * WebProcess/WebPage/ios/WebPageIOS.mm:
225         (WebKit::WebPage::resetViewportDefaultConfiguration): Use nativeWebpageParameters() instance method to
226             get the appropriate default configuration.
227
228 2019-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
229
230         [iOS] Adjust initial scale zooming heuristics when changing view scale
231         https://bugs.webkit.org/show_bug.cgi?id=194995
232
233         Reviewed by Tim Horton.
234
235         Currently, we only zoom to the new initial scale iff we're exactly at initial scale before changing the view
236         scale. This was done so that if a user zoomed in really far and then increased the view scale, we wouldn't end
237         up zooming out as a result. However, this leads to confusing behavior in the case where the user has manually
238         changed the zoom scale to something close to (but not exactly) initial scale, and then attempts to zoom in
239         further using view scale. In this case, we'll end up keeping page scale the same, so it looks like nothing is
240         happening.
241
242         To fix this, we tweak our heuristics for determining whether to jump to initial scale; if the view scale is
243         increasing and the new initial scale is greater than the current scale, zoom to initial scale. Likewise, if the
244         view scale is decreasing and the new initial scale is less than the current scale, zoom to initial scale.
245
246         Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
247
248         * WebProcess/WebPage/ios/WebPageIOS.mm:
249         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
250
251 2019-02-25  John Wilander  <wilander@apple.com>
252
253         Introduce and adopt new class RegistrableDomain for eTLD+1
254         https://bugs.webkit.org/show_bug.cgi?id=194791
255         <rdar://problem/48179240>
256
257         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
258
259         A new API test was added. Plenty of existing layout tests under
260         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
261
262         This patch introduces and adopts a new class called WebCore::RegistrableDomain
263         which represents a domain's eTLD+1 (effective top level domain plus one) and is
264         the basis for the term "site," as in same-site. Other popular names include
265         high-level domain, primary domain, and top privately controlled/owned domain.
266         Effective top level domains are enumerated on the Public Suffix List
267         (https://publicsuffix.org).
268
269         This class just uses the full domain for when the Public Suffix List cannot help
270         finding the registrable domain and for WebKit ports that haven't enabled
271         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
272         for the null or unique origin (this matches how these origins were handled
273         before).
274
275         The implementation is a wrapper around a String and the functions and class
276         members that now make use of this new class used to handle regular String
277         objects which didn't help much in terms of type safety or guarantees that the
278         string had already been converted to an eTLD+1.
279
280         We've at least two bad bugs in the Storage Access API because of confusion
281         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
282         will prohibit such bugs in the future.
283
284         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
285         WebCore::RegistrableDomain for partitioning in a later patch.
286
287         This patch also enhances parameter naming by:
288         - Removing parts that refer to "primary" as in primaryDomain.
289         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
290         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
291         - Using the term "domain" consistently instead of e.g. "host."
292
293         A follow-up patch will continue backwards in call chains to create
294         WebCore::RegistrableDomain objects as early as possible instead of using strings.
295         I did not do that work here in the interest of patch size.
296
297         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
298         (WebKit::domainsToString):
299         (WebKit::pruneResources):
300         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
301         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
302         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
303         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentDueToDebugMode):
304         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
305         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
306         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
307         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
308         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
309         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
310         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
311         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
312         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
313         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
314         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
315         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
316         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
317         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
318         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
319         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
320         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
321         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
322         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
323         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
324         (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
325         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
326         (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
327         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
328         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
329         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
330         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
331         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
332         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
333         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForRegistrableDomain):
334         (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
335         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
336         (WebKit::debugLogDomainsInBatches):
337         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
338         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
339         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
340         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
341         (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
342         (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
343         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
344         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain): Deleted.
345         (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Deleted.
346         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
347         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
348         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
349         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
350         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
351         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
352         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
353         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
354         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
355         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
356         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
357         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
358         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
359         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
360         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
361         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
362         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
363         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
364         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
365         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
366         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
367         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
368         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
369         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
370         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
371         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
372         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
373         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
374         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
375         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
376         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
377         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
378         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
379         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
380         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
381         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
382         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
383         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
384         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
385         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
386         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
387         (WebKit::WebResourceLoadStatisticsStore::registrableDomainsWithWebsiteData):
388         (WebKit::isolatedPrimaryDomain): Deleted.
389         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
390         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
391         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
392         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
393         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
394         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
395         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
396         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
397         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
398         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
399         * NetworkProcess/NetworkConnectionToWebProcess.h:
400         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
401         * NetworkProcess/NetworkProcess.cpp:
402         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
403         (WebKit::NetworkProcess::isGrandfathered):
404         (WebKit::NetworkProcess::isPrevalentResource):
405         (WebKit::NetworkProcess::isVeryPrevalentResource):
406         (WebKit::NetworkProcess::setGrandfathered):
407         (WebKit::NetworkProcess::setPrevalentResource):
408         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
409         (WebKit::NetworkProcess::setVeryPrevalentResource):
410         (WebKit::NetworkProcess::clearPrevalentResource):
411         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
412         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
413         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
414         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
415         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
416         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
417         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
418         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
419         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
420         (WebKit::NetworkProcess::setLastSeen):
421         (WebKit::NetworkProcess::hasStorageAccessForFrame):
422         (WebKit::NetworkProcess::hasStorageAccess):
423         (WebKit::NetworkProcess::requestStorageAccess):
424         (WebKit::NetworkProcess::requestStorageAccessGranted):
425         (WebKit::NetworkProcess::grantStorageAccess):
426         (WebKit::NetworkProcess::logFrameNavigation):
427         (WebKit::NetworkProcess::logUserInteraction):
428         (WebKit::NetworkProcess::hadUserInteraction):
429         (WebKit::NetworkProcess::clearUserInteraction):
430         (WebKit::NetworkProcess::removePrevalentDomains):
431         (WebKit::filterForRegistrableDomains):
432         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
433         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
434         (WebKit::filterForTopLevelDomains): Deleted.
435         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
436         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
437         * NetworkProcess/NetworkProcess.h:
438         * NetworkProcess/NetworkProcess.messages.in:
439         * NetworkProcess/NetworkResourceLoader.cpp:
440         (WebKit::logCookieInformationInternal):
441         * NetworkProcess/NetworkSession.cpp:
442         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
443         (WebKit::NetworkSession::registrableDomainsWithWebsiteData):
444         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
445         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
446         * NetworkProcess/NetworkSession.h:
447         * Shared/WebCoreArgumentCoders.cpp:
448         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
449         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
450         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
451         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
452         * UIProcess/Network/NetworkProcessProxy.cpp:
453         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
454         (WebKit::NetworkProcessProxy::isPrevalentResource):
455         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
456         (WebKit::NetworkProcessProxy::setPrevalentResource):
457         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
458         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
459         (WebKit::NetworkProcessProxy::setLastSeen):
460         (WebKit::NetworkProcessProxy::clearPrevalentResource):
461         (WebKit::NetworkProcessProxy::logUserInteraction):
462         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
463         (WebKit::NetworkProcessProxy::clearUserInteraction):
464         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
465         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
466         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
467         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
468         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
469         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
470         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
471         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
472         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
473         (WebKit::NetworkProcessProxy::isGrandfathered):
474         (WebKit::NetworkProcessProxy::setGrandfathered):
475         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
476         (WebKit::NetworkProcessProxy::hasStorageAccess):
477         (WebKit::NetworkProcessProxy::requestStorageAccess):
478         (WebKit::NetworkProcessProxy::grantStorageAccess):
479         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
480         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
481         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
482         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
483         * UIProcess/Network/NetworkProcessProxy.h:
484         * UIProcess/Network/NetworkProcessProxy.messages.in:
485         * UIProcess/WebPageProxy.cpp:
486         (WebKit::WebPageProxy::logFrameNavigation):
487         (WebKit::WebPageProxy::requestStorageAccessConfirm):
488         * UIProcess/WebProcessProxy.cpp:
489         (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed):
490         (WebKit::WebProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
491         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
492         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
493         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
494         * UIProcess/WebProcessProxy.h:
495         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
496         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
497         (WebKit::WebsiteDataStore::isPrevalentResource):
498         (WebKit::WebsiteDataStore::setPrevalentResource):
499         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
500         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
501         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
502         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
503         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
504         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
505         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
506         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
507         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
508         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
509         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
510         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
511         (WebKit::WebsiteDataStore::clearPrevalentResource):
512         (WebKit::WebsiteDataStore::setLastSeen):
513         (WebKit::WebsiteDataStore::hasStorageAccess):
514         (WebKit::WebsiteDataStore::requestStorageAccess):
515         (WebKit::WebsiteDataStore::grantStorageAccess):
516         (WebKit::WebsiteDataStore::logUserInteraction):
517         (WebKit::WebsiteDataStore::hasHadUserInteraction):
518         (WebKit::WebsiteDataStore::clearUserInteraction):
519         (WebKit::WebsiteDataStore::setGrandfathered):
520         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Deleted.
521         * UIProcess/WebsiteData/WebsiteDataStore.h:
522         * WebProcess/WebPage/WebPage.cpp:
523         (WebKit::WebPage::hasStorageAccess):
524         (WebKit::WebPage::requestStorageAccess):
525         * WebProcess/WebProcess.cpp:
526         (WebKit::m_nonVisibleProcessCleanupTimer):
527         (WebKit::WebProcess::initializeWebProcess):
528
529 2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
530
531         [WPE] Bump WPEBackend-fdo requirement to API version 1.0
532         https://bugs.webkit.org/show_bug.cgi?id=195001
533
534         Reviewed by Carlos Garcia Campos.
535
536         API version 1.0 always includes the functionality previously guarded with
537         WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
538         unconditionally.
539
540         * UIProcess/API/wpe/WPEView.cpp:
541         (WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
542         (WKWPE::m_backend): Ditto.
543         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
544         (WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
545         library name, remove call to wpe_fdo_initialize_for_egl_display().
546         (WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
547         here, to bail out early in case initialization fails.
548         * UIProcess/glib/WebProcessPoolGLib.cpp:
549         (WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
550         WPE_BACKEND_CHECK_VERSION().
551
552 2019-02-25  Per Arne Vollan  <pvollan@apple.com>
553
554         A prewarmed Web process should have a process assertion.
555         https://bugs.webkit.org/show_bug.cgi?id=195006
556
557         Reviewed by Geoffrey Garen.
558
559         To make sure the prewarm message is handled in the Web process before the process is suspended,
560         the process should have a process assertion. This can be fixed by sending the prewarm message
561         inside WebProcessPool::initializeNewWebProcess, since all message sent inside this method are
562         guaranteed to be handled before the WebContent process is suspended.
563
564         This patch is based on Chris Dumez' idea and obervation of the issue.
565
566         * UIProcess/WebProcessPool.cpp:
567         (WebKit::WebProcessPool::createNewWebProcess):
568         (WebKit::WebProcessPool::initializeNewWebProcess):
569         * UIProcess/WebProcessPool.h:
570
571 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
572
573         [GTK] Enable PSON
574         https://bugs.webkit.org/show_bug.cgi?id=194979
575
576         Reviewed by Žan Doberšek.
577
578         It is expected that this may introduce unexpected regressions, so it's appropriate to do
579         this at the start of a new release cycle.
580
581         * Shared/WebPreferencesDefaultValues.h:
582
583 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
584
585         [WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
586         https://bugs.webkit.org/show_bug.cgi?id=194614
587
588         Reviewed by Carlos Garcia Campos.
589
590         This environment variable is now enabled for WPE, not just for GTK.
591
592         It is now possible to use this environment variable to enable complex text, not just to
593         disable it.
594
595         WebProcessPool::setAlwaysUsesComplexTextCodePath is fixed to be respected even when this
596         environment variable is set, although WPE and GTK will never do so.
597
598         * UIProcess/glib/WebProcessPoolGLib.cpp:
599         (WebKit::WebProcessPool::platformInitialize):
600         (WebKit::WebProcessPool::platformInitializeWebProcess):
601
602 2019-02-24  Zalan Bujtas  <zalan@apple.com>
603
604         Introduce ContentChangeObserver class
605         https://bugs.webkit.org/show_bug.cgi?id=194977
606         <rdar://problem/48338115>
607
608         Reviewed by Simon Fraser.
609
610         * WebProcess/WebPage/ios/WebPageIOS.mm:
611         (WebKit::WebPage::handleSyntheticClick):
612         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
613
614 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
615
616         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
617         https://bugs.webkit.org/show_bug.cgi?id=194984
618
619         Reviewed by Sam Weinig.
620
621         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
622
623         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
624         current layout viewport rect. Instead, set the layout viewport on the root
625         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
626         
627         Add a WK2 Scrolling log channel.
628
629         * Platform/Logging.h:
630         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
631         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
632         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
633         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
634         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
635         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
636         (WebKit::RemoteScrollingTree::fixedPositionRect): Deleted.
637         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
638         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
639         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
640         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted.
641         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
642         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
643         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
644         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
645         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
646         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
647         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
648         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
649         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
650         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
651         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange):
652         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
653         * UIProcess/ios/WKContentView.mm:
654         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
655
656 2019-02-20  Darin Adler  <darin@apple.com>
657
658         Finish removing String::format
659         https://bugs.webkit.org/show_bug.cgi?id=194893
660
661         Reviewed by Daniel Bates.
662
663         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
664         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
665         a problem where we passed an NSData * to format with a "%s"."
666
667 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
668
669         [WPE] Install MemoryPressureHandler in UIProcess
670         https://bugs.webkit.org/show_bug.cgi?id=194617
671
672         Reviewed by Žan Doberšek.
673
674         Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
675         too.
676
677         We need @no-unify to avoid changing the unified source bundles under API/, which are
678         notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)
679
680         * SourcesWPE.txt:
681         * UIProcess/WebMemoryPressureHandler.cpp:
682         (WebKit::installMemoryPressureHandler):
683         * UIProcess/glib/WebProcessPoolGLib.cpp:
684         (WebKit::WebProcessPool::platformInitialize):
685
686 2019-02-23  Chris Dumez  <cdumez@apple.com>
687
688         Give DrawingAreas their own identifiers
689         https://bugs.webkit.org/show_bug.cgi?id=194969
690         <rdar://problem/48154508>
691
692         Unreviewed, fix API test debug assertion failures after r241988.
693         We do not support sending an ObjectIdentifier that is 0 via IPC so update WebPageProxy::CreateNewPage
694         IPC to return an Optional<WebPageCreationParameters> instead of a WebPageCreationParameters. It returns
695         nullopt when there this no UIClient or the client did not create the page, instead of returning a
696         default-initialized WebPageCreationParameters.
697
698         * UIProcess/WebPageProxy.cpp:
699         (WebKit::WebPageProxy::createNewPage):
700         * UIProcess/WebPageProxy.messages.in:
701         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
702         (WebKit::WebChromeClient::createWindow):
703
704 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
705
706         Remove remnants of iOS WK1 scrolling tree code
707         https://bugs.webkit.org/show_bug.cgi?id=194980
708
709         Reviewed by Sam Weinig.
710
711         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.
712
713         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
714         removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).
715
716         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
717         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
718         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
719         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
720         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
721         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
722         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
723         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
724         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
725         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
726         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
727         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
728         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
729         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
730         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
731         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
732
733 2019-02-23  Keith Miller  <keith_miller@apple.com>
734
735         Add new mac target numbers
736         https://bugs.webkit.org/show_bug.cgi?id=194955
737
738         Reviewed by Tim Horton.
739
740         * Configurations/Base.xcconfig:
741         * Configurations/DebugRelease.xcconfig:
742
743 2019-02-22  Chris Dumez  <cdumez@apple.com>
744
745         Give DrawingAreas their own identifiers
746         https://bugs.webkit.org/show_bug.cgi?id=194969
747         <rdar://problem/48154508>
748
749         Reviewed by Geoffrey Garen.
750
751         Give DrawingAreas their own identifiers instead of using the pageID. It will make the IPC more robust now that a
752         WebPageProxy can have several drawing areas with PSON.
753
754         * Shared/DrawingAreaInfo.h:
755         * Shared/WebPageCreationParameters.cpp:
756         (WebKit::WebPageCreationParameters::encode const):
757         (WebKit::WebPageCreationParameters::decode):
758         * Shared/WebPageCreationParameters.h:
759         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
760         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
761         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
762         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
763         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
764         * UIProcess/DrawingAreaProxy.cpp:
765         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
766         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
767         (WebKit::DrawingAreaProxy::messageSenderConnection const):
768         (WebKit::DrawingAreaProxy::sendMessage):
769         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
770         * UIProcess/DrawingAreaProxy.h:
771         (WebKit::DrawingAreaProxy::identifier const):
772         (WebKit::DrawingAreaProxy::process const):
773         * UIProcess/DrawingAreaProxyImpl.cpp:
774         (WebKit::DrawingAreaProxyImpl::update):
775         * UIProcess/ProvisionalPageProxy.cpp:
776         (WebKit::ProvisionalPageProxy::initializeWebPage):
777         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
778         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
779         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
780         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
781         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
782         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
783         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
784         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
785         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
786         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
787         * UIProcess/WebPageProxy.cpp:
788         (WebKit::WebPageProxy::initializeWebPage):
789         (WebKit::WebPageProxy::createNewPage):
790         (WebKit::WebPageProxy::creationParameters):
791         * UIProcess/WebPageProxy.h:
792         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
793         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
794         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
795         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
796         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
797         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
798         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
799         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
800         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
801         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
802         (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
803         (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
804         * WebProcess/WebPage/DrawingArea.cpp:
805         (WebKit::DrawingArea::DrawingArea):
806         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
807         * WebProcess/WebPage/DrawingArea.h:
808         (WebKit::DrawingArea::identifier const):
809         (WebKit::DrawingArea::send):
810         * WebProcess/WebPage/DrawingAreaImpl.cpp:
811         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
812         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
813         (WebKit::DrawingAreaImpl::display):
814         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
815         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
816         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
817         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
818         * WebProcess/WebPage/WebPage.cpp:
819         (WebKit::WebPage::reinitializeWebPage):
820         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
821         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
822         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
823         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
824         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
825         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
826         (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
827
828 2019-02-22  Andy Estes  <aestes@apple.com>
829
830         [Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
831         https://bugs.webkit.org/show_bug.cgi?id=194971
832         <rdar://problem/35786264>
833
834         Reviewed by Tim Horton.
835
836         sandbox_extension_issue_file is not actually deprecated.
837
838         * Shared/mac/SandboxExtensionMac.mm:
839         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
840
841 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
842
843         [iOS] Callout menu overlaps in-page controls when editing a comment in github.com's issue tracker
844         https://bugs.webkit.org/show_bug.cgi?id=194873
845         <rdar://problem/46701974>
846
847         Reviewed by Tim Horton.
848
849         On the topic of supporting web-based rich text editors on iOS, one problematic area has always been handling
850         conflicts between platform UI (i.e., the system callout menu) and in-page text editing controls. This issue
851         comes up in websites that don't use the "hidden contenteditable" approach to rich text editing, but also show
852         additional controls in a toolbar or contextual menu above the selection. In these cases, what often happens is
853         that system controls overlap controls in the page.
854
855         Luckily, the iOS callout menu (i.e. the private UICalloutBar) is capable of presenting with a list of "evasion
856         rects" to avoid; if the callout bar would normally intersect with one of these rects, then a different
857         orientation that does not intersect with one of these rects is chosen instead. Currently, the only rect added
858         here by UIKit when presenting the callout menu is the bounding rect of the on-screen keyboard, but after
859         <rdar://problem/48128337>, we now have a generalized mechanism for offering additional evasion rects before
860         UIKit presents the callout menu.
861
862         This patch adopts the mechanism introduced in <rdar://problem/48128337>, and introduces a heuristic for
863         determining the approximate location of controls in the page which might overlap the callout menu. This
864         heuristic works by hit-testing for clickable (but non-editable) nodes above the bounds of the selection, which
865         are additionally not hit-tested by advancing outwards from any of the other edges of the selection bounds.
866         Additionally, any hit-tested nodes whose bounding rects are very large (relative to the content view size) are
867         ignored (this deals with scenarios where the body or a large container element has a click handler). We then add
868         the bounding rects of each of the nodes that fit this criteria to the list of rects for UIKit to avoid when
869         presenting the system callout menu.
870
871         The result is that WebKit will, by default, avoid overlapping anything that looks like controls in the page when
872         showing a callout menu in editable content. In practice, this fixes overlapping controls on most websites that
873         roll their own context menu or toolbar in their rich text editor.
874
875         Test: editing/selection/ios/avoid-showing-callout-menu-over-controls.html
876
877         * Platform/spi/ios/UIKitSPI.h:
878         * UIProcess/WebPageProxy.h:
879         * UIProcess/ios/WKContentViewInteraction.mm:
880         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
881         (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
882         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
883
884         Drive-by: handle null completion handler arguments more gracefully, by raising an NSException and bailing before
885         attempting to invoke a nil block.
886
887         * UIProcess/ios/WebPageProxyIOS.mm:
888         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
889
890         See above for more detail.
891
892         * WebProcess/WebPage/WebPage.h:
893         * WebProcess/WebPage/WebPage.messages.in:
894         * WebProcess/WebPage/ios/WebPageIOS.mm:
895         (WebKit::WebPage::requestEvasionRectsAboveSelection):
896
897 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
898
899         Unreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.
900
901         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
902
903 2019-02-22  Chris Dumez  <cdumez@apple.com>
904
905         Regression(PSON) Unable to preview password-protected documents on iCloud.com
906         https://bugs.webkit.org/show_bug.cgi?id=194954
907         <rdar://problem/48127957>
908
909         Reviewed by Alex Christensen.
910
911         Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related
912         IPC on iOS.
913
914         * UIProcess/ProvisionalPageProxy.cpp:
915         (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
916         (WebKit::ProvisionalPageProxy::didReceiveMessage):
917         * UIProcess/ProvisionalPageProxy.h:
918         * UIProcess/WebPageProxy.h:
919         * UIProcess/ios/WebPageProxyIOS.mm:
920         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
921         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
922
923 2019-02-22  Per Arne Vollan  <pvollan@apple.com>
924
925         [iOS] Sandbox should allow mach lookups related to media capturing
926         https://bugs.webkit.org/show_bug.cgi?id=194951
927         <rdar://problem/48013875>
928
929         Reviewed by Brent Fulgham.
930
931         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
932
933 2019-02-22  Alexander Mikhaylenko  <exalm7659@gmail.com>
934
935         [GTK] Navigation gesture improvements
936         https://bugs.webkit.org/show_bug.cgi?id=194943
937
938         Reviewed by Michael Catanzaro.
939
940         Cancel the gesture if progress is less than 0.5 and velocity is not high enough.
941
942         Allow to continue the gesture during animation. Introduce finished state to be used
943         when showing snapshot after the animation ends.
944
945         Fix duration calculation, also slow it down so that the initial velocity matches
946         what it was during the gesture.
947
948         * UIProcess/ViewGestureController.h: Add shouldCancel() and State::Finishing to SwipeProgressTracker.
949         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
950         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
951         Fix velocity calculation, allow scrolling during State::Animating.
952         (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): Added.
953         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): Use shouldCancel() and fix duration calculation.
954         (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation): Set state to State::Finishing when the animation ends.
955
956 2019-02-22  Chris Dumez  <cdumez@apple.com>
957
958         REGRESSION(PSON) Scroll position is sometimes not restored on history navigation
959         https://bugs.webkit.org/show_bug.cgi?id=194924
960         <rdar://problem/48216125>
961
962         Reviewed by Geoffrey Garen.
963
964         When process-swapping, we would create a new WebPage in the new process, which would
965         call restoreSessionInternal() to restore the HistoryItems based on the UIProcess's
966         backforward list. The issue is that this session restoring would send HistoryItem
967         updates back to the UIProcess. Without PSON, this would be unnecessary but harmless.
968         With PSON though, this may end up overwriting values set by the previous process,
969         such as the scroll position.
970
971         Address the issue by temporarily disabling the HistoryItem update notifications to
972         the UIProcess while restoring a session.
973
974         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
975         (-[WKBackForwardListItem _scrollPosition]):
976         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
977         * WebProcess/WebPage/WebPage.cpp:
978         (WebKit::WebPage::restoreSessionInternal):
979
980 2019-02-21  Adrian Perez de Castro  <aperez@igalia.com>
981
982         [WPE][GTK] No API documentation generated for WebKitUserContentFilterStore
983         https://bugs.webkit.org/show_bug.cgi?id=194908
984
985         Reviewed by Carlos Garcia Campos.
986
987         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add entry for webkit_user_content_filter_store_get_type().
988         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add entry for WebKitUserContentFilterStore.
989         * UIProcess/API/wpe/docs/wpe-docs.sgml: Ditto.
990
991 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
992
993         wpewebkit-2.23.90 Failing to build on Fedora
994         https://bugs.webkit.org/show_bug.cgi?id=194922
995
996         Unreviewed. Fix path to WebKitUserContentFilterStore.h in WPE_API_INSTALLED_HEADERS.
997
998         * PlatformWPE.cmake:
999
1000 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
1001
1002         Hardcode Visual Viewports on everywhere except iOS WK1
1003         https://bugs.webkit.org/show_bug.cgi?id=194928
1004
1005         Reviewed by Zalan Bujtas.
1006
1007         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
1008         change the default value of the Setting to 'true', and hardcode WebView on iOS to
1009         set it to false. The setting has shipped for several years and there's no need to turn
1010         it off now.
1011
1012         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
1013         Visual Viewports are not enabled.
1014         
1015         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
1016         that only runs in WK2
1017
1018         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1019         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1020         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1021         * Shared/WebPreferences.yaml:
1022         * UIProcess/API/Cocoa/WKPreferences.mm:
1023         (-[WKPreferences _visualViewportEnabled]): Deleted.
1024         (-[WKPreferences _setVisualViewportEnabled:]): Deleted.
1025         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1026         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1027         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1028         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1029         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
1030         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1031         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
1032         * UIProcess/WebPageProxy.h:
1033         * UIProcess/ios/WKContentView.mm:
1034         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1035         * UIProcess/ios/WebPageProxyIOS.mm:
1036         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
1037         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1038         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1039         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1040         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1041         * WebProcess/WebPage/ios/WebPageIOS.mm:
1042         (WebKit::WebPage::getFocusedElementInformation):
1043         (WebKit::WebPage::dynamicViewportSizeUpdate):
1044         (WebKit::WebPage::updateVisibleContentRects):
1045
1046 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1047
1048         [GTK] Epiphany searching for plugins even if plugins are disabled
1049         https://bugs.webkit.org/show_bug.cgi?id=194352
1050
1051         Reviewed by Michael Catanzaro.
1052
1053         Check pluginsEnabled setting before trying to get plugins from UI process.
1054
1055         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1056         (WebKit::WebPluginInfoProvider::populatePluginCache):
1057
1058 2019-02-21  Darin Adler  <darin@apple.com>
1059
1060         Some refinements for Node and Document
1061         https://bugs.webkit.org/show_bug.cgi?id=194764
1062
1063         Reviewed by Ryosuke Niwa.
1064
1065         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
1066         (webkit_dom_document_get_override_style): Changed to return nullptr directly instead of
1067         calling a bunch of WebCore code first. No real value in checking arguments or doing any work.
1068
1069         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1070         (WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument const): Deleted.
1071         No need to override the function inherited from the base class, nor to keep track of the
1072         unnecessary task of implementing this some day.
1073         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
1074
1075 2019-02-21  Ryosuke Niwa  <rniwa@webkit.org>
1076
1077         Discard cached processes when clearing website data store
1078         https://bugs.webkit.org/show_bug.cgi?id=194894
1079
1080         Reviewed by Chris Dumez.
1081
1082         Clear the process cache when clearing the website data store so that there is no way to infer
1083         which site the user had visited by observing for which sites WebContent processes had been cached.
1084
1085         There is one sublty in WebsiteDataStore::removeData that we have to delay the clearing of
1086         the web process cache until the next run loop because SuspendedPageProxy::~SuspendedPageProxy
1087         invokes WebProcessProxy::maybeShutDown in the next run loop. We also have to disable the process
1088         cache during this time as it would otherwise trigger the responsiveness check of WebContent process
1089         can take arbitrarily long time.
1090
1091         * UIProcess/API/Cocoa/WKProcessPool.mm:
1092         (-[WKProcessPool _processCacheCapacity]): Added for testing.
1093         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1094         * UIProcess/WebProcessCache.cpp:
1095         (WebKit::WebProcessCache::addProcess): Avoid adding web processes to the cache while the suspended
1096         pages are being cleared.
1097         * UIProcess/WebProcessCache.h:
1098         (WebKit::WebProcessCache::disabled const): Added.
1099         (WebKit::WebProcessCache::setDisabled): Added.
1100         * UIProcess/WebProcessPool.cpp:
1101         (WebKit::WebProcessPool::handleMemoryPressureWarning):
1102         (WebKit::WebProcessPool::clearSuspendedPages): Added.
1103         * UIProcess/WebProcessPool.h:
1104         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1105         (WebKit::WebsiteDataStore::removeData):
1106
1107 2019-02-21  Alex Christensen  <achristensen@webkit.org>
1108
1109         Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView
1110         https://bugs.webkit.org/show_bug.cgi?id=194914
1111         <rdar://problem/47586889>
1112
1113         Reviewed by Geoffrey Garen.
1114
1115         * UIProcess/API/APIUIClient.h:
1116         (API::UIClient::didShowSafeBrowsingWarning):
1117         (API::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
1118         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1119         * UIProcess/Cocoa/UIDelegate.h:
1120         * UIProcess/Cocoa/UIDelegate.mm:
1121         (WebKit::UIDelegate::setDelegate):
1122         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
1123         * UIProcess/WebPageProxy.cpp:
1124         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1125
1126 2019-02-21  Tim Horton  <timothy_horton@apple.com>
1127
1128         Turn a high-value UI-side-compositing assertion into a release assert
1129         https://bugs.webkit.org/show_bug.cgi?id=194887
1130
1131         Reviewed by Simon Fraser.
1132
1133         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1134         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1135         There is absolutely no situation in which this assert should fire
1136         if WebKit is behaving correctly, and it will basically always result
1137         in a UI process crash (or at least confusion), so make it a release assert.
1138         This would have saved us a lot of stress in bug 194845.
1139
1140 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
1141
1142         [MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
1143         https://bugs.webkit.org/show_bug.cgi?id=194913
1144
1145         Reviewed by Brent Fulgham.
1146
1147         MSVC has problems with the scoping of `this` within a nested lambda. To work around the
1148         behavior the enclosing lambda's wrapping of `this` is used within the nested lambda.
1149
1150         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1151         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
1152         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1153         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1154
1155 2019-02-21  Chris Dumez  <cdumez@apple.com>
1156
1157         Fix API test crashes after r241855.
1158
1159         Reviewed by Ryosuke Niwa.
1160
1161         * UIProcess/WebProcessCache.cpp:
1162         (WebKit::WebProcessCache::addProcessIfPossible):
1163
1164 2019-02-21  Alex Christensen  <achristensen@webkit.org>
1165
1166         API::HTTPCookieStore should expose setCookies()
1167         https://bugs.webkit.org/show_bug.cgi?id=194861
1168
1169         Reviewed by Brent Fulgham.
1170
1171         Pass a Vector<Cookie> instead of just one cookie at a time.
1172         This will add the ability to set multiple cookies without an IPC roundtrip per cookie.
1173
1174         * NetworkProcess/Cookies/WebCookieManager.cpp:
1175         (WebKit::WebCookieManager::setCookie):
1176         * NetworkProcess/Cookies/WebCookieManager.h:
1177         * NetworkProcess/Cookies/WebCookieManager.messages.in:
1178         * UIProcess/API/APIHTTPCookieStore.cpp:
1179         (API::HTTPCookieStore::setCookies):
1180         (API::HTTPCookieStore::setCookie): Deleted.
1181         * UIProcess/API/APIHTTPCookieStore.h:
1182         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1183         (-[WKHTTPCookieStore setCookie:completionHandler:]):
1184         * UIProcess/WebCookieManagerProxy.cpp:
1185         (WebKit::WebCookieManagerProxy::setCookies):
1186         (WebKit::WebCookieManagerProxy::setCookie): Deleted.
1187         * UIProcess/WebCookieManagerProxy.h:
1188
1189 2019-02-21  Antoine Quint  <graouts@apple.com>
1190
1191         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
1192         https://bugs.webkit.org/show_bug.cgi?id=194531
1193         <rdar://problem/47714562>
1194
1195         Reviewed by Tim Horton.
1196
1197         Follow-up commit to ensure this SPI is only called on newer versions of iOS.
1198
1199         * UIProcess/ios/WKContentViewInteraction.mm:
1200         (-[WKContentView cancelPointersForGestureRecognizer:]):
1201
1202 2019-02-21  Tim Horton  <timothy_horton@apple.com>
1203
1204         Crash under RemoteLayerTreePropertyApplier::applyProperties when reattaching to old process
1205         https://bugs.webkit.org/show_bug.cgi?id=194845
1206         <rdar://problem/47944579>
1207
1208         Reviewed by Antti Koivisto.
1209
1210         New test: ProcessSwap.PageOverlayLayerPersistence
1211
1212         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1213         (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
1214         Keep track of all properties that have ever changed on a layer, so we
1215         can re-send them if a layer moves between contexts.
1216
1217         * WebProcess/WebPage/DrawingArea.cpp:
1218         (WebKit::DrawingArea::~DrawingArea):
1219         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
1220         * WebProcess/WebPage/DrawingArea.h:
1221         (WebKit::DrawingArea::layerHostDidFlushLayers):
1222         Make it possible to tear down DrawingArea's MessageReceiver before it is destroyed,
1223         so that we can keep two DrawingAreas alive in a single process for a short time.
1224
1225         (WebKit::DrawingArea::adoptLayersFromDrawingArea):
1226         Add adoptLayersFromDrawingArea; see below for its only useful implementation.
1227
1228         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
1229         (WebKit::GraphicsLayerCARemote::GraphicsLayerCARemote):
1230         (WebKit::GraphicsLayerCARemote::~GraphicsLayerCARemote):
1231         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
1232         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
1233         (WebKit::GraphicsLayerCARemote::moveToContext):
1234         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
1235         Make it possible to move a GraphicsLayerCARemote between RemoteLayerTreeContexts.
1236
1237         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1238         (WebKit::PlatformCALayerRemote::create):
1239         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
1240         (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
1241         (WebKit::PlatformCALayerRemote::moveToContext):
1242         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
1243         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
1244         (WebKit::PlatformCALayerRemoteCustom::create):
1245         (WebKit::PlatformCALayerRemoteCustom::clone const):
1246         Make it possible to move a PlatformCALayerRemote between RemoteLayerTreeContexts.
1247
1248         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
1249         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1250         (WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
1251         (WebKit::RemoteLayerTreeContext::adoptLayersFromContext):
1252         (WebKit::RemoteLayerTreeContext::layerDidEnterContext):
1253         (WebKit::RemoteLayerTreeContext::layerWillLeaveContext):
1254         (WebKit::RemoteLayerTreeContext::graphicsLayerDidEnterContext):
1255         (WebKit::RemoteLayerTreeContext::graphicsLayerWillLeaveContext):
1256         (WebKit::RemoteLayerTreeContext::layerWasCreated): Deleted.
1257         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed): Deleted.
1258         Keep track of all GraphicsLayerCARemote instances in the context, like we
1259         do for PlatformCALayerRemote, so that we can update their context backpointers if needed.
1260
1261         Also make it possible to move all outstanding layers to a new context.
1262
1263         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1264         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1265         (WebKit::RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea):
1266         * WebProcess/WebPage/WebPage.cpp:
1267         (WebKit::WebPage::reinitializeWebPage):
1268         When doing a DrawingArea swap, transition all layers from the old context
1269         to the new one. In order to do this, we temporarily keep both DrawingAreas
1270         alive, but make use of the new mechanism to remove the old one's MessageReceiver
1271         before installing the new one, so that destroying the old one later doesn't
1272         remove it (avoiding re-introducing bug 189481).
1273
1274 2019-02-21  Chris Dumez  <cdumez@apple.com>
1275
1276         Unreviewed API test fix after r241855.
1277
1278         * UIProcess/WebProcessProxy.cpp:
1279         (WebKit::WebProcessProxy::~WebProcessProxy):
1280
1281 2019-02-21  Antoine Quint  <graouts@apple.com>
1282
1283         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
1284         https://bugs.webkit.org/show_bug.cgi?id=194531
1285         <rdar://problem/47714562>
1286
1287         Reviewed by Dean Jackson.
1288
1289         * Platform/spi/ios/UIKitSPI.h:
1290         * UIProcess/ios/WKContentViewInteraction.mm:
1291         (-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
1292         to respondsToSelector until the SPI has shipped for OpenSource builds to work.
1293
1294 2019-02-20  Antti Koivisto  <antti@apple.com>
1295
1296         Make programmatic frame scrolling work on iOS
1297         https://bugs.webkit.org/show_bug.cgi?id=194886
1298
1299         Reviewed by Simon Fraser.
1300
1301         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1302         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
1303
1304         Don't move based on the layout scroll position. This just overrides the user scroll position.
1305         Remove ScrolledContentsLayer checks, we only need to deal with the ScrollContainerLayer here.
1306
1307         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition):
1308
1309         Scroll the UIScrollView correctly. This is called as a result of setting the RequestedScrollPosition property.
1310         Remove scroll origin code, it doesn't look correct (and is untested).
1311
1312 2019-02-20  Chris Dumez  <cdumez@apple.com>
1313
1314         [PSON] Make sure hung processes are not kept alive by suspended pages or process caching
1315         https://bugs.webkit.org/show_bug.cgi?id=194881
1316         <rdar://problem/48249014>
1317
1318         Reviewed by Geoffrey Garen.
1319
1320         After we construct a SuspendedPageProxy and before we send the IPC to the WebProcess to
1321         ask it to suspend, start a 10 seconds timer. If the process does not answer the request
1322         to suspend before the timer fires, we destroy the SuspendedPageProxy so that we do not
1323         keep a hung process around.
1324
1325         For the WebProcessCache, we now call WebProcessProxy::isResponsive() on the process
1326         before adding it to the cache. Internally, this relies on an IPC handshake with the
1327         WebProcess. If the process is not responsive, we do not add it to the cache and we
1328         shut it down. If it is responsive then we proceed normally with adding it to the
1329         cache.
1330
1331         * UIProcess/SuspendedPageProxy.cpp:
1332         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1333         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
1334         (WebKit::SuspendedPageProxy::suspensionTimedOut):
1335         * UIProcess/SuspendedPageProxy.h:
1336         * UIProcess/WebProcessCache.cpp:
1337         (WebKit::WebProcessCache::addProcessIfPossible):
1338         (WebKit::WebProcessCache::addProcess):
1339         * UIProcess/WebProcessCache.h:
1340         * UIProcess/WebProcessProxy.cpp:
1341         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1342         (WebKit::WebProcessProxy::maybeShutDown):
1343         (WebKit::WebProcessProxy::isResponsive):
1344         * UIProcess/WebProcessProxy.h:
1345
1346 2019-02-20  Chris Dumez  <cdumez@apple.com>
1347
1348         Unreviewed build fix after r241823.
1349
1350         * UIProcess/SuspendedPageProxy.h:
1351
1352 2019-02-20  Alex Christensen  <achristensen@webkit.org>
1353
1354         Unreviewed, rolling out r241838.
1355
1356         Broke API tests
1357
1358         Reverted changeset:
1359
1360         "Resolve WebsiteDataStore/HTTPCookieStore ref cycle"
1361         https://bugs.webkit.org/show_bug.cgi?id=194868
1362         https://trac.webkit.org/changeset/241838
1363
1364 2019-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1365
1366         REGRESSION: [ iOS ] Layout Test editing/input/ios/rtl-keyboard-input-on-focus.html is a Timeout
1367         https://bugs.webkit.org/show_bug.cgi?id=194601
1368         <rdar://problem/48080316>
1369
1370         Reviewed by Tim Horton.
1371
1372         Following r241311, if a web view becomes first responder and is then moved offscreen (or obscured, hidden, or in
1373         the case of WebKitTestRunner, its UIWindow loses its status as keyWindow), we end up holding on to the input
1374         view update deferral token indefinitely, waiting for the current focused element to be blurred or refocused.
1375
1376         This also manifests other user-facing bugs, the most common of which is the keyboard occasionally remaining
1377         onscreen after typing a URL in the unified field in MobileSafari and hitting Return, in the case where there is
1378         no autofocused element on the page.
1379
1380         To fix this, when becoming the first responder, additionally install a callback to detect when the page is
1381         finished handling the activity state change, and invalidate the input deferral token then. This retains the
1382         behavior where calling -becomeFirstResponder on the web view while a different view is focused will keep the
1383         keyboard stable, since the focused element message from the web process should be dispatched when handling the
1384         activity state change within the web process.
1385
1386         Of course, the web process may not be responsive at all while the web view is still in the view hierarchy, in
1387         which case we may still end up deferring input view updates indefinitely. In this case, we maintain a separate
1388         watchdog timer with a short delay, after which we unconditionally invalidate the token.
1389
1390         * UIProcess/WebPageProxy.cpp:
1391         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
1392
1393         Move the implementation of installActivityStateChangeCompletionHandler into cross-platform code.
1394
1395         * UIProcess/WebPageProxy.h:
1396         * UIProcess/ios/WKContentView.mm:
1397         * UIProcess/ios/WKContentViewInteraction.mm:
1398         (-[WKContentView cleanupInteraction]):
1399         (-[WKContentView _cancelPreviousResetInputViewDeferralRequest]):
1400         (-[WKContentView _scheduleResetInputViewDeferralAfterBecomingFirstResponder]):
1401         (-[WKContentView _resetInputViewDeferral]):
1402         (-[WKContentView becomeFirstResponderForWebView]):
1403         (-[WKContentView resignFirstResponderForWebView]):
1404         (-[WKContentView _commitPotentialTapFailed]):
1405         (-[WKContentView _didNotHandleTapAsClick:]):
1406         (-[WKContentView _didCompleteSyntheticClick]):
1407
1408         Funnel all existing calls that reset _inputViewDeferralToken to nullptr, such that they go through a helper
1409         method instead that also cancels any scheduled requests to clear the token.
1410
1411         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1412         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
1413
1414         Respond to all pending callbacks after handling the activity state change.
1415
1416 2019-02-20  Chris Dumez  <cdumez@apple.com>
1417
1418         Regression(PSON) "Reload without content extensions" does not work when the main resource is blocked
1419         https://bugs.webkit.org/show_bug.cgi?id=194872
1420         <rdar://problem/47924500>
1421
1422         Reviewed by Alex Christensen.
1423
1424         [WKWebView _reloadWithoutContentBlockers] relies on a ReloadOption flag that is passed to WebCore
1425         instead of using WebsitePolicies.contentBlockersEnabled flag. If the reload causes a process swap
1426         due to PSON, then the new process does not know about this ReloadOption and fails to honor it.
1427
1428         Since the modern way to do this is WebsitePolicies, and since WebsitePolicies are properly
1429         propagated cross-process in case of process swap, this patch updates _reloadWithoutContentBlockers
1430         to set a flag on the Navigation which we use to later set the WebsitePolicies.contentBlockersEnabled
1431         flag in WebPageProxy::receivedNavigationPolicyDecision().
1432
1433         * UIProcess/API/APINavigation.h:
1434         (API::Navigation::setUserContentExtensionsEnabled):
1435         (API::Navigation::userContentExtensionsEnabled const):
1436         * UIProcess/WebPageProxy.cpp:
1437         (WebKit::WebPageProxy::reload):
1438         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1439
1440 2019-02-20  Truitt Savell  <tsavell@apple.com>
1441
1442         Unreviewed, rolling out r241817.
1443
1444         Caused 4 API failures
1445
1446         Reverted changeset:
1447
1448         "[GTK] Epiphany searching for plugins even if plugins are
1449         disabled"
1450         https://bugs.webkit.org/show_bug.cgi?id=194352
1451         https://trac.webkit.org/changeset/241817
1452
1453 2019-02-20  Andy Estes  <aestes@apple.com>
1454
1455         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
1456         https://bugs.webkit.org/show_bug.cgi?id=194869
1457
1458         Rubber-stamped by Jer Noble.
1459
1460         * WebKit.xcodeproj/project.pbxproj:
1461
1462 2019-02-20  Alex Christensen  <achristensen@webkit.org>
1463
1464         Resolve WebsiteDataStore/HTTPCookieStore ref cycle
1465         https://bugs.webkit.org/show_bug.cgi?id=194868
1466
1467         Reviewed by Geoffrey Garen.
1468
1469         * UIProcess/API/APIHTTPCookieStore.cpp:
1470         (API::HTTPCookieStore::HTTPCookieStore):
1471         (API::HTTPCookieStore::cookies):
1472         (API::HTTPCookieStore::setCookie):
1473         (API::HTTPCookieStore::deleteCookie):
1474         (API::HTTPCookieStore::registerObserver):
1475         (API::HTTPCookieStore::unregisterObserver):
1476         (API::HTTPCookieStore::cookieManagerDestroyed):
1477         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
1478         (API::HTTPCookieStore::ref const):
1479         (API::HTTPCookieStore::deref const):
1480         * UIProcess/API/APIHTTPCookieStore.h:
1481
1482 2019-02-20  Per Arne Vollan  <pvollan@apple.com>
1483
1484         [iOS] Open sandbox for specific call.
1485         https://bugs.webkit.org/show_bug.cgi?id=194860
1486         <rdar://problem/48166729>
1487
1488         Reviewed by Brent Fulgham.
1489
1490         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1491
1492 2019-02-20  Alex Christensen  <achristensen@webkit.org>
1493
1494         Move API::HTTPCookieStore ownership from API::WebsiteDataStore to WebKit::WebsiteDataStore
1495         https://bugs.webkit.org/show_bug.cgi?id=194842
1496
1497         Reviewed by Geoff Garen.
1498
1499         We need a way to get from WebKit::WebsiteDataStore to API::HTTPCookieStore.  It can't be done before this.
1500         This made an existing reference cycle easier to see, and we should fix it in a followup patch.
1501
1502         * UIProcess/API/APIWebsiteDataStore.cpp:
1503         (API::WebsiteDataStore::httpCookieStore):
1504         * UIProcess/API/APIWebsiteDataStore.h:
1505         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1506         (WebKit::WebsiteDataStore::cookieStore):
1507         * UIProcess/WebsiteData/WebsiteDataStore.h:
1508
1509 2019-02-20  Chris Dumez  <cdumez@apple.com>
1510
1511         Regression(PSON) Crash under WebKit::WebPageProxy::decidePolicyForNavigationActionSync
1512         https://bugs.webkit.org/show_bug.cgi?id=194857
1513         <rdar://problem/47759323>
1514
1515         Reviewed by Alex Christensen.
1516
1517         The ProvisionalPageProxy was blindly forwarding the DecidePolicyForNavigationActionSync
1518         synchronous IPC to the WebPageProxy, without passing it the process the IPC came from.
1519         As a result, WebPageProxy::decidePolicyForNavigationActionSync() would try to look up
1520         a WebFrameProxy using the provided frameID from the wrong process and we would end up
1521         hitting a RELEASE_ASSERT().
1522
1523         * UIProcess/ProvisionalPageProxy.cpp:
1524         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
1525         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
1526         * UIProcess/ProvisionalPageProxy.h:
1527         * UIProcess/WebPageProxy.cpp:
1528         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1529         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
1530         * UIProcess/WebPageProxy.h:
1531
1532 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
1533
1534         [MSVC] Fix compilation errors with lambdas in Service Workers
1535         https://bugs.webkit.org/show_bug.cgi?id=194841
1536
1537         Reviewed by Alex Christensen.
1538
1539         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1540         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
1541
1542 2019-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1543
1544         [GTK] Epiphany searching for plugins even if plugins are disabled
1545         https://bugs.webkit.org/show_bug.cgi?id=194352
1546
1547         Reviewed by Michael Catanzaro.
1548
1549         Check pluginsEnabled setting before trying to get plugins from UI process.
1550
1551         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1552         (WebKit::WebPluginInfoProvider::populatePluginCache):
1553
1554 2019-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1555
1556         [WPE] Send client host fd and library name as web process creation parameters
1557         https://bugs.webkit.org/show_bug.cgi?id=194494
1558
1559         Reviewed by Žan Doberšek.
1560
1561         Instead of using command line arguments. The code is simpler and we don't need wpe specific code in process
1562         launcher glib implementation.
1563
1564         * Shared/WebProcessCreationParameters.cpp:
1565         (WebKit::WebProcessCreationParameters::encode const):
1566         (WebKit::WebProcessCreationParameters::decode):
1567         * Shared/WebProcessCreationParameters.h:
1568         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1569         (WebKit::ProcessLauncher::launchProcess):
1570         * UIProcess/glib/WebProcessPoolGLib.cpp:
1571         (WebKit::WebProcessPool::platformInitializeWebProcess):
1572         * WebProcess/glib/WebProcessGLib.cpp:
1573         (WebKit::WebProcess::platformInitializeWebProcess):
1574         * WebProcess/wpe/WebProcessMainWPE.cpp:
1575
1576 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
1577
1578         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
1579         https://bugs.webkit.org/show_bug.cgi?id=167941
1580
1581         Reviewed by Carlos Garcia Campos.
1582
1583         Adds new API to manage a collection of content extensions on disk (including compilation
1584         of new ones) using WebKitUserContentFilterStore; the associated WebKitUserContentFilter
1585         type (which represents a compiled content extension); and the functions needed to enable
1586         and disable them for a given WebKitUserContentManager.
1587
1588         The WebKitUserContentFilterStore public API is expressed in abstract terms of "saving"
1589         filters into the store (which involves compiling the JSON source rule set); and "loading"
1590         them back as main operations. This way we do not disclose to users of the API any detail
1591         about compilation, nor how contents are laid out on disk, and the documentation explicitly
1592         tells about only using the provided functions to manipulate the on-disk contents. This
1593         way we allow ourselves some leeway if the implementation needs changing in the future.
1594
1595         * PlatformGTK.cmake: Added WebKitUserContentFilterStore.h to the list of public API headers.
1596         * PlatformWPE.cmake: Ditto.
1597         * SourcesGTK.txt: Added WebKitUserContentFilterStore.cpp
1598         * SourcesWPE.txt: Ditto.
1599         * UIProcess/API/glib/WebKitError.cpp: Add definition of webkit_user_content_filter_error_quark().
1600         * UIProcess/API/glib/WebKitUserContent.cpp: Added WebKitUserContentFilter.
1601         (_WebKitUserContentFilter::_WebKitUserContentFilter):
1602         (webkit_user_content_filter_ref):
1603         (webkit_user_content_filter_unref):
1604         (webkit_user_content_filter_get_identifier):
1605         (webkitUserContentFilterCreate):
1606         (webkitUserContentFilterGetContentRuleList):
1607         * UIProcess/API/glib/WebKitUserContentFilterStore.cpp: Added.
1608         (toGError): Utility function to convert content extension error codes to GError.
1609         (webkit_user_content_filter_store_class_init):
1610         (webkit_user_content_filter_store_new):
1611         (webkit_user_content_filter_store_get_path):
1612         (webkitUserContentFilterStoreSaveBytes): Common function used as final step for all the
1613         functions which save (compile) JSON rule sets into the store, to avoid duplicating code.
1614         (webkit_user_content_filter_store_save):
1615         (webkit_user_content_filter_store_save_finish):
1616         (webkit_user_content_filter_store_save_from_file):
1617         (webkit_user_content_filter_store_save_from_file_finish):
1618         (webkit_user_content_filter_store_remove):
1619         (webkit_user_content_filter_store_remove_finish):
1620         (webkit_user_content_filter_store_load):
1621         (webkit_user_content_filter_store_lookup_finish):
1622         (webkit_user_content_filter_store_fetch_identifiers):
1623         (webkit_user_content_filter_store_fetch_identifiers_finish):
1624         * UIProcess/API/glib/WebKitUserContentManager.cpp: Added definitions for the new API
1625         functions to add and remove filters from an user content manager.
1626         (webkit_user_content_manager_add_filter):
1627         (webkit_user_content_manager_remove_filter):
1628         (webkit_user_content_manager_remove_all_filters):
1629         * UIProcess/API/glib/WebKitUserContentPrivate.h: Added declarations for
1630         webkitUserContentFilterCreate() and webkitUserContentFilterGetContentRuleList().
1631         * UIProcess/API/gtk/WebKitAutocleanups.h: Added autocleanups for WebKitUserContentFilter
1632         and WebKitUserContentFilterStore.
1633         * UIProcess/API/gtk/WebKitError.h: Added declarations for WEBKIT_USER_CONTENT_FILTER_ERROR
1634         plus the associated webkit_user_content_filter_error_quark() function and
1635         WebKitUserContentFilterErrror enum.
1636         * UIProcess/API/gtk/WebKitUserContent.h: Added declarations for WebKitUserContentFilter
1637         and its associated functions.
1638         * UIProcess/API/gtk/WebKitUserContentFilterStore.h: Added.
1639         * UIProcess/API/gtk/WebKitUserContentManager.h: Added declarations for the functions to
1640         add and remove filters from the user content manager.
1641         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new API functions and types to
1642         be included in the documentation.
1643         * UIProcess/API/gtk/webkit2.h: Added inclusion of WebKitUserContentFilterStore.h
1644         * UIProcess/API/wpe/WebKitError.h: Same as for the GTK port header.
1645         * UIProcess/API/wpe/WebKitUserContent.h: Same as for the GTK port header.
1646         * UIProcess/API/wpe/WebKitUserContentFilterStore.h: Added.
1647         * UIProcess/API/wpe/WebKitUserContentManager.h: Same as for the GTK port header.
1648         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added new API functions and types to be
1649         included in the documentation.
1650         * UIProcess/API/wpe/webkit.h: Added inclusion of WebKitUserContentFilterStore.h
1651
1652 2019-02-19  Antti Koivisto  <antti@apple.com>
1653
1654         Pass rootContentsLayer to Mac remote layer tree
1655         https://bugs.webkit.org/show_bug.cgi?id=194828
1656
1657         Reviewed by Simon Fraser.
1658
1659         Make this code path work again.
1660
1661         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1662         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1663         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1664         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1665         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1666
1667 2019-02-19  Alex Christensen  <achristensen@webkit.org>
1668
1669         Reduce use of LegacySync IPC messages
1670         https://bugs.webkit.org/show_bug.cgi?id=194783
1671
1672         Reviewed by Geoffrey Garen.
1673
1674         * UIProcess/WebProcessPool.cpp:
1675         (WebKit::WebProcessPool::handleSynchronousMessage):
1676         * UIProcess/WebProcessPool.h:
1677         * UIProcess/WebProcessPool.messages.in:
1678         * UIProcess/WebProcessProxy.cpp:
1679         (WebKit::WebProcessProxy::getPlugins):
1680         (WebKit::WebProcessProxy::shouldTerminate):
1681         * UIProcess/WebProcessProxy.h:
1682         * UIProcess/WebProcessProxy.messages.in:
1683         * WebProcess/Plugins/PluginProcessConnection.cpp:
1684         (WebKit::PluginProcessConnection::setException):
1685         * WebProcess/Plugins/PluginProcessConnection.h:
1686         * WebProcess/Plugins/PluginProcessConnection.messages.in:
1687         * WebProcess/Plugins/PluginProxy.cpp:
1688         (WebKit::PluginProxy::didCreatePlugin):
1689         (WebKit::PluginProxy::didFailToCreatePlugin):
1690         (WebKit::PluginProxy::proxiesForURL):
1691         (WebKit::PluginProxy::cookiesForURL):
1692         (WebKit::PluginProxy::getAuthenticationInfo):
1693         (WebKit::PluginProxy::getPluginElementNPObject):
1694         (WebKit::PluginProxy::evaluate):
1695         (WebKit::PluginProxy::createPluginContainer):
1696         * WebProcess/Plugins/PluginProxy.h:
1697         * WebProcess/Plugins/PluginProxy.messages.in:
1698
1699 2019-02-19  Alex Christensen  <achristensen@webkit.org>
1700
1701         Remove assertion introduced in r229683
1702         https://bugs.webkit.org/show_bug.cgi?id=194825
1703         <rdar://problem/47628258>
1704
1705         Reviewed by Geoffrey Garen.
1706
1707         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1708         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
1709         If we reach this code and the form's original Document's Frame has been destroyed,
1710         we have already been told to submit the form so do so, just like we do if the WebPage
1711         has been destroyed.  This is a rare edge case having to do with the timing of Frame
1712         destruction and decidePolicyForNavigationAction response, which unfortunately does not
1713         reproduce with a test case unless the timing of IPC is just right.
1714
1715 2019-02-19  Antoine Quint  <graouts@apple.com>
1716
1717         [iOS] "touch-action: none" should not prevent text selection or tapping on a link
1718         https://bugs.webkit.org/show_bug.cgi?id=194812
1719         <rdar://problem/47901131>
1720
1721         Reviewed by Dean Jackson.
1722
1723         We shouldn't prevent all gestures to be disabled when "touch-action: none" is set and instead follow the same code path we would use should
1724         "pan-x", "pan-y" or "pinch-zoom" be used.
1725
1726         * UIProcess/ios/WKContentViewInteraction.mm:
1727         (-[WKContentView _handleTouchActionsForTouchEvent:]):
1728
1729 2019-02-18  Alex Christensen  <achristensen@webkit.org>
1730
1731         Revert functional part of r241451
1732         https://bugs.webkit.org/show_bug.cgi?id=194510
1733
1734         * UIProcess/WebPageProxy.cpp:
1735         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1736         It caused crashes and assertions on Linux and Cocoa without safe browsing, which
1737         means it's fundamentally flawed in some way.  The testing piping was fine.
1738
1739 2019-02-18  Chris Dumez  <cdumez@apple.com>
1740
1741         REGRESSION (PSON): Can't access optumbank.com from myuhc.com
1742         https://bugs.webkit.org/show_bug.cgi?id=194797
1743         <rdar://problem/48055151>
1744
1745         Reviewed by Geoffrey Garen.
1746
1747         The issue was caused by us mistakenly process-swapping for a same-site server side redirect.
1748         The reason we were getting it wrong is because the logic in
1749         WebProcessPool::processForNavigationInternal() was expecting page.process() to be the source
1750         process and page.pageLoadState().url() to be the source URL. Those assumptions are incorrect
1751         when a server-side redirect occurs in a provisional process. In such case, the source process
1752         is the ProvisionalPageProxy's process and the source URL is the provisional URL, not the
1753         committed one.
1754
1755         * UIProcess/ProvisionalPageProxy.cpp:
1756         (WebKit::ProvisionalPageProxy::didPerformServerRedirect):
1757         (WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1758         (WebKit::ProvisionalPageProxy::didReceiveMessage):
1759         * UIProcess/ProvisionalPageProxy.h:
1760         Make sure the provisional page forwards IPC related to server-side redirects to the page so
1761         that the client gets informed.
1762
1763         * UIProcess/WebPageProxy.cpp:
1764         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1765         (WebKit::WebPageProxy::didPerformServerRedirect):
1766         (WebKit::WebPageProxy::didPerformServerRedirectShared):
1767         * UIProcess/WebPageProxy.h:
1768         * UIProcess/WebProcessPool.cpp:
1769         (WebKit::WebProcessPool::processForNavigation):
1770         (WebKit::WebProcessPool::processForNavigationInternal):
1771         * UIProcess/WebProcessPool.h:
1772
1773 2019-02-16  Darin Adler  <darin@apple.com>
1774
1775         Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
1776         https://bugs.webkit.org/show_bug.cgi?id=194752
1777
1778         Reviewed by Daniel Bates.
1779
1780         * Platform/IPC/win/ConnectionWin.cpp:
1781         (IPC::Connection::createServerAndClientIdentifiers): Use makeString instead of
1782         String::format.
1783         * Shared/win/WebEventFactory.cpp:
1784         (WebKit::keyIdentifierFromEvent): Ditto.
1785
1786         * UIProcess/API/APINavigation.cpp:
1787         (API::Navigation::loggingString const): Use hex instead of String::format.
1788         * UIProcess/SuspendedPageProxy.cpp:
1789         (WebKit::SuspendedPageProxy::loggingString const): Ditto.
1790
1791         * UIProcess/WebBackForwardList.cpp:
1792         (WebKit::WebBackForwardList::loggingString): Added a "0x".
1793
1794         * UIProcess/gtk/InputMethodFilter.cpp:
1795         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting): Use makeString and hex
1796         instead of String::format and "%x".
1797         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
1798         Ditto.
1799
1800 2019-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1801
1802         [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
1803         https://bugs.webkit.org/show_bug.cgi?id=194670
1804         <rdar://problem/39066529>
1805
1806         Reviewed by Tim Horton.
1807
1808         Remove all IPC plumbing for getTypesByFidelityForItemAtIndex, now that the types in fidelity order have been
1809         rolled into PasteboardItemInfo.
1810
1811         Additionally, remove support for subresource URL replacement. This feature was originally added with the
1812         intention that private clients (i.e. Mail) would intercept pasted or dropped images and replace their URLs.
1813         However, since <rdar://problem/43216836>, our strategy for this scenario has changed, such that WebKit now
1814         handles the drop/paste, and later delivers the image data to the client via NSFileWrappers in the UI process.
1815         At this time, there are no adopters of this SPI, and no adopters of the V2 injected bundle editing client. As
1816         such, we can simply revert all of this to its state prior to the introduction of the replacement URL SPI, with
1817         the exception to changes in WKBundlePageEditorClient.h, wherein there is a nonzero (but likely tiny) chance of
1818         completely breaking binary compatability with any third parties on macOS which may have tried to adopt
1819         subresource URL replacement.
1820
1821         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1822         (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex): Deleted.
1823         * UIProcess/WebPasteboardProxy.h:
1824         * UIProcess/WebPasteboardProxy.messages.in:
1825         * UIProcess/ios/WKContentViewInteraction.mm:
1826         (-[WKContentView canPerformActionForWebView:withSender:]):
1827
1828         Return YES for -paste: in the case where:
1829         1. The pasteboard contains items that are explicitly marked as attachments.
1830         2. The selection is richly contenteditable.
1831         3. Attachment elements are enabled.
1832
1833         Among other things, this allows the callout bar on iOS to show the "Paste" action.
1834
1835         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
1836         (API::InjectedBundle::EditorClient::performTwoStepDrop):
1837         (API::InjectedBundle::EditorClient::replacementURLForResource): Deleted.
1838         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
1839         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1840         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
1841         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
1842         (WebKit::InjectedBundlePageEditorClient::replacementURLForResource): Deleted.
1843         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
1844         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1845         (WebKit::WebEditorClient::replacementURLForResource): Deleted.
1846         * WebProcess/WebCoreSupport/WebEditorClient.h:
1847         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1848         (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex): Deleted.
1849         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1850
1851 2019-02-18  Jeremy Jones  <jeremyj@apple.com>
1852
1853         exitFullscreen should not instantiate a new model/interface mapping.
1854         https://bugs.webkit.org/show_bug.cgi?id=191988
1855         rdar://problem/42327939
1856
1857         Reviewed by Jer Noble.
1858
1859         This change is a speculative fix for a crash that cannot be reproduced.
1860
1861         Somehow, exitFullscreen is being requested after didCleanupFullscreen has completed.
1862         This change should allow us to prevent the crash in release, and assert in debug.
1863
1864         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1865         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
1866
1867 2019-02-18  John Wilander  <wilander@apple.com>
1868
1869         Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
1870         https://bugs.webkit.org/show_bug.cgi?id=194777
1871         <rdar://problem/47731945>
1872
1873         Reviewed by Geoffrey Garen and Chris Dumez.
1874
1875         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1876         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1877            Now returns early if the incoming session ID is invalid.
1878            Added an ASSERT to help us find other call sites passing invalid session IDs.
1879
1880 2019-02-18  Per Arne Vollan  <pvollan@apple.com>
1881
1882         It should be possible to get the mouse event modifiers for a page overlay client.
1883         https://bugs.webkit.org/show_bug.cgi?id=189621
1884         <rdar://problem/44437279>
1885
1886         Reviewed by Daniel Bates.
1887
1888         When access to the WindowServer is blocked, [NSEvent modifierFlags] always returns 0.
1889         This can be fixed by swizzling the class method, and getting the cached modifiers from
1890         PlatformKeyboardEvent.
1891  
1892         * WebProcess/cocoa/WebProcessCocoa.mm:
1893         (WebKit::currentModifierFlags):
1894         (WebKit::WebProcess::platformInitializeProcess):
1895
1896 2019-02-18  Claudio Saavedra  <csaavedra@igalia.com>
1897
1898         WebPageProxy::didFinishDocumentLoadForFrame() crashing in WPE and GTK+ ports
1899         https://bugs.webkit.org/show_bug.cgi?id=194774
1900
1901         Reviewed by Alex Christensen.
1902
1903         * UIProcess/WebPageProxy.cpp:
1904         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1905         Null check navigation before using it.
1906         This is a regression from r241451.
1907
1908 2019-02-18  Daniel Bates  <dabates@apple.com>
1909
1910         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
1911         https://bugs.webkit.org/show_bug.cgi?id=192824
1912         <rdar://problem/47100332>
1913
1914         Reviewed by Wenson Hsieh.
1915
1916         Use the same code path for key events to editable elements and non-editable elements.
1917
1918         Currently we have different code paths for hardware key events depending on whether the active element
1919         is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
1920         presses this differentiation was a necessary workaround for UIKit's event processing precedence of
1921         interpreting key events for system text editing commands and app commands before dispatching unhandled
1922         key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
1923         WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
1924         is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
1925         empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
1926         that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
1927
1928         As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
1929         key events use the same code path.
1930
1931         * UIProcess/ios/WKContentViewInteraction.h:
1932         * UIProcess/ios/WKContentViewInteraction.mm:
1933         (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
1934         (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
1935         when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
1936         keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
1937         element (by returning NO in -_requiresKeyboardWhenFirstResponder).
1938         (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
1939         so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
1940         hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
1941         automatic keyboard UI.
1942         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): If we are not in an editable
1943         element then we cannot perform the replacement. This logic was necessary now that we always require a
1944         keyboard.
1945         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): If we are not in an editable
1946         element then return an autocorrection object that indicates that we could not compute this data. This
1947         logic was necessary now that we always require a keyboard.
1948         (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
1949         now that we require a keyboard when first responder even if the focused element is non-editable.
1950         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
1951         as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
1952         its chance to interpret the UIEvent, we intercepted, for app key commands.
1953         (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
1954         (e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
1955         responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
1956         no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
1957         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1958         (-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
1959         type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
1960         editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
1961         editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
1962         when the popover is presented.
1963
1964 2019-02-18  Jiewen Tan  <jiewen_tan@apple.com>
1965
1966         Tell Networking Process to not optimize load
1967         https://bugs.webkit.org/show_bug.cgi?id=194753
1968         <rdar://problem/48143603>
1969
1970         Reviewed by Brent Fulgham.
1971
1972         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1973         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1974
1975 2019-02-18  Dean Jackson  <dino@apple.com>
1976
1977         iOS Safari will not load USDZ in QLPreview when opening as BLOB
1978         https://bugs.webkit.org/show_bug.cgi?id=194766
1979         <rdar://problem/42769186>
1980
1981         Reviewed by Wenson Hsieh.
1982
1983         A download from a Blob URL can happen effectively instantly, which means
1984         that the loadHandler on the registerItemForTypeIdentifier method might not have
1985         been called yet, and we haven't been told what the completionHandler is.
1986         In this case, keep a record of the URL we finished with, and call the completionHandler
1987         right away.
1988
1989         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add a new private member variable: _downloadedURL.
1990         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): Call the completionHandler
1991         right away if we've finished.
1992         (-[_WKPreviewControllerDataSource finish:]): Remember that we've finished by recording the URL.
1993
1994 2019-02-18  Alex Christensen  <achristensen@webkit.org>
1995
1996         Disable safe browsing in WKWebView and remove its WKPreferences API
1997         https://bugs.webkit.org/show_bug.cgi?id=194723
1998         <rdar://problem/48122993>
1999
2000         Reviewed by Geoffrey Garen.
2001
2002         * Shared/WebPreferences.yaml:
2003         * UIProcess/API/Cocoa/WKPreferences.h:
2004         * UIProcess/API/Cocoa/WKPreferences.mm:
2005         (-[WKPreferences setSafeBrowsingEnabled:]): Deleted.
2006         (-[WKPreferences isSafeBrowsingEnabled]): Deleted.
2007
2008 2019-02-18  Chris Fleizach  <cfleizach@apple.com>
2009
2010         AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
2011         https://bugs.webkit.org/show_bug.cgi?id=194742
2012
2013         Reviewed by Chris Dumez.
2014
2015         Re-initialize the accessibility web process tokens when swapping processes.
2016         Send page load notifications from the UIProcess instead of the WebProcess to improve reliability.
2017
2018         * UIProcess/mac/PageClientImplMac.mm:
2019         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
2020         (WebKit::PageClientImpl::didFailLoadForMainFrame):
2021         * WebProcess/WebPage/WebPage.cpp:
2022         (WebKit::WebPage::reinitializeWebPage):
2023         * WebProcess/WebPage/WebPage.h:
2024         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2025         (WebKit::WebPage::platformReinitialize):
2026         (WebKit::WebPage::platformDetach): Deleted.
2027         (WebKit::WebPage::platformEditorState const): Deleted.
2028         (WebKit::WebPage::updateAccessibilityTree): Deleted.
2029         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Deleted.
2030         (WebKit::WebPage::platformCanHandleRequest): Deleted.
2031         (WebKit::WebPage::platformUserAgent const): Deleted.
2032         (WebKit::WebPage::getCenterForZoomGesture): Deleted.
2033         (WebKit::WebPage::setInputMethodState): Deleted.
2034         (WebKit::WebPage::collapseSelectionInFrame): Deleted.
2035         * WebProcess/WebPage/ios/WebPageIOS.mm:
2036         (WebKit::WebPage::platformReinitialize):
2037         * WebProcess/WebPage/mac/WebPageMac.mm:
2038         (WebKit::WebPage::platformReinitialize):
2039         * WebProcess/WebPage/win/WebPageWin.cpp:
2040         (WebKit::WebPage::platformReinitialize):
2041         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
2042         (WebKit::WebPage::platformReinitialize):
2043
2044 2019-02-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2045
2046         [GTK] Crash while filling selection data during drag and drop
2047         https://bugs.webkit.org/show_bug.cgi?id=194698
2048
2049         Reviewed by Michael Catanzaro.
2050
2051         I can't reproduce this, but it seems that m_draggingSelectionData is nullptr in fillDragData(). That can happen
2052         when startDrag cancels a previous DND operation, because the new m_draggingSelectionData is set before the
2053         current DND operation is cancelled, which sets it to nullptr.
2054
2055         * UIProcess/gtk/DragAndDropHandler.cpp:
2056         (WebKit::DragAndDropHandler::startDrag): Finish the previous operation before setting m_draggingSelectionData.
2057
2058 2019-02-17  Youenn Fablet  <youenn@apple.com>
2059
2060         https://device.login.microsoftonline.com is hanging on STP75
2061         https://bugs.webkit.org/show_bug.cgi?id=194734
2062         <rdar://problem/47573830>
2063
2064         Reviewed by Jiewen Tan.
2065
2066         Make sure to only go the XPC route if SecKeyProxyStore has credentials.
2067         Tested manually by going to the above website with and without the patch.
2068         Load hangs without the patch and completes with the patch.
2069
2070         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2071         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
2072         * UIProcess/Authentication/cocoa/SecKeyProxyStore.h:
2073         * UIProcess/Authentication/cocoa/SecKeyProxyStore.mm:
2074         (WebKit::SecKeyProxyStore::initialize):
2075
2076 2019-02-17  David Kilzer  <ddkilzer@apple.com>
2077
2078         Unreviewed, rolling out r241620.
2079
2080         "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
2081         (Requested by ddkilzer on #webkit.)
2082
2083         Reverted changeset:
2084
2085         "[WTF] Add environment variable helpers"
2086         https://bugs.webkit.org/show_bug.cgi?id=192405
2087         https://trac.webkit.org/changeset/241620
2088
2089 2019-02-15  Youenn Fablet  <youenn@apple.com>
2090
2091         NetworkDataTask should check its client before calling shouldCaptureExtraNetworkLoadMetrics
2092         https://bugs.webkit.org/show_bug.cgi?id=194732
2093
2094         Reviewed by Geoffrey Garen.
2095
2096         NetworkDataTask may be kept alive if refing it after its NetworkLoad is gone.
2097         This might happen for instance in DownloadManager or when checking for TLS certificates.
2098         In that case, if the NetworkLoad gets destroyed, it clears the client of the NetworkDataTask.
2099         To ensure that NetworkDataTask does not try to use its client, add a null check.
2100
2101         * NetworkProcess/NetworkDataTask.cpp:
2102         (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics const):
2103
2104 2019-02-15  Chris Dumez  <cdumez@apple.com>
2105
2106         [PSON] Allow tweaking WebProcess cache parameters via user defaults
2107         https://bugs.webkit.org/show_bug.cgi?id=194731
2108         <rdar://problem/48125377>
2109
2110         Reviewed by Geoffrey Garen.
2111
2112         Allow tweaking WebProcess cache parameters via user defaults like so:
2113         $ defaults write com.apple.Safari WebProcessCacheCachedProcessLifetimeInSeconds 120
2114         -> Cached processes will be evicted after 2 minutes (instead of 30)
2115
2116         $ defaults write com.apple.Safari WebProcessCacheClearingDelayAfterApplicationResignsActiveInSeconds 60
2117         -> Web process cache will be cleared if Safari is no longer active for 1 minutes (instead of 5).
2118
2119         * SourcesCocoa.txt:
2120         * UIProcess/Cocoa/WebProcessCacheCocoa.mm: Copied from Source/WebKit/UIProcess/WebProcessCache.h.
2121         (WebKit::WebProcessCache::platformInitialize):
2122         * UIProcess/WebProcessCache.cpp:
2123         (WebKit::WebProcessCache::WebProcessCache):
2124         (WebKit::WebProcessCache::platformInitialize):
2125         * UIProcess/WebProcessCache.h:
2126         * WebKit.xcodeproj/project.pbxproj:
2127
2128 2019-02-15  Chris Dumez  <cdumez@apple.com>
2129
2130         [PSON] Disable WebContent process cache on devices with less than 3GB of RAM
2131         https://bugs.webkit.org/show_bug.cgi?id=194726
2132         <rdar://problem/48126255>
2133
2134         Reviewed by Geoffrey Garen.
2135
2136         * UIProcess/WebProcessCache.cpp:
2137         (WebKit::WebProcessCache::updateCapacity):
2138
2139 2019-02-15  Andy Estes  <aestes@apple.com>
2140
2141         [iOS] Stop setting a background color on the PDF host view
2142         https://bugs.webkit.org/show_bug.cgi?id=194722
2143         <rdar://48124152>
2144
2145         Reviewed by Wenson Hsieh.
2146
2147         PDFKit already sets a background color on this view, so there’s no need (and some harm) in
2148         us doing it too.
2149
2150         * UIProcess/ios/WKPDFView.mm:
2151         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2152
2153 2019-02-15  Alex Christensen  <achristensen@webkit.org>
2154
2155         Update IPC code generator unit test expectations after r241611
2156         https://bugs.webkit.org/show_bug.cgi?id=194678
2157
2158         * Scripts/webkit/LegacyMessages-expected.h:
2159         * Scripts/webkit/Messages-expected.h:
2160         * Scripts/webkit/MessagesSuperclass-expected.h:
2161
2162 2019-02-15  Ross Kirsling  <ross.kirsling@sony.com>
2163
2164         [WTF] Add environment variable helpers
2165         https://bugs.webkit.org/show_bug.cgi?id=192405
2166
2167         Reviewed by Michael Catanzaro.
2168
2169         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
2170         (main):
2171         * Platform/unix/LoggingUnix.cpp:
2172         (WebKit::logLevelString):
2173         * Platform/win/LoggingWin.cpp:
2174         (WebKit::logLevelString):
2175         * PluginProcess/mac/PluginProcessMac.mm:
2176         (WebKit::shouldCallRealDebugger):
2177         * Shared/Plugins/unix/PluginSearchPath.cpp:
2178         (WebKit::pluginsDirectories):
2179         * Shared/glib/ProcessExecutablePathGLib.cpp:
2180         (WebKit::findWebKitProcess):
2181         * UIProcess/API/glib/WebKitSettings.cpp:
2182         (webKitSettingsConstructed):
2183         (webKitSettingsSetProperty):
2184         * UIProcess/API/glib/WebKitWebContext.cpp:
2185         (injectedBundleDirectory):
2186         (webkitWebContextConstructed):
2187         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
2188         (webkitWebViewMaximizeWindow):
2189         (webkitWebViewRestoreWindow):
2190         * UIProcess/API/wpe/WPEView.cpp:
2191         (WKWPE::m_backend):
2192         * UIProcess/AuxiliaryProcessProxy.cpp:
2193         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2194         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2195         (WebKit::XDGDBusProxyLauncher::launch):
2196         (WebKit::bindDBusSession):
2197         (WebKit::bindX11):
2198         (WebKit::bindWayland):
2199         (WebKit::bindPulse):
2200         (WebKit::bindPathVar):
2201         (WebKit::bindGStreamerData):
2202         (WebKit::bubblewrapSpawn):
2203         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2204         (WebKit::ProcessLauncher::launchProcess):
2205         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2206         (WebKit::systemDirectoryPath):
2207         (WebKit::ProcessLauncher::launchProcess):
2208         * UIProcess/glib/WebProcessPoolGLib.cpp:
2209         (WebKit::memoryPressureMonitorDisabled):
2210         (WebKit::WebProcessPool::platformInitialize):
2211         (WebKit::WebProcessPool::platformInitializeWebProcess):
2212         * UIProcess/gtk/HardwareAccelerationManager.cpp:
2213         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
2214         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
2215         (main):
2216         * WebProcess/gtk/WebProcessMainGtk.cpp:
2217         * WebProcess/wpe/WebProcessMainWPE.cpp:
2218         Utilize WTF::Environment where possible.
2219
2220 2019-02-15  Alex Christensen  <achristensen@webkit.org>
2221
2222         Add SPI version of WKPreferences.safeBrowsingEnabled
2223         https://bugs.webkit.org/show_bug.cgi?id=194718
2224         <rdar://problem/48122993>
2225
2226         Rubber-stamped by Brady Eidson.
2227
2228         * UIProcess/API/Cocoa/WKPreferences.mm:
2229         (-[WKPreferences _isSafeBrowsingEnabled]):
2230         (-[WKPreferences _setSafeBrowsingEnabled:]):
2231         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2232
2233 2019-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2234
2235         [iOS] WKWebView callout bar is missing Change Writing Direction item
2236         https://bugs.webkit.org/show_bug.cgi?id=190015
2237         <rdar://problem/44810366>
2238
2239         Reviewed by Tim Horton.
2240
2241         Support -makeTextWritingDirectionLeftToRight: and -makeTextWritingDirectionRightToLeft: in WKWebView on iOS.
2242         To match behavior in native UITextViews on iOS, we implement these methods by changing the *base* writing
2243         direction, rather than the text writing direction (this is in contrast to macOS, which has different
2244         NSResponder methods for changing the base writing direction as opposed to the text writing direction).
2245
2246         Additionally fixes the implementation of -makeTextWritingDirectionNatural:, which currently attempts to change
2247         the text writing direction instead of the base writing direction.
2248
2249         * Platform/spi/ios/UIKitSPI.h:
2250
2251         Add a forward declaration for keyboards SPI to determine whether the user has an active RTL keyboard.
2252
2253         * Shared/EditorState.cpp:
2254         (WebKit::EditorState::PostLayoutData::encode const):
2255         (WebKit::EditorState::PostLayoutData::decode):
2256         (WebKit::operator<<):
2257         * Shared/EditorState.h:
2258
2259         Plumb the base writing direction to the UI process through EditorState.
2260
2261         * UIProcess/ios/WKContentViewInteraction.h:
2262         * UIProcess/ios/WKContentViewInteraction.mm:
2263         (-[WKContentView makeTextWritingDirectionNaturalForWebView:]):
2264         (-[WKContentView makeTextWritingDirectionLeftToRightForWebView:]):
2265         (-[WKContentView makeTextWritingDirectionRightToLeftForWebView:]):
2266
2267         Implement the new SPI (see above for more details).
2268
2269         (-[WKContentView canPerformActionForWebView:withSender:]):
2270
2271         Implement -canPerformAction: for LTR and RTL actions. To match existing UIWebView behavior, we only enable
2272         these actions if either the base writing direction is RTL, or the user has an active RTL keyboard. This means,
2273         for instance, that in the case where a user with only an English keyboard is editing LTR content, we would never
2274         show an option to convert to RTL.
2275
2276         * WebProcess/WebPage/WebPage.cpp:
2277         (WebKit::WebPage::editorState const):
2278
2279 2019-02-15  Alex Christensen  <achristensen@webkit.org>
2280
2281         Make WebPaymentCoordinatorProxy more robust and modern
2282         https://bugs.webkit.org/show_bug.cgi?id=194678
2283
2284         Reviewed by Andy Estes.
2285
2286         Use WeakPtr instead of storing raw pointers in lambdas or the global activePaymentCoordinatorProxy to avoid UAF problems.
2287         Call CompletionHandlers in all code paths to avoid hangs.
2288         Use Delayed instead of LegacySync for synchronous messaging to progress towards removing LegacySync messages.
2289
2290         * Scripts/webkit/messages.py:
2291         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2292         (WebKit::activePaymentCoordinatorProxy):
2293         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
2294         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
2295         (WebKit::WebPaymentCoordinatorProxy::canMakePayments):
2296         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
2297         (WebKit::WebPaymentCoordinatorProxy::didReachFinalState):
2298         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2299         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2300         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2301         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2302         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2303         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2304
2305 2019-02-15  Youenn Fablet  <youenn@apple.com>
2306
2307         Make ServiceWorkerClientFetch closer to WebResourceLoader
2308         https://bugs.webkit.org/show_bug.cgi?id=194651
2309
2310         Unreviewed, build fix for WPE.
2311
2312         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2313
2314 2019-02-15  Chris Dumez  <cdumez@apple.com>
2315
2316         Regression(PSON) Navigating quickly back and forth can lead to getting 'about:blank' in the backforward list
2317         https://bugs.webkit.org/show_bug.cgi?id=194717
2318         <rdar://problem/47884404>
2319
2320         Reviewed by Brady Eidson.
2321
2322         When the client does a history navigation, the UIProcess sends a WebPage::GoToBackForwardItem IPC to the
2323         WebProcess and the WebProcess sends a WebPageProxy::BackForwardGoToItem IPC back to the UIProcess to
2324         update the current item in the BackForwardList. This means that there is a slight delay between the
2325         point a client requests a history navigation and the point where the BackForwardList's current item gets
2326         update. This delay is pre-existing behavior and not new to PSON.
2327
2328         However, with PSON enabled, if we decide to process-swap for the history navigation, we'll tell the
2329         previous (committed) process to ignore the load and we ask a new (provisional) process to do the history
2330         navigation. When the previous process receives the request to ignore the history navigation, it restores
2331         the History's current item to the one previous the navigation, which sends a WebPageProxy::GoToBackForwardItem
2332         IPC to the UIProcess to update the BackForwardList as well. In parallel, the new process starts the
2333         history navigation and also sends a WebPageProxy::GoToBackForwardItem to update the BackForwardList's
2334         current item as well. We end up with a race between the 2 GoToBackForwardItem IPC messages coming from
2335         the old and new process. If the old process's message loses the race, we end up with the wrong current
2336         history item getting set in the UIProcess. Later, when we commit the provisional load and try to suspend
2337         the previous page, we would save the SuspendedPage on the *wrong* BackForwardList item. If one tries to
2338         load this BackForwardList item later, we'll use its SuspendedPage and try to unsuspend it. However,
2339         because the PageCache entry is saved on another HistoryItem than the one getting loaded in the WebProcess
2340         side, we attempt to do a regular load instead of a PageCache restore. We end up failing the load because
2341         pages cannot trigger new loads while in page cache. Because the load fails, we end up loading the
2342         initial empty document and this is how we end up with 'about:blank' in the back forward list.
2343
2344         To address the issue, update WebPageProxy::backForwardGoToItem() to ignore messages from the old/committed
2345         WebProcess when there is a pending provisional load. If the committed processes starts a legit new
2346         load, it would clear any existing pending provisional load before attempting the call backForwardGoToItem().
2347         As a result, ignoring such messages from the old processes when there is a pending provisional load is
2348         safe.
2349
2350         In the future, we should probably move more of the history / backForwardList management to the UIProcess
2351         to avoid this sort of issues. This would be a much larger refactoring though so I am going with this
2352         simpler fix that is easily cherry-pickable for now.
2353
2354         * UIProcess/WebPageProxy.cpp:
2355         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2356         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2357         (WebKit::WebPageProxy::backForwardGoToItem):
2358
2359 2019-02-15  Alex Christensen  <achristensen@webkit.org>
2360
2361         Update IPC code generator unit test expectations after r241595
2362         https://bugs.webkit.org/show_bug.cgi?id=194679
2363
2364         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
2365         (WebKit::WebPage::didReceiveSyncWebPageMessage):
2366         * Scripts/webkit/MessageReceiver-expected.cpp:
2367         (WebKit::WebPage::didReceiveSyncMessage):
2368
2369 2019-02-15  Youenn Fablet  <youenn@apple.com>
2370
2371         Make ServiceWorkerClientFetch closer to WebResourceLoader
2372         https://bugs.webkit.org/show_bug.cgi?id=194651
2373
2374         Reviewed by Alex Christensen.
2375
2376         The goal of this refactoring is to, at some point use the regular network process load path for service worker loads.
2377         This should simplify things and allow less IPC exchanges, for instance in the case of fetch not handled by service worker.
2378
2379         Introduce two IPC messages for supporting redirect responses and allow the didReceiveResponse/continueDidReceiveResponse
2380         handshake for navigation loads.
2381
2382         This makes ServiceWorker having to buffer load information for this particular case.
2383
2384         * NetworkProcess/NetworkProcess.cpp:
2385         (WebKit::NetworkProcess::didReceiveFetchRedirectResponse):
2386         (WebKit::NetworkProcess::didReceiveFetchResponse):
2387         * NetworkProcess/NetworkProcess.h:
2388         * NetworkProcess/NetworkProcess.messages.in:
2389         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2390         (WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
2391         (WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse):
2392         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
2393         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
2394         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
2395         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2396         (WebKit::ServiceWorkerClientFetch::start):
2397         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
2398         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2399         (WebKit::ServiceWorkerClientFetch::didReceiveData):
2400         (WebKit::ServiceWorkerClientFetch::didFinish):
2401         (WebKit::ServiceWorkerClientFetch::didFail):
2402         (WebKit::ServiceWorkerClientFetch::didNotHandle):
2403         (WebKit::ServiceWorkerClientFetch::cancel):
2404         * WebProcess/Storage/ServiceWorkerClientFetch.h:
2405         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
2406         * WebProcess/Storage/WebSWClientConnection.cpp:
2407         (WebKit::WebSWClientConnection::startFetch):
2408         (WebKit::WebSWClientConnection::cancelFetch):
2409         (WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
2410         * WebProcess/Storage/WebSWClientConnection.h:
2411         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2412         (WebKit::WebSWContextManagerConnection::continueDidReceiveFetchResponse):
2413         (WebKit::WebSWContextManagerConnection::startFetch):
2414         * WebProcess/Storage/WebSWContextManagerConnection.h:
2415         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2416         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2417         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
2418         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
2419         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
2420         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
2421         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
2422         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
2423         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
2424         (WebKit::WebServiceWorkerFetchTaskClient::continueDidReceiveResponse):
2425         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2426
2427 2019-02-15  Brian Burg  <bburg@apple.com>
2428
2429         [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
2430         https://bugs.webkit.org/show_bug.cgi?id=194411
2431         <rdar://problem/47787614>
2432
2433         Reviewed by Joseph Pecoraro.
2434
2435         * Configurations/WebKit.xcconfig:
2436         Conditionalize weak linking to WebInspectorUI.framework for Mac only.
2437
2438         * UIProcess/mac/WebInspectorProxyMac.mm:
2439         (WebKit::WebInspectorProxy::inspectorPageURL):
2440         (WebKit::WebInspectorProxy::inspectorTestPageURL):
2441         (WebKit::WebInspectorProxy::inspectorBaseURL):
2442         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
2443         (WebKit::webInspectorUILocalizedStringsURL):
2444         Rewrite uses of the bundle to exit early if bundle couldn't be loaded.
2445
2446 2019-02-15  Alex Christensen  <achristensen@webkit.org>
2447
2448         IPC code should support messages with both Delayed and WantsConnection attributes
2449         https://bugs.webkit.org/show_bug.cgi?id=194679
2450
2451         Reviewed by Geoffrey Garen.
2452
2453         * Platform/IPC/HandleMessage.h:
2454         (IPC::callMemberFunctionImpl):
2455         (IPC::callMemberFunction):
2456         (IPC::handleMessageDelayedWantsConnection):
2457         * Scripts/webkit/messages.py:
2458         * UIProcess/WebStorage/StorageManager.cpp:
2459         (WebKit::StorageManager::getValues):
2460         * UIProcess/WebStorage/StorageManager.h:
2461         * UIProcess/WebStorage/StorageManager.messages.in:
2462
2463 2019-02-15  Commit Queue  <commit-queue@webkit.org>
2464
2465         Unreviewed, rolling out r241559 and r241566.
2466         https://bugs.webkit.org/show_bug.cgi?id=194710
2467
2468         Causes layout test crashes under GuardMalloc (Requested by
2469         ryanhaddad on #webkit).
2470
2471         Reverted changesets:
2472
2473         "[WTF] Add environment variable helpers"
2474         https://bugs.webkit.org/show_bug.cgi?id=192405
2475         https://trac.webkit.org/changeset/241559
2476
2477         "Unreviewed build fix for WinCairo Debug after r241559."
2478         https://trac.webkit.org/changeset/241566
2479
2480 2019-02-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2481
2482         [WPE][GTK] Defer sandboxing APIs to 2.26
2483         https://bugs.webkit.org/show_bug.cgi?id=194274
2484
2485         Reviewed by Carlos Garcia Campos.
2486
2487         The web process sandbox has not been widely-tested yet, so we should defer the new APIs to
2488         2.26.
2489
2490         * UIProcess/API/glib/WebKitWebContext.cpp:
2491
2492 2019-02-10  Darin Adler  <darin@apple.com>
2493
2494         Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
2495         https://bugs.webkit.org/show_bug.cgi?id=194487
2496
2497         Reviewed by Daniel Bates.
2498
2499         * NetworkProcess/NetworkProcess.cpp:
2500         (WebKit::NetworkProcess::switchToNewTestingSession): Use makeString instead of String::format.
2501         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2502         (WebKit::buildAcceptLanguages): Ditto.
2503         * UIProcess/API/glib/IconDatabase.cpp:
2504         (WebKit::IconDatabase::performURLImport): Ditto.
2505         * UIProcess/gtk/InputMethodFilter.cpp:
2506         (WebKit::InputMethodFilter::logConfirmCompositionForTesting): Ditto.
2507         (WebKit::InputMethodFilter::logSetPreeditForTesting): Ditto.
2508
2509 2019-02-15  Truitt Savell  <tsavell@apple.com>
2510
2511         Unreviewed, rolling out r241564.
2512
2513         Caused 50+ Timeouts on Mac WK2, mostly in the http/ directory
2514
2515         Reverted changeset:
2516
2517         "[Mac] WebInspectorUI.framework does not need to be soft-
2518         linked anymore"
2519         https://bugs.webkit.org/show_bug.cgi?id=194411
2520         https://trac.webkit.org/changeset/241564
2521
2522 2019-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2523
2524         Unreviewed. Fix GTK+ build after r241556
2525
2526         I guess this is due to unified builds after a new file being added in r241556.
2527
2528         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
2529         * UIProcess/API/C/WKPage.cpp:
2530
2531 2019-02-14  Brent Fulgham  <bfulgham@apple.com>
2532
2533         REGRESSION (r240446): Storage Access API does not handle domains consistently
2534         https://bugs.webkit.org/show_bug.cgi?id=194664
2535
2536         Reviewed by Alex Christensen.
2537         
2538         During my refactoring of the ResourceLoadStatistics code, I introduced two bugs:
2539         (1) I neglected to be consistent in my use of 'primaryDomain', causing some Storage
2540         Access API code paths to store approves under one domain (e.g., 'www.example.com'),
2541         while checking status under the eTLD+1 (e.g., 'example.com'). The exact string matching
2542         requirement caused these to get missed.
2543
2544         (2) I used a move operator before a final set of copies of domain names, leading to
2545         some empty strings being passed to Storage Access API calls.
2546
2547         Both issues are corrected in this patch.
2548
2549         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2550         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode): Always make the
2551         domain comply with our 'primaryDomain' logic.
2552         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): Ditto.
2553         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted): Ditto.
2554         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): Ditto.
2555         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Ditto.
2556         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Ditto.
2557         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Ditto.
2558         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): Ditto.
2559         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Ditto.
2560         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): Ditto.
2561         (WebKit::WebResourceLoadStatisticsStore::setLastSeen): Ditto.
2562         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): Ditto.
2563         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource): Ditto.
2564         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): Ditto.
2565         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource): Ditto.
2566         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder): Ditto.
2567         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): Ditto.
2568         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Ditto.
2569         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): Ditto.
2570         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): Ditto.
2571         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): Ditto.
2572         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Ditto.
2573         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Ditto.
2574         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): Ditto.
2575         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom): Ditto.
2576         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo): Ditto.
2577         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom): Ditto.
2578         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2579         (WebKit::WebsiteDataStore::hasStorageAccess): Always make the
2580         domain comply with our 'primaryDomain' logic.
2581         (WebKit::WebsiteDataStore::requestStorageAccess): Ditto. Also make copy of domain
2582         names before moving them to the completion handler.
2583         (WebKit::WebsiteDataStore::grantStorageAccess): Ditto.
2584         * WebProcess/WebPage/WebPage.cpp:
2585         (WebKit::WebPage::hasStorageAccess):  Always make the domain comply with our
2586         'primaryDomain' logic.
2587         (WebKit::WebPage::requestStorageAccess): Ditto.
2588
2589 2019-02-14  Tim Horton  <timothy_horton@apple.com>
2590
2591         Fix the build.
2592
2593         * UIProcess/ios/WKDrawingView.mm:
2594         (-[WKDrawingView renderedDrawing]):
2595
2596 2019-02-14  Youenn Fablet  <youenn@apple.com>
2597
2598         ASSERTION FAILED: m_caches.isEmpty() || !m_pendingInitializationCallbacks.isEmpty() in WebKit::CacheStorage::Caches::clearMemoryRepresentation()
2599         https://bugs.webkit.org/show_bug.cgi?id=188393
2600         <rdar://problem/43025665>
2601
2602         Reviewed by Alex Christensen.
2603
2604         In case Caches::dispose is called, clearMemoryRepresentation might be called if there is no active cache.
2605         We also ensure to not clear the memory representation if there is any remaining removed cache.
2606         Update the clearMemoryRepresentation assertion to take that into account.
2607
2608         In case a Caches is cleared twice, the clearMemoryRepresentation assertion will assert while it should not.
2609         In that case m_storage is null the second time. Update the assertion accordingly.
2610
2611         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2612         (WebKit::CacheStorage::Caches::hasActiveCache const):
2613         (WebKit::CacheStorage::Caches::dispose):
2614         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2615         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2616
2617 2019-02-14  Brian Burg  <bburg@apple.com>
2618
2619         [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
2620         https://bugs.webkit.org/show_bug.cgi?id=194411
2621         <rdar://problem/47787614>
2622
2623         Reviewed by Joseph Pecoraro.
2624
2625         * Configurations/WebKit.xcconfig:
2626         Conditionalize weak linking to WebInspectorUI.framework for Mac only.
2627
2628         * UIProcess/mac/WebInspectorProxyMac.mm:
2629         (WebKit::WebInspectorProxy::inspectorPageURL):
2630         (WebKit::WebInspectorProxy::inspectorTestPageURL):
2631         (WebKit::WebInspectorProxy::inspectorBaseURL):
2632         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
2633         (WebKit::webInspectorUILocalizedStringsURL):
2634         Rewrite uses of the bundle to exit early if bundle couldn't be loaded.
2635
2636 2019-02-14  Michael Catanzaro  <mcatanzaro@igalia.com>
2637
2638         [GTK] WebKitGTK+ -> WebKitGTK
2639         https://bugs.webkit.org/show_bug.cgi?id=194658
2640
2641         Reviewed by Alex Christensen.
2642
2643         This renames WebKitGTK+ to WebKitGTK in a few user-visible places: the API documentation,
2644         the pkg-config, and an error message.
2645
2646         In a couple places where it's exposed in WPE documentation, WPE is now mentioned, or the
2647         reference to "WebKitGTK+" is changed to just "WebKit."
2648
2649         * UIProcess/API/glib/WebKitSettings.cpp:
2650         (webkit_settings_class_init):
2651         * UIProcess/API/glib/WebKitWebView.cpp:
2652         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2653         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h:
2654         * gtk/webkit2gtk-web-extension.pc.in:
2655         * gtk/webkit2gtk.pc.in:
2656
2657 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
2658
2659         [WTF] Add environment variable helpers
2660         https://bugs.webkit.org/show_bug.cgi?id=192405
2661
2662         Reviewed by Michael Catanzaro.
2663
2664         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
2665         (main):
2666         * Platform/unix/EnvironmentUtilities.cpp:
2667         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
2668         * Platform/unix/LoggingUnix.cpp:
2669         (WebKit::logLevelString):
2670         * Platform/win/LoggingWin.cpp:
2671         (WebKit::logLevelString):
2672         * PluginProcess/mac/PluginProcessMac.mm:
2673         (WebKit::shouldCallRealDebugger):
2674         * Shared/Plugins/unix/PluginSearchPath.cpp:
2675         (WebKit::pluginsDirectories):
2676         * Shared/glib/ProcessExecutablePathGLib.cpp:
2677         (WebKit::findWebKitProcess):
2678         * UIProcess/API/glib/WebKitSettings.cpp:
2679         (webKitSettingsConstructed):
2680         (webKitSettingsSetProperty):
2681         * UIProcess/API/glib/WebKitWebContext.cpp:
2682         (injectedBundleDirectory):
2683         (webkitWebContextConstructed):
2684         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
2685         (webkitWebViewMaximizeWindow):
2686         (webkitWebViewRestoreWindow):
2687         * UIProcess/API/wpe/WPEView.cpp:
2688         (WKWPE::m_backend):
2689         * UIProcess/AuxiliaryProcessProxy.cpp:
2690         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2691         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2692         (WebKit::XDGDBusProxyLauncher::launch):
2693         (WebKit::bindDBusSession):
2694         (WebKit::bindX11):
2695         (WebKit::bindWayland):
2696         (WebKit::bindPulse):
2697         (WebKit::bindPathVar):
2698         (WebKit::bindGStreamerData):
2699         (WebKit::bubblewrapSpawn):
2700         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2701         (WebKit::ProcessLauncher::launchProcess):
2702         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2703         (WebKit::systemDirectoryPath):
2704         (WebKit::ProcessLauncher::launchProcess):
2705         * UIProcess/glib/WebProcessPoolGLib.cpp:
2706         (WebKit::memoryPressureMonitorDisabled):
2707         (WebKit::WebProcessPool::platformInitialize):
2708         (WebKit::WebProcessPool::platformInitializeWebProcess):
2709         * UIProcess/gtk/HardwareAccelerationManager.cpp:
2710         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
2711         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
2712         (main):
2713         * WebProcess/gtk/WebProcessMainGtk.cpp:
2714         * WebProcess/wpe/WebProcessMainWPE.cpp:
2715         Utilize WTF::Environment where possible.
2716
2717 2019-02-14  Jiewen Tan  <jiewen_tan@apple.com>
2718
2719         Handle _WKNavigationActionPolicyAllowWithoutTryingAppLink for LoadOptimizer
2720         https://bugs.webkit.org/show_bug.cgi?id=194640
2721         <rdar://problem/48064140>
2722
2723         Reviewed by Brent Fulgham.
2724
2725         * UIProcess/Cocoa/NavigationState.mm:
2726         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2727
2728 2019-02-14  Chris Dumez  <cdumez@apple.com>
2729
2730         [PSON] Introduce a WebContent Process cache
2731         https://bugs.webkit.org/show_bug.cgi?id=194594
2732         <rdar://problem/46793397>
2733
2734         Reviewed by Geoff Garen.
2735
2736         Introduce a WebContent Process cache to reduce the number of process launches when
2737         process swap on navigation is enabled, and to reduce the power cost of the feature.
2738
2739         If a WebProcess loaded pages from a single registrable domain then it is eligible
2740         for the cache. When process-swapping on navigation to a new registrable domain, we
2741         now attempt to retrieve a process from the cache for the domain in question instead
2742         of always launching a new one.
2743
2744         The WebProcess cache currently has the following attributes:
2745         - It may contains 4 processes per GB of RAM the machine has, up to 30 processes.
2746         - WebProcesses automatically get evicted from the cache after 30 minutes.
2747         - If the application is no longer the active app, then the cache will get cleared
2748           after 5 minutes.
2749         - WebProcesses that are in the cache are reported as "(Cached)" in Activity Monitor.
2750
2751         The WebProcess cache is currently disabled by default and can by enabled by the
2752         client via SPI.
2753
2754         * Shared/WebBackForwardListItem.cpp:
2755         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2756         * Shared/WebBackForwardListItem.h:
2757         (WebKit::WebBackForwardListItem::lastProcessIdentifier const):
2758         (WebKit::WebBackForwardListItem::setLastProcessIdentifier):
2759         Add new lastProcessIdentifier data member that reflects which process this item
2760         was last loaded in. It is normally identical to the identifier of the process
2761         that created the item but it gets overriden in case of cross-site client-side
2762         redirect, since a new process takes over the item in this case.
2763
2764         * Sources.txt:
2765         Add new source file.
2766
2767         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2768         (API::ProcessPoolConfiguration::copy):
2769         * UIProcess/API/APIProcessPoolConfiguration.h:
2770         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2771         (WKContextConfigurationUsesWebProcessCache):
2772         (WKContextConfigurationSetUsesWebProcessCache):
2773         * UIProcess/API/C/WKContextConfigurationRef.h:
2774         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2775         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2776         (-[_WKProcessPoolConfiguration setUsesWebProcessCache:]):
2777         (-[_WKProcessPoolConfiguration usesWebProcessCache]):
2778         Add new SPI to enable the WebProcess cache.
2779
2780         * UIProcess/API/Cocoa/WKProcessPool.mm:
2781         (-[WKProcessPool _webProcessCountIgnoringPrewarmedAndCached]):
2782         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2783         Add new SPI for testing which returns the number of WebProcesses ignoring
2784         both prewarmed and cached ones.
2785
2786         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2787         (WebKit::WebProcessPool::registerNotificationObservers):
2788         (WebKit::WebProcessPool::unregisterNotificationObservers):
2789         Add application active state observers as the WebProcess cache gets cleared
2790         when the application resigns active state for more than 5 minutes.
2791
2792         * UIProcess/ProvisionalPageProxy.cpp:
2793         (WebKit::ProvisionalPageProxy::loadRequest):
2794         When doing a load in a new process with the BackForwardList locked (i.e. client-side
2795         redirect), make sure we update the last process identifier for the BackForwardListItem.
2796         This is important because the logic in WebProcessPool::processForNavigation() relies on
2797         this identifier to select which process to do the history navigation into, and we want
2798         to do the load in the post-redirect process, not the pre-redirect one.
2799
2800         * UIProcess/WebPageProxy.cpp:
2801         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2802         Tell the WebProcess whenever a main frame provisional load is started, providing the URL.
2803
2804         * UIProcess/WebProcessCache.cpp: Added.
2805         (WebKit::WebProcessCache::WebProcessCache):
2806         (WebKit::WebProcessCache::addProcess):
2807         (WebKit::WebProcessCache::takeProcess):
2808         (WebKit::WebProcessCache::updateMaximumSize):
2809         (WebKit::WebProcessCache::clear):
2810         (WebKit::WebProcessCache::setApplicationIsActive):
2811         (WebKit::WebProcessCache::evictProcess):
2812         (WebKit::WebProcessCache::CachedProcess::CachedProcess):
2813         (WebKit::WebProcessCache::CachedProcess::~CachedProcess):
2814         (WebKit::WebProcessCache::CachedProcess::takeProcess):
2815         (WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
2816         * UIProcess/WebProcessCache.h: Added.
2817         (WebKit::WebProcessCache::maximumSize):
2818         (WebKit::WebProcessCache::size const):
2819         (WebKit::WebProcessCache::CachedProcess::process):
2820         Add process cache implementation.
2821
2822         * UIProcess/WebProcessPool.cpp:
2823         (WebKit::m_webProcessCache):
2824         WebProcessCache is stored on the WebProcessPool via m_webProcessCache data member.
2825
2826         (WebKit::WebProcessPool::~WebProcessPool):
2827         Clear the WebProcess cache in the destructor.
2828
2829         (WebKit::WebProcessPool::setApplicationIsActive):
2830         Notify the WebProcessCache whenever the application's active state changes.
2831
2832         (WebKit::WebProcessPool::createWebPage):
2833         If the state of PSON changes via the experimental features menu, dynamically
2834         update the WebProcessCache's size. This is needed because the cache is disabled
2835         when PSON is disabled.
2836
2837         (WebKit::WebProcessPool::handleMemoryPressureWarning):
2838         Clear the WebProcess cache on memory pressure.
2839
2840         (WebKit::WebProcessPool::processForNavigationInternal):
2841         Query the WebProcessCache before attempting to create a new WebProcess for a cross-site
2842         navigation.
2843
2844         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
2845         This logic was split out of processForNavigationInternal() to reduce the size
2846         of the method.
2847
2848         * UIProcess/WebProcessPool.h:
2849         * UIProcess/WebProcessProxy.cpp:
2850         (WebKit::WebProcessProxy::setIsInProcessCache):
2851         Update the isInProcessCache flag on the WebProcessProxy and send an IPC to the WebContent
2852         process so that it can update its name in Activity Monitor.
2853         We also need to stop holding a strong reference to the WebProcessPool whenever the process
2854         is in the cache, similarly to what we do for pre-warmed processes, given that such processes
2855         should not keep the process pool alive.
2856
2857         (WebKit::WebProcessProxy::addExistingWebPage):
2858         Assert that we never try to add a page to a cached process, it should be taken out of the
2859         cache before use.
2860
2861         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
2862         (WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
2863         (WebKit::WebProcessProxy::updateBackForwardItem):
2864         In case of client-side redirects, the previous process would sometimes send an IPC causing
2865         the UIProcess' backforward list item to get updated with the pre-redirect URL after we've
2866         already redirected. This previously would be unlikely to occur because we do not suspend
2867         client-redirect pages and their process would normally exit before getting a chance to send
2868         the IPC. However, with the process cache, the bug became obvious as the process would stay
2869         alive and send up the "bad" IPC. To address the issue, we now only let the IPC update the
2870         item if the item's page is (still) associated with the process. In the future, we may want
2871         to update the IPC so that it gets sent to the WebPageProxy instead of the WebProcessProxy.
2872
2873         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2874         If a cached WebProcess crashes, remove it from the cache so that we do not attempt to use
2875         it for a load later.
2876
2877         (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
2878         Only cache WebProcesses that have loaded a single registrable domain. Also prevent caching
2879         for service worker and inspector processes.
2880
2881         (WebKit::WebProcessProxy::maybeShutDown):
2882         If the process is cacheable, add it to the cache instead of shutting it down right away.
2883
2884         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
2885         Make sure we do not attempt to terminate a processes that is in the cache.
2886
2887         (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
2888         Whenever a main frame provisional load starts, make sure we update the process's associated
2889         registrable domain. nullopt indicates that there is no associated domain yet. Null string
2890         indicates that the process is associated with several registrable domain and is therefore
2891         not eligible for caching.
2892
2893         * UIProcess/WebProcessProxy.h:
2894         (WebKit::WebProcessProxy::registrableDomain const):
2895         (WebKit::WebProcessProxy::isInProcessCache const):
2896         (WebKit::WebProcessProxy::provisionalPageCount const):
2897         Add convenience getters.
2898
2899         * WebKit.xcodeproj/project.pbxproj:
2900         Add new files to project.
2901
2902         * WebProcess/WebProcess.cpp:
2903         (WebKit::WebProcess::setIsInProcessCache):
2904         * WebProcess/WebProcess.h:
2905         * WebProcess/WebProcess.messages.in:
2906         * WebProcess/cocoa/WebProcessCocoa.mm:
2907         (WebKit::WebProcess::updateProcessName):
2908         Update the WebProcess' name in Activity Monitor whenever it goes into or out of the WebProcess
2909         cache.
2910
2911 2019-02-14  Per Arne Vollan  <pvollan@apple.com>
2912
2913         [iOS] Open sandbox for certain calls.
2914         https://bugs.webkit.org/show_bug.cgi?id=194626
2915
2916         Reviewed by Brent Fulgham.
2917
2918         Reporting shows that certain calls needs to be allowed in the sandbox.
2919
2920         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2921
2922 2019-02-14  Chris Fleizach  <cfleizach@apple.com>
2923
2924         AX: ARIA Reflection was disabled in error
2925         https://bugs.webkit.org/show_bug.cgi?id=194647
2926         <rdar://problem/48068336>
2927
2928         Reviewed by Ryosuke Niwa.
2929
2930         * Shared/WebPreferences.yaml:
2931
2932 2019-02-14  Commit Queue  <commit-queue@webkit.org>
2933
2934         Unreviewed, rolling out r241486.
2935         https://bugs.webkit.org/show_bug.cgi?id=194655
2936
2937         causing API failures in builds (Requested by ShawnRoberts on
2938         #webkit).
2939
2940         Reverted changeset:
2941
2942         "[Cocoa] Media elements will restart network buffering just
2943         before suspending"
2944         https://bugs.webkit.org/show_bug.cgi?id=193691
2945         https://trac.webkit.org/changeset/241486
2946
2947 2019-02-14  Youenn Fablet  <youenn@apple.com>
2948
2949         Do not add a caches to its engine if the salt cannot be initialized
2950         https://bugs.webkit.org/show_bug.cgi?id=194604
2951
2952         Reviewed by Antti Koivisto.
2953
2954         This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=194588.
2955         We should return early if initialize fails.
2956
2957         * NetworkProcess/cache/CacheStorageEngine.cpp:
2958         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2959
2960 2019-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2961
2962         [GTK] Use a scrolled window for script alerts text
2963         https://bugs.webkit.org/show_bug.cgi?id=184875
2964
2965         Reviewed by Michael Catanzaro.
2966
2967         To ensure long text doesn't make the dialog bigger.
2968
2969         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
2970         (webkitScriptDialogImplConstructed): Use PANGO_ELLIPSIZE_END for the title and add a scrolled window for the body.
2971         (webkitScriptDialogImplSetText): Helper function to set the dialog body, ensuring the scrolled window fills the
2972         dialog available size.
2973         (webkitScriptDialogImplNew): It now receives the maximum size and uses webkitScriptDialogImplSetText().
2974         * UIProcess/API/gtk/WebKitScriptDialogImpl.h:
2975         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
2976         (webkitWebViewScriptDialog): Pass the 80% of the web view size as the maximum size of script dialogs.
2977
2978 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
2979
2980         Crash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy
2981         https://bugs.webkit.org/show_bug.cgi?id=194641
2982
2983         Reviewed by Geoffrey Garen.
2984
2985         Fixed the bug by adding a null check to WebFrame::parentFrame.
2986
2987         * WebProcess/WebPage/WebFrame.cpp:
2988         (WebKit::WebFrame::parentFrame const):
2989
2990 2019-02-13  Timothy Hatcher  <timothy@apple.com>
2991
2992         Allow some deprecations in WKDrawingView.
2993         https://bugs.webkit.org/show_bug.cgi?id=194636
2994
2995         Reviewed by Wenson Hsieh.
2996
2997         * UIProcess/ios/WKDrawingView.mm:
2998         (-[WKDrawingView PNGRepresentation]):
2999         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
3000         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
3001         (-[WKDrawingView didChangeInk:]):
3002
3003 2019-02-13  Jer Noble  <jer.noble@apple.com>
3004
3005         [Cocoa] Media elements will restart network buffering just before suspending
3006         https://bugs.webkit.org/show_bug.cgi?id=193691
3007
3008         Reviewed by Eric Carlson.
3009
3010         When the WebProcess receives a notification that the process is about to become
3011         suspended, it tells the MemoryPressureHandler to release all critical memory. This
3012         has the side effect of causing AVFoundation-backed media elements to dump their
3013         in-memory caches and start downloading media data again. Instead, media elements
3014         should all stop buffering media data during suspension. Add new testing SPI to
3015         simulate suspension and resume messages.
3016
3017         * UIProcess/API/Cocoa/WKWebView.mm:
3018         (-[WKWebView _processWillSuspendImminentlyForTesting]):
3019         (-[WKWebView _processDidResumeForTesting]):
3020         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3021         * UIProcess/WebProcessProxy.h:
3022         * UIProcess/ios/WKInkPickerView.mm:
3023         * WebProcess/WebPage/WebPage.cpp:
3024         (WebKit::WebPage::suspendAllMediaBuffering):
3025         (WebKit::WebPage::resumeAllMediaBuffering):
3026         * WebProcess/WebPage/WebPage.h:
3027         * WebProcess/WebProcess.cpp:
3028         (WebKit::WebProcess::actualPrepareToSuspend):
3029         (WebKit::WebProcess::cancelPrepareToSuspend):
3030         (WebKit::WebProcess::processDidResume):
3031         (WebKit::WebProcess::suspendAllMediaBuffering):
3032         (WebKit::WebProcess::resumeAllMediaBuffering):
3033         * WebProcess/WebProcess.h:
3034
3035 2019-02-13  Per Arne Vollan  <pvollan@apple.com>
3036
3037         [iOS] Fix sandbox violation during media playback
3038         https://bugs.webkit.org/show_bug.cgi?id=194616
3039         <rdar://problem/48049264>
3040
3041         Reviewed by Brent Fulgham.
3042
3043         Mach lookup to "com.apple.coremedia.figcontentkeysession.xpc" should be allowed.
3044
3045         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3046
3047 2019-02-13  Tim Horton  <timothy_horton@apple.com>
3048
3049         Encrypted PDFs inside <embed> or <object> crash the Web Content process
3050         https://bugs.webkit.org/show_bug.cgi?id=194605
3051         <rdar://problem/19894818>
3052
3053         Reviewed by Andy Estes.
3054
3055         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3056         (WebKit::PDFPlugin::createPasswordEntryForm):
3057         Don't try to create a password form field if we can't make form fields.
3058
3059         This means you will be left with a useless embedded PDF, but at least
3060         the Web Content process won't crash.
3061
3062         We'll need to find an alternative implementation of PDF embedded form
3063         fields that is compatible with <embed> and <object> if we want to support
3064         this. Currently we piggy-back off the fact that we can just insert
3065         <input>s into the PluginDocument's DOM, but we can't do that if there
3066         is no PluginDocument, just a main document, like in the <embed> case.
3067
3068 2019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
3069
3070         Further restricting webarchive loads
3071         https://bugs.webkit.org/show_bug.cgi?id=194567
3072         <rdar://problem/47610130>
3073
3074         Reviewed by Youenn Fablet.
3075
3076         * WebProcess/WebPage/WebPage.cpp:
3077         (WebKit::WebPage::loadRequest):
3078         Set a flag to indicate a load is started from clients.
3079
3080 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
3081
3082         [WPE][GTK] Merge WebProcessPoolWPE.cpp and WebProcessPoolGtk.cpp
3083         https://bugs.webkit.org/show_bug.cgi?id=194551
3084
3085         Reviewed by Carlos Garcia Campos.
3086
3087         * SourcesGTK.txt:
3088         * SourcesWPE.txt:
3089         * UIProcess/glib/WebProcessPoolGLib.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp.
3090         (WebKit::initializeRemoteInspectorServer):
3091         (WebKit::memoryPressureMonitorDisabled):
3092         (WebKit::WebProcessPool::platformInitialize):
3093         (WebKit::WebProcessPool::platformInitializeWebProcess):
3094         (WebKit::WebProcessPool::platformInvalidateContext):
3095         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
3096         * UIProcess/wpe/WebProcessPoolWPE.cpp: Removed.
3097
3098 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
3099
3100         Fix -Wformat warning from r241401
3101         https://bugs.webkit.org/show_bug.cgi?id=194584
3102         <rdar://problem/47761293>
3103
3104         * WebProcess/WebPage/WebPage.cpp:
3105         (WebKit::WebPage::setActivityState):
3106
3107 2019-02-13  Youenn Fablet  <youenn@apple.com>
3108
3109         Make WebRTCUnifiedPlanEnabled true by default
3110         https://bugs.webkit.org/show_bug.cgi?id=194595
3111
3112         Reviewed by Eric Carlson.
3113
3114         * Shared/WebPreferences.yaml:
3115
3116 2019-02-13  John Wilander  <wilander@apple.com>
3117
3118         Store Ad Click Attribution requests in the network process
3119         https://bugs.webkit.org/show_bug.cgi?id=194510
3120         <rdar://problem/47650118>
3121
3122         Reviewed by Alex Christensen and Daniel Bates.
3123
3124         With this patch, WebPageProxy::didCommitLoadForFrame() now looks for
3125         an AdClickAttribution object in its navigation state. If there is an
3126         attribution, it sends it to the network process where the 
3127         WebKit::NetworkSession stores it in an object of a new class,
3128         WebKit::NetworkAdClickAttribution.
3129
3130         This patch also covers test infrastructure to support two new
3131         TestRunner functions:
3132         - dumpAdClickAttribution()
3133         - clearAdClickAttribution()
3134
3135         * NetworkProcess/Cookies/WebCookieManager.cpp:
3136             Added missing header include.
3137         * NetworkProcess/Downloads/DownloadManager.cpp:
3138             Added missing header include.
3139         * NetworkProcess/NetworkAdClickAttribution.cpp: Added.
3140         (WebKit::NetworkAdClickAttribution::ensureDestinationMapForSource):
3141         (WebKit::NetworkAdClickAttribution::store):
3142         (WebKit::NetworkAdClickAttribution::clear):
3143         (WebKit::NetworkAdClickAttribution::toString const):
3144         * NetworkProcess/NetworkAdClickAttribution.h: Added.
3145             Stores WebCore::AdClickAttribution objects in a map structure.
3146         * NetworkProcess/NetworkLoad.cpp:
3147             Added missing header includes.
3148         * NetworkProcess/NetworkProcess.cpp:
3149         (WebKit::NetworkProcess::storeAdClickAttribution):
3150         (WebKit::NetworkProcess::dumpAdClickAttribution):
3151         (WebKit::NetworkProcess::clearAdClickAttribution):
3152         * NetworkProcess/NetworkProcess.h:
3153         * NetworkProcess/NetworkProcess.messages.in:
3154         * NetworkProcess/NetworkSession.cpp:
3155         (WebKit::NetworkSession::NetworkSession):
3156         (WebKit::NetworkSession::storeAdClickAttribution):
3157         (WebKit::NetworkSession::dumpAdClickAttribution):
3158         (WebKit::NetworkSession::clearAdClickAttribution):
3159         * NetworkProcess/NetworkSession.h:
3160         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
3161             Added missing header include.
3162         * Sources.txt:
3163             Added NetworkProcess/NetworkAdClickAttribution.cpp.
3164         * UIProcess/API/APINavigation.h:
3165         (API::Navigation::adClickAttribution const):
3166         * UIProcess/API/C/WKPage.cpp:
3167         (WKPageDumpAdClickAttribution):
3168         (WKPageClearAdClickAttribution):
3169             Test infrastructure.
3170         * UIProcess/API/C/WKPagePrivate.h:
3171         * UIProcess/Network/NetworkProcessProxy.cpp:
3172         (WebKit::NetworkProcessProxy::dumpAdClickAttribution):
3173         (WebKit::NetworkProcessProxy::clearAdClickAttribution):
3174             Test infrastructure.
3175         * UIProcess/Network/NetworkProcessProxy.h:
3176         * UIProcess/WebPageProxy.cpp:
3177         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3178             This is where pending Ad Click Attributions are forwarded to the
3179             network process.
3180         (WebKit::WebPageProxy::dumpAdClickAttribution):
3181         (WebKit::WebPageProxy::clearAdClickAttribution):
3182             Test infrastructure.
3183         * UIProcess/WebPageProxy.h:
3184         * UIProcess/WebProcessPool.cpp:
3185         (WebKit::WebProcessPool::dumpAdClickAttribution):
3186         (WebKit::WebProcessPool::clearAdClickAttribution):
3187             Test infrastructure.
3188         * UIProcess/WebProcessPool.h:
3189         * WebKit.xcodeproj/project.pbxproj:
3190         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3191         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3192             Added missing data copying from navigationAction to navigationActionData.
3193
3194 2019-02-13  Antti Koivisto  <antti@apple.com>
3195
3196         Crash in WebKit::CacheStorage::Engine::cachesRootPath
3197         https://bugs.webkit.org/show_bug.cgi?id=194588
3198         <rdar://problem/46363997>
3199
3200         Reviewed by Youenn Fablet.
3201
3202         * NetworkProcess/cache/CacheStorageEngine.cpp:
3203         (WebKit::CacheStorage::Engine::cachesRootPath):
3204
3205         Salt may have not been initialized yet when the Engine is destroyed.
3206
3207 2019-02-13  Alex Christensen  <achristensen@webkit.org>
3208
3209         Remove legacy sync messaging in some IPC code
3210         https://bugs.webkit.org/show_bug.cgi?id=194561
3211
3212         Reviewed by Geoffrey Garen.
3213
3214         Changing some LegacySync messages to Delayed messages.  We should probably rename Delayed to Sync.
3215         There are too many ways to send messages.  Let's work to get rid of the old one.
3216
3217         * NetworkProcess/NetworkProcess.cpp:
3218         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
3219         (WebKit::NetworkProcess::processWillSuspendImminently):
3220         * NetworkProcess/NetworkProcess.h:
3221         * NetworkProcess/NetworkProcess.messages.in:
3222         * PluginProcess/PluginControllerProxy.cpp:
3223         (WebKit::PluginControllerProxy::handleWheelEvent):
3224         (WebKit::PluginControllerProxy::handleMouseEnterEvent):
3225         (WebKit::PluginControllerProxy::handleMouseLeaveEvent):
3226         (WebKit::PluginControllerProxy::handleKeyboardEvent):
3227         (WebKit::PluginControllerProxy::handleEditingCommand):
3228         (WebKit::PluginControllerProxy::isEditingCommandEnabled):
3229         (WebKit::PluginControllerProxy::handlesPageScaleFactor):
3230         (WebKit::PluginControllerProxy::requiresUnifiedScaleFactor):
3231         (WebKit::PluginControllerProxy::paintEntirePlugin):
3232         (WebKit::PluginControllerProxy::supportsSnapshotting):
3233         (WebKit::PluginControllerProxy::snapshot):
3234         (WebKit::PluginControllerProxy::getPluginScriptableNPObject):
3235         (WebKit::PluginControllerProxy::getFormValue):
3236         * PluginProcess/PluginControllerProxy.h:
3237         * PluginProcess/PluginControllerProxy.messages.in:
3238         * Shared/Plugins/NPObjectMessageReceiver.cpp:
3239         (WebKit::NPObjectMessageReceiver::deallocate):
3240         (WebKit::NPObjectMessageReceiver::hasMethod):
3241         (WebKit::NPObjectMessageReceiver::invoke):
3242         (WebKit::NPObjectMessageReceiver::invokeDefault):
3243         (WebKit::NPObjectMessageReceiver::hasProperty):
3244         (WebKit::NPObjectMessageReceiver::getProperty):
3245         (WebKit::NPObjectMessageReceiver::setProperty):
3246         (WebKit::NPObjectMessageReceiver::removeProperty):
3247         (WebKit::NPObjectMessageReceiver::enumerate):
3248         (WebKit::NPObjectMessageReceiver::construct):
3249         * Shared/Plugins/NPObjectMessageReceiver.h:
3250         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
3251         * UIProcess/mac/SecItemShimProxy.cpp:
3252         (WebKit::SecItemShimProxy::secItemRequest):
3253         * UIProcess/mac/SecItemShimProxy.h:
3254         * UIProcess/mac/SecItemShimProxy.messages.in:
3255
3256 2019-02-13  Truitt Savell  <tsavell@apple.com>
3257
3258         Unreviewed, rolling out r241433.
3259
3260         Broke internal builds.
3261
3262         Reverted changeset:
3263
3264         "Move
3265         UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to
3266         SPI"
3267         https://bugs.webkit.org/show_bug.cgi?id=194531
3268         https://trac.webkit.org/changeset/241433
3269
3270 2019-02-12  Antoine Quint  <graouts@apple.com>
3271
3272         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
3273         https://bugs.webkit.org/show_bug.cgi?id=194531
3274         <rdar://problem/47714562>
3275
3276         Reviewed by Dean Jackson.
3277
3278         * Platform/spi/ios/UIKitSPI.h:
3279         * UIProcess/ios/WKContentViewInteraction.mm:
3280         (-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
3281         to respondsToSelector until the SPI has shipped for OpenSource builds to work.
3282
3283 2019-02-13  Antoine Quint  <graouts@apple.com>
3284
3285         Support simulated mouse events on iOS based on a PlatformTouchEvent
3286         https://bugs.webkit.org/show_bug.cgi?id=194501
3287         <rdar://problem/46910790>
3288
3289         Reviewed by Dean Jackson.
3290
3291         Add two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and whether
3292         simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. We also ensure
3293         that we correctly create touch tracking regions for mouse events.
3294
3295         * Shared/WebPreferences.yaml:
3296         * UIProcess/WebPageProxy.cpp:
3297         (WebKit::WebPageProxy::updateTouchEventTracking):
3298
3299 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
3300
3301         Crash in Page::setActivityState because m_page is null
3302         https://bugs.webkit.org/show_bug.cgi?id=194584
3303
3304         Reviewed by Antti Koivisto.
3305
3306         Add a null check to avoid the crash. Also add a debug assertion to help diagnose this in the future.
3307
3308         * WebProcess/WebPage/WebPage.cpp:
3309         (WebKit::WebPage::setActivityState):
3310
3311 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
3312
3313         Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
3314         https://bugs.webkit.org/show_bug.cgi?id=194582
3315
3316         Reviewed by Antti Koivisto.
3317
3318         The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback
3319         with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier
3320         is invalid in that case, and we should be using requestIdentifier instead.
3321
3322         Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case.
3323
3324         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3325         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3326
3327 2019-02-13  Benjamin Poulain  <benjamin@webkit.org>
3328
3329         Responsiveness timers are too expensive for frequent events
3330         https://bugs.webkit.org/show_bug.cgi?id=194003
3331
3332         Reviewed by Geoffrey Garen.
3333
3334         With each event, we set a responsivness timer to check if the WebProcess
3335         is responsive, and reset the timer when the WebProcess sends an answer.
3336
3337         For frequent events (e.g. wheel events, mouse force events, etc),
3338         we are spamming the kernel with hundreds of timers per second.
3339         That is a bit inefficient.
3340
3341         Another source of inefficiency comes from the timer implementation
3342         itself. Stopping a RunLoop::Timer removes the timer from every mode
3343         and invalidate the timer. It becomes costly since we do it a lot.
3344
3345         With this patch, I tweak ResponsivenessTimer and its use to minimize
3346         how often we schedule system timers.
3347
3348         The first change is to not stop the timer when we get the stop()
3349         calls if we expect more events to come in. Instead, we keep track
3350         if we care about the timeout or not in the attribute "m_waitingForTimer".
3351         When the next event starts, we can reschedule the timer without ever
3352         having told the kernel about the stop.
3353         If there are no next events, the timeout fires but m_waitingForTimer
3354         is false. To avoid idle wake up, the lazy stop is only used when having
3355         following events is common.
3356
3357         The second improvements comes from not even rescheduling the timer
3358         when restarted. Instead of changing the timer, we let the original timer
3359         fire and re-shedule a new one with the missing time.
3360
3361         For more context, also see patches r240759 and r240944.
3362
3363         * UIProcess/ResponsivenessTimer.cpp:
3364         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
3365         (WebKit::ResponsivenessTimer::invalidate):
3366         (WebKit::ResponsivenessTimer::timerFired):
3367         (WebKit::ResponsivenessTimer::start):
3368         (WebKit::ResponsivenessTimer::startWithLazyStop):
3369         (WebKit::ResponsivenessTimer::stop):
3370         (WebKit::ResponsivenessTimer::processTerminated):
3371         (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
3372         * UIProcess/ResponsivenessTimer.h:
3373         (WebKit::ResponsivenessTimer::hasActiveTimer const):
3374         * UIProcess/WebPageProxy.cpp:
3375         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
3376         (WebKit::WebPageProxy::sendWheelEvent):
3377         (WebKit::WebPageProxy::handleKeyboardEvent):
3378         (WebKit::WebPageProxy::handleGestureEvent):
3379         * UIProcess/WebProcessProxy.cpp:
3380         (WebKit::WebProcessProxy::isResponsiveWithLazyStop):
3381         * UIProcess/WebProcessProxy.h:
3382
3383 2019-02-12  Tim Horton  <timothy_horton@apple.com>
3384
3385         Null deref in userInterfaceLayoutDirection under ViewGestureController::handleSwipeGesture
3386         https://bugs.webkit.org/show_bug.cgi?id=194569
3387         <rdar://problem/46711049>
3388
3389         Reviewed by Wenson Hsieh.
3390
3391         * UIProcess/mac/ViewGestureControllerMac.mm:
3392         (WebKit::ViewGestureController::handleSwipeGesture):
3393         It is conceivable that we could get here if the client closes the page
3394         e.g. in the callback from willEndSwipeGesture. We already guarded against
3395         this ... one line too late! Rearrange the lines so we don't call into
3396         WebPageProxy at all if we don't have a drawing area (which is a strict subset
3397         of the time that isValid would return true). This is a speculative fix,
3398         since I can no longer reproduce the crash on demand.
3399
3400 2019-02-12  Youenn Fablet  <youenn@apple.com>
3401
3402         WebServiceWorkerProvider::handleFetch no longer needs a CachedResource parameter
3403         https://bugs.webkit.org/show_bug.cgi?id=194548
3404
3405         Reviewed by Alex Christensen.
3406
3407         * WebProcess/Network/WebLoaderStrategy.cpp:
3408         (WebKit::WebLoaderStrategy::scheduleLoad):
3409         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3410         (WebKit::WebServiceWorkerProvider::handleFetch):
3411         * WebProcess/Storage/WebServiceWorkerProvider.h:
3412
3413 2019-02-12  Tim Horton  <timothy_horton@apple.com>
3414
3415         Remove WKLegacyPDFView
3416         https://bugs.webkit.org/show_bug.cgi?id=194559
3417
3418         Reviewed by Andy Estes.
3419
3420         * Platform/spi/ios/CorePDFSPI.h: Removed.
3421         * SourcesCocoa.txt:
3422         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
3423         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
3424         * UIProcess/ios/WKLegacyPDFView.h: Removed.
3425         * UIProcess/ios/WKLegacyPDFView.mm: Removed.
3426         * WebKit.xcodeproj/project.pbxproj:
3427
3428 2019-02-12  Chris Dumez  <cdumez@apple.com>
3429
3430         Regression(PSON) MESSAGE_CHECK() hit under WebPageProxy::didFailProvisionalLoadForFrameShared()
3431         https://bugs.webkit.org/show_bug.cgi?id=194568
3432         <rdar://problem/47944490>
3433
3434         Reviewed by Ryosuke Niwa.
3435
3436         When the provisional process crashes, it is unsafe to call ProvisionalPageProxy::cancel() because
3437         the WebProcessProxy clears its frame map as soon as the process crashes. Calling cancel() after
3438         that would call WebPageProxy::didFailProvisionalLoadForFrameShared(), which would try to look up
3439         the frame by ID and MESSAGE_CHECK() that the frame is not null. We would fail this check since
3440         the frame has been removed from the WebProcessProxy at this point.
3441
3442         * UIProcess/API/Cocoa/WKWebView.mm:
3443         (-[WKWebView _provisionalWebProcessIdentifier]):
3444         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3445         * UIProcess/WebPageProxy.cpp:
3446         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
3447         (WebKit::WebPageProxy::provisionalProcessDidTerminate):
3448
3449 2019-02-12  Per Arne Vollan  <pvollan@apple.com>
3450
3451         [iOS] Youtube fails to play.
3452         https://bugs.webkit.org/show_bug.cgi?id=194565
3453         <rdar://problem/47974770>
3454
3455         Reviewed by Geoffrey Garen.
3456
3457         This is caused by sandbox violations and was introduced in r240500.
3458
3459         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3460
3461 2019-02-12  Alex Christensen  <achristensen@webkit.org>
3462
3463         Remove firing assertion after r241317
3464         https://bugs.webkit.org/show_bug.cgi?id=194506
3465
3466         * WebProcess/Network/WebLoaderStrategy.cpp:
3467         (WebKit::WebLoaderStrategy::setDefersLoading):
3468         The creation of a PageGroupLoadDeferrer in Chrome.cpp tries to defer loading.
3469         See comments in Chrome::runJavaScriptAlert et al.
3470         This was necessary with WebKitLegacy, so keep it, but it doesn't need to do anything in modern WebKit.
3471
3472 2019-02-12  Tim Horton  <timothy_horton@apple.com>
3473
3474         Find on Page shouldn't zoom in on matches
3475         https://bugs.webkit.org/show_bug.cgi?id=194557
3476         <rdar://problem/42087017>
3477
3478         Reviewed by Wenson Hsieh.
3479
3480         * UIProcess/ios/SmartMagnificationController.h:
3481         * UIProcess/ios/SmartMagnificationController.messages.in:
3482         * UIProcess/ios/SmartMagnificationController.mm:
3483         (WebKit::SmartMagnificationController::scrollToRect):
3484         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3485         (WebKit::FindController::updateFindIndicator):
3486         Only scroll to reveal the find result, do not zoom in.
3487
3488 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3489
3490         Allow pages to trigger programmatic paste from script on iOS
3491         https://bugs.webkit.org/show_bug.cgi?id=194271
3492         <rdar://problem/47808810>
3493
3494         Reviewed by Tim Horton.
3495
3496         Cancel the pending DOM paste access handler when the menu is about to hide, rather than when the hiding
3497         animation has completed. This ensures that if the page (on behalf of the user) requests DOM paste again during
3498         user interaction before the callout bar has finished fading after the previous DOM paste, we won't automatically
3499         cancel the incoming DOM paste access request because the callout bar animation finished.
3500
3501         This scenario is exercised in the layout test editing/pasteboard/ios/dom-paste-consecutive-confirmations.html.
3502
3503         * Platform/spi/ios/UIKitSPI.h:
3504         * UIProcess/ios/WKContentViewInteraction.mm:
3505         (-[WKContentView setupInteraction]):
3506         (-[WKContentView _willHideMenu:]):
3507         (-[WKContentView _didHideMenu:]):
3508
3509 2019-02-12  Chris Fleizach  <cfleizach@apple.com>
3510
3511         AX: IsolatedTree: Implement more attributes
3512         https://bugs.webkit.org/show_bug.cgi?id=193911
3513         <rdar://problem/47599217>
3514
3515         Reviewed by Daniel Bates.
3516
3517         * Platform/spi/mac/AccessibilityPrivSPI.h: Added.
3518         * WebKit.xcodeproj/project.pbxproj:
3519         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
3520         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3521         (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]):
3522         (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):
3523         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
3524         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
3525         (-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]):
3526         (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
3527         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
3528         (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
3529         (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
3530         (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):
3531         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
3532         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
3533
3534 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3535
3536         Allow pages to trigger programmatic paste from script on iOS
3537         https://bugs.webkit.org/show_bug.cgi?id=194271
3538         <rdar://problem/47808810>
3539
3540         Reviewed by Ryosuke Niwa.
3541
3542         * Shared/WebPreferences.yaml:
3543         * Shared/WebPreferencesDefaultValues.h:
3544
3545         Add an internal setting to enable or disable DOM paste access requests. This is on by default in iOS only
3546         (excluding watchOS and Apple TV), and is additionally disabled on macOS.
3547
3548         * UIProcess/API/gtk/PageClientImpl.cpp:
3549         (WebKit::PageClientImpl::requestDOMPasteAccess):
3550         * UIProcess/API/gtk/PageClientImpl.h:
3551         * UIProcess/API/wpe/PageClientImpl.cpp:
3552         (WebKit::PageClientImpl::requestDOMPasteAccess):
3553
3554         Plumb DOM paste access requests from the web process (WebEditorClient) to the view (WKContentView). As per the
3555         usual, this involves WebEditorClient, WebPage, WebPageProxy, PageClient and finally WKContentView.
3556
3557         * UIProcess/API/wpe/PageClientImpl.h:
3558         * UIProcess/PageClient.h:
3559         * UIProcess/WebPageProxy.cpp:
3560         (WebKit::WebPageProxy::requestDOMPasteAccess):
3561         * UIProcess/WebPageProxy.h:
3562         * UIProcess/WebPageProxy.messages.in:
3563         * UIProcess/ios/PageClientImplIOS.h:
3564         * UIProcess/ios/PageClientImplIOS.mm:
3565         (WebKit::PageClientImpl::requestDOMPasteAccess):
3566         * UIProcess/ios/WKContentViewInteraction.h:
3567         * UIProcess/ios/WKContentViewInteraction.mm:
3568         (-[WKContentView setupInteraction]):
3569         (-[WKContentView cleanupInteraction]):
3570         (-[WKContentView resignFirstResponderForWebView]):
3571         (-[WKContentView _webTouchEventsRecognized:]):
3572
3573         Bail from any pending DOM paste access handler the moment we start handling touches on the web view, or if the
3574         web view resigns first responder, or if the web process crashes.
3575
3576         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3577
3578         Reject text selection gestures while waiting for DOM paste access.
3579
3580         (-[WKContentView canPerformAction:withSender:]):
3581         (-[WKContentView canPerformActionForWebView:withSender:]):
3582
3583         If we're handling a DOM paste, always return YES to allow the callout bar to show the "Paste" option.
3584
3585         (-[WKContentView _didHideMenu:]):
3586
3587         If the menu is programmatically hidden by the app while handling a DOM paste request, immediately reject the DOM
3588         paste request.
3589
3590         (-[WKContentView pasteForWebView:]):
3591
3592         Adjust -pasteForWebView: on WKContentView to first check whether there's an outstanding DOM paste completion
3593         handler to invoke, instead of telling the page to execute a paste command.
3594
3595         (-[WKContentView _handleDOMPasteRequestWithResult:]):
3596
3597         Add a helper to take and invoke the current DOM paste completion handler (if it exists) with the given result,
3598         and then dismiss the shared callout bar. Returns whether or not the paste completion handler exists. Invoked
3599         from various sources of user interaction or significant state changes (e.g. following a web process crash in
3600         -cleanupInteraction).
3601
3602         (-[WKContentView _willPerformAction:sender:]):
3603         (-[WKContentView _didPerformAction:sender:]):
3604
3605         Add hooks to detect when WKContentView is executing an editing action. This is to ensure that the page doesn't
3606         get stuck in a bad state in the case where WKWebView has been subclassed, overrides `-paste:`, and does not
3607         invoke the superclass method (which calls back into `-[WKContentView pasteForWebView:]`). There are a few
3608         possibilities here:
3609         1. WKWebView's `-paste:` action is not overridden. In this case, we will call back into `-pasteForWebView:`,
3610            which will notice that we have a pending paste completion handler and invoke it.
3611         2. WKWebView's `-paste:` action is overridden and does not call back into the content view. In this case, we
3612            will invoke the paste completion handler in `-_didPerformAction:sender:`.
3613         3. WKWebView's `-canPerformAction:withSender:` is overridden to include additional actions. In this case, we may
3614            get a call to invoke a different action selector while waiting for a potential paste action. If this happens,
3615            prevent the DOM paste in `-_willPerformAction:sender:` prior to handling the other action.
3616
3617         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
3618
3619         Dismiss DOM paste UI upon handling any key event.
3620
3621         (-[WKContentView showGlobalMenuControllerInRect:]):
3622         (-[WKContentView hideGlobalMenuController]):
3623
3624         Helper methods to present and dismiss the global UIMenuController, that accounts for available platform APIs for
3625         presenting or dismissing the menu controller on iOS.
3626
3627         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]):
3628
3629         Attempt to find a good target presentation rect when showing the callout menu. First, we will try to use the
3630         rect of the element the user has interacted with when triggering the paste. If such an element is too large or
3631         does not exist, we fall back to presenting the callout menu near the user's last touch location (with a small
3632         amount of margin, such that the action doesn't overlap with the user's finger, stylus, etc.).
3633
3634         (-[WKContentView _resetShowingTextStyle:]): Deleted.
3635
3636         Rename this to `-_didHideMenu:`.
3637
3638         * UIProcess/mac/PageClientImplMac.h:
3639         * UIProcess/win/PageClientImpl.cpp:
3640         (WebKit::PageClientImpl::requestDOMPasteAccess):
3641         * UIProcess/win/PageClientImpl.h:
3642         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3643         (WebKit::WebEditorClient::requestDOMPasteAccess):
3644         * WebProcess/WebCoreSupport/WebEditorClient.h:
3645         * WebProcess/WebPage/WebPage.cpp:
3646         (WebKit::WebPage::requestDOMPasteAccess):
3647
3648         Add more plumbing and method stubs.
3649
3650         (WebKit::WebPage::updateCurrentModifierState):
3651         (WebKit::WebPage::rectForElementAtInteractionLocation const):
3652         * WebProcess/WebPage/WebPage.h:
3653         * WebProcess/WebPage/ios/WebPageIOS.mm:
3654         (WebKit::WebPage::rectForElementAtInteractionLocation const):
3655         (WebKit::WebPage::rectForElementAtInteractionLocation): Deleted.
3656
3657         Mark this method as const, add a platform-agnostic stub, and adopt it for the purposes of determining where to
3658         position the callout bar when pasting.
3659
3660 2019-02-12  Alex Christensen  <achristensen@webkit.org>
3661
3662         Remove setDefersLoading infrastructure from WebKit2
3663         https://bugs.webkit.org/show_bug.cgi?id=194506
3664
3665         Reviewed by Brady Eidson.
3666
3667         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3668         (WebKit::NetworkConnectionToWebProcess::setDefersLoading): Deleted.
3669         * NetworkProcess/NetworkConnectionToWebProcess.h:
3670         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3671         * NetworkProcess/NetworkDataTask.h:
3672         * NetworkProcess/NetworkDataTaskBlob.cpp:
3673         (WebKit::NetworkDataTaskBlob::suspend): Deleted.
3674         * NetworkProcess/NetworkDataTaskBlob.h:
3675         * NetworkProcess/NetworkLoad.cpp:
3676         (WebKit::NetworkLoad::initialize):
3677         (WebKit::NetworkLoad::setDefersLoading): Deleted.
3678         * NetworkProcess/NetworkLoad.h:
3679         * NetworkProcess/NetworkLoadParameters.h:
3680         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3681         (WebKit::NetworkResourceLoadParameters::encode const):
3682         (WebKit::NetworkResourceLoadParameters::decode):
3683         * NetworkProcess/NetworkResourceLoader.cpp:
3684         (WebKit::NetworkResourceLoader::start):
3685         (WebKit::NetworkResourceLoader::startNetworkLoad):
3686         (WebKit::NetworkResourceLoader::setDefersLoading): Deleted.
3687         * NetworkProcess/NetworkResourceLoader.h:
3688         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3689         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3690         (WebKit::NetworkDataTaskCocoa::suspend): Deleted.
3691         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
3692         (WebKit::NetworkDataTaskCurl::suspend): Deleted.
3693         * NetworkProcess/curl/NetworkDataTaskCurl.h:
3694         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3695         (WebKit::NetworkDataTaskSoup::suspend): Deleted.
3696         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3697         * WebProcess/Network/WebLoaderStrategy.cpp:
3698         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3699         (WebKit::WebLoaderStrategy::setDefersLoading):
3700
3701 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
3702
3703         Unreviewed, fix build warnings after content extensions enablement
3704         https://bugs.webkit.org/show_bug.cgi?id=193622
3705         <rdar://problem/47982850>
3706
3707         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
3708         (toResult):
3709
3710 2019-02-12  Tim Horton  <timothy_horton@apple.com>
3711
3712         Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
3713         https://bugs.webkit.org/show_bug.cgi?id=194524
3714         <rdar://problem/35481797>
3715
3716         Reviewed by Wenson Hsieh.
3717
3718         * Platform/spi/ios/UIKitSPI.h:
3719         * UIProcess/ios/InputViewUpdateDeferrer.h:
3720         * UIProcess/ios/InputViewUpdateDeferrer.mm:
3721         (WebKit::InputViewUpdateDeferrer::InputViewUpdateDeferrer):
3722         (WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer):
3723         Make use of the per-responder and much safer input view pinning mechanism.
3724
3725         * UIProcess/ios/WKContentViewInteraction.mm:
3726         (-[WKContentView becomeFirstResponderForWebView]):
3727         (-[WKContentView _singleTapCommited:]):
3728         (-[WKContentView _attemptClickAtLocation:modifierFlags:]):
3729         Always temporarily pin input views when becoming first responder; there are
3730         many paths (such as through the text interaction assistant) that can
3731         focus us on tap, trying to cover them all is a fool's errand. We'll
3732         just get out the big hammer and call it in becomeFirstResponder.
3733         This also means we can remove it from _singleTapCommitted and _attemptClick...
3734
3735         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3736         Don't release the input view pinning until we return from _elementDidFocus;
3737         it does the rebuilding synchronously, so we need to have actually updated
3738         all of the prerequisites of -inputView before depinning.
3739
3740 2019-02-12  Youenn Fablet  <youenn@apple.com>
3741
3742         Make use of is<SubresourceLoader>
3743         https://bugs.webkit.org/show_bug.cgi?id=194541
3744
3745         Reviewed by Alex Christensen.
3746
3747         * WebProcess/Network/WebLoaderStrategy.cpp:
3748         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3749
3750 2019-02-12  Alex Christensen  <achristensen@webkit.org>
3751
3752         WebPage::close needs to remove all message receivers associated with that WebPage, not WebPage::~WebPage
3753         https://bugs.webkit.org/show_bug.cgi?id=194522
3754         <rdar://problem/47789393>
3755
3756         Reviewed by Chris Dumez.
3757
3758         The InjectedBundle SPI can retain the WebPage or wrapping objects (WKWebProcessPlugInBrowserContextController/WKBundlePageRef).
3759         This can make it so WebPage::close is called before WebPage::~WebPage, and if the SuspendedPageProxy is reused for a subsequent
3760         navigation to the same domain, the WebProcess is reused with a different WebPage instance with the same PageID, which causes problems
3761         when another WebPage registers message handlers and then the previous WebPage is destroyed, which removes both message handlers.
3762
3763         * WebProcess/WebPage/WebPage.cpp:
3764         (WebKit::WebPage::~WebPage):
3765         (WebKit::WebPage::close):
3766         (WebKit::WebPage::mainFrameDidLayout):
3767         * WebProcess/WebPage/WebPage.h:
3768         * WebProcess/WebProcess.h:
3769         (WebKit::WebProcess::eventDispatcher):
3770
3771 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
3772
3773         [WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize
3774         https://bugs.webkit.org/show_bug.cgi?id=194370
3775
3776         Reviewed by Darin Adler.
3777
3778         It is incorrect to use g_unsetenv() here because it is MT-Unsafe. We know that it is
3779         impossible and unreasonable to expect the application has not started other threads at this
3780         point, and threads will be calling getenv(). WebKit itself has probably already started
3781         threads of its own.
3782
3783         Fortunately, the remote inspector in the web process is already prepared to deal with
3784         failure to connect to the inspector server, so we don't need to do anything except stop
3785         messing with the environment.
3786
3787         Note these files are copies of each other. I'll merge them together in a follow-up patch.
3788
3789         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3790         (WebKit::initializeRemoteInspectorServer):
3791         (WebKit::WebProcessPool::platformInitialize):
3792         * UIProcess/wpe/WebProcessPoolWPE.cpp:
3793         (WebKit::initializeRemoteInspectorServer):
3794         (WebKit::WebProcessPool::platformInitialize):
3795
3796 2019-02-08  Beth Dakin  <bdakin@apple.com>
3797
3798         Ensure old binaries have old snapshotting behaviors
3799         https://bugs.webkit.org/show_bug.cgi?id=194449
3800         -and corresponding-
3801         rdar://problem/47931954
3802
3803         Reviewed by Darin Adler.
3804
3805         Make sure that a nil configuration behaves the same way that it used to on apps 
3806         that were linked before FirstWithSnapshotAfterScreenUpdates
3807
3808         * UIProcess/API/Cocoa/WKWebView.mm:
3809         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
3810         * UIProcess/Cocoa/VersionChecks.h:
3811
3812 2019-02-12  Andy Estes  <aestes@apple.com>
3813
3814         [iOSMac] Enable Parental Controls Content Filtering
3815         https://bugs.webkit.org/show_bug.cgi?id=194521
3816         <rdar://39732376>
3817
3818         Reviewed by Tim Horton.
3819
3820         * Configurations/FeatureDefines.xcconfig:
3821
3822 2019-02-11  Alex Christensen  <achristensen@webkit.org>
3823
3824         Remove noisy and unnecessary logs added in r241223
3825         https://bugs.webkit.org/show_bug.cgi?id=194427
3826
3827         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3828         (WebKit::ProcessLauncher::launchProcess):
3829         Errors occur all the time in the XPC connection's event handler, like when a process terminates.
3830         We don't need to print an "error" every time any process terminates.
3831
3832 2019-02-11  Brian Burg  <bburg@apple.com>
3833
3834         [Cocoa] Web Automation: client callbacks are not called if delegate does not override
3835         https://bugs.webkit.org/show_bug.cgi?id=194519
3836         <rdar://problem/47981961>
3837
3838         Reviewed by Joseph Pecoraro.
3839
3840         Call the completion handler directly if the delegate does not implement the relevant method.
3841
3842         * UIProcess/Cocoa/AutomationSessionClient.mm:
3843         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
3844         (WebKit::AutomationSessionClient::requestSwitchToPage):
3845         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
3846         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
3847         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
3848
3849 2019-02-11  Daniel Bates  <dabates@apple.com>
3850
3851         [iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
3852         https://bugs.webkit.org/show_bug.cgi?id=194505
3853         <rdar://problem/47743533>
3854
3855         Reviewed by Tim Horton.
3856
3857         * UIProcess/ios/WKContentViewInteraction.mm:
3858         (-[WKContentView _deleteToEndOfParagraph]): Added.
3859         (-[WKContentView _transpose]): Added.
3860
3861 2019-02-11  Adrian Perez de Castro  <aperez@igalia.com>
3862
3863         [GTK][WPE] Add content extensions support in WKTR and unskip layout tests
3864         https://bugs.webkit.org/show_bug.cgi?id=193622
3865
3866         Reviewed by Michael Catanzaro.
3867
3868         * NetworkProcess/cache/NetworkCacheData.h: Define an adoptAndMapFile() implementation
3869         for GFileIOStream objects.
3870         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
3871         (WebKit::NetworkCache::adoptAndMapFile): Added implementation, which extracts the file
3872         descriptor from a GFileIOStream, as it inherits from GFileDescriptorBased, and then
3873         reuses the version of adoptAndMapFile() which takes a file descritor for the actual work.
3874         * NetworkProcess/NetworkLoadChecker.cpp:
3875         (Webkit::NetworkLoadChecker::checkRequest): Use "this" when referring to
3876         processContentExtensionRulesForLoad() in order to avoid ambiguity.
3877         * Sources.txt: Add WKUserContentExtensionStoreRef.cpp, all ports use it now.
3878         * SourcesCocoa.txt: Remove WKUserContentExtensionStoreRef.cpp, because it is not
3879         Cocoa-specific anymore.
3880         * SourcesGTK.txt: Add APIContentRuleListStoreGLib.cpp.
3881         * SourcesWPE.txt: Ditto.
3882         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
3883         (WKUserContentExtensionStoreCreate): Added.
3884         (toResult): Added.
3885         (WKUserContentExtensionStoreCompile): Added.
3886         (WKUserContentExtensionStoreLookup): Added.
3887         (WKUserContentExtensionStoreRemove): Added.
3888         * UIProcess/API/C/WKUserContentExtensionStoreRef.h: Add declarations for the new C API
3889         functions and for the WKUserContentExtensionStoreResult status enum.
3890         * UIProcess/API/glib/APIContentRuleListStoreGLib.cpp: Added.
3891         (API::ContentRuleListStore::defaultStorePath): Add a dummy implementation. The public API
3892         for the GLib based ports (GTK+ and WPE) will not allow using the default store and will
3893         always indicating a path.
3894
3895 2019-02-11  Daniel Bates  <dabates@apple.com>
3896
3897         [iOS] Mouse/Touch/Pointer events are missing modifier keys
3898         https://bugs.webkit.org/show_bug.cgi?id=191446
3899         <rdar://problem/45929460>
3900
3901         Reviewed by Tim Horton.
3902
3903         Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
3904         Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
3905         flags held when a navigation action was initiated.
3906
3907         * Platform/spi/ios/UIKitSPI.h: Expose SPI.
3908         * Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
3909         WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
3910         from both C++ and Objective-C source files. It only makes sense to expose this function when
3911         compiling as part of an Objective-C source file.
3912         * Shared/ios/NativeWebTouchEventIOS.mm:
3913         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
3914         when the platform touch event was received and pass them through to the base constructor.
3915         (WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
3916         OptionSet<WebKit::WebEvent::Modifier>.
3917         * Shared/ios/WebIOSEventFactory.h:
3918         * Shared/ios/WebIOSEventFactory.mm:
3919         (WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
3920         to the platform-specific UIKeyModifierFlags.
3921         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3922         (-[WKNavigationAction modifierFlags]): Added.
3923         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
3924         * UIProcess/WebPageProxy.h:
3925         * UIProcess/ios/WKContentViewInteraction.h:
3926         * UIProcess/ios/WKContentViewInteraction.mm:
3927         (gestureRecognizerModifierFlags): Added.
3928
3929         (-[WKContentView _webTouchEventsRecognized:]):
3930         (-[WKContentView _highlightLongPressRecognized:]):
3931         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
3932         (-[WKContentView _singleTapCommited:]):
3933         Pass modifier flags through.
3934
3935         (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
3936         (-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
3937         via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
3938         detail that this action is implemented via mouse click and we should