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