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