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