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