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