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