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