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