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