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