[iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
2
3         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
4         https://bugs.webkit.org/show_bug.cgi?id=195584
5
6         Reviewed by Zalan Bujtas.
7
8         Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
9         RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
10         just as we do for frames.
11
12         AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
13
14         Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
15         ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
16         callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
17         ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
18
19         Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
20         the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
21         already been put in the right locations, but the UI process needs to know that a scroll happened).
22         However, we need to prevent notifications from programmatic scrolls getting back to the
23         web process, because this causes jumpiness. This is done via an early return in
24         RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
25
26         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
27         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
28         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
29         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): Subframe nodes have
30         a delegate, and that will take care of the requestedScrollPosition update.
31         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
32         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
33         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
34         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
35         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
36
37 2019-04-04  Ryan Haddad  <ryanhaddad@apple.com>
38
39         Unreviewed, rolling out r243888.
40
41         Introduced layout test crashes.
42
43         Reverted changeset:
44
45         "[macOS][iOS] Add filter to syscall sandbox rule"
46         https://bugs.webkit.org/show_bug.cgi?id=196613
47         https://trac.webkit.org/changeset/243888
48
49 2019-04-04  Youenn Fablet  <youenn@apple.com>
50
51         Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
52         https://bugs.webkit.org/show_bug.cgi?id=196543
53
54         Reviewed by Alex Christensen.
55
56         Renamed methods used to set cache storage quota to be storage generic
57         since they will apply to all storage.
58
59         Pass quota parameters as part of WebsiteDataStoreParameters from UIProcess
60         to NetworkProcess (start-up time and new WebsiteDataStore time).
61
62         Compute on UIProcess the quota for third party origins using the default rule of dividing by 10.
63
64         * NetworkProcess/NetworkProcess.cpp:
65         (WebKit::NetworkProcess::initializeNetworkProcess):
66         (WebKit::NetworkProcess::addWebsiteDataStore):
67         (WebKit::NetworkProcess::initializeStorageQuota):
68         (WebKit::NetworkProcess::setCacheStorageParameters):
69         * NetworkProcess/NetworkProcess.h:
70         * NetworkProcess/NetworkProcess.messages.in:
71         * Shared/WebsiteDataStoreParameters.cpp:
72         (WebKit::WebsiteDataStoreParameters::encode const):
73         (WebKit::WebsiteDataStoreParameters::decode):
74         * Shared/WebsiteDataStoreParameters.h:
75         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
76         (WKWebsiteDataStoreSetPerOriginStorageQuota):
77         (WKWebsiteDataStoreSetCacheStoragePerOriginQuota): Deleted.
78         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
79         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
80         (-[WKWebsiteDataStore _perOriginStorageQuota]):
81         (-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
82         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]): Deleted.
83         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]): Deleted.
84         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
85         * UIProcess/Network/NetworkProcessProxy.cpp:
86         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
87         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
88         (WebKit::WebsiteDataStore::parameters):
89         * UIProcess/WebsiteData/WebsiteDataStore.h:
90         (WebKit::WebsiteDataStore::perOriginStorageQuota const):
91         (WebKit::WebsiteDataStore::setPerOriginStorageQuota):
92         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): Deleted.
93         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): Deleted.
94         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
95         (WebKit::WebsiteDataStoreConfiguration::copy):
96         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
97         (WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota):
98         (WebKit::WebsiteDataStoreConfiguration::setPerOriginStorageQuota):
99         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota): Deleted.
100         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota): Deleted.
101
102 2019-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>
103
104         Changing default website policies shouldn't change default website policies in subsequent navigations
105         https://bugs.webkit.org/show_bug.cgi?id=196562
106         <rdar://problem/49573377>
107
108         Reviewed by Tim Horton.
109
110         Currently, changing the default WKWebpagePreferences object when deciding navigation policy causes the set of
111         default policies to change in subsequent navigations. Among other things, this prevents clients from passing
112         a modified version of the default website policies into the decision handler without impacting future
113         navigations. To fix this, teach API::WebsitePolicies to make a copy of itself, and then use this to pass a copy
114         of the default website policies to the navigation delegate when deciding navigation policies.
115
116         Test: DoNotAllowChangingDefaultWebpagePreferencesInDelegateMethod
117
118         * UIProcess/API/APIWebsitePolicies.cpp:
119         (API::WebsitePolicies::copy const):
120
121         Add a helper method to copy a set of website policies.
122
123         * UIProcess/API/APIWebsitePolicies.h:
124         * UIProcess/Cocoa/NavigationState.mm:
125         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
126
127 2019-04-04  Michael Catanzaro  <mcatanzaro@igalia.com>
128
129         Unreviewed, fix -Wreturn-type warning
130
131         * Shared/WebsiteData/WebsiteData.cpp:
132         (WebKit::WebsiteData::ownerProcess):
133
134 2019-04-04  Per Arne Vollan  <pvollan@apple.com>
135
136         [macOS] Fix sandbox violations
137         https://bugs.webkit.org/show_bug.cgi?id=196616
138         <rdar://problem/49498040>
139
140         Reviewed by Brent Fulgham.
141
142         Fix some observed sandbox violations in the WebContent process on macOS.
143
144         * WebProcess/com.apple.WebProcess.sb.in:
145
146 2019-04-04  Eric Carlson  <eric.carlson@apple.com>
147
148         [MediaStream] Host should be able to mute screen capture and camera/microphone independently
149         https://bugs.webkit.org/show_bug.cgi?id=196555
150         <rdar://problem/47303865>
151
152         Reviewed by Youenn Fablet.
153
154         * UIProcess/API/C/WKPagePrivate.h: Add kWKMediaScreenCaptureMuted.
155
156         * UIProcess/API/Cocoa/WKWebView.mm:
157         (-[WKWebView _setPageMuted:]):
158         (-[WKWebView _setMediaCaptureMuted:]): Deleted, it was unused.
159         (-[WKWebView _muteMediaCapture]): Deleted, it was unused.
160         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
161
162         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
163         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest): Fix
164         a log comment typo.
165
166         * UIProcess/WebPageProxy.cpp:
167         (WebKit::WebPageProxy::setMediaStreamCaptureMuted): Use the new flag.
168         (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Ditto.
169         (WebKit::WebPageProxy::setMuted): Ditto.
170         * UIProcess/WebPageProxy.h:
171         (WebKit::WebPageProxy::isMediaStreamCaptureMuted const): Ditto.
172
173 2019-04-04  Per Arne Vollan  <pvollan@apple.com>
174
175         [macOS][iOS] Add filter to syscall sandbox rule
176         https://bugs.webkit.org/show_bug.cgi?id=196613
177         <rdar://problem/49531420>
178
179         Reviewed by Brent Fulgham.
180
181         This will restrict the existing sandbox rule for the syscall.
182
183         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
184         * WebProcess/com.apple.WebProcess.sb.in:
185
186 2019-04-04  Youenn Fablet  <youenn@apple.com>
187
188         Service Worker Process does not have the right domain name
189         https://bugs.webkit.org/show_bug.cgi?id=196585
190
191         Reviewed by Chris Dumez.
192
193         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
194         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
195         Updated extraInitializationData to go from "security-origin" to "registrable-domain".
196
197 2019-04-04  Chris Dumez  <cdumez@apple.com>
198
199         Temporarily disable delayed WebProcess launch on iOS to address PLT regression
200         https://bugs.webkit.org/show_bug.cgi?id=196604
201         <rdar://problem/49074131>
202
203         Reviewed by Geoffrey Garen.
204
205         Temporarily disable delayed WebProcess launch on iOS to address PLT regression. This
206         is while I figure out how to enable this on iOS without regressed PLT.
207
208         * UIProcess/WebProcessPool.h:
209
210 2019-04-04  Miguel Gomez  <magomez@igalia.com>
211
212         [CoordGraphics] Revalidate need for 'coordinated update completion' in ThreadedCompositor
213         https://bugs.webkit.org/show_bug.cgi?id=188839
214
215         Reviewed by Žan Doberšek.
216
217         Even if a platform layer has changed, don't wait for a main thread callback to finish the
218         CompositingRunLoop update. It can be finished as soon as we receive the frameComplete signal.
219
220         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
221         (WebKit::CompositingRunLoop::scheduleUpdate):
222         (WebKit::CompositingRunLoop::stopUpdates):
223         (WebKit::CompositingRunLoop::updateCompleted):
224         (WebKit::CompositingRunLoop::updateTimerFired):
225         (WebKit::CompositingRunLoop::compositionCompleted): Deleted.
226         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
227         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
228         (WebKit::ThreadedCompositor::renderLayerTree):
229         (WebKit::ThreadedCompositor::sceneUpdateFinished):
230         (WebKit::ThreadedCompositor::displayRefreshMonitor):
231         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): Deleted.
232         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
233         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
234         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
235
236 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
237
238         [ATK] Cleanup WebPageAccessibilityObjectAtk
239         https://bugs.webkit.org/show_bug.cgi?id=196537
240
241         Reviewed by Michael Catanzaro.
242
243         Several changes and cleanups:
244
245          - Add WebKit prefix so that style checker doesn't complain about GObject conventions.
246          - Rename the header to remove the Atk prefix to match the cpp file and class name.
247          - Use pragma once.
248          - Use nullptr instead of 0.
249          - Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
250          - Return generic AtkObject* from constructor.
251
252         * SourcesGTK.txt:
253         * WebProcess/WebPage/WebPage.h:
254         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
255         (accessibilityRootObjectWrapper):
256         (webkitWebPageAccessibilityObjectInitialize):
257         (webkitWebPageAccessibilityObjectGetIndexInParent):
258         (webkitWebPageAccessibilityObjectGetNChildren):
259         (webkitWebPageAccessibilityObjectRefChild):
260         (webkit_web_page_accessibility_object_class_init):
261         (webkitWebPageAccessibilityObjectNew):
262         (webkitWebPageAccessibilityObjectRefresh):
263         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
264         * WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
265         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
266         (WebKit::WebPage::platformInitialize):
267         (WebKit::WebPage::updateAccessibilityTree):
268
269 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
270
271         [ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
272         https://bugs.webkit.org/show_bug.cgi?id=196535
273
274         Reviewed by Michael Catanzaro.
275
276         This way the properties are not cached. Right now, if number of children is queried before the socket is
277         embedded, 0 is returned and cached, so ATs don't see the child even after the socket has been embedded.
278
279         * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
280         (webkitWebViewBaseAccessibleRefStateSet): Set ATK_STATE_TRANSIENT is the socket is not occupied.
281         * UIProcess/gtk/WebPageProxyGtk.cpp:
282         (WebKit::WebPageProxy::bindAccessibilityTree): Unset ATK_STATE_TRANSIENT.
283
284 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
285
286         [ATK] Embed the AtkSocket as soon as we receive the plug ID
287         https://bugs.webkit.org/show_bug.cgi?id=196534
288
289         Reviewed by Michael Catanzaro.
290
291         We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
292         can simply embed the socket when the plug ID is received.
293
294         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
295         (webkitWebViewBaseGetAccessible):
296         * UIProcess/WebPageProxy.h:
297         * UIProcess/gtk/WebPageProxyGtk.cpp:
298         (WebKit::WebPageProxy::bindAccessibilityTree):
299
300 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
301
302         [ATK] Don't touch accessibility tree in WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld
303         https://bugs.webkit.org/show_bug.cgi?id=193914
304
305         Reviewed by Michael Catanzaro.
306
307         Move it to dispatchDidFinishDocumentLoad, since we know we have the document at that point and we can create the
308         root accessibility object wrapper.
309
310         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
311         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
312         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
313
314 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
315
316         Simplify some "programmaticScroll" code paths
317         https://bugs.webkit.org/show_bug.cgi?id=196589
318
319         Reviewed by Zalan Bujtas.
320
321         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Remove the parameter.
322         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): Use the enum type.
323         * WebProcess/WebPage/ios/WebPageIOS.mm:
324         (WebKit::WebPage::updateVisibleContentRects):
325
326 2019-04-03  Chris Dumez  <cdumez@apple.com>
327
328         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash
329         https://bugs.webkit.org/show_bug.cgi?id=196588
330         <rdar://problem/49365787>
331
332         Reviewed by Ryosuke Niwa.
333
334         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash.
335         This can lead to returning stale frames to the client if it asks for those.
336
337         * UIProcess/WebPageProxy.cpp:
338         (WebKit::WebPageProxy::resetState):
339
340 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
341
342         Remove the isProgrammaticScroll argument to requestScroll() because no-one uses it
343         https://bugs.webkit.org/show_bug.cgi?id=196587
344
345         Reviewed by Zalan Bujtas.
346
347         This argument was unused.
348
349         * UIProcess/API/gtk/PageClientImpl.cpp:
350         (WebKit::PageClientImpl::requestScroll):
351         * UIProcess/API/gtk/PageClientImpl.h:
352         * UIProcess/API/wpe/PageClientImpl.cpp:
353         (WebKit::PageClientImpl::requestScroll):
354         * UIProcess/API/wpe/PageClientImpl.h:
355         * UIProcess/PageClient.h:
356         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
357         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
358         * UIProcess/WebPageProxy.cpp:
359         (WebKit::WebPageProxy::requestScroll):
360         * UIProcess/WebPageProxy.h:
361         * UIProcess/ios/PageClientImplIOS.h:
362         * UIProcess/ios/PageClientImplIOS.mm:
363         (WebKit::PageClientImpl::requestScroll):
364         * UIProcess/mac/PageClientImplMac.h:
365         * UIProcess/mac/PageClientImplMac.mm:
366         (WebKit::PageClientImpl::requestScroll):
367         * UIProcess/win/PageClientImpl.cpp:
368         (WebKit::PageClientImpl::requestScroll):
369         * UIProcess/win/PageClientImpl.h:
370
371 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
372
373         -apple-trailing-word is needed for browser detection
374         https://bugs.webkit.org/show_bug.cgi?id=196575
375
376         Unreviewed.
377
378         * Configurations/FeatureDefines.xcconfig:
379
380 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
381
382         Add a WebKit internal feature flag to always enable modern compatibility mode by default
383         https://bugs.webkit.org/show_bug.cgi?id=196526
384         <rdar://problem/49532923>
385
386         Reviewed by Tim Horton.
387
388         Change UseModernCompatibilityModeByDefault from an internal preference to a debug preference, so that it may be
389         enabled for all apps on the system.
390
391         * Shared/WebPreferences.yaml:
392
393 2019-04-03  Alex Christensen  <achristensen@webkit.org>
394
395         Fix internal build after r243829
396         https://bugs.webkit.org/show_bug.cgi?id=196549
397
398         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
399         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
400         Some SDK's don't include this selector in the header.
401         Use NSSelectorFromString.
402
403 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
404
405         [CMake][WTF] Mirror XCode header directories
406         https://bugs.webkit.org/show_bug.cgi?id=191662
407
408         Reviewed by Konstantin Tokarev.
409
410         Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
411         builds.
412
413         * CMakeLists.txt:
414
415 2019-04-03  Alex Christensen  <achristensen@webkit.org>
416
417         Add SPI to disable legacy TLS fallback
418         https://bugs.webkit.org/show_bug.cgi?id=196549
419         <rdar://44979744>
420
421         Reviewed by Geoffrey Garen.
422
423         * NetworkProcess/NetworkSessionCreationParameters.cpp:
424         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
425         (WebKit::NetworkSessionCreationParameters::encode const):
426         (WebKit::NetworkSessionCreationParameters::decode):
427         * NetworkProcess/NetworkSessionCreationParameters.h:
428         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
429         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
430         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
431         (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
432         (-[WKWebsiteDataStore _allowsTLSFallback]):
433         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
434         * UIProcess/WebProcessPool.cpp:
435         (WebKit::WebProcessPool::ensureNetworkProcess):
436         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
437         (WebKit::WebsiteDataStore::parameters):
438         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
439         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
440         (WebKit::WebsiteDataStore::setAllowsTLSFallback):
441         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
442         * UIProcess/WebsiteData/WebsiteDataStore.h:
443         (WebKit::WebsiteDataStore::allowsTLSFallback const):
444         (WebKit::WebsiteDataStore::networkingHasBegun):
445         (WebKit::WebsiteDataStore::finalizeApplicationIdentifiers): Deleted.
446
447 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
448
449         Remove support for -apple-trailing-word
450         https://bugs.webkit.org/show_bug.cgi?id=196525
451
452         Reviewed by Zalan Bujtas.
453
454         This CSS property is nonstandard and not used.
455
456         * Configurations/FeatureDefines.xcconfig:
457
458 2019-04-03  Alex Christensen  <achristensen@webkit.org>
459
460         Resurrect and fix layout test http/tests/adClickAttribution/store-ad-click-attribution.html
461         https://bugs.webkit.org/show_bug.cgi?id=196476
462
463         Reviewed by Chris Dumez.
464
465         Re-apply a change I reverted in r241754 now that it's safe to do so.
466
467         * UIProcess/WebPageProxy.cpp:
468         (WebKit::WebPageProxy::didCommitLoadForFrame):
469
470 2019-04-03  Daniel Bates  <dabates@apple.com>
471
472         [iOS] Should be able to dismiss picker or popover using the keyboard
473         https://bugs.webkit.org/show_bug.cgi?id=196272
474         <rdar://problem/48943170>
475
476         Reviewed by Wenson Hsieh.
477
478         Intercept key events and route them to the current input peripheral (if we have one). Add a base key event handler
479         for all form peripherals that dismisses the accessory when either the Escape key is pressed or Command + . is pressed.
480         I will fix this issue for the file upload picker/popover in <https://bugs.webkit.org/show_bug.cgi?id=196287>.
481
482         * SourcesCocoa.txt: Add file WKFormPeripheralBase.mm.
483         * UIProcess/ios/WKContentViewInteraction.mm:
484         (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason]): Added.
485         (-[WKContentView resignFirstResponderForWebView]): Write in terms of -endEditingAndUpdateFocusAppearance.
486         (-[WKContentView inputView]): Code style nit while I am here; add an empty line to demarcate the "crazy"
487         code that the FIXME is referring to and should ideally be removed from the code that is sane to always do.
488         (-[WKContentView accessoryDone]): When the accessory is dismissed via the Done button (iPhone) or by pressing
489         Escape or Command + . using a hardware keyboard (iPhone or iPad) then end the current editing session, but
490         do not resign first responder status as the page activation state should not be changed.
491         (-[WKContentView _handleKeyUIEvent:]): Bring back this code when building with USE(UIKIT_KEYBOARD_ADDITIONS)
492         as we need to route key events to the input peripheral (if we have one). If the input peripheral handles it
493         then we're done: no need to let UIKit or WebKit handle it when building with USE(UIKIT_KEYBOARD_ADDITIONS),
494         respectively. If the input peripheral does not handle it then do what we do now.
495         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
496         If the element is re-focused and we have an input peripheral then we want to ensure we are first responder,
497         reveal the focused element, update the accessory and tell the peripheral that editing has begun (again).
498         For all other element re-focusing where we don't have a peripheral do what we do now. Also, update _isEditable
499         to reflect whether the focused element contains selectable text. This is what UIKit wants to know when it queries
500         -isEditable. Now that we no longer blur the focused element on iPad when the popover is dismissed and keep the
501         peripheral until there is a focus change we need to ensure that we give the correct answer to UIKit on view
502         editability. Otherwise, UIKit thinks it needs to update the text selection state when a popup button is tapped
503         again (as part of its gesture recognizer logic) and this causes an assertion failure in UIKit after it calls back
504         into us to ask for selection details, which we correctly respond with the equivalent of "we have none" and is
505         not the answer UIKit expects since we told it we are editable. (Currently we manage to get away with telling UIKit
506         we are always editable because it is not possible to perform a selection operation when we have a popover open.
507         Closing the popover blurs the element, setting -isEditable to NO and deallocates the peripheral avoiding this issue).
508         * UIProcess/ios/forms/WKFormColorControl.h:
509         * UIProcess/ios/forms/WKFormColorControl.mm:
510         (-[WKColorPopover controlEndEditing]): Dismiss the popover.
511         (-[WKFormColorControl initWithView:]): Modified to call base class initializer.
512         (-[WKFormColorControl assistantView]): Deleted.
513         (-[WKFormColorControl beginEditing]): Deleted.
514         (-[WKFormColorControl endEditing]): Deleted.
515         * UIProcess/ios/forms/WKFormInputControl.h:
516         * UIProcess/ios/forms/WKFormInputControl.mm:
517         (-[WKFormInputControl initWithView:]): Modified to call base class initializer.
518         (-[WKFormInputControl dateTimePickerCalendarType]): Write in terms of self.control.
519         (-[WKDateTimePopover controlEndEditing]): Dismiss the popover and tell the controller that editing ended.
520         (-[WKFormInputControl beginEditing]): Deleted.
521         (-[WKFormInputControl endEditing]): Deleted.
522         (-[WKFormInputControl assistantView]): Deleted.
523         * UIProcess/ios/forms/WKFormPeripheral.h:
524         * UIProcess/ios/forms/WKFormPeripheralBase.h: Added.
525         * UIProcess/ios/forms/WKFormPeripheralBase.mm: Added.
526         (-[WKFormPeripheralBase initWithView:control:]): Take ownership of the passed WKFormControl.
527         (-[WKFormPeripheralBase beginEditing]): Turn around and tell the control.
528         (-[WKFormPeripheralBase endEditing]): Ditto.
529         (-[WKFormPeripheralBase assistantView]): Ditto.
530         (-[WKFormPeripheralBase control]): Return the control.
531         (-[WKFormPeripheralBase handleKeyEvent:]): Dismiss the accessory (in the same way we dismiss when the Done
532         button is pressed on iPhone) on keydown of the Escape key or when we receive a UIKeyInputEscape event (for
533         Command + .).
534         * UIProcess/ios/forms/WKFormSelectControl.h:
535         * UIProcess/ios/forms/WKFormSelectControl.mm:
536         (-[WKFormSelectControl initWithView:]): Modified to call base class initializer.
537         (-[WKFormSelectControl selectRow:inComponent:extendingSelection:]): Write in terms of self.control.
538         (-[WKFormSelectControl selectFormPopoverTitle]): Ditto.
539         (-[WKFormSelectControl assistantView]): Deleted.
540         (-[WKFormSelectControl beginEditing]): Deleted.
541         (-[WKFormSelectControl endEditing]): Deleted.
542         * UIProcess/ios/forms/WKFormSelectPopover.mm:
543         (-[WKSelectPopover controlEndEditing]): Dismiss the popover.
544         * WebKit.xcodeproj/project.pbxproj: Add files WKFormPeripheralBase.{h, mm}.
545
546 2019-04-03  Youenn Fablet  <youenn@apple.com>
547
548         Resetting quota should take into account third party origins
549         https://bugs.webkit.org/show_bug.cgi?id=196462
550
551         Reviewed by Geoffrey Garen.
552
553         When clearing the storage quota, we were resetting it to the default value
554         without taking care of whether third party or not.
555         Updated the code to ensure that the default quota is computed based on the origin.
556
557         Updated existing test to cover this case.
558
559         * NetworkProcess/NetworkProcess.cpp:
560         (WebKit::NetworkProcess::clearStorageQuota):
561         (WebKit::NetworkProcess::setCacheStorageParameters):
562         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
563         (WebKit::NetworkProcess::storageQuotaManager):
564         * NetworkProcess/NetworkProcess.h:
565         (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const):
566         (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas):
567         (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin):
568
569 2019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
570
571         Get rid of HTMLInputElement::setEditingValue
572         https://bugs.webkit.org/show_bug.cgi?id=196402
573
574         Reviewed by Darin Adler.
575
576         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
577         (webkit_dom_element_html_input_element_set_editing_value):
578         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
579         (webkit_dom_html_input_element_set_editing_value):
580
581 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
582
583         Add a WebKit internal feature flag to always enable modern compatibility mode by default
584         https://bugs.webkit.org/show_bug.cgi?id=196526
585         <rdar://problem/49532923>
586
587         Reviewed by Antoine Quint.
588
589         * Shared/WebPreferences.yaml:
590
591 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
592
593         Introduce and add plumbing for a website policy for meta viewport tag handling
594         https://bugs.webkit.org/show_bug.cgi?id=196285
595
596         Reviewed by Tim Horton.
597
598         Add WebsiteMetaViewportPolicy, a bit that can be used to determine whether to respect or ignore the meta
599         viewport tag and use native web page parameters instead of the default parameters.
600
601         * Shared/WebsiteMetaViewportPolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
602         * Shared/WebsitePoliciesData.cpp:
603         (WebKit::WebsitePoliciesData::encode const):
604         (WebKit::WebsitePoliciesData::decode):
605         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
606
607         Convert WebKit::WebsiteMetaViewportPolicy into WebCore::MetaViewportPolicy.
608
609         * Shared/WebsitePoliciesData.h:
610         * UIProcess/API/APIWebsitePolicies.cpp:
611         (API::WebsitePolicies::data):
612         * UIProcess/API/APIWebsitePolicies.h:
613
614         Add additional plumbing for the policy flag.
615
616         * WebKit.xcodeproj/project.pbxproj:
617         * WebProcess/WebPage/ios/WebPageIOS.mm:
618         (WebKit::WebPage::resetViewportDefaultConfiguration):
619
620         Use native web page parameters if either "shouldIgnoreMetaViewport" is enabled, or the new policy is set.
621         Eventually, the policy should completely replace the former preference once no internal clients depend on it.
622
623 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
624
625         Add plumbing for a compatibility mode preference in WebKit
626         https://bugs.webkit.org/show_bug.cgi?id=196005
627
628         Reviewed by Tim Horton.
629
630         Add plumbing between the Cocoa API object (WKWebpagePreferences) and the inner C++ API object
631         (API::WebsitePolicies) for compatibility mode.
632
633         * Shared/WebCompatibilityMode.h: Added.
634         * UIProcess/API/APIWebsitePolicies.h:
635         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
636         * UIProcess/Cocoa/NavigationState.mm:
637         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
638         * UIProcess/WebPageProxy.cpp:
639         (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
640         * UIProcess/WebPageProxy.h:
641         * UIProcess/ios/WebPageProxyIOS.mm:
642         * WebKit.xcodeproj/project.pbxproj:
643
644 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
645
646         [CoordinatedGraphics] Hidden pages are not suspended after a web view resize
647         https://bugs.webkit.org/show_bug.cgi?id=196487
648
649         Reviewed by Žan Doberšek.
650
651         When resizing the window, the hidden tabs are updated too, to avoid flickering or getting the old size when
652         switching tabs. For that we need to resume painting but we are not suspending it again after the update.
653
654         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
655         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState): Suspend the painting again after a
656         synchronous update if needed.
657
658 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
659
660         Web Inspector: [GTK] Copy copies to nowhere
661         https://bugs.webkit.org/show_bug.cgi?id=181228
662
663         Reviewed by Michael Catanzaro.
664
665         The thing is that those items are actually submenu items, with options, for example in the case of Copy to copy
666         HTML, Text, XPath, etc. We are not correctly handling submenus when populating the context menu received from
667         the web process.
668
669         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
670         (WebKit::WebContextMenuProxyGtk::populateSubMenu): Helper to populate submenu items recursively.
671         (WebKit::WebContextMenuProxyGtk::populate): Handle submenu items.
672         * UIProcess/gtk/WebContextMenuProxyGtk.h:
673
674 2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
675
676         [Cocoa] Add new API around WKWebpagePreferences in WKNavigationDelegate and WKWebViewConfiguration
677         https://bugs.webkit.org/show_bug.cgi?id=196284
678         <rdar://problem/47228232>
679
680         Reviewed by Tim Horton.
681
682         Tests for both of these APIs will be added in a subsequent patch.
683
684         * Shared/API/Cocoa/WebKit.h:
685         * UIProcess/API/APIPageConfiguration.cpp:
686         (API::PageConfiguration::defaultWebsitePolicies const):
687         (API::PageConfiguration::setDefaultWebsitePolicies):
688         * UIProcess/API/APIPageConfiguration.h:
689         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
690
691         Add a new navigation delegate hook to allow clients to return a WKWebpagePreference targeting the given
692         navigation action.
693
694         * UIProcess/API/Cocoa/WKWebView.mm:
695         (-[WKWebView _initializeWithConfiguration:]):
696         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
697         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
698
699         Add new API on WKWebViewConfiguration to specify a default WKWebpagePreference to use when navigating.
700
701         (-[WKWebViewConfiguration copyWithZone:]):
702         (-[WKWebViewConfiguration defaultWebpagePreferences]):
703         (-[WKWebViewConfiguration setDefaultWebpagePreferences:]):
704         * UIProcess/API/Cocoa/WKWebpagePreferences.h:
705         * UIProcess/Cocoa/NavigationState.h:
706         * UIProcess/Cocoa/NavigationState.mm:
707         (WebKit::NavigationState::setNavigationDelegate):
708         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
709
710         Invoke the new WKWebpagePreferences-based navigation delegate method.
711
712         * WebKit.xcodeproj/project.pbxproj:
713         * mac/postprocess-framework-headers.sh:
714         * mac/replace-webkit-additions-in-framework-headers.sh: Added.
715
716         Move logic in the "Postprocess Framework Headers" step responsible for stripping away included files from
717         WebKitAdditions out into a separate build phase, called "Replace WebKitAdditions in Framework Headers". This
718         ensures headers attempting to include from WebKitAdditions have these additional statements removed.
719
720 2019-04-02  Geoffrey Garen  <ggaren@apple.com>
721
722         Eliminate plugin sandbox exceptions
723         https://bugs.webkit.org/show_bug.cgi?id=196510
724
725         Reviewed by Chris Dumez.
726
727         * PluginProcess/mac/PluginProcessMac.mm:
728         (WebKit::PluginProcess::initializeSandbox):
729         * UIProcess/Plugins/PluginInfoStore.cpp:
730         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
731         * UIProcess/Plugins/PluginInfoStore.h:
732         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
733         (WebKit::PluginInfoStore::shouldUsePlugin):
734         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
735
736 2019-04-02  Alex Christensen  <achristensen@webkit.org>
737
738         Fix assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
739         https://bugs.webkit.org/show_bug.cgi?id=196503
740
741         Reviewed by Chris Dumez.
742
743         In WebPageProxy::didDestroyNavigation we try to ignore a request to destroy a navigation from a page being navigated from
744         during a cross-site navigation, but if the old web process sends the message after WebPageProxy::commitProvisionalPage
745         has been called, we can still destroy a navigation when we are continuing a navigation in another process.  To prevent this,
746         have the process not send the message when it knows the navigation is continuing in another process.
747         Also make the use of unchecked navigation pointers more robust by checking it for nullity.
748
749         * UIProcess/WebPageProxy.cpp:
750         (WebKit::WebPageProxy::didCommitLoadForFrame):
751         * WebProcess/WebPage/WebFrame.cpp:
752         (WebKit::WebFrame::didReceivePolicyDecision):
753         (WebKit::WebFrame::documentLoaderDetached):
754         * WebProcess/WebPage/WebFrame.h:
755
756 2019-04-02  Per Arne Vollan  <pvollan@apple.com>
757
758         [iOS] Fix iokit-get-properties sandbox violation in the WebContent process
759         https://bugs.webkit.org/show_bug.cgi?id=196500
760         <rdar://problem/49497788>
761
762         Reviewed by Brent Fulgham.
763
764         Attempting to get the iokit properties 'product-description', 'artwork-display-gamut' and
765         'artwork-scale-factor' is causing sandbox violations.
766
767         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
768
769 2019-04-02  Chris Dumez  <cdumez@apple.com>
770
771         [WK2] Add support for Window's beforeprint / afterprint events
772         https://bugs.webkit.org/show_bug.cgi?id=196478
773
774         Reviewed by Alex Christensen.
775
776         Add support for Window's beforeprint / afterprint events as per:
777         - https://html.spec.whatwg.org/#dom-print
778
779         Blink and Gecko already support this.
780
781         * WebProcess/WebPage/WebPage.cpp:
782         (WebKit::WebPage::beginPrinting):
783         (WebKit::WebPage::endPrinting):
784
785 2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
786
787         REGRESSION (r243726): Crash at unrecognized selector: -[WKWebpagePreferences webpagePreferences]
788         https://bugs.webkit.org/show_bug.cgi?id=196496
789         <rdar://problem/49521634>
790
791         Reviewed by Chris Dumez.
792
793         r243726 made an incorrect assumption that all callers of -decidePolicyForNavigationAction:decisionHandler: and
794         -decidePolicyForNavigationAction:userInfo:decisionHandler: must be instances of _WKWebsitePolicies, as opposed
795         to the new WKWebpagePreferences. However, it's possible for clients (in this case, Safari) to already generate
796         and pass in an instance of WKWebpagePreferences by bridging the C API opaque ref (WKWebsitePoliciesRef) into the
797         Objective-C object (which is now WKWebpagePreferences, after my change).
798
799         To maintain binary compatibility of trunk WebKit against prior versions of Safari, we need to handle both
800         WKWebpagePreferences and the soon-to-be-deprecated _WKWebsitePolicies in the navigation action policy decision
801         handler.
802
803         Tests:  WebKit.WebsitePoliciesWithBridgingCast
804                 WebKit.WebsitePoliciesWithUnexpectedType
805
806         * UIProcess/Cocoa/NavigationState.mm:
807         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
808
809 2019-04-01  Chris Dumez  <cdumez@apple.com>
810
811         Unreviewed, drop debug logging landed as part of r242903 by mistake.
812
813         * UIProcess/WebPageProxy.cpp:
814         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
815
816 2019-04-01  Remy Demarest  <rdemarest@apple.com>
817
818         Add SPI to give injected bundles access to displayed PDFDocuments
819         https://bugs.webkit.org/show_bug.cgi?id=196471
820         <rdar://problem/48080768>
821
822         Reviewed by Tim Horton.
823
824         * WebKit.xcodeproj/project.pbxproj:
825
826         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.h: Added.
827         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm: Added.
828         (WKBundlePageGetPDFDocumentInFrame):
829
830 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
831
832         [WebKit2] Introduce a public version of WKWebsitePolicies
833         https://bugs.webkit.org/show_bug.cgi?id=195989
834         <rdar://problem/47228232>
835
836         Reviewed by Tim Horton.
837
838         Expose the existing _WKWebsitePolicies object as WKWebpagePreferences, in what will eventually become a public
839         header in the WebKit SDK (WKWebpagePreferences.h). Following a similar transitioning strategy as
840         _WKWebsiteDataStore and WKWebsiteDataStore, we move existing logic from _WKWebsitePolicies to WKWebpagePreferences
841         and make _WKWebsitePolicies a wrapper around WKWebpagePreferences.
842
843         No change in behavior.
844
845         * Shared/Cocoa/APIObject.mm:
846         (API::Object::newObject):
847
848         Wrap API::WebsitePolicies with WKWebpagePreferences.
849
850         * SourcesCocoa.txt:
851         * UIProcess/API/Cocoa/WKWebView.mm:
852         (-[WKWebView _updateWebsitePolicies:]):
853         * UIProcess/API/Cocoa/WKWebpagePreferences.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
854         * UIProcess/API/Cocoa/WKWebpagePreferences.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm.
855
856         Introduce WKWebpagePreferences.
857
858         (+[WKWebpagePreferences defaultPreferences]):
859         (-[WKWebpagePreferences dealloc]):
860         (-[WKWebpagePreferences init]):
861         (-[WKWebpagePreferences _setContentBlockersEnabled:]):
862         (-[WKWebpagePreferences _contentBlockersEnabled]):
863         (-[WKWebpagePreferences _setAllowedAutoplayQuirks:]):
864         (-[WKWebpagePreferences _allowedAutoplayQuirks]):
865         (-[WKWebpagePreferences _setAutoplayPolicy:]):
866         (-[WKWebpagePreferences _autoplayPolicy]):
867         (-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
868         (-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
869         (-[WKWebpagePreferences _setPopUpPolicy:]):
870         (-[WKWebpagePreferences _popUpPolicy]):
871         (-[WKWebpagePreferences _customHeaderFields]):
872         (-[WKWebpagePreferences _setCustomHeaderFields:]):
873         (-[WKWebpagePreferences _websiteDataStore]):
874         (-[WKWebpagePreferences _setWebsiteDataStore:]):
875         (-[WKWebpagePreferences _setCustomUserAgent:]):
876         (-[WKWebpagePreferences _customUserAgent]):
877         (-[WKWebpagePreferences _setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
878         (-[WKWebpagePreferences _customJavaScriptUserAgentAsSiteSpecificQuirks]):
879         (-[WKWebpagePreferences _setCustomNavigatorPlatform:]):
880         (-[WKWebpagePreferences _customNavigatorPlatform]):
881         (-[WKWebpagePreferences _apiObject]):
882         * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
883         * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h.
884
885         Reintroduce all the interfaces currently available on _WKWebsitePolicies as underscore-prefixed SPI on
886         WKWebpagePreferences.
887
888         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
889         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
890
891         Make _WKWebsitePolicies wrap WKWebpagePreferences, and plumb all existing SPI on WKWebsitePolicies through to
892         WKWebpagePreferences.
893
894         (-[_WKWebsitePolicies init]):
895         (-[_WKWebsitePolicies webpagePreferences]):
896         (-[_WKWebsitePolicies setContentBlockersEnabled:]):
897         (-[_WKWebsitePolicies contentBlockersEnabled]):
898         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
899         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
900         (-[_WKWebsitePolicies setAutoplayPolicy:]):
901         (-[_WKWebsitePolicies autoplayPolicy]):
902         (-[_WKWebsitePolicies setDeviceOrientationAndMotionAccessPolicy:]):
903         (-[_WKWebsitePolicies deviceOrientationAndMotionAccessPolicy]):
904         (-[_WKWebsitePolicies setPopUpPolicy:]):
905         (-[_WKWebsitePolicies popUpPolicy]):
906         (-[_WKWebsitePolicies customHeaderFields]):
907         (-[_WKWebsitePolicies setCustomHeaderFields:]):
908         (-[_WKWebsitePolicies websiteDataStore]):
909         (-[_WKWebsitePolicies setWebsiteDataStore:]):
910         (-[_WKWebsitePolicies setCustomUserAgent:]):
911         (-[_WKWebsitePolicies customUserAgent]):
912         (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
913         (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]):
914         (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
915         (-[_WKWebsitePolicies customNavigatorPlatform]):
916         (-[_WKWebsitePolicies description]):
917         (-[_WKWebsitePolicies _apiObject]):
918         (-[_WKWebsitePolicies dealloc]): Deleted.
919         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
920         * UIProcess/Cocoa/NavigationState.mm:
921         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
922         * WebKit.xcodeproj/project.pbxproj:
923
924 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
925
926         Unable to copy and paste a PDF from Notes into Mail compose body
927         https://bugs.webkit.org/show_bug.cgi?id=196442
928         <rdar://problem/48573098>
929
930         Reviewed by Tim Horton.
931
932         Relax the -canPerformAction: logic in the case of pasting an attachment. Consider an NSItemProvider to possibly
933         paste as an attachment if either it has a preferred presentation style of UIPreferredPresentationStyleAttachment
934         or has a style of UIPreferredPresentationStyleUnspecified, but has a suggested file name.
935
936         This allows for the "Paste" action to be shown in the callout menu when copying and pasting a non-text file.
937
938         * UIProcess/ios/WKContentViewInteraction.mm:
939         (-[WKContentView canPerformActionForWebView:withSender:]):
940
941 2019-04-01  Tim Horton  <timothy_horton@apple.com>
942
943         Make UIWKDocumentContext rects per-character instead of per-word
944         https://bugs.webkit.org/show_bug.cgi?id=196459
945
946         Reviewed by Wenson Hsieh.
947
948         * WebProcess/WebPage/ios/WebPageIOS.mm:
949         (WebKit::WebPage::requestDocumentEditingContext):
950         Switch to CharacterIterator instead of TextIterator directly, to get
951         per-character rects as the API requests.
952
953 2019-04-01  Chris Dumez  <cdumez@apple.com>
954
955         UIProcess crash when a prewarmed process is terminated
956         https://bugs.webkit.org/show_bug.cgi?id=196451
957         <rdar://problem/49245471>
958
959         Reviewed by Geoffrey Garen.
960
961         Stop assuming that WebProcessProxy::m_websiteDataStore is non-null as this is no longer
962         true after r243384. For example, prewarmed WebContent processe do not get a data store
963         until they actually get used.
964
965         * UIProcess/API/Cocoa/WKProcessPool.mm:
966         (-[WKProcessPool _prewarmedProcessIdentifier]):
967         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
968         * UIProcess/WebProcessPool.cpp:
969         (WebKit::WebProcessPool::networkProcessIdentifier):
970         (WebKit::WebProcessPool::prewarmedProcessIdentifier):
971         * UIProcess/WebProcessPool.h:
972         * UIProcess/WebProcessProxy.cpp:
973         (WebKit::WebProcessProxy::didClose):
974         (WebKit::WebProcessProxy::didFinishLaunching):
975         (WebKit::WebProcessProxy::requestTermination):
976         (WebKit::WebProcessProxy::isReleaseLoggingAllowed const):
977         * UIProcess/WebProcessProxy.h:
978
979 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
980
981         [GTK][WPE] Add more websitedatastore directories to web process sandbox
982         https://bugs.webkit.org/show_bug.cgi?id=196447
983
984         Reviewed by Michael Catanzaro.
985
986         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
987         (WebKit::bubblewrapSpawn):
988         * UIProcess/glib/WebProcessProxyGLib.cpp:
989         (WebKit::WebProcessProxy::platformGetLaunchOptions):
990
991 2019-04-01  Per Arne Vollan  <pvollan@apple.com>
992
993         [macOS] Crash when loading Twitter with autoplay video enabled.
994         https://bugs.webkit.org/show_bug.cgi?id=196446
995         <rdar://problem/49060359>
996
997         Reviewed by Brent Fulgham.
998
999         This is caused by a syscall violation.
1000
1001         * WebProcess/com.apple.WebProcess.sb.in:
1002
1003 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
1004
1005         [GTK][WPE] Fix seccomp rule for blacklisting TIOCSTI
1006         https://bugs.webkit.org/show_bug.cgi?id=196297
1007
1008         Reviewed by Michael Catanzaro.
1009
1010         More information can be found here: https://www.exploit-db.com/exploits/46594
1011
1012         Note that this sandbox never made it into production so does not
1013         warrant any CVE specific to WebKit.
1014
1015         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1016         (WebKit::setupSeccomp):
1017
1018 2019-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1019
1020         [iOS] Crash when changing inputmode for certain types of focusable elements
1021         https://bugs.webkit.org/show_bug.cgi?id=196431
1022         <rdar://problem/49454962>
1023
1024         Reviewed by Tim Horton.
1025
1026         The crash is happening because WebPage::focusedElementDidChangeInputMode assumes that the document's focused
1027         element must be the same as m_focusedElement in WebPage. However, this is not the case, since m_focusedElement
1028         is only set for certain types of elements that require user input (e.g. text fields, editable content, select
1029         menus, etc.). The function then attempts to dereference m_focusedElement, which may be null if the document's
1030         focused element doesn't fall into one of the aforementioned categories.
1031
1032         To fix this, bail if the element that is changing inputmode is not equal to the WebPage's current focused
1033         element. See below for more details.
1034
1035         Test: fast/forms/change-inputmode-crash.html
1036
1037         * WebProcess/WebPage/WebPage.cpp:
1038         (WebKit::isTextFormControlOrEditableContent):
1039
1040         Clean up some existing logic by introducing a helper method for determining whether an element should
1041         propagate inputmode attribute changes to the UI process. Also, check the element type using type traits instead
1042         of checking against the tag name.
1043
1044         (WebKit::WebPage::elementDidFocus):
1045         (WebKit::WebPage::focusedElementDidChangeInputMode):
1046
1047 2019-03-31  Sam Weinig  <weinig@apple.com>
1048
1049         Remove more i386 specific configurations
1050         https://bugs.webkit.org/show_bug.cgi?id=196430
1051
1052         Reviewed by Alexey Proskuryakov.
1053
1054         * Configurations/BaseTarget.xcconfig:
1055         WK_HAVE_CORE_PREDICTION can now be enabled unconditionally.
1056  
1057         * Configurations/FeatureDefines.xcconfig:
1058         ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
1059
1060 2019-03-31  Andy Estes  <aestes@apple.com>
1061
1062         [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
1063         https://bugs.webkit.org/show_bug.cgi?id=196433
1064         <rdar://problem/49293305>
1065
1066         Reviewed by Tim Horton.
1067
1068         Added WKWebViewConfiguration SPI for setting the QuickLook navigation response policy
1069         decision behavior. The configuration setting defaults to YES for clients linked on or after
1070         this WebKit change and NO otherwise.
1071
1072         * NetworkProcess/NetworkResourceLoader.cpp:
1073         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
1074         * Shared/WebPreferences.yaml:
1075         * Shared/ios/QuickLookDocumentData.cpp:
1076         (WebKit::QuickLookDocumentData::isEmpty const):
1077         * Shared/ios/QuickLookDocumentData.h:
1078         * UIProcess/API/Cocoa/WKWebView.mm:
1079         (-[WKWebView _initializeWithConfiguration:]):
1080         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1081         (defaultShouldDecidePolicyBeforeLoadingQuickLookPreview):
1082         (-[WKWebViewConfiguration init]):
1083         (-[WKWebViewConfiguration encodeWithCoder:]):
1084         (-[WKWebViewConfiguration initWithCoder:]):
1085         (-[WKWebViewConfiguration copyWithZone:]):
1086         (-[WKWebViewConfiguration _shouldDecidePolicyBeforeLoadingQuickLookPreview]):
1087         (-[WKWebViewConfiguration _setShouldDecidePolicyBeforeLoadingQuickLookPreview:]):
1088         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1089         * UIProcess/Cocoa/VersionChecks.h:
1090         * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
1091         (WebKit::WebPreviewLoaderClient::didReceiveDataArray):
1092
1093 2019-03-30  Zalan Bujtas  <zalan@apple.com>
1094
1095         [ContentChangeObserver] Subframe load should not reset content observation on the mainframe
1096         https://bugs.webkit.org/show_bug.cgi?id=196408
1097         <rdar://problem/49436797>
1098
1099         Reviewed by Simon Fraser.
1100
1101         Hover intent fails when an unrelated frame commits a load the same time.
1102         cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
1103         (If the current frame navigates away, willDetachPage takes care of canceling the observation.)
1104
1105         * WebProcess/WebPage/ios/WebPageIOS.mm:
1106         (WebKit::WebPage::cancelPotentialTap):
1107         (WebKit::WebPage::cancelPotentialTapInFrame):
1108
1109 2019-03-29  John Wilander  <wilander@apple.com>
1110
1111         Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
1112         https://bugs.webkit.org/show_bug.cgi?id=196407
1113         <rdar://problem/47859936>
1114
1115         Reviewed by Brent Fulgham.
1116
1117         The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
1118         moved Resource Load Statistics from the UI process to the network process. One
1119         of the endpoints is the message RequestStorageAccessUnderOpener which underpins
1120         our compatibility fix for federated logins using popups. This patch redirects
1121         these IPC calls to the network process and cleans up some assumptions around
1122         them.
1123
1124         * CMakeLists.txt:
1125             Removed the old IPC receiver.
1126         * DerivedSources.make:
1127             Removed the old IPC receiver.
1128         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1129         (WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.
1130             This is no longer needed since there is a dedicated update mechanism
1131             that actually sends the update.
1132         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1133         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1134         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
1135         (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
1136             Two new IPC receivers to pipe the calls to the network process.
1137         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.
1138             NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
1139             this purpose.
1140         * NetworkProcess/NetworkConnectionToWebProcess.h:
1141         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1142         * UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.
1143             Removed the old IPC receiver.
1144         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1145         * WebKit.xcodeproj/project.pbxproj:
1146         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1147         (WKBundleResourceLoadStatisticsNotifyObserver):
1148             Function name update.
1149         * WebProcess/WebProcess.cpp:
1150             Now calls IPC to the network process instead of the UI process.
1151
1152 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
1153
1154         Delete WebMetal implementation in favor of WebGPU
1155         https://bugs.webkit.org/show_bug.cgi?id=195418
1156
1157         Reviewed by Dean Jackson.
1158
1159         * Configurations/FeatureDefines.xcconfig:
1160         * Shared/WebPreferences.yaml:
1161         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1162         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1163
1164 2019-03-29  Takashi Komori  <Takashi.Komori@sony.com>
1165
1166         [Curl] Add Server Trust Evaluation Support.
1167         https://bugs.webkit.org/show_bug.cgi?id=191646
1168
1169         Reviewed by Fujii Hironori.
1170
1171         Tests: http/tests/ssl/iframe-upgrade.https.html
1172                http/tests/ssl/mixedContent/insecure-websocket.html
1173                http/tests/ssl/upgrade-origin-usage.html
1174
1175         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1176         (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
1177         (WebKit::NetworkDataTaskCurl::tryServerTrustEvaluation):
1178         (WebKit::NetworkDataTaskCurl::restartWithCredential):
1179         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1180
1181 2019-03-29  Cathie Chen  <cathiechen@igalia.com>
1182
1183         Implement ResizeObserver.
1184         https://bugs.webkit.org/show_bug.cgi?id=157743
1185
1186         Reviewed by Simon Fraser.
1187
1188         Add WebPreferences and FeatureDefines for ResizeObserver.
1189
1190         * Configurations/FeatureDefines.xcconfig:
1191         * Shared/WebPreferences.yaml:
1192
1193 2019-03-28  Timothy Hatcher  <timothy@apple.com>
1194
1195         CFDictionary encoder crashes on non-string keys.
1196         https://bugs.webkit.org/show_bug.cgi?id=196388
1197         rdar://problem/49339242
1198
1199         Reviewed by Ryosuke Niwa.
1200
1201         Allow non-string keys in CFDictionary encoding/decoding. Encode the correct
1202         size for dictionaries and arrays when unknown keys or values are skipped.
1203         Allow null array encoding and decoding like dictionary already allowed.
1204
1205         * Shared/cf/ArgumentCodersCF.cpp:
1206         (IPC::encode):
1207         (IPC::decode):
1208
1209 2019-03-28  John Wilander  <wilander@apple.com>
1210
1211         Resource Load Statistics: IPC to the WebsiteDataStore in the UI process from NetworkProcess::deleteWebsiteDataForRegistrableDomains()
1212         https://bugs.webkit.org/show_bug.cgi?id=196281
1213         <rdar://problem/48938748>
1214
1215         Reviewed by Alex Christensen.
1216
1217         The move of Resource Load Statistics to the network process requires that it
1218         calls the UI process when clearing website data (previously the other way
1219         around). This patch achieves that.
1220
1221         Specifically, NetworkProcess::deleteWebsiteDataForRegistrableDomains() now
1222         filters its WebsiteDataTypes down to just the ones applicable for the UI
1223         process and then calls DeleteWebsiteDataInUIProcessForRegistrableDomains over
1224         IPC.
1225
1226         NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains() on
1227         the UI process side makes use of the re-introduced
1228         WebsiteDataStore::fetchDataForRegistrableDomains() function to get the relevant
1229         data records and call WebsiteDataStore::removeData(). The re-introduced
1230         WebsiteDataStore::fetchDataForRegistrableDomains() was removed as dead code in
1231         https://trac.webkit.org/changeset/242056/webkit, then under the name
1232         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). The reason it
1233         was dead code was the lack of IPC call that this patch adds.
1234
1235         * NetworkProcess/NetworkProcess.cpp:
1236         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
1237            Now calls DeleteWebsiteDataInUIProcessForRegistrableDomains over IPC if there
1238            are WebsiteDataTypes applicable to the UI process.
1239         * NetworkProcess/NetworkProcess.h:
1240         * Shared/WebsiteData/WebsiteData.cpp:
1241         (WebKit::WebsiteData::ownerProcess):
1242         (WebKit::WebsiteData::filter):
1243             Convenience functions to manage process ownership of website data types.
1244         * Shared/WebsiteData/WebsiteData.h:
1245         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1246         (WKWebsiteDataStoreStatisticsHasLocalStorage):
1247             Test infrastructure, called by the TestRunner.
1248         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1249         * UIProcess/Network/NetworkProcessProxy.cpp:
1250         (WebKit::NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains):
1251             New function to be called from the network process.
1252         * UIProcess/Network/NetworkProcessProxy.h:
1253         * UIProcess/Network/NetworkProcessProxy.messages.in:
1254         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1255         (WebKit::WebsiteDataRecord::matches const):
1256             Now matches with WebCore::RegistrableDomain instead of a string.
1257         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain const): Deleted.
1258             Replaced by WebsiteDataRecord::matches().
1259         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1260         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1261         (WebKit::WebsiteDataStore::fetchDataForRegistrableDomains):
1262             Re-introduced. It was removed as dead code in r242056.
1263         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
1264         (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
1265             Test infrastructure, called by the TestRunner.
1266         * UIProcess/WebsiteData/WebsiteDataStore.h:
1267
1268 2019-03-28  Jiewen Tan  <jiewen_tan@apple.com>
1269
1270         API::Data::createWithoutCopying should do a null check before calling CFRelease
1271         https://bugs.webkit.org/show_bug.cgi?id=196276
1272         <rdar://problem/48059859>
1273
1274         Reviewed by Alex Christensen.
1275
1276         * Shared/Cocoa/APIDataCocoa.mm:
1277         (API::Data::createWithoutCopying):
1278
1279 2019-03-28  Per Arne Vollan  <pvollan@apple.com>
1280
1281         [iOS] Automatic focus of input field is flaky
1282         https://bugs.webkit.org/show_bug.cgi?id=196302
1283
1284         Reviewed by Brent Fulgham.
1285
1286         Sometimes the status of whether a keyboard is connected can be incorrect, both in the UI process, and in
1287         the WebContent process. Fix this by sending the keyboard status to the WebContent process as part of the
1288         Web page creation parameters. Stop caching the keyboard status in the Web process proxy, and call
1289         [UIKeyboard isInHardwareKeyboardMode] instead, since this method is swizzled in the test harness.
1290
1291         * Shared/WebPageCreationParameters.cpp:
1292         (WebKit::WebPageCreationParameters::encode const):
1293         (WebKit::WebPageCreationParameters::decode):
1294         * Shared/WebPageCreationParameters.h:
1295         * UIProcess/API/Cocoa/WKWebView.mm:
1296         (hardwareKeyboardAvailabilityChangedCallback):
1297         * UIProcess/WebPageProxy.cpp:
1298         (WebKit::WebPageProxy::creationParameters):
1299         * UIProcess/WebPageProxy.h:
1300         * UIProcess/WebProcessProxy.cpp:
1301         * UIProcess/WebProcessProxy.h:
1302         (WebKit::WebProcessProxy::setKeyboardIsAttached): Deleted.
1303         (WebKit::WebProcessProxy::keyboardIsAttached const): Deleted.
1304         * UIProcess/ios/WKContentViewInteraction.mm:
1305         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1306         * UIProcess/ios/WebPageProxyIOS.mm:
1307         (WebKit::WebPageProxy::isInHardwareKeyboardMode):
1308         (WebKit::WebPageProxy::applicationWillEnterForeground):
1309         * WebProcess/WebPage/WebPage.cpp:
1310         * WebProcess/WebPage/WebPage.h:
1311
1312 2019-03-28  Tim Horton  <timothy_horton@apple.com>
1313
1314         Fix the build.
1315
1316         * UIProcess/ios/WKActionSheetAssistant.mm:
1317         (-[WKActionSheetAssistant showImageSheet]):
1318         * UIProcess/ios/WKContentViewInteraction.mm:
1319         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
1320
1321 2019-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1322
1323         [WPE][GTK] webkit_web_resource_get_data_finish can return NULL without setting error
1324         https://bugs.webkit.org/show_bug.cgi?id=186276
1325
1326         Reviewed by Carlos Garcia Campos.
1327
1328         Currently it's possible for webkit_web_resource_get_data_finish() to return NULL without
1329         setting the error parameter. This is illegal because it is an API guarantee (and a GObject
1330         convention) that if an error parameter exists, it should be set whenever a function call
1331         returns NULL. Epiphany correctly dereferences the error in this case without checking if it
1332         is NULL, because it knows it does not have to, and crashes. Fix this. We'll return a byte
1333         array of length 1 containing a NUL character. This isn't great, but there's not really any
1334         better solution without deprecating the API or returning an error code to indicate an empty
1335         resource, and it at least fixes the Epiphany crash.
1336
1337         This does not fix bug #186276, in which this function incorrectly returns no data when it
1338         ought to. But that is a different bug. Now, at least we won't crash when no data is
1339         available.
1340
1341         * UIProcess/API/glib/WebKitWebResource.cpp:
1342         (resourceDataCallback):
1343
1344 2019-03-28  Daniel Bates  <dabates@apple.com>
1345
1346         [iPad] Tapping on a popup form control may not show a popover
1347         https://bugs.webkit.org/show_bug.cgi?id=196322
1348         <rdar://problem/49229632>
1349
1350         Reviewed by Wenson Hsieh.
1351
1352         Stop taking advantage of -[WKContentView inputView] being called when we invoke -reloadInputViews
1353         to "lazily" allocate the input peripheral for the currently focused element. In theory, UIKit only
1354         needs to call -inputView when it actually needs to display the input view (the keyboard). For
1355         popup menu buttons, like <select>, no keyboard is needed. Instead we should create the peripheral
1356         as part of the logic in the UI process to focus a new element before we call -reloadInputViews.
1357
1358         * UIProcess/ios/WKContentViewInteraction.mm:
1359         (-[WKContentView inputView]): Extract logic to allocate the peripheral from here and moved it to createInputPeripheralWithView().
1360         (-[WKContentView accessoryTab:]): While I am here, add a FIXME comment to explain why we need to
1361         end the input sessions and nullify the input peripheral before we tell the web process to switch
1362         focus as opposed to letting this happen after the web process tells us it focused a new element.
1363         (createInputPeripheralWithView): Added.
1364         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1365         Write in terms of createInputPeripheralWithView(). Create the input peripheral after becoming
1366         first responder because creating the peripheral has known side-effects: for popup buttons it
1367         tells the popup controller to present the popover. For key input to popovers to work from the get-go,
1368         the content view must be the first responder. See <https://bugs.webkit.org/show_bug.cgi?id=196272>
1369         for more details.
1370
1371 2019-03-28  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1372
1373         Silence lot of warnings when compiling with clang
1374         https://bugs.webkit.org/show_bug.cgi?id=196310
1375
1376         Reviewed by Michael Catanzaro.
1377
1378         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: add missing
1379         override clause.
1380         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: add
1381         missing override clause.
1382
1383 2019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
1384
1385         [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
1386         https://bugs.webkit.org/show_bug.cgi?id=196336
1387
1388         Reviewed by Tim Horton.
1389
1390         The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
1391         This resulted in RenderMenuList::m_popupIsVisible to be never reset.
1392
1393         Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
1394         the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
1395         Send cancelTracking to NSMenu instead, which DOES dismiss the popup.
1396
1397         Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
1398                fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html
1399
1400         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1401         (WebKit::WebPopupMenuProxyMac::hidePopupMenu):
1402         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1403         (WebKit::WebPopupMenu::hide):
1404
1405 2019-03-27  Dean Jackson  <dino@apple.com>
1406
1407         [ARKit] Black view when opening a 3D model usdz file in new tab
1408         https://bugs.webkit.org/show_bug.cgi?id=196333
1409         <rdar://problem/47693367>
1410
1411         Reviewed by Tim Horton.
1412
1413         When opening a new WKSystemPreviewView, we were exiting if there was no
1414         presentingViewController. This code was unnecessary, and causing blank
1415         content when opening a new tab.
1416
1417         * UIProcess/ios/WKSystemPreviewView.mm:
1418         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1419         Remove the code looking for a presentingViewController.
1420
1421 2019-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1422
1423         Need a way to include WebKitAdditions code in WebKit API headers
1424         https://bugs.webkit.org/show_bug.cgi?id=196173
1425
1426         Reviewed by Tim Horton.
1427
1428         Introduce a mechanism that allows us to insert code from WebKitAdditions into public or private SDK headers
1429         using `#import`s of the form:
1430
1431         ```
1432         #if USE(APPLE_INTERNAL_SDK)
1433         #import <WebKitAdditions/WKWebViewConfigurationAdditions.h>
1434         #endif
1435         ```
1436
1437         The resulting header in the built products directory will contain the contents of the imported file inserted in
1438         place of the `#if USE(APPLE_INTERNAL_SDK) … #endif` block; however, when building with the Apple internal SDK,
1439         the additions header content will be imported by the usual means.
1440
1441         * mac/postprocess-framework-headers.sh:
1442         * mac/replace-webkit-additions-includes.py: Added.
1443
1444         Add a step when post-processing framework headers to replace instances of `#if USE(APPLE_INTERNAL_SDK) … #endif`
1445         with the text content of the additions files. The replacement script first searches in the built products
1446         directory for the matching additions file, and falls back to the SDK if no matching file is found. If neither
1447         are present (e.g. a build using the public SDK), then the block is simply replaced by the empty string.
1448
1449         (read_content_from_webkit_additions):
1450         (main):
1451
1452 2019-03-27  Andy Estes  <aestes@apple.com>
1453
1454         REGRESSION (r242686): package-root creates roots with broken symlinks in WebKit.framework/XPCServices/
1455         https://bugs.webkit.org/show_bug.cgi?id=196317
1456
1457         Reviewed by Dan Bernstein.
1458
1459         Removed some remnants of the Storage Process.
1460
1461         * Configurations/BaseTarget.xcconfig:
1462         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Removed.
1463         * WebKit.xcodeproj/project.pbxproj:
1464
1465 2019-03-27  Keith Rollin  <krollin@apple.com>
1466
1467         Include the CFNetworking task UUID to the NSError when a resource-load fails
1468         https://bugs.webkit.org/show_bug.cgi?id=196156
1469
1470         Reviewed by Alex Christensen.
1471
1472         In order to help track the connection between a failed resource-load
1473         and a user-visible error message, include the CFNetworking task UUID
1474         in the associated error as an element of the userInfo property. This
1475         can then be pulled out and reported in the logging at the point the
1476         error is reported to the user.
1477
1478         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1479         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1480
1481 2019-03-27  Chris Dumez  <cdumez@apple.com>
1482
1483         [ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout
1484         https://bugs.webkit.org/show_bug.cgi?id=195425
1485         <rdar://problem/48682403>
1486
1487         Reviewed by Alex Christensen.
1488
1489         When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
1490         process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
1491         in which it was previously loaded. However, we were failing to check if the WebProcess in question was
1492         still running so we could potentially try to use a process that's already exited.
1493
1494         * UIProcess/WebProcessPool.cpp:
1495         (WebKit::WebProcessPool::processForNavigationInternal):
1496
1497 2019-03-27  Zalan Bujtas  <zalan@apple.com>
1498
1499         [ContentChangeObserver] Always dispatch the synthetic click asynchronously
1500         https://bugs.webkit.org/show_bug.cgi?id=196278
1501         <rdar://problem/49299968>
1502
1503         Reviewed by Simon Fraser.
1504
1505         This patch ensures that all completeSyntheticClick() calls happen in an asynchronous manner (unless the feature is turned off).
1506
1507         * WebProcess/WebPage/ios/WebPageIOS.mm:
1508         (WebKit::dispatchSyntheticMouseMove):
1509         (WebKit::WebPage::handleSyntheticClick):
1510
1511 2019-03-27  Tim Horton  <timothy_horton@apple.com>
1512
1513         Fix some more deprecation warnings in WKDrawingView
1514         https://bugs.webkit.org/show_bug.cgi?id=196282
1515         <rdar://problem/47637608>
1516
1517         Reviewed by Wenson Hsieh.
1518
1519         * Platform/spi/ios/PencilKitSPI.h:
1520         * SourcesCocoa.txt:
1521         * UIProcess/ios/PencilKitSoftLink.h:
1522         * UIProcess/ios/PencilKitSoftLink.mm:
1523         * UIProcess/ios/WKContentViewInteraction.mm:
1524         * UIProcess/ios/WKDrawingCoordinator.h:
1525         * UIProcess/ios/WKDrawingCoordinator.mm:
1526         (-[WKDrawingCoordinator initWithContentView:]):
1527         (-[WKDrawingCoordinator currentInk]):
1528         (-[WKDrawingCoordinator undoManagerForInkPicker:]):
1529         (-[WKDrawingCoordinator containingViewForInkPicker:]):
1530         (-[WKDrawingCoordinator inkPickerDidToggleRuler:]):
1531         (-[WKDrawingCoordinator inkPickerDidChangeInk:]):
1532         (-[WKDrawingCoordinator installInkPickerForDrawing:]):
1533         (-[WKDrawingCoordinator uninstallInkPicker]):
1534         (-[WKDrawingCoordinator inkPicker]): Deleted.
1535         (-[WKDrawingCoordinator didChangeRulerState:]): Deleted.
1536         (-[WKDrawingCoordinator didChangeInk:]): Deleted.
1537         * UIProcess/ios/WKDrawingView.mm:
1538         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
1539         * UIProcess/ios/WKInkPickerView.h: Removed.
1540         * UIProcess/ios/WKInkPickerView.mm: Removed.
1541         * WebKit.xcodeproj/project.pbxproj:
1542         Adopt the new names.
1543
1544 2019-03-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1545
1546         Geolocation request not complete when watch request was started in a different web process
1547         https://bugs.webkit.org/show_bug.cgi?id=195996
1548
1549         Reviewed by Alex Christensen.
1550
1551         In WebGeolocationManagerProxy::startUpdating() we do nothing when the provider is already updating. We should
1552         reply with a DidChangePosition using the last known position, if available. If we are updating, but we still
1553         don't have a known position, the request will be completed when
1554         WebGeolocationManagerProxy::providerDidChangePosition() is called since it always notifies all web
1555         processes.
1556
1557         * UIProcess/WebGeolocationManagerProxy.cpp:
1558         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition): Cache the position.
1559         (WebKit::WebGeolocationManagerProxy::startUpdating): Reply using cached position if already known.
1560         * UIProcess/WebGeolocationManagerProxy.h:
1561         (WebKit::WebGeolocationManagerProxy::lastPosition const): Return cached position.
1562         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
1563         (WebKit::WebGeolocationClient::lastPosition): Remove the FIXME since we don't want this feature.
1564
1565 2019-03-26  Brent Fulgham  <bfulgham@apple.com>
1566
1567         [macOS] Correct kerberos-related sandbox violations
1568         https://bugs.webkit.org/show_bug.cgi?id=196279
1569         <rdar://problem/48622502>
1570
1571         Reviewed by Per Arne Vollan.
1572
1573         We need to allow communications with a Kerberos-related service on macOS
1574         until <rdar://problem/35542803> is fixed.
1575
1576         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1577
1578 2019-03-26  Chris Dumez  <cdumez@apple.com>
1579
1580         [macOS] The network process is not exiting reliably when the WebProcessPool is destroyed
1581         https://bugs.webkit.org/show_bug.cgi?id=196277
1582         <rdar://problem/49127581>
1583
1584         Reviewed by Alex Christensen.
1585
1586         When, an AuxiliaryProcess receives the AuxiliaryProcess::Terminate IPC, it calls stopRunLoop()
1587         to exit. WebProcess overrides AuxiliaryProcess::stopRunLoop() to call exit(0) on the main
1588         thread. Other auxiliary processes such as the NetworkProcess would end up calling
1589         platformStopRunLoop(). On iOS and iOSMac, platformStopRunLoop() calls XPCServiceExit(), which
1590         makes sense since auxiliary processes run their run loop by calling xpc_main(). However, on
1591         macOS, platformStopRunLoop() was calling RunLoop::main().stop() to exit instead, which was
1592         unreliable as demonstrated by the test app attached to the radar.
1593
1594         Updating platformStopRunLoop() to call XPCServiceExit() on macOS fixes the problem and I now
1595         see the NetworkProcess exiting reliably there. This is the approach I have chosen in this
1596         patch since it appears to be reliable and it makes the code consistent on all Cocoa platforms.
1597
1598         * Shared/AuxiliaryProcess.cpp:
1599         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
1600         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1601         * Shared/ios/AuxiliaryProcessIOS.mm:
1602         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
1603         * Shared/mac/AuxiliaryProcessMac.mm:
1604         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
1605
1606 2019-03-26  Keith Rollin  <krollin@apple.com>
1607
1608         Inhibit CFNetwork logging in private sessions
1609         https://bugs.webkit.org/show_bug.cgi?id=196268
1610         <rdar://problem/48210793>
1611
1612         Reviewed by Alex Christensen.
1613
1614         Before performing any logging, the NetworkProcess checks to see if
1615         it's performing an operation associated with a private (ephemeral)
1616         browsing session. If so, it skips the logging. However, networking
1617         layers below the NetworkProcess don't know about private browsing, so
1618         they would still perform their own logging. CFNetwork now has a flag
1619         that lets us control that, so set it to False if private browsing.
1620
1621         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1622         (WebKit::configurationForSessionID):
1623
1624 2019-03-26  Chris Dumez  <cdumez@apple.com>
1625
1626         Add basic layout test coverage for File Picker on iOS
1627         https://bugs.webkit.org/show_bug.cgi?id=196265
1628
1629         Reviewed by Wenson Hsieh.
1630
1631         Add layout test infrastructure to test the file picker on iOS.
1632
1633         * UIProcess/API/Cocoa/WKWebView.mm:
1634         (-[WKWebView _dismissFilePicker]):
1635         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1636         * UIProcess/ios/WKContentViewInteraction.h:
1637         * UIProcess/ios/WKContentViewInteraction.mm:
1638         (-[WKContentView dismissFilePicker]):
1639         (-[WKContentView _contentsOfUserInterfaceItem:]):
1640         * UIProcess/ios/forms/WKFileUploadPanel.h:
1641         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1642         (-[WKFileUploadPanel currentAvailableActionTitles]):
1643
1644 2019-03-26  Daniel Bates  <dabates@apple.com>
1645
1646         [iOS][WK2] Use a better concept to describe the reason we defer zooming a focused element: selectabiltiy
1647         https://bugs.webkit.org/show_bug.cgi?id=196264
1648
1649         Reviewed by Wenson Hsieh.
1650
1651         Rename shouldDeferZoomingToSelectionWhenRevealingFocusedElement() to mayContainSelectableText() to describe
1652         the criterion that we will use to decide whether to defer zooming or not. We defer zooming only for elements
1653         that may support text selection on initial focus because we do not have an up-to-date selection rect at that
1654         time. For element, like <select>, that do not support text selection, we can zoom them immediately when focused.
1655
1656         * UIProcess/ios/WKContentViewInteraction.mm:
1657         (mayContainSelectableText): Renamed from shouldDeferZoomingToSelectionWhenRevealingFocusedElement.
1658         List all the input types in the switch block and remove the default case to force the compiler to check that we
1659         covered all cases. This will prevent unforseen keyboard issues (why isn't the keyboard shown? or why is the keyboard shown?)
1660         for future input types that we may add.
1661         (rectToRevealWhenZoomingToFocusedElement): Update for renaming.
1662         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Add a
1663         comment to explain why we may need to defer the zoom: the focused element supports text selection and we need
1664         to wait for the web process to call back to provide an up-to-date selection rect for us to zoom and reveal.
1665         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Update for renaming.
1666         (shouldDeferZoomingToSelectionWhenRevealingFocusedElement): Deleted.
1667
1668 2019-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1669
1670         Implement async paste method on UIWKInteractionViewProtocol
1671         https://bugs.webkit.org/show_bug.cgi?id=196267
1672         <rdar://problem/49236346>
1673
1674         Reviewed by Tim Horton.
1675
1676         Implement a new UIWKInteractionViewProtocol hook to perform a paste command, and invoke the given completion
1677         handler when pasting is finished.
1678
1679         Test: UIPasteboardTests.PasteWithCompletionHandler
1680
1681         * UIProcess/ios/WKContentViewInteraction.mm:
1682         (-[WKContentView pasteWithCompletionHandler:]):
1683
1684 2019-03-26  Per Arne Vollan  <pvollan@apple.com>
1685
1686         [macOS] Fix sandbox violations
1687         https://bugs.webkit.org/show_bug.cgi?id=196262
1688         <rdar://problem/47738015>
1689
1690         Reviewed by Brent Fulgham.
1691
1692         Fix various observed sandbox violations.
1693
1694         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1695         * WebProcess/com.apple.WebProcess.sb.in:
1696
1697 2019-03-26  Tomoki Imai  <Tomoki.Imai@sony.com>
1698
1699         Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyCoordinatedGraphics::incorporateUpdate when forceCompositingMode is turned on
1700         https://bugs.webkit.org/show_bug.cgi?id=195879
1701
1702         Reviewed by Carlos Garcia Campos.
1703
1704         The root cause is that DrawingAreaProxyCoordinatedGraphics::isInAcceleratedCompositingMode checks both of alwaysUseCompositing() and !m_layerTreeContext.isEmpty().
1705         alwaysUseCompositing() refers preferences, which is written by the application (UIProcess).
1706         On the other hand, m_layerTreeContext is changed when it receives enterAcceleratedCompositingMode/exitAcceleratedCompositingMode from WebProcess.
1707
1708         It results when we set forceCompositingMode and acceleratedCompositingEnabled to true, WebProcess and UIProcess is out of sync until WebProcess sends enterAcceleratedCompositingMode message.
1709         In such situation, WebProcess sends incorporateUpdate to UIProcess because WebProcess is in non-AC mode, but isInAcceleratedCompositingMode becomes true in UIProcess side.
1710
1711         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
1712         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics): Should call exitAcceleratedCompositingMode even when alwaysUseCompositing is true.
1713         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode): enterAcceleratedCompositingMode should check enterAcceleratedCompositingMode is not called twice.
1714         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Remove alwaysUseCompositing from isInAcceleratedCompositingMode
1715
1716 2019-03-26  Antoine Quint  <graouts@apple.com>
1717
1718         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
1719         https://bugs.webkit.org/show_bug.cgi?id=196254
1720         <rdar://problem/49124334>
1721
1722         Reviewed by Dean Jackson.
1723
1724         * Shared/WebPreferences.yaml:
1725
1726 2019-03-26  Philippe Normand  <pnormand@igalia.com>
1727
1728         [WPE][Qt] Uninitialized racy ViewBackend
1729         https://bugs.webkit.org/show_bug.cgi?id=196247
1730
1731         Reviewed by Carlos Garcia Campos.
1732
1733         * UIProcess/API/wpe/qt/WPEQtView.h: Initialize the backend pointer to nullptr.
1734
1735 2019-03-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1736
1737         Unreviewed. Fix typo in GLib geolocation API after r243285.
1738
1739         gelocation -> geolocation.
1740
1741         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
1742         (webkit_geolocation_manager_class_init):
1743         (webkit_geolocation_manager_update_position):
1744         (webkit_geolocation_manager_failed):
1745         (webkit_gelocation_manager_update_position): Deleted.
1746         (webkit_gelocation_manager_failed): Deleted.
1747         * UIProcess/API/gtk/WebKitGeolocationManager.h:
1748         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1749         * UIProcess/API/wpe/WebKitGeolocationManager.h:
1750         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
1751
1752 2019-03-26  Patrick Griffis  <pgriffis@igalia.com>
1753
1754         [GTK][WPE] Disable process warming
1755         https://bugs.webkit.org/show_bug.cgi?id=196208
1756
1757         Reviewed by Chris Dumez.
1758
1759         Fixes crash caused by r243384.
1760
1761         Process warming is incompatible with our launcher as it expects a valid
1762         WebsiteDataStore at initialization time for sandbox permissions.
1763
1764         * UIProcess/glib/WebProcessPoolGLib.cpp:
1765         (WebKit::WebProcessPool::platformInitialize):
1766
1767 2019-03-25  Alex Christensen  <achristensen@webkit.org>
1768
1769         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
1770         https://bugs.webkit.org/show_bug.cgi?id=196213
1771
1772         Reviewed by Geoff Garen.
1773
1774         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
1775         with a SecIdentityRef wrapped in an NSCredential.
1776
1777         * Shared/cf/ArgumentCodersCF.cpp:
1778         (IPC::decode):
1779
1780 2019-03-25  Chris Dumez  <cdumez@apple.com>
1781
1782         Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
1783         https://bugs.webkit.org/show_bug.cgi?id=196205
1784         <rdar://problem/49083324>
1785
1786         Reviewed by Geoffrey Garen.
1787
1788         Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
1789         wild cards (e.g. "image/*") that are defined in the HTML specification:
1790         - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
1791
1792         Previously, we would fail to convert those to UTIs.
1793
1794         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1795
1796 2019-03-25  Tim Horton  <timothy_horton@apple.com>
1797
1798         Remove some now-unnecessary dynamic class lookup
1799         https://bugs.webkit.org/show_bug.cgi?id=196237
1800
1801         Reviewed by Simon Fraser.
1802
1803         * Shared/DocumentEditingContext.mm:
1804         (WebKit::DocumentEditingContext::toPlatformContext):
1805
1806 2019-03-25  Tim Horton  <timothy_horton@apple.com>
1807
1808         Get rid of ENABLE(ANIMATED_KEYBOARD_SCROLLING)
1809         https://bugs.webkit.org/show_bug.cgi?id=196224
1810
1811         Reviewed by Simon Fraser.
1812
1813         * Platform/spi/ios/AccessibilitySupportSPI.h:
1814         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1815         (-[WKKeyboardScrollingAnimator invalidate]):
1816         (perpendicularAbsoluteUnitVector):
1817         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
1818         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
1819         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
1820         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
1821         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
1822         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]): Deleted.
1823         (-[WKKeyboardScrollingAnimator stopRepeatTimer]): Deleted.
1824         (-[WKKeyboardScrollingAnimator performDiscreteScroll]): Deleted.
1825
1826 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
1827
1828         Enable IPC sending and receiving non-default-constructible types
1829         https://bugs.webkit.org/show_bug.cgi?id=196132
1830         <rdar://problem/49229221>
1831
1832         Unreviewed build fix for WinCairo port.
1833
1834         error C2440: '=': cannot convert from 'int' to 'HANDLE'
1835
1836         * Platform/win/SharedMemoryWin.cpp:
1837         (WebKit::SharedMemory::Handle::Handle): std::exchange HANDLE with nullptr, not 0.
1838         (WebKit::SharedMemory::Handle::operator=): Ditto.
1839
1840 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
1841
1842         [Coordinated Graphics][WinCairo] ASSERTION FAILED: state.id == m_nicosia.state.id
1843         https://bugs.webkit.org/show_bug.cgi?id=196190
1844
1845         Reviewed by Žan Doberšek.
1846
1847         This assertion assumes the pre-committed and the committed scenes
1848         are identical. But, the pre-committed scene is updated in the main
1849         thread. Removed the false assertion.
1850
1851         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1852         (WebKit::CoordinatedGraphicsScene::purgeGLResources): Remove the
1853         assertion. Removed layers of committed scene, not pre-committed
1854         scene.
1855
1856 2019-03-25  Brady Eidson  <beidson@apple.com>
1857
1858         Add socket-delegate to another entitlements config
1859         rdar://problem/48090350 and https://bugs.webkit.org/show_bug.cgi?id=196227
1860
1861         Reviewed by Geoffrey Garen.
1862
1863         * Configurations/Network-iOSMac.entitlements:
1864
1865 2019-03-25  Commit Queue  <commit-queue@webkit.org>
1866
1867         Unreviewed, rolling out r243465.
1868         https://bugs.webkit.org/show_bug.cgi?id=196226
1869
1870         the test doesn't build (Requested by thorton on #webkit).
1871
1872         Reverted changeset:
1873
1874         "Do not terminate the NetworkProcess if a third party
1875         application sends a NSCredential with a SecIdentityRef"
1876         https://bugs.webkit.org/show_bug.cgi?id=196213
1877         https://trac.webkit.org/changeset/243465
1878
1879 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
1880
1881         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
1882         https://bugs.webkit.org/show_bug.cgi?id=196126
1883         rdar://problem/49095791
1884
1885         Reviewed by Tim Horton.
1886         
1887         I fumbled the commit after the enum rename. Make this actually work.
1888
1889         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1890         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1891
1892 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
1893
1894         Zoom on macOS is centered around a point lower than the cursor
1895         https://bugs.webkit.org/show_bug.cgi?id=196225
1896         rdar://problem/49213574
1897
1898         Reviewed by Tim Horton.
1899         
1900         The origin handed to ViewGestureController::handleMagnificationGestureEvent is in WKWebView
1901         coordinates, but we end up setting the transform on the RenderView's layer, so we need
1902         to subtract the topContentInset.
1903
1904         * UIProcess/mac/ViewGestureControllerMac.mm:
1905         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
1906
1907 2019-03-25  Alex Christensen  <achristensen@webkit.org>
1908
1909         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
1910         https://bugs.webkit.org/show_bug.cgi?id=196213
1911
1912         Reviewed by Geoff Garen.
1913
1914         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
1915         with a SecIdentityRef wrapped in an NSCredential.
1916
1917         * Shared/cf/ArgumentCodersCF.cpp:
1918         (IPC::decode):
1919
1920 2019-03-25  Chris Dumez  <cdumez@apple.com>
1921
1922         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
1923         https://bugs.webkit.org/show_bug.cgi?id=196210
1924         <rdar://problem/48681326>
1925
1926         Reviewed by Geoffrey Garen.
1927
1928         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
1929         instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.
1930
1931         This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
1932         communicate via DrawingArea IPC.
1933
1934         * WebProcess/WebPage/WebPage.cpp:
1935         (WebKit::WebPage::reinitializeWebPage):
1936         (WebKit::WebPage::setIsSuspended):
1937         * WebProcess/WebPage/WebPage.h:
1938
1939 2019-03-25  Alex Christensen  <achristensen@webkit.org>
1940
1941         Enable IPC sending and receiving non-default-constructible types
1942         https://bugs.webkit.org/show_bug.cgi?id=196132
1943
1944         Reviewed by Geoff Garen.
1945
1946         * Platform/IPC/ArgumentCoder.h:
1947         * Platform/IPC/ArgumentCoders.h:
1948         (IPC::TupleEncoder::encode):
1949         (IPC::tupleFromTupleAndObject):
1950         (IPC::TupleDecoderImpl::decode):
1951         (IPC::TupleDecoderImpl<Type>::decode):
1952         (IPC::TupleDecoder::decode):
1953         (IPC::TupleDecoder<0>::decode):
1954         (IPC::TupleCoder::encode): Deleted.
1955         (IPC::TupleCoder::decode): Deleted.
1956         * Platform/IPC/Connection.h:
1957         (IPC::Connection::sendWithReply):
1958         (IPC::TupleMover::move):
1959         (IPC::moveTuple):
1960         (IPC::Connection::sendSync):
1961         * Platform/IPC/Decoder.h:
1962         (IPC::Decoder::decode):
1963         (IPC::Decoder::operator>>):
1964         * Platform/IPC/HandleMessage.h:
1965         (IPC::handleMessage):
1966         (IPC::handleMessageSynchronous):
1967         (IPC::handleMessageSynchronousWantsConnection):
1968         (IPC::handleMessageAsync):
1969         * Platform/SharedMemory.h:
1970         * Scripts/webkit/LegacyMessages-expected.h:
1971         * Scripts/webkit/Messages-expected.h:
1972         * Scripts/webkit/MessagesSuperclass-expected.h:
1973         * Scripts/webkit/messages.py:
1974         * Shared/Databases/IndexedDB/WebIDBResult.h:
1975         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1976         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1977         * Shared/ShareableBitmap.h:
1978         * Shared/ShareableResource.h:
1979         * Shared/UpdateInfo.h:
1980         * Shared/WebEvent.h:
1981         * Shared/WebProcessCreationParameters.cpp:
1982         * Shared/WebProcessCreationParameters.h:
1983         * Shared/mac/SecItemResponseData.cpp:
1984         (WebKit::SecItemResponseData::SecItemResponseData):
1985         (WebKit::SecItemResponseData::decode):
1986         * Shared/mac/SecItemResponseData.h:
1987         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
1988
1989 2019-03-25  Tim Horton  <timothy_horton@apple.com>
1990
1991         Animated keyboard scrolling is extremely chaotic
1992         https://bugs.webkit.org/show_bug.cgi?id=196164
1993         <rdar://problem/48702444>
1994
1995         Reviewed by Simon Fraser.
1996
1997         * UIProcess/ios/WKContentViewInteraction.mm:
1998         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1999         Consume keyboard events instead of interpreting them traditionally
2000         if WKKeyboardScrollingAnimator is animating.
2001
2002         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
2003         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2004         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
2005         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
2006         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
2007         (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
2008         (-[WKKeyboardScrollingAnimator displayLinkFired:]):
2009         (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
2010         Expose the current state of interactive scrolling, and rename the related member.
2011
2012 2019-03-25  Keith Rollin  <krollin@apple.com>
2013
2014         Add WebKit logging for first paint and other interesting layout milestones
2015         https://bugs.webkit.org/show_bug.cgi?id=196159
2016         <rdar://problem/49128952>
2017
2018         Reviewed by Simon Fraser.
2019
2020         Add some logging to indicate what layout milestones have been reached.
2021         This should help us determine if there's a client, rendering, layout,
2022         or some other issue when page content does not appear in the client
2023         window.
2024
2025         The logging is being added to
2026         WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
2027         a nice central place to capture layout milestones. However, it will
2028         only log notifications that are being sent to clients. It does not
2029         indicate all milestones that have occurred. That is, it does not
2030         report milestones that are filtered out due to client disinterest.
2031         There doesn't seem to be a good central place to capture all
2032         milestones, regardless of client interest.
2033
2034         * Platform/Logging.h:
2035         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2036         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
2037
2038 2019-03-25  Patrick Griffis  <pgriffis@igalia.com>
2039
2040         [GTK][WPE] Remove network access from web process sandbox
2041         https://bugs.webkit.org/show_bug.cgi?id=189967
2042
2043         Reviewed by Michael Catanzaro.
2044
2045         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2046         (WebKit::createFlatpakInfo):
2047         (WebKit::bubblewrapSpawn):
2048         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
2049         (WebKit::flatpakSpawn):
2050
2051 2019-03-25  Andy Estes  <aestes@apple.com>
2052
2053         [Apple Pay] Call +canMakePayments on a work queue
2054         https://bugs.webkit.org/show_bug.cgi?id=196179
2055         <rdar://problem/45388749>
2056
2057         Reviewed by Brady Eidson.
2058
2059         Calling +canMakePayments on either PKPaymentAuthorizationController or
2060         PKPaymentAuthorizationViewController results in synchronous IPC and is therefore very
2061         expensive to call on the main thread. On iOS, these calls are made in the network process,
2062         and on Mac in the UI process.
2063
2064         Call these methods on a work queue to avoid main thread spins.
2065
2066         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
2067         (WebKit::WebPaymentCoordinatorProxy::canMakePayments):
2068         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
2069         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2070         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2071         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2072         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2073
2074 2019-03-25  Andy Estes  <aestes@apple.com>
2075
2076         [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
2077         https://bugs.webkit.org/show_bug.cgi?id=196180
2078
2079         Reviewed by Youenn Fablet.
2080
2081         Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
2082         without an entitlement. Therefore, we can call it from the web process directly rather than
2083         synchronously messaging the entitled UI or networking process.
2084
2085         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
2086         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
2087         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2088         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2089         * SourcesCocoa.txt:
2090         * WebKit.xcodeproj/project.pbxproj:
2091         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2092         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
2093         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2094         * WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
2095         (WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
2096         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2097         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2098         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
2099
2100 2019-03-25  Chris Dumez  <cdumez@apple.com>
2101
2102         Unreviewed, tiny fix after r243388 to address API test failures on iOS
2103
2104         m_processType was properly initialized on macOS but not iOS.
2105
2106         * WebProcess/cocoa/WebProcessCocoa.mm:
2107         (WebKit::WebProcess::platformInitializeProcess):
2108
2109 2019-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2110
2111         [GTK][WPE] Do not allow changes in active URI before provisional load starts for non-API requests
2112         https://bugs.webkit.org/show_bug.cgi?id=194208
2113
2114         Reviewed by Michael Catanzaro.
2115
2116         * UIProcess/API/glib/WebKitWebView.cpp:
2117         (webkitWebViewWillStartLoad): Block updates of active URL.
2118         (webkitWebViewLoadChanged): Unblock updates of active URL on WEBKIT_LOAD_STARTED.
2119
2120 2019-03-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2121
2122         Remove NavigatorContentUtils in WebCore/Modules
2123         https://bugs.webkit.org/show_bug.cgi?id=196070
2124
2125         Reviewed by Alex Christensen.
2126
2127         NavigatorContentUtils was to support the custom scheme spec [1].
2128         However, in WebKit side, no port has supported the feature in
2129         WebKit layer after EFL port was removed. So there has been the
2130         only IDL implementation of the NavigatorContentUtils in WebCore.
2131         So we don't need to keep the implementation in WebCore anymore.
2132
2133         [1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
2134
2135         * Configurations/FeatureDefines.xcconfig:
2136         * WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h: Removed.
2137
2138 2019-03-24  Zan Dobersek  <zdobersek@igalia.com>
2139
2140         Unreviewed WPE build fix.
2141
2142         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
2143         Add an explicit CompletionHandler.h include to avoid a trip-up in
2144         unified builds.
2145
2146 2019-03-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2147
2148         [WinCairo] WebProcessDataStoreParameters.h(32): error C2653: 'SandboxExtension': is not a class or namespace name
2149         https://bugs.webkit.org/show_bug.cgi?id=196192
2150
2151         Unreviewed for WinCairo port.
2152
2153         * Shared/WebProcessDataStoreParameters.h: Added #include "SandboxExtension.h".
2154
2155 2019-03-24  Andy Estes  <aestes@apple.com>
2156
2157         [watchOS] Remove unused Proximity Networking code
2158         https://bugs.webkit.org/show_bug.cgi?id=196188
2159
2160         Reviewed by Tim Horton.
2161
2162         * Configurations/WebKit.xcconfig:
2163         * NetworkProcess/NetworkProcess.cpp:
2164         (WebKit::NetworkProcess::NetworkProcess):
2165         * NetworkProcess/NetworkProcess.h:
2166         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2167         (WebKit::NetworkProcessCreationParameters::encode const):
2168         (WebKit::NetworkProcessCreationParameters::decode):
2169         * NetworkProcess/NetworkProcessCreationParameters.h:
2170         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2171         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2172         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2173         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2174         (WebKit::NetworkProcess::platformPrepareToSuspend):
2175         (WebKit::NetworkProcess::platformProcessDidResume):
2176         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
2177         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
2178         * NetworkProcess/watchos/NetworkProximityAssertion.h: Removed.
2179         * NetworkProcess/watchos/NetworkProximityAssertion.mm: Removed.
2180         * NetworkProcess/watchos/NetworkProximityManager.h: Removed.
2181         * NetworkProcess/watchos/NetworkProximityManager.mm: Removed.
2182         * SourcesCocoa.txt:
2183         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2184         (API::ProcessPoolConfiguration::copy):
2185         * UIProcess/API/APIProcessPoolConfiguration.h:
2186         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2187         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2188         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
2189         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
2190         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2191         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2192         * WebKit.xcodeproj/project.pbxproj:
2193
2194 2019-03-23  Chris Dumez  <cdumez@apple.com>
2195
2196         Unreviewed, fix typo in comment added in r243379.
2197
2198         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2199         (-[WKProcessGroup setDelegate:]):
2200
2201 2019-03-23  Simon Fraser  <simon.fraser@apple.com>
2202
2203         REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
2204         https://bugs.webkit.org/show_bug.cgi?id=137043
2205         rdar://problem/16595330
2206
2207         Reviewed by Zalan Bujtas.
2208
2209         Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
2210         to the UI process, and use it to set UIScrollView indicators visible or not.
2211         
2212         The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
2213         where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
2214         tests, so would never get called.
2215
2216         * Shared/WebCoreArgumentCoders.cpp:
2217         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
2218         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
2219         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2220         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2221
2222 2019-03-23  Zalan Bujtas  <zalan@apple.com>
2223
2224         [ContentChangeObserver] Taping on a form control should always result in click.
2225         https://bugs.webkit.org/show_bug.cgi?id=196177
2226
2227         Reviewed by Simon Fraser.
2228
2229         This patch enures that we send a synthetic click when the traget node is a form control (button, edit field etc) even if
2230         the mousemove brings up some hover content.
2231
2232         * WebProcess/WebPage/ios/WebPageIOS.mm:
2233         (WebKit::WebPage::handleSyntheticClick):
2234
2235 2019-03-23  Andy Estes  <aestes@apple.com>
2236
2237         [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS
2238         https://bugs.webkit.org/show_bug.cgi?id=196163
2239         <rdar://problem/48787564>
2240
2241         Reviewed by Anders Carlsson.
2242
2243         Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop
2244         calling PKPaymentAuthorizationViewController class methods on iOS in favor of their
2245         PKPaymentAuthorizationController alternatives.
2246
2247         While we're here, we should also transition to calling
2248         +paymentServicesMerchantURLForAPIType:completion: on both
2249         PKPaymentAuthorizationViewController and PKPaymentAuthorizationController.
2250
2251         * Platform/cocoa/PaymentAuthorizationViewController.mm:
2252         (-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2253         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
2254         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
2255         (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]):
2256         (-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2257         * Platform/ios/PaymentAuthorizationController.mm:
2258         (-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
2259         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2260         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted.
2261         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2262         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2263         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2264         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2265
2266 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2267
2268         Unreviewed. Fix GTK build after r243409.
2269
2270         Build failure is actually unrelated to r243409, it's yet another unified build failure that happens when source
2271         file list changes.
2272
2273         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2274         (WebKit::WebInspectorProxy::platformShowCertificate): Use WebCore namespace for CertificateInfo parameter.
2275
2276 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2277
2278         [GTK] Remove build time dependency on Geoclue2
2279         https://bugs.webkit.org/show_bug.cgi?id=195994
2280
2281         Reviewed by Michael Catanzaro.
2282
2283         Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.
2284
2285         * PlatformGTK.cmake:
2286         * PlatformWPE.cmake:
2287         * SourcesGTK.txt:
2288         * SourcesWPE.txt:
2289         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
2290         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
2291         (webkitGeolocationManagerStop):
2292         (webkitGeolocationManagerSetEnableHighAccuracy):
2293         (webkitGeolocationManagerDispose):
2294         (webkit_geolocation_manager_class_init):
2295         * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
2296         (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
2297         (WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
2298         (WebKit::GeoclueGeolocationProvider::start):
2299         (WebKit::GeoclueGeolocationProvider::stop):
2300         (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
2301         (WebKit::GeoclueGeolocationProvider::destroyManagerLater):
2302         (WebKit::GeoclueGeolocationProvider::destroyManager):
2303         (WebKit::GeoclueGeolocationProvider::setupManager):
2304         (WebKit::GeoclueGeolocationProvider::createClient):
2305         (WebKit::GeoclueGeolocationProvider::setupClient):
2306         (WebKit::GeoclueGeolocationProvider::startClient):
2307         (WebKit::GeoclueGeolocationProvider::stopClient):
2308         (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
2309         (WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
2310         (WebKit::GeoclueGeolocationProvider::createLocation):
2311         (WebKit::GeoclueGeolocationProvider::locationUpdated):
2312         (WebKit::GeoclueGeolocationProvider::didFail):
2313         * UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
2314
2315 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2316
2317         Undo collision with r243390.
2318
2319         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2320         (stringForSSLProtocol):
2321
2322 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2323
2324         Fix internal builds.
2325
2326         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2327         (stringForSSLProtocol):
2328
2329 2019-03-22  Keith Rollin  <krollin@apple.com>
2330
2331         Enable ThinLTO support in Production builds
2332         https://bugs.webkit.org/show_bug.cgi?id=190758
2333         <rdar://problem/45413233>
2334
2335         Reviewed by Daniel Bates.
2336
2337         Enable building with Thin LTO in Production when using Xcode 10.2 or
2338         later. This change results in a 1.45% progression in PLT5. Full
2339         Production build times increase about 2-3%. Incremental build times
2340         are more severely affected, and so LTO is not enabled for local
2341         engineering builds.
2342
2343         LTO is enabled only on macOS for now, until rdar://problem/49013399,
2344         which affects ARM builds, is fixed.
2345
2346         To change the LTO setting when building locally:
2347
2348         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
2349           command line.
2350         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
2351           on the command line.
2352         - If building with `build-root`, specify --lto={none,thin,full} on the
2353           command line.
2354         - If building with Xcode, create a LocalOverrides.xcconfig file at the
2355           top level of your repository directory (if needed) and define
2356           WK_LTO_MODE to full, thin, or none.
2357
2358         * Configurations/Base.xcconfig:
2359
2360 2019-03-22  Chris Dumez  <cdumez@apple.com>
2361
2362         Unreviewed build fix after r243388.
2363
2364         * WebProcess/WebProcess.h:
2365
2366 2019-03-22  Per Arne Vollan  <pvollan@apple.com>
2367
2368         [macOS] Fix sandbox violation
2369         https://bugs.webkit.org/show_bug.cgi?id=196153
2370         <rdar://problem/49123855>
2371
2372         Reviewed by Brent Fulgham.
2373
2374         The sandbox on macOS is blocking the mach lookup.
2375
2376         * WebProcess/com.apple.WebProcess.sb.in:
2377
2378 2019-03-21  Ryan Haddad  <ryanhaddad@apple.com>
2379
2380         Unreviewed, fix the build with recent SDKs.
2381
2382         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2383         (stringForSSLProtocol):
2384
2385 2019-03-22  Chris Dumez  <cdumez@apple.com>
2386
2387         Implement WebProcess freezer opt-in completely on WebContent process side
2388         https://bugs.webkit.org/show_bug.cgi?id=196149
2389
2390         Reviewed by Brady Eidson.
2391
2392         Implement WebProcess freezer opt-in completely on WebContent process side, we do not need
2393         to involve the UIProcess with this and rely on IPC which may be fragile.
2394
2395         In the future, we may want to set freezable state from the UIProcess when the API supports
2396         it. We can move the logic to be fully on the UIProcess side then. In the mean time, it is
2397         likely best not to rely on IPC and process coordination for this.
2398
2399         * UIProcess/WebProcessProxy.cpp:
2400         (WebKit::globalPageMap):
2401         (WebKit::WebProcessProxy::WebProcessProxy):
2402         (WebKit::WebProcessProxy::setIsInProcessCache):
2403         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
2404         (WebKit::WebProcessProxy::didFinishLaunching):
2405         (WebKit::WebProcessProxy::validateFreezerStatus): Deleted.
2406         * UIProcess/WebProcessProxy.h:
2407         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
2408         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap): Deleted.
2409         (WebKit::WebProcessProxy::WebPageProxyMap::size const): Deleted.
2410         (WebKit::WebProcessProxy::WebPageProxyMap::values): Deleted.
2411         (WebKit::WebProcessProxy::WebPageProxyMap::values const): Deleted.
2412         (WebKit::WebProcessProxy::WebPageProxyMap::begin): Deleted.
2413         (WebKit::WebProcessProxy::WebPageProxyMap::end): Deleted.
2414         (WebKit::WebProcessProxy::WebPageProxyMap::get): Deleted.
2415         (WebKit::WebProcessProxy::WebPageProxyMap::contains const): Deleted.
2416         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const): Deleted.
2417         (WebKit::WebProcessProxy::WebPageProxyMap::set): Deleted.
2418         (WebKit::WebProcessProxy::WebPageProxyMap::take): Deleted.
2419         * WebProcess/WebProcess.cpp:
2420         (WebKit::WebProcess::setIsInProcessCache):
2421         (WebKit::WebProcess::markIsNoLongerPrewarmed):
2422         (WebKit::WebProcess::actualPrepareToSuspend):
2423         (WebKit::WebProcess::setFreezable): Deleted.
2424         * WebProcess/WebProcess.h:
2425         * WebProcess/WebProcess.messages.in:
2426         * WebProcess/cocoa/WebProcessCocoa.mm:
2427         (WebKit::WebProcess::updateProcessName):
2428         (WebKit::WebProcess::shouldFreezeOnSuspension const):
2429         (WebKit::WebProcess::updateFreezerStatus):
2430
2431 2019-03-22  Chris Dumez  <cdumez@apple.com>
2432
2433         Prewarmed processes should be usable with any website data store
2434         https://bugs.webkit.org/show_bug.cgi?id=196104
2435
2436         Reviewed by Alex Christensen.
2437
2438         Split WebsiteDataStore-specific data out of WebProcessCreationParameters and into a new
2439         WebProcessDataStoreParameters struct so that we do not need a WebsiteDataStore in order
2440         to lauch and initialize a WebProcess. When the process finally gets used and we thus
2441         know which WebsiteDataStore they will be used for, we send the WebProcessDataStoreParameters
2442         to the process to that it can do its data store-specific initialization.
2443
2444         This allows prewarmed processes not not have a WebsiteDataStore assocated with them. They
2445         can then be used for any WebsiteDataStore when we need them.
2446
2447         This is also used by our dummy WebProcessProxy since it does not have a backing process and
2448         thus has no associated WebsiteDataStore.
2449
2450         * Shared/WebProcessCreationParameters.cpp:
2451         (WebKit::WebProcessCreationParameters::encode const):
2452         (WebKit::WebProcessCreationParameters::decode):
2453         * Shared/WebProcessCreationParameters.h:
2454         * Shared/WebProcessDataStoreParameters.h: Added.
2455         (WebKit::WebProcessDataStoreParameters::encode const):
2456         (WebKit::WebProcessDataStoreParameters::decode):
2457         * UIProcess/API/C/WKContext.cpp:
2458         (WKContextWarmInitialProcess):
2459         * UIProcess/API/Cocoa/WKProcessPool.mm:
2460         (-[WKProcessPool _warmInitialProcess]):
2461         * UIProcess/ServiceWorkerProcessProxy.cpp:
2462         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2463         * UIProcess/WebPageProxy.cpp:
2464         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
2465         * UIProcess/WebProcessPool.cpp:
2466         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
2467         (WebKit::WebProcessPool::createNewWebProcess):
2468         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
2469         (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
2470         (WebKit::WebProcessPool::initializeNewWebProcess):
2471         (WebKit::WebProcessPool::prewarmProcess):
2472         (WebKit::WebProcessPool::processForRegistrableDomain):
2473         (WebKit::WebProcessPool::createWebPage):
2474         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
2475         * UIProcess/WebProcessPool.h:
2476         (WebKit::WebProcessPool::sendToOneProcess):
2477         * UIProcess/WebProcessProxy.cpp:
2478         (WebKit::WebProcessProxy::create):
2479         (WebKit::WebProcessProxy::WebProcessProxy):
2480         (WebKit::WebProcessProxy::setWebsiteDataStore):
2481         (WebKit::WebProcessProxy::addExistingWebPage):
2482         * UIProcess/WebProcessProxy.h:
2483         (WebKit::WebProcessProxy::websiteDataStore const):
2484         * WebKit.xcodeproj/project.pbxproj:
2485         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
2486         (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
2487         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
2488         * WebProcess/WebProcess.cpp:
2489         (WebKit::WebProcess::initializeWebProcess):
2490         (WebKit::WebProcess::setWebsiteDataStoreParameters):
2491         * WebProcess/WebProcess.h:
2492         * WebProcess/WebProcess.messages.in:
2493         * WebProcess/WebProcessSupplement.h:
2494         (WebKit::WebProcessSupplement::initialize):
2495         (WebKit::WebProcessSupplement::setWebsiteDataStore):
2496         * WebProcess/cocoa/WebProcessCocoa.mm:
2497         (WebKit::WebProcess::platformInitializeWebProcess):
2498         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
2499         * WebProcess/win/WebProcessWin.cpp:
2500         (WebKit::WebProcess::platformInitializeWebProcess):
2501         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
2502
2503 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
2504
2505         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
2506         https://bugs.webkit.org/show_bug.cgi?id=196126
2507         rdar://problem/49095791
2508
2509         Reviewed by Antti Koivisto.
2510
2511         The scrolling tree doesn't have an accurate picture of the main view's scroll position
2512         during pinch-zooming, so don't have it apply layer positions if a transient zoom is
2513         in progress.
2514
2515         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2516         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2517         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2518         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
2519
2520 2019-03-22  Antti Koivisto  <antti@apple.com>
2521
2522         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
2523         https://bugs.webkit.org/show_bug.cgi?id=196100
2524         <rdar://problem/49117933>
2525
2526         Reviewed by Simon Fraser.
2527
2528         Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
2529
2530         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
2531         (WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const):
2532         (WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const):
2533
2534         Make more generic and save the associated positioning behavior.
2535
2536         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const): Deleted.
2537         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID): Deleted.
2538         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs): Deleted.
2539         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
2540         (WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs):
2541         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2542         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2543         (WebKit::isScrolledBy):
2544
2545         Stationary relationship means the layer won't scroll the scroller.
2546
2547         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2548         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
2549
2550 2019-03-22  Chris Dumez  <cdumez@apple.com>
2551
2552         REGRESSION (r243094): ePub files do not render or open in Books
2553         https://bugs.webkit.org/show_bug.cgi?id=196119
2554         <rdar://problem/49121686>
2555
2556         Reviewed by Brady Eidson.
2557
2558         Do not delay the WebProcess launch until a load when contructing a web view and the client
2559         may observe when its injected bundle is loaded via WKProcessGroupDelegate's
2560         didCreateConnectionToWebProcessPlugIn.
2561
2562         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2563         (-[WKProcessGroup setDelegate:]):
2564         * UIProcess/WebInspectorUtilities.cpp:
2565         (WebKit::inspectorProcessPool):
2566         * UIProcess/WebProcessPool.cpp:
2567         (WebKit::WebProcessPool::createWebPage):
2568         * UIProcess/WebProcessPool.h:
2569
2570 2019-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2571
2572         REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()
2573         https://bugs.webkit.org/show_bug.cgi?id=196140
2574
2575         Reviewed by Chris Dumez.
2576
2577         Since r243094, the WebPageProxy fullscreen manager is not created in the constructor, but once the page has a
2578         process launched.
2579
2580         * UIProcess/Automation/WebAutomationSession.cpp:
2581         (WebKit::WebAutomationSession::exitFullscreenWindowForPage): Null check WebPageProxy::fullScreenManager() before
2582         using it.
2583
2584 2019-03-22  Timothy Hatcher  <timothy@apple.com>
2585
2586         Change macosx() to macos() in WK_API... and JSC_API... macros.
2587         https://bugs.webkit.org/show_bug.cgi?id=196106
2588
2589         Reviewed by Brian Burg.
2590
2591         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
2592         * Shared/API/Cocoa/WKDragDestinationAction.h:
2593         * Shared/API/Cocoa/WKMain.h:
2594         * Shared/API/Cocoa/_WKFrameHandle.h:
2595         * Shared/API/Cocoa/_WKHitTestResult.h:
2596         * Shared/API/Cocoa/_WKNSWindowExtras.h:
2597         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
2598         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
2599         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
2600         * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
2601         * UIProcess/API/C/WKPage.h:
2602         * UIProcess/API/Cocoa/NSAttributedString.h:
2603         * UIProcess/API/Cocoa/WKBackForwardList.h:
2604         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2605         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
2606         * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
2607         * UIProcess/API/Cocoa/WKContentRuleList.h:
2608         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2609         * UIProcess/API/Cocoa/WKError.h:
2610         * UIProcess/API/Cocoa/WKErrorPrivate.h:
2611         * UIProcess/API/Cocoa/WKFrameInfo.h:
2612         * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
2613         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
2614         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
2615         * UIProcess/API/Cocoa/WKNavigation.h:
2616         * UIProcess/API/Cocoa/WKNavigationAction.h:
2617         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2618         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2619         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2620         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2621         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
2622         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
2623         * UIProcess/API/Cocoa/WKPreferences.h:
2624         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2625         * UIProcess/API/Cocoa/WKProcessPool.h:
2626         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2627         * UIProcess/API/Cocoa/WKScriptMessage.h:
2628         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
2629         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2630         * UIProcess/API/Cocoa/WKUIDelegate.h:
2631         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2632         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
2633         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
2634         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
2635         * UIProcess/API/Cocoa/WKUserContentController.h:
2636         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2637         * UIProcess/API/Cocoa/WKUserScript.h:
2638         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
2639         * UIProcess/API/Cocoa/WKViewPrivate.h:
2640         * UIProcess/API/Cocoa/WKWebView.h:
2641         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2642         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2643         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2644         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2645         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2646         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2647         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2648         * UIProcess/API/Cocoa/WKWindowFeatures.h:
2649         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
2650         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2651         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
2652         * UIProcess/API/Cocoa/_WKAttachment.h:
2653         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
2654         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2655         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
2656         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2657         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
2658         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2659         * UIProcess/API/Cocoa/_WKDownload.h:
2660         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
2661         * UIProcess/API/Cocoa/_WKElementAction.h:
2662         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
2663         * UIProcess/API/Cocoa/_WKFindOptions.h:
2664         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2665         * UIProcess/API/Cocoa/_WKFormInputSession.h:
2666         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
2667         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
2668         * UIProcess/API/Cocoa/_WKInspector.h:
2669         * UIProcess/API/Cocoa/_WKInspectorWindow.h:
2670         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
2671         * UIProcess/API/Cocoa/_WKLayoutMode.h:
2672         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
2673         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
2674         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2675         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
2676         * UIProcess/API/Cocoa/_WKSessionState.h:
2677         * UIProcess/API/Cocoa/_WKTextInputContext.h:
2678         * UIProcess/API/Cocoa/_WKThumbnailView.h:
2679         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
2680         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2681         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
2682         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
2683         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
2684         * UIProcess/API/Cocoa/_WKUserInitiatedAction.h:
2685         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
2686         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2687         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
2688         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2689         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2690         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
2691         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2692         * WebProcess/API/Cocoa/WKWebProcess.h:
2693         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2694         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
2695         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
2696         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2697         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
2698         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
2699         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
2700         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
2701         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
2702         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
2703         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
2704         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
2705         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
2706         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
2707         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2708         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
2709         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2710
2711 2019-03-22  Yousuke Kimoto  <Yousuke.Kimoto@sony.com>
2712
2713         Unreviewed build fix.
2714
2715         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2716
2717 2019-03-22  Tim Horton  <timothy_horton@apple.com>
2718
2719         Fix the build after r243354
2720         https://bugs.webkit.org/show_bug.cgi?id=196138
2721         <rdar://problem/49145951>
2722
2723         * Platform/spi/ios/UIKitSPI.h:
2724         * Shared/DocumentEditingContext.mm:
2725         (WebKit::DocumentEditingContext::toPlatformContext):
2726         * UIProcess/ios/WKContentViewInteraction.mm:
2727
2728 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
2729
2730         Clean up some TiledCoreAnimationDrawingArea members
2731         https://bugs.webkit.org/show_bug.cgi?id=196124
2732
2733         Reviewed by Tim Horton.
2734
2735         The giant m_transform was unused.
2736         
2737         Group the bools etc.
2738
2739         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2740         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2741         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2742         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
2743
2744 2019-03-21  Brady Eidson  <beidson@apple.com>
2745
2746         Certain WebProcesses should opt-out of the freezer.
2747         <rdar://problem/42846139> and https://bugs.webkit.org/show_bug.cgi?id=196062
2748
2749         Reviewed by Andy Estes.
2750
2751         WebProcesses should opt-in and opt-out of the freezer as is appropriate.
2752         By default a WebProcess is freezer eligible.
2753         If any of the following become true then it should become ineligible:
2754         - The WebProcess is a pre-warmed process.
2755         - The WebProcess is in the process cache.
2756         - The WebProcess is not actively hosting any web pages (e.g. it only has suspending web pages)
2757
2758         The most complicated part of the above is guaranteeing that any operation that changes
2759         the active pages hosted by the process causes a recalculation of the freezer opt-in state.
2760
2761         To do that this replaces the basic WebPageProxyMap with a custom class.
2762
2763         * UIProcess/WebProcessProxy.cpp:
2764         (WebKit::globalPageMap):
2765         (WebKit::WebProcessProxy::WebProcessProxy):
2766         (WebKit::WebProcessProxy::validateFreezerStatus):
2767         (WebKit::WebProcessProxy::setIsInProcessCache):
2768         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
2769         (WebKit::WebProcessProxy::didFinishLaunching):
2770         * UIProcess/WebProcessProxy.h:
2771         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap):
2772         (WebKit::WebProcessProxy::WebPageProxyMap::size const):
2773         (WebKit::WebProcessProxy::WebPageProxyMap::values):
2774         (WebKit::WebProcessProxy::WebPageProxyMap::values const):
2775         (WebKit::WebProcessProxy::WebPageProxyMap::begin):
2776         (WebKit::WebProcessProxy::WebPageProxyMap::end):
2777         (WebKit::WebProcessProxy::WebPageProxyMap::get):
2778         (WebKit::WebProcessProxy::WebPageProxyMap::contains const):
2779         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const):
2780         (WebKit::WebProcessProxy::WebPageProxyMap::set):
2781         (WebKit::WebProcessProxy::WebPageProxyMap::take):
2782
2783         * WebProcess/WebProcess.cpp:
2784         (WebKit::WebProcess::setFreezable):
2785         * WebProcess/WebProcess.h:
2786         * WebProcess/WebProcess.messages.in:
2787
2788 2019-03-21  Tim Horton  <timothy_horton@apple.com>
2789
2790         Adopt UIWKDocumentContext
2791         https://bugs.webkit.org/show_bug.cgi?id=196040
2792         <rdar://problem/48642440>
2793
2794         Reviewed by Ryosuke Niwa.
2795
2796         * Platform/spi/ios/UIKitSPI.h:
2797         * Scripts/webkit/messages.py:
2798         * Shared/DocumentEditingContext.h: Added.
2799         * Shared/DocumentEditingContext.mm: Added.
2800         (WebKit::toNSRange):
2801         (WebKit::DocumentEditingContext::toPlatformContext):
2802         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::encode):
2803         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::decode):
2804         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::encode):
2805         (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::decode):
2806         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::encode):
2807         (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::decode):
2808         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::encode):
2809         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
2810         Add DocumentEditingContext(Request), and coders.
2811         Also expose DocumentEditingContext::toPlatformContext, which populates
2812         a UIWKDocumentContext with the relevant values.
2813
2814         * SourcesCocoa.txt:
2815         * UIProcess/WebPageProxy.h:
2816         * UIProcess/ios/WKContentViewInteraction.mm:
2817         (toWebDocumentRequestOptions):
2818         (toWebRequest):
2819         (-[WKContentView adjustSelectionWithDelta:completionHandler:]):
2820         (-[WKContentView requestDocumentContext:completionHandler:]):
2821         (-[WKContentView selectPositionAtPoint:withContextRequest:completionHandler:]):
2822         * UIProcess/ios/WebPageProxyIOS.mm:
2823         (WebKit::WebPageProxy::adjustSelectionWithDelta):
2824         (WebKit::WebPageProxy::requestDocumentEditingContext):
2825         * WebKit.xcodeproj/project.pbxproj:
2826         * WebProcess/WebPage/WebPage.h:
2827         * WebProcess/WebPage/WebPage.messages.in:
2828         Plumb DocumentEditingContext(Request) around.
2829
2830         * WebProcess/WebPage/ios/WebPageIOS.mm:
2831         (WebKit::WebPage::adjustSelectionWithDelta):
2832         Adjust the current selection given deltas to apply to the location and length.
2833
2834         (WebKit::visiblePositionAdjacentToVisiblePosition):
2835         (WebKit::visiblePositionForPointInRootViewCoordinates):
2836         (WebKit::WebPage::requestDocumentEditingContext):
2837         Retrieve the relevant part of the selection, as well as the context,
2838         given either the selection, or a rect.
2839         If we're collecting context for a rect, we split the context between
2840         before and after (except for the part that intersects the selection).
2841         The three strings will always be directly adjacent, and any of the three
2842         can sometimes be null.
2843
2844 2019-03-21  James Magahern  <jmagahern@apple.com>
2845
2846         Long press gesture recognizers in WKWebView are conflicting with internal scroll view long press gesture recognizers
2847         https://bugs.webkit.org/show_bug.cgi?id=195726
2848         rdar://problem/48582449
2849
2850         Reviewed by Megan Gardner.
2851
2852         We just need to add another clause to WKContentViewInteraction's
2853         canPreventGestureRecognizer whitelist. 
2854
2855         * UIProcess/ios/WKContentViewInteraction.mm:
2856         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
2857
2858 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
2859
2860         [iOS WK2] Turn on async overflow scrolling by default
2861         https://bugs.webkit.org/show_bug.cgi?id=196011
2862         rdar://problem/48453859
2863
2864         Reviewed by Antti Koivisto.
2865
2866         * Shared/WebPreferences.yaml:
2867         * Shared/WebPreferencesDefaultValues.h:
2868
2869 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2870
2871         Remove last use of LegacySync IPC messages
2872         https://bugs.webkit.org/show_bug.cgi?id=196113
2873
2874         Reviewed by Chris Dumez.
2875
2876         Also rename "Delayed" to "Synchronous" now that there's only one type of synchronous message.
2877
2878         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2879         * NetworkProcess/NetworkProcess.messages.in:
2880         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2881         (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient):
2882         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
2883         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
2884         * Platform/IPC/Connection.cpp:
2885         (IPC::Connection::dispatchMessage):
2886         * Platform/IPC/HandleMessage.h:
2887         (IPC::handleMessageSynchronous):
2888         (IPC::handleMessageSynchronousWantsConnection):
2889         (IPC::handleMessageLegacySync): Deleted.
2890         (IPC::handleMessageDelayed): Deleted.
2891         (IPC::handleMessageDelayedWantsConnection): Deleted.
2892         * PluginProcess/PluginControllerProxy.messages.in:
2893         * PluginProcess/WebProcessConnection.messages.in:
2894         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
2895         (WebKit::WebPage::didReceiveSyncWebPageMessage):
2896         * Scripts/webkit/MessageReceiver-expected.cpp:
2897         (WebKit::WebPage::didReceiveSyncMessage):
2898         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
2899         (Messages::WebPage::TestSyncMessage::send):
2900         (Messages::WebPage::TestSynchronousMessage::send):
2901         (WebKit::WebPage::didReceiveSyncMessage):
2902         (Messages::WebPage::TestDelayedMessage::send): Deleted.
2903         * Scripts/webkit/MessagesSuperclass-expected.h:
2904         (Messages::WebPage::TestSynchronousMessage::name):
2905         (Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
2906         (Messages::WebPage::TestDelayedMessage::receiverName): Deleted.
2907         (Messages::WebPage::TestDelayedMessage::name): Deleted.
2908         (Messages::WebPage::TestDelayedMessage::TestDelayedMessage): Deleted.
2909         (Messages::WebPage::TestDelayedMessage::arguments const): Deleted.
2910         * Scripts/webkit/messages.py:
2911         * Scripts/webkit/messages_unittest.py:
2912         * Scripts/webkit/test-legacy-messages.in:
2913         * Scripts/webkit/test-messages.in:
2914         * Scripts/webkit/test-superclass-messages.in:
2915         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2916         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
2917         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2918         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2919         * UIProcess/WebFullScreenManagerProxy.messages.in:
2920         * UIProcess/WebPageProxy.messages.in:
2921         * UIProcess/WebPasteboardProxy.messages.in:
2922         * UIProcess/WebProcessPool.messages.in:
2923         * UIProcess/WebProcessProxy.messages.in:
2924         * UIProcess/WebStorage/StorageManager.messages.in:
2925         * UIProcess/mac/SecItemShimProxy.messages.in:
2926         * WebProcess/Plugins/PluginProcessConnection.messages.in:
2927         * WebProcess/Plugins/PluginProxy.messages.in:
2928         * WebProcess/Storage/WebSWClientConnection.cpp:
2929         (WebKit::WebSWClientConnection::syncTerminateWorker):
2930         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2931         * WebProcess/WebPage/WebPage.messages.in:
2932         * WebProcess/WebProcess.messages.in:
2933
2934 2019-03-21  Brian Burg  <bburg@apple.com>
2935
2936         Web Automation: support uploading non-local file paths
2937         https://bugs.webkit.org/show_bug.cgi?id=196081
2938         <rdar://problem/45819897>
2939
2940         Reviewed by Devin Rousso and Joseph Pecoraro.
2941
2942         To support cases where supplied file paths do not exist on the session host, add support for
2943         receiving file contents via Automation.setFilesToSelectForFileUpload.
2944
2945         * UIProcess/Automation/Automation.json: Add new parameter.
2946
2947         * UIProcess/Automation/WebAutomationSession.h:
2948         * UIProcess/Automation/WebAutomationSession.cpp:
2949         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
2950         Add support for receiving and saving file contents to a temporary directory. Rewrite the used paths so
2951         that WebCore knows to look at the revised paths where the file contents have been saved.
2952
2953         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
2954         Since WebKit does not have usable FileSystem implementations for all ports, shell out the actual
2955         saving of base64-encoded file data. Provide a Cocoa implementation, since that's what I can test.
2956
2957         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
2958         (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
2959         Use WTF::FileSystem to create a temporary directory, and use Cocoa methods to actually write the file.
2960
2961 2019-03-21  Youenn Fablet  <youenn@apple.com>
2962
2963         Cache API and IDB space usages should be initialized on first quota check
2964         https://bugs.webkit.org/show_bug.cgi?id=195707
2965
2966         Reviewed by Chris Dumez.
2967
2968         When the quota manager is created, make sure it delays quota check decisions until IDB and Cache API quota users are initialized.
2969         For IDB, the creation is synchronous but it may not be synchronous for Cache API.
2970         For that purpose, add a temporary quota user that will stay uninitialized until these two quota users are added.
2971         Once added, the temporary quota user is removed.
2972         The addition of the real users is made asynchronously as this is triggered by the creation of one of the two quota users.
2973
2974         In the case of a Cache API caches being cleared, make sure to reset the size to zero and to redo the quota user initialization dance.
2975
2976         * NetworkProcess/NetworkProcess.cpp:
2977         (WebKit::QuotaUserInitializer::initialize):
2978         (WebKit::QuotaUserInitializer::~QuotaUserInitializer):
2979         (WebKit::QuotaUserInitializer::QuotaUserInitializer):
2980         (WebKit::NetworkProcess::storageQuotaManager):
2981         * NetworkProcess/cache/CacheStorageEngine.cpp:
2982         (WebKit::CacheStorage::Engine::initializeQuotaUser):
2983         * NetworkProcess/cache/CacheStorageEngine.h:
2984         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2985         (WebKit::CacheStorage::Caches::clear):
2986
2987 2019-03-21  Per Arne Vollan  <pvollan@apple.com>
2988
2989         [iOS][macOS] Fix sandbox call violations
2990         https://bugs.webkit.org/show_bug.cgi?id=195809
2991         <rdar://problem/48829655>
2992
2993         Reviewed by Brent Fulgham.
2994
2995         An additional syscall needs to be added to the sandbox allow list.
2996
2997         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2998         * WebProcess/com.apple.WebProcess.sb.in:
2999
3000 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
3001
3002         Add UI process WebRTC runtime logging.
3003         https://bugs.webkit.org/show_bug.cgi?id=196020
3004         <rdar://problem/49071443>
3005
3006         Reviewed by Youenn Fablet.
3007
3008         * Platform/Logging.cpp:
3009         (WebKit::getLogChannel): New.
3010         * Platform/Logging.h:
3011         * Shared/WebCoreArgumentCoders.h: Add coders for WTFLogChannelState and WTFLogLevel.
3012
3013         Add runtime logging.
3014         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3015         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
3016         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture):
3017         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
3018         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState):
3019         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
3020         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
3021         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
3022         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
3023         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
3024         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3025         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
3026         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
3027         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
3028         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
3029         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3030         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
3031         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired):
3032         (WebKit::UserMediaPermissionRequestManagerProxy::logChannel const):
3033         (WebKit::convertEnumerationToString):
3034
3035         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3036         (WTF::LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction>::toString):
3037         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3038         (WebKit::convertEnumerationToString): Add an enum specialization for logging.
3039
3040         * UIProcess/UserMediaPermissionRequestProxy.h:
3041         (WTF::LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason>::toString): Ditto.
3042
3043         * UIProcess/WebPageProxy.cpp:
3044         (WebKit::WebPageProxy::logger):
3045         (WebKit::WebPageProxy::configureLoggingChannel):
3046         * UIProcess/WebPageProxy.h:
3047         * UIProcess/WebPageProxy.messages.in:
3048
3049         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3050         (WebKit::WebChromeClient::configureLoggingChannel):
3051         * WebProcess/WebCoreSupport/WebChromeClient.h:
3052         * WebProcess/WebPage/WebPage.cpp:
3053         (WebKit::WebPage::configureLoggingChannel):
3054         * WebProcess/WebPage/WebPage.h:
3055
3056 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3057
3058         Stop using LegacySync messages in WebPageProxy
3059         https://bugs.webkit.org/show_bug.cgi?id=196056
3060
3061         Reviewed by Chris Dumez.
3062
3063         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3064         (WebKit::WebPageProxy::loadRecentSearches):
3065         * UIProcess/ProvisionalPageProxy.cpp:
3066         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
3067         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3068         * UIProcess/ProvisionalPageProxy.h:
3069         * UIProcess/WebPageProxy.cpp:
3070         (WebKit::WebPageProxy::handleSynchronousMessage):
3071         (WebKit::WebPageProxy::hasInsecureContent):
3072         (WebKit::WebPageProxy::accessibilityScreenToRootView):
3073         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
3074         (WebKit::WebPageProxy::printFrame):
3075         (WebKit::WebPageProxy::backForwardGoToItem):
3076         (WebKit::WebPageProxy::backForwardGoToItemShared):
3077         (WebKit::WebPageProxy::backForwardItemAtIndex):
3078         (WebKit::WebPageProxy::backForwardBackListCount):
3079         (WebKit::WebPageProxy::backForwardForwardListCount):
3080         (WebKit::WebPageProxy::canUndoRedo):
3081         (WebKit::WebPageProxy::executeUndoRedo):
3082         (WebKit::WebPageProxy::checkTextOfParagraph):
3083         (WebKit::WebPageProxy::checkSpellingOfString):
3084         (WebKit::WebPageProxy::checkGrammarOfString):
3085         (WebKit::WebPageProxy::spellingUIIsShowing):
3086         (WebKit::WebPageProxy::getGuessesForWord):
3087         (WebKit::WebPageProxy::substitutionsPanelIsShowing):
3088         (WebKit::WebPageProxy::showCorrectionPanel):
3089         (WebKit::WebPageProxy::dismissCorrectionPanel):
3090         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
3091         (WebKit::WebPageProxy::recordAutocorrectionResponse):
3092         (WebKit::WebPageProxy::dictationAlternatives):
3093         (WebKit::WebPageProxy::wrapCryptoKey):
3094         (WebKit::WebPageProxy::unwrapCryptoKey):
3095         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
3096         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
3097         (WebKit::WebPageProxy::speechSynthesisVoiceList):
3098         (WebKit::WebPageProxy::printMainFrame): Deleted.
3099         * UIProcess/WebPageProxy.h:
3100         * UIProcess/WebPageProxy.messages.in:
3101         * UIProcess/gtk/WebPageProxyGtk.cpp:
3102         (WebKit::WebPageProxy::createPluginContainer):
3103         * UIProcess/ios/WebPageProxyIOS.mm:
3104         (WebKit::WebPageProxy::interpretKeyEvent):
3105         * UIProcess/mac/WebPageProxyMac.mm:
3106         (WebKit::WebPageProxy::getIsSpeaking):
3107         (WebKit::WebPageProxy::executeSavedCommandBySelector):
3108         (WebKit::WebPageProxy::showPDFContextMenu):
3109
3110 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3111
3112         Stop using LegacySync messages in WebPage
3113         https://bugs.webkit.org/show_bug.cgi?id=196057
3114
3115         Reviewed by Chris Dumez.
3116
3117         * WebProcess/WebPage/WebPage.h:
3118         (WebKit::WebPage::markLayersVolatile):
3119         * WebProcess/WebPage/WebPage.messages.in:
3120         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3121         (WebKit::WebPage::getCenterForZoomGesture):
3122         * WebProcess/WebPage/ios/WebPageIOS.mm:
3123         (WebKit::WebPage::readSelectionFromPasteboard):
3124         (WebKit::WebPage::getStringSelectionForPasteboard):
3125         (WebKit::WebPage::getDataSelectionForPasteboard):
3126         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
3127         (WebKit::WebPage::acceptsFirstMouse):
3128         * WebProcess/WebPage/mac/WebPageMac.mm:
3129         (WebKit::WebPage::replaceSelectionWithPasteboardData):
3130         (WebKit::WebPage::readSelectionFromPasteboard):
3131         (WebKit::WebPage::getStringSelectionForPasteboard):
3132         (WebKit::WebPage::getDataSelectionForPasteboard):
3133         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
3134         (WebKit::WebPage::acceptsFirstMouse):
3135
3136 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3137
3138         Stop using LegacySync messages in WebPasteboardProxy
3139         https://bugs.webkit.org/show_bug.cgi?id=196060
3140
3141         Reviewed by Chris Dumez.
3142
3143         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3144         (WebKit::WebPasteboardProxy::getPasteboardTypes):
3145         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
3146         (WebKit::WebPasteboardProxy::getPasteboardStringForType):
3147         (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
3148         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
3149         (WebKit::WebPasteboardProxy::pasteboardCopy):
3150         (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
3151         (WebKit::WebPasteboardProxy::getPasteboardUniqueName):
3152         (WebKit::WebPasteboardProxy::getPasteboardColor):
3153         (WebKit::WebPasteboardProxy::getPasteboardURL):
3154         (WebKit::WebPasteboardProxy::addPasteboardTypes):
3155         (WebKit::WebPasteboardProxy::setPasteboardTypes):
3156         (WebKit::WebPasteboardProxy::setPasteboardURL):
3157         (WebKit::WebPasteboardProxy::setPasteboardColor):
3158         (WebKit::WebPasteboardProxy::setPasteboardStringForType):
3159         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
3160         (WebKit::WebPasteboardProxy::getNumberOfFiles):
3161         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
3162         (WebKit::WebPasteboardProxy::writeCustomData):
3163         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
3164         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
3165         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
3166         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
3167         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
3168         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
3169         * UIProcess/WebPasteboardProxy.cpp:
3170         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
3171         (WebKit::WebPasteboardProxy::writeCustomData):
3172         * UIProcess/WebPasteboardProxy.h:
3173         * UIProcess/WebPasteboardProxy.messages.in:
3174         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
3175         (WebKit::WebPasteboardProxy::writeToClipboard):
3176         (WebKit::WebPasteboardProxy::readFromClipboard):
3177         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
3178         (WebKit::WebPasteboardProxy::getPasteboardTypes):
3179         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
3180         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
3181         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
3182
3183 2019-03-21  Andy Estes  <aestes@apple.com>
3184
3185         [iOS] Apple Pay should be available in documents with no user agent scripts
3186         https://bugs.webkit.org/show_bug.cgi?id=196061
3187         <rdar://problem/48649391>
3188
3189         Reviewed by Brady Eidson.
3190
3191         * Shared/AuxiliaryProcess.h:
3192         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
3193         (WebKit::AuxiliaryProcess::parentProcessHasEntitlement):
3194
3195         Added a convenience function for checking parent process entitlements.
3196
3197         * Shared/WebPreferences.yaml:
3198         * Shared/WebPreferencesDefaultValues.h:
3199         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3200         (-[WKWebViewConfiguration init]):
3201
3202         Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
3203
3204         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
3205         (WebKit::WebPaymentCoordinator::supportsUnrestrictedApplePay const):
3206         * WebProcess/ApplePay/WebPaymentCoordinator.h:
3207
3208         Implemented supportsUnrestrictedApplePay by checking for the
3209         com.apple.private.WebKit.UnrestrictedApplePay entitlement on platforms that enable
3210         APPLE_PAY_REMOTE_UI.
3211
3212         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
3213         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3214         (didClearWindowObjectForFrame):
3215         (setUpPageLoaderClient):
3216
3217         Added injected bundle SPI that TestWebKitAPI uses to inject the WebCore Internals interface.
3218
3219         * WebProcess/WebPage/WebPage.cpp:
3220         (WebKit::WebPage::runJavaScript):
3221
3222         Changed to call ScriptController::executeUserAgentScriptInWorld.
3223
3224 2019-03-21  Chris Dumez  <cdumez@apple.com>
3225
3226         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store
3227         https://bugs.webkit.org/show_bug.cgi?id=196041
3228         <rdar://problem/49083230>
3229
3230         Reviewed by Alex Christensen.
3231
3232         WebKit should throw when trying to create a WKWebView with a related view that is using a different data store.
3233         We do not support having several WebsiteDataStores sharing the same WebProcess.
3234
3235         * UIProcess/API/Cocoa/WKWebView.mm:
3236         (-[WKWebView _initializeWithConfiguration:]):
3237         * UIProcess/WebProcessPool.cpp:
3238         (WebKit::WebProcessPool::createWebPage):
3239
3240 2019-03-21  Alex Christensen  <achristensen@webkit.org>
3241
3242         Add SPI to inform applications of WKContentRuleList actions
3243         https://bugs.webkit.org/show_bug.cgi?id=195965
3244         <rdar://problem/42664365>
3245
3246         Reviewed by Geoff Garen.
3247
3248         * NetworkProcess/NetworkLoadChecker.cpp:
3249         (WebKit::NetworkLoadChecker::checkRequest):
3250         (WebKit::NetworkLoadChecker::processContentRuleListsForLoad):
3251         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): Deleted.
3252         * NetworkProcess/NetworkLoadChecker.h:
3253         * UIProcess/API/APINavigationClient.h:
3254         (API::NavigationClient::contentRuleListNotification):
3255         * UIProcess/API/C/WKPage.cpp:
3256         (WKPageSetPageNavigationClient):
3257         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3258         * UIProcess/Cocoa/NavigationState.h:
3259         * UIProcess/Cocoa/NavigationState.mm:
3260         (WebKit::NavigationState::setNavigationDelegate):
3261         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
3262         * UIProcess/WebPageProxy.cpp:
3263         (WebKit::WebPageProxy::contentRuleListNotification):
3264         * UIProcess/WebPageProxy.h:
3265         * UIProcess/WebPageProxy.messages.in:
3266         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3267         (WebKit::WebChromeClient::contentRuleListNotification):
3268         * WebProcess/WebCoreSupport/WebChromeClient.h:
3269
3270 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
3271
3272         Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
3273         https://bugs.webkit.org/show_bug.cgi?id=196058
3274         rdar://problem/49078202
3275
3276         Reviewed by Antti Koivisto.
3277
3278         Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
3279         on by default.
3280
3281         * Shared/WebPreferences.yaml:
3282
3283 2019-03-21  Antti Koivisto  <antti@apple.com>
3284
3285         UI-process hit-testing needs to know about containing block relationships
3286         https://bugs.webkit.org/show_bug.cgi?id=195845
3287         <rdar://problem/48949633>
3288
3289         Reviewed by Simon Fraser.
3290
3291         Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
3292
3293         When an overflow scroller contains a positioned element the element may not be on a descendant layer of the scroller,
3294         yet should move along with it. This needs to be taken into account in UI-side hit testing.
3295
3296         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3297         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const):
3298         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID):
3299         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs):
3300
3301         Maintain non-ancestor scrolling relationships for layers.
3302
3303         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3304         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
3305         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
3306         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3307         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3308         (WebKit::isScrolledBy):
3309
3310         Helper to figure out who scrolls who.
3311
3312         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
3313         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3314         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
3315
3316         After commit, pull the non-ancestor scrolling relationships from the scrolling tree and update the layer tree.
3317
3318 2019-03-21  Daniel Bates  <dabates@apple.com>
3319
3320         [iOS] Inline -_ensureFormAccessoryView into -formAccessoryView and have -_updateAccessory ensure we have a form accessory
3321         https://bugs.webkit.org/show_bug.cgi?id=196021
3322
3323         Reviewed by Wenson Hsieh.
3324
3325         Every caller of -_ensureFormAccessoryView, except -formAccessoryView, immediately follows the call
3326         with a call to -_updateAccessory. Let's just have -_updateAccessory ensure we have a form accessory
3327         view and inline the implementation of -_ensureFormAccessoryView into -formAccessoryView so we can
3328         remove one method.
3329
3330         * UIProcess/ios/WKContentViewInteraction.mm:
3331         (-[WKContentView inputView]): Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
3332         the equivalent work for us.
3333         (-[WKContentView formAccessoryView]): Moved implementation of -_ensureFormAccessoryView into here.
3334         (-[WKContentView _updateAccessory]): Call self.formAccessoryView to ensure we have a form accessory view.
3335         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3336         Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
3337         the equivalent work for us.
3338         (-[WKContentView _ensureFormAccessoryView]): Deleted.
3339
3340 2019-03-21  Shawn Roberts  <sroberts@apple.com>
3341
3342         Unreviewed, rolling out r243250.
3343
3344         Causing 109 Failures and 2 crashes on iOS Sim Debug
3345         OpenSource/Internal queues
3346
3347         Reverted changeset:
3348
3349         "[iOS WK2] Turn on async overflow scrolling by default"
3350         https://bugs.webkit.org/show_bug.cgi?id=196011
3351         https://trac.webkit.org/changeset/243250
3352
3353 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
3354
3355         Fix possible memory leak when dismissing a color picker
3356         https://bugs.webkit.org/show_bug.cgi?id=196026
3357         <rdar://problem/48778568>
3358
3359         Reviewed by Wenson Hsieh.
3360
3361         Fix a problem with WebPageProxy::endColorPicker where an early return could leave a color picker
3362         with a +1 reference count after dismissing it.
3363
3364         * UIProcess/WebColorPicker.cpp:
3365         (WebKit::WebColorPicker::endPicker):
3366         * UIProcess/WebPageProxy.cpp:
3367         (WebKit::WebPageProxy::endColorPicker):
3368         (WebKit::WebPageProxy::didEndColorPicker):
3369
3370 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3371
3372         [GTK][WPE] Add API to provide geolocation information
3373         https://bugs.webkit.org/show_bug.cgi?id=195940
3374
3375         Reviewed by Michael Catanzaro.
3376
3377         Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
3378         been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.
3379
3380         * PlatformGTK.cmake:
3381         * PlatformWPE.cmake:
3382         * SourcesGTK.txt:
3383         * SourcesWPE.txt:
3384         * UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
3385         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
3386         (webkit_geolocation_position_new):
3387         (webkit_geolocation_position_copy):
3388         (webkit_geolocation_position_free):
3389         (webkit_geolocation_position_set_timestamp):
3390         (webkit_geolocation_position_set_altitude):
3391         (webkit_geolocation_position_set_altitude_accuracy):
3392         (webkit_geolocation_position_set_heading):
3393         (webkit_geolocation_position_set_speed):
3394         (webkitGeolocationManagerStop):
3395         (webkitGeolocationManagerSetEnableHighAccuracy):
3396         (webkitGeolocationManagerCreate):
3397         (webkitGeolocationManagerGetProperty):
3398         (webkit_geolocation_manager_class_init):
3399         (webkit_gelocation_manager_update_position):
3400         (webkit_gelocation_manager_failed):
3401         (webkit_geolocation_manager_get_enable_high_accuracy):
3402         * UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
3403         * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
3404         * UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
3405         * UIProcess/API/glib/WebKitWebContext.cpp:
3406         (webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
3407         (webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
3408         * UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
3409         * UIProcess/API/gtk/WebKitWebContext.h:
3410         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3411         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
3412         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3413         * UIProcess/API/gtk/webkit2.h:
3414         * UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
3415         * UIProcess/API/wpe/WebKitWebContext.h:
3416         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
3417         * UIProcess/API/wpe/docs/wpe-docs.sgml:
3418         * UIProcess/API/wpe/webkit.h:
3419
3420 2019-03-20  Youenn Fablet  <youenn@apple.com>
3421
3422         Compute quota after network process restart based on default quota and space used
3423         https://bugs.webkit.org/show_bug.cgi?id=195804
3424
3425         Reviewed by Chris Dumez.
3426
3427         Make sure that Cache Storage quota user waits to declare as initialized to its manager
3428         until all data is loaded so that it can report a valid space used from the start.
3429
3430         Add test API to reset the quota to its default value and compute it according current space use.
3431
3432         * NetworkProcess/NetworkProcess.cpp:
3433         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
3434         * NetworkProcess/NetworkProcess.h:
3435         * NetworkProcess/NetworkProcess.messages.in:
3436         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3437       &n