Unreviewed, silence -Wpragmas warning
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3         Unreviewed, silence -Wpragmas warning
4
5         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
6
7 2018-12-19  Vivek Seth  <v_seth@apple.com>
8
9         HTTPS Upgrade: Use full sqlite upgrade list
10         https://bugs.webkit.org/show_bug.cgi?id=192736
11         <rdar://problem/45851427>
12
13         Reviewed by Chris Dumez.
14
15         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Added.
16         (WebKit::NetworkHTTPSUpgradeCheckerDatabasePath):
17         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
18         (WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker):
19         (WebKit::NetworkHTTPSUpgradeChecker::query):
20         (WebKit::NetworkHTTPSUpgradeChecker::isAlwaysOnLoggingAllowed const):
21         * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added.
22         (WebKit::NetworkHTTPSUpgradeChecker::didSetupCompleteSuccessfully const):
23         * NetworkProcess/NetworkLoadChecker.cpp:
24         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
25         (WebKit::NetworkLoadChecker::checkRequest):
26         * NetworkProcess/NetworkLoadChecker.h:
27         * NetworkProcess/NetworkProcess.h:
28         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
29         * Sources.txt:
30         * WebKit.xcodeproj/project.pbxproj:
31
32 2018-12-19  Tim Horton  <timothy_horton@apple.com>
33
34         Use delegate instead of drawingDelegate in WKDrawingView
35         https://bugs.webkit.org/show_bug.cgi?id=192899
36         <rdar://problem/46733339>
37
38         Reviewed by Wenson Hsieh.
39
40         * UIProcess/ios/WKDrawingView.mm:
41         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
42         Do the dance.
43
44 2018-12-19  Alex Christensen  <achristensen@webkit.org>
45
46         Navigations away from the SafeBrowsing interstitial show a flash of old content
47         https://bugs.webkit.org/show_bug.cgi?id=192676
48
49         Reviewed by Chris Dumez.
50
51         When a user clicks through a safe browsing warning, do not remove the warning until content is drawn for the destination.
52         Otherwise, the user will confusingly see the page before the warning while the navigation happens.
53         We can only do this for warnings caused by main frame navigations, though.  Other warnings (such as those caused by iframes)
54         need to be cleared immediately, and we still need to clear the warning immediately if the user has said to go back.
55
56         This change is reflected in an updated API test.
57
58         * UIProcess/API/Cocoa/WKWebView.mm:
59         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
60         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
61         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
62         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
63         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
64         (-[WKSafeBrowsingWarning forMainFrameNavigation]):
65         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
66         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
67         * UIProcess/Cocoa/WebViewImpl.h:
68         * UIProcess/Cocoa/WebViewImpl.mm:
69         (WebKit::WebViewImpl::showSafeBrowsingWarning):
70         (WebKit::WebViewImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
71         * UIProcess/PageClient.h:
72         (WebKit::PageClient::clearSafeBrowsingWarningIfForMainFrameNavigation):
73         * UIProcess/SafeBrowsingWarning.h:
74         (WebKit::SafeBrowsingWarning::create):
75         (WebKit::SafeBrowsingWarning::forMainFrameNavigation const):
76         * UIProcess/WebPageProxy.cpp:
77         (WebKit::WebPageProxy::didReachLayoutMilestone):
78         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
79         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
80         * UIProcess/WebPageProxy.h:
81         * UIProcess/ios/PageClientImplIOS.h:
82         * UIProcess/mac/PageClientImplMac.h:
83         * UIProcess/mac/PageClientImplMac.mm:
84         (WebKit::PageClientImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
85
86 2018-12-19  Tim Horton  <timothy_horton@apple.com>
87
88         UI process crash when focusing an editable image
89         https://bugs.webkit.org/show_bug.cgi?id=192839
90         <rdar://problem/46786670>
91
92         Reviewed by Wenson Hsieh.
93
94         * SourcesCocoa.txt:
95         * UIProcess/ios/WKContentViewInteraction.h:
96         * UIProcess/ios/WKContentViewInteraction.mm:
97         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
98         (-[WKContentView inputView]):
99         (-[WKContentView requiresAccessoryView]):
100         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
101         (-[WKContentView _stopAssistingNode]):
102         (-[WKContentView _installInkPickerForDrawingViewWithID:]):
103         (-[WKContentView _uninstallInkPicker]):
104         * UIProcess/ios/WKInkPickerView.h: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.h.
105         * UIProcess/ios/WKInkPickerView.mm: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.mm.
106         (-[WKInkPickerView initWithDrawingView:]):
107         (-[WKInkPickerView didPickInk]):
108         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
109         (-[WKInkPickerView inlineInkPicker:didSelectTool:]):
110         (-[WKInkPickerView inlineInkPicker:didSelectColor:]):
111         (-[WKInkPickerView inkPickerSize]):
112         (-[WKInkPickerView layoutSubviews]):
113         (-[WKInkPickerView sizeThatFits:]):
114         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
115         * WebKit.xcodeproj/project.pbxproj:
116         Make WKInkPickerView a WKWebView subview instead of an inputView.
117         Also, don't force the keyboard to be visible when an editable image is focused.
118
119 2018-12-19  Eric Carlson  <eric.carlson@apple.com>
120
121         [MediaStream] Force system camera/microphone TCC prompt if necessary
122         https://bugs.webkit.org/show_bug.cgi?id=192820
123         <rdar://problem/42680098>
124
125         Reviewed by Jer Noble.
126
127         * UIProcess/Cocoa/UIDelegate.mm:
128         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Enable TCC check 
129         and prompt on Mojave.
130
131 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
132
133         Allow clients to set the navigator platform
134         https://bugs.webkit.org/show_bug.cgi?id=192735
135
136         Reviewed by Tim Horton.
137
138         Add private API to allow clients to override the default navigator
139         platform. Some websites check for the platform, which 
140         interfears with our request desktop site feature. This should
141         help more sites function as expected.
142
143         * Shared/WebsitePoliciesData.cpp:
144         (WebKit::WebsitePoliciesData::encode const):
145         (WebKit::WebsitePoliciesData::decode):
146         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
147         * Shared/WebsitePoliciesData.h:
148         * UIProcess/API/APIWebsitePolicies.cpp:
149         (API::WebsitePolicies::data):
150         * UIProcess/API/APIWebsitePolicies.h:
151         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
152         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
153         (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
154         (-[_WKWebsitePolicies customNavigatorPlatform]):
155         * UIProcess/Cocoa/NavigationState.mm:
156         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
157
158 2018-12-19  Truitt Savell  <tsavell@apple.com>
159
160         Unreviewed, rolling out r239358.
161
162         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
163         crash on Debug bots
164
165         Reverted changeset:
166
167         "Clean up IndexedDB files between tests"
168         https://bugs.webkit.org/show_bug.cgi?id=192796
169         https://trac.webkit.org/changeset/239358
170
171 2018-12-18  Alex Christensen  <achristensen@webkit.org>
172
173         REGRESSION(r239134) iOS safe browsing warning unable to show details
174         https://bugs.webkit.org/show_bug.cgi?id=192837
175
176         Reviewed by Tim Horton.
177
178         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
179         (-[WKSafeBrowsingWarning addContent]):
180         I had a fragile design that relied on the internal view heirarchy structure of UIScrollView,
181         which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy.
182         I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to.
183         Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave
184         differently in TestWebKitAPI, but I verified manually that this fixes the issue.
185
186 2018-12-18  Fujii Hironori  <Hironori.Fujii@sony.com>
187
188         [Win][Clang] Fix compilation warnings under Source/WebKit directory
189         https://bugs.webkit.org/show_bug.cgi?id=192695
190
191         Reviewed by Alex Christensen.
192
193         * NetworkProcess/cache/NetworkCacheData.cpp:
194         (makeSalt): Enclosed by #if !OS(WINDOWS).
195         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
196         (WebKit::NetworkCache::directoryEntryType): Ditto.
197         * Platform/win/ModuleWin.cpp:
198         (WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast<void*>().
199         * UIProcess/DrawingAreaProxyImpl.cpp:
200         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
201         Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK).
202         * UIProcess/DrawingAreaProxyImpl.h: Ditto.
203         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
204         (WebKit::processName): Removed the duplicated 'const' type qualifier.
205         * UIProcess/win/WebInspectorProxyWin.cpp:
206         (WebKit::WebInspectorProxy::platformAttach): Removed an unused variable.
207         (WebKit::WebInspectorProxy::platformDetach): Ditto.
208         * UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto.
209         * UIProcess/win/WebView.cpp:
210         (WebKit::WebView::paint): Ditto.
211         (WebKit::WebPopupMenu::setUpPlatformData): Ditto.
212         * UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'.
213         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto.
214         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable.
215
216 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
217
218         [macOS] fast/forms/datalist/datalist-textinput-suggestions-order.html sometimes crashes after r239337
219         https://bugs.webkit.org/show_bug.cgi?id=192836
220         <rdar://problem/45321184>
221
222         Reviewed by Tim Horton.
223
224         r239337 exposed a subtle issue in the implementation of `-[WKDataListSuggestionsView updateWithInformation:]`,
225         wherein we might end up recomputing information for table view cells at rows that no longer exist. This currently
226         happens because we first set the datalist's `_suggestions`, then change the table view's frame, and then finally
227         reload the table view; however, in the case where the number of suggestions decreased and the frame changed
228         (which prompts AppKit to ask us again for table cell views), we'll attempt to access an out-of-bounds index in
229         the `_suggestions` vector.
230
231         To address this, we change our suggestions and immediately reload the table view before updating `NSTableView`'s
232         frame, so that we only provide table view cells for rows that actually correspond to items in `_suggestions`.
233
234         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
235         (-[WKDataListSuggestionsView updateWithInformation:]):
236
237 2018-12-18  Jiewen Tan  <jiewen_tan@apple.com>
238
239         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
240         https://bugs.webkit.org/show_bug.cgi?id=192061
241
242         Reviewed by Dewei Zhu.
243
244         Part 4.
245
246         Add some additional temporary logging info to determine if the time out value passed to the timer is right.
247         Once the bug is determined and fixed, we should remove all logging added in this patch.
248
249         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
250         (WebKit::AuthenticatorManager::initTimeOutTimer):
251
252 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
253
254         Clean up IndexedDB files between tests
255         https://bugs.webkit.org/show_bug.cgi?id=192796
256
257         Reviewed by Geoffrey Garen.
258
259         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
260         (WKWebsiteDataStoreRemoveAllIndexedDatabasesSync):
261         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
262
263 2018-12-18  Vivek Seth  <v_seth@apple.com>
264
265         HTTPS Upgrade: Scripts / preprocessing necessary to create new database in future
266         https://bugs.webkit.org/show_bug.cgi?id=192612
267         <rdar://problem/46651207>
268
269         Reviewed by Andy Estes.
270
271         * Configurations/WebKit.xcconfig:
272         * DerivedSources.make:
273         * Scripts/generate-https-upgrade-database.sh: Added.
274         * WebKit.xcodeproj/project.pbxproj:
275
276 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
277
278         Unreviewed, fix the 32-bit watchOS build after r239314
279
280         * UIProcess/API/Cocoa/WKWebView.mm:
281         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
282
283 2018-12-18  Alex Christensen  <achristensen@webkit.org>
284
285         WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click navigations
286         https://bugs.webkit.org/show_bug.cgi?id=192675
287
288         Reviewed by Geoffrey Garen.
289
290         When a safe browsing warning is being shown, WKWebView.URL should be the unsafe website, not the safe website before it.
291
292         * UIProcess/API/Cocoa/WKWebView.mm:
293         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
294         (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
295         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
296         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
297         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
298         * UIProcess/SafeBrowsingWarning.h:
299         (WebKit::SafeBrowsingWarning::create):
300         (WebKit::SafeBrowsingWarning::url const):
301         * UIProcess/WebPageProxy.cpp:
302         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
303
304 2018-12-18  Chris Dumez  <cdumez@apple.com>
305
306         Regression(r239182) SuspendedPage's process reuse for link navigation optimization sometimes broken
307         https://bugs.webkit.org/show_bug.cgi?id=192772
308
309         Reviewed by Antti Koivisto.
310
311         With r239182, if the page in the previous process would fail to enter PageCache, we would destroy
312         the corresponding SuspendedPageProxy, which would potentially terminate the process. This would
313         regress performance when trying to navigate back in history to that page. This would also regress
314         performance when link-navigating to the same domain as we would have previously reused the suspended
315         page's process for such navigation.
316
317         Address the issue by keeping the SuspendedPageProxy alive even if the WebPage fails to suspend.
318         When trying to reuse a SuspendedPageProxy, if the page failed to suspend, reuse its process but
319         not the suspended page itself.
320
321         * UIProcess/SuspendedPageProxy.cpp:
322         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
323         (WebKit::SuspendedPageProxy::waitUntilReadyToUnsuspend):
324         (WebKit::SuspendedPageProxy::unsuspend):
325         (WebKit::SuspendedPageProxy::didSuspend):
326         (WebKit::SuspendedPageProxy::didFailToSuspend):
327         (WebKit::SuspendedPageProxy::loggingString const):
328         * UIProcess/SuspendedPageProxy.h:
329         * UIProcess/WebPageProxy.cpp:
330         (WebKit::WebPageProxy::swapToWebProcess):
331         * UIProcess/WebProcessPool.cpp:
332         (WebKit::WebProcessPool::processForNavigationInternal):
333
334 2018-12-17  Jiewen Tan  <jiewen_tan@apple.com>
335
336         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
337         https://bugs.webkit.org/show_bug.cgi?id=192061
338
339         Reviewed by Dewei Zhu.
340
341         Part 3.
342
343         Add some additional temporary logging info to determine if the timer is working as expected.
344         Once the bug is determined and fixed, we should remove all logging added in this patch.
345
346         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
347         (WebKit::AuthenticatorManager::respondReceived):
348         (WebKit::AuthenticatorManager::initTimeOutTimer):
349         (WebKit::AuthenticatorManager::timeOutTimerFired):
350         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
351         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
352
353 2018-12-17  Saam barati  <sbarati@apple.com>
354
355         Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
356         https://bugs.webkit.org/show_bug.cgi?id=192374
357         <rdar://problem/46506286>
358
359         Reviewed by Alex Christensen.
360
361         This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
362         To enable on iOS, you can do something like:
363         $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
364         $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
365         
366         This patch also changes the Proxy to be enabled on a per NSURLSession
367         basis instead of a per process basis.
368
369         * NetworkProcess/NetworkProcess.cpp:
370         (WebKit::NetworkProcess::initializeNetworkProcess):
371         * NetworkProcess/NetworkSessionCreationParameters.cpp:
372         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
373         (WebKit::NetworkSessionCreationParameters::encode const):
374         (WebKit::NetworkSessionCreationParameters::decode):
375         * NetworkProcess/NetworkSessionCreationParameters.h:
376         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
377         (WebKit::proxyDictionary):
378         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
379         * NetworkProcess/mac/NetworkProcessMac.mm:
380         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
381         (WebKit::overrideSystemProxies): Deleted.
382         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
383         (-[WKWebsiteDataStore _initWithConfiguration:]):
384         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
385         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
386         (-[_WKWebsiteDataStoreConfiguration httpProxy]):
387         (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
388         (-[_WKWebsiteDataStoreConfiguration httpsProxy]):
389         (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
390         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
391         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
392         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
393         (WebKit::WebsiteDataStore::parameters):
394         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
395         (WebKit::WebsiteDataStoreConfiguration::copy):
396         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
397         (WebKit::WebsiteDataStoreConfiguration::httpProxy const):
398         (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
399         (WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
400         (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
401
402 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
403
404         Tap highlights should not be shown on iOSMac
405         https://bugs.webkit.org/show_bug.cgi?id=192797
406         <rdar://problem/46793995>
407
408         Reviewed by Tim Horton.
409
410         WKWebViews in iOSMac should avoid painting tap highlights, since tap highlights are not present in the rest of
411         the macOS platform. Simply disable this functionality by bailing in `-[WKContentView _showTapHighlight]`.
412
413         * UIProcess/ios/WKContentViewInteraction.mm:
414         (-[WKContentView _showTapHighlight]):
415
416 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
417
418         Unreviewed, fix the iOSMac engineering build again
419
420         After r239311, `WebProcessProxy::fullKeyboardAccessEnabled` in `WebProcessProxyIOS.mm` attempts to use
421         `WKFullKeyboardAccessWatcher`, which is guarded by `ENABLE(FULL_KEYBOARD_ACCESS)`. However, on iOSMac,
422         `ENABLE(FULL_KEYBOARD_ACCESS)` is 0. Fix the build by putting access to `WKFullKeyboardAccessWatcher` behind
423         `ENABLE(FULL_KEYBOARD_ACCESS)`.
424
425         * UIProcess/ios/WebProcessProxyIOS.mm:
426         (WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
427
428 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
429
430         Unreviewed, fix the iOSMac engineering build
431
432         `generateRequestID()` is only invoked from code under `ENABLE(MEDIA_STREAM)`; move it under this guard to avoid
433         an unused function warning.
434
435         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
436
437 2018-12-17  David Kilzer  <ddkilzer@apple.com>
438
439         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
440         <https://webkit.org/b/192707>
441         <rdar://problem/46734926>
442
443         Reviewed by Daniel Bates.
444
445         * WebProcess/cocoa/WebProcessCocoa.mm:
446         (WebKit::WebProcess::updateCPUMonitorState):
447         - Pass m_cpuLimit directly since getting its value causes an
448           identical std::optional<double> to be created unnecessarily.
449
450 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
451
452         [iOS] Focusing a large editable element always scrolls to the top of the element
453         https://bugs.webkit.org/show_bug.cgi?id=192745
454         <rdar://problem/46758445>
455
456         Reviewed by Tim Horton.
457
458         Currently, when focusing form controls or editable elements, we try to scroll such that the focused element rect
459         is centered within the visible area. In the case of very large focusable elements whose dimensions exceed the
460         width or height of the visible area, we instead scroll such that the top left point of the element is at the top
461         left corner of the visible area.
462
463         However, this results in unnecessary scrolling if the top of the element is already near the top of the visible
464         area. For WebKit2-based rich text editors that have an editable body element with a top content inset that
465         contains additional content, this means we will always scroll the additional content away when focusing the
466         editable body.
467
468         To avoid this behavior, adjust focused element zooming logic for editable elements that are too large to be
469         centered in the visible area, such that we only scroll the top left position of the focused element to the top
470         half or top right of the visible area, respectively. This reduces the amount of scrolling when focusing large
471         editable elements, while still making it clear which element is being focused.
472
473         * Platform/spi/ios/UIKitSPI.h:
474         * UIProcess/API/Cocoa/WKWebView.mm:
475         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
476
477         Make some small adjustments to improve the readability of this method by using `clampTo` instead of clamping
478         values by comparing and setting values.
479
480         Also, fix an existing bug wherein focusable elements that are meant to be centered within the visible area are
481         currently offset by half the difference between the bottom inset amount and the top inset amount, in the case
482         where the `_obscuredInsets` SPI is used to specify content insets for the web view (i.e., MobileSafari).
483
484         * UIProcess/API/Cocoa/WKWebViewInternal.h:
485
486         Make a couple of arguments `const FloatRect&` instead of just `FloatRect`.
487
488 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
489
490         offsetLeft and offsetParent should adjust across shadow boundaries
491         https://bugs.webkit.org/show_bug.cgi?id=157437
492         <rdar://problem/26154021>
493
494         Reviewed by Simon Fraser.
495
496         Use *forBindings variants of offsetLeft, offsetTop, and offsetParent.
497
498         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp:
499         (webkit_dom_element_get_offset_left):
500         (webkit_dom_element_get_offset_top):
501         (webkit_dom_element_get_offset_parent):
502
503 2018-12-17  Chris Fleizach  <cfleizach@apple.com>
504
505         Some builds are broken after r239262
506         https://bugs.webkit.org/show_bug.cgi?id=192777
507
508         Reviewed by Simon Fraser.
509
510         * Platform/spi/ios/AccessibilitySupportSPI.h:
511         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h:
512         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
513         (platformIsFullKeyboardAccessEnabled):
514         (-[WKFullKeyboardAccessWatcher init]):
515         Fix the build by being more clear about when it's OK to use AccessibilitySupport.
516
517 2018-12-17  Chris Dumez  <cdumez@apple.com>
518
519         Allow passing nil as session state to [WKWebView _restoreSessionState:]
520         https://bugs.webkit.org/show_bug.cgi?id=192789
521         <rdar://problem/46755277>
522
523         Reviewed by Alex Christensen.
524
525         Allow passing nil as session state to [WKWebView _restoreSessionState:] instead of crashing.
526
527         * UIProcess/API/Cocoa/WKWebView.mm:
528         (-[WKWebView _restoreSessionState:andNavigate:]):
529
530 2018-12-17  Alex Christensen  <achristensen@webkit.org>
531
532         Fix occasional null-dereference crash in WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame
533         https://bugs.webkit.org/show_bug.cgi?id=192744
534         <rdar://problem/45842668>
535
536         Reviewed by Chris Dumez.
537
538         * UIProcess/WebPageProxy.cpp:
539         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
540         Things happen.  Navigations can be null.  If they are, we shouldn't dereference pointers to them.
541
542 2018-12-17  Chris Dumez  <cdumez@apple.com>
543
544         Unreviewed, revert recent CrashReporterClient build fixes as they are no longer needed.
545
546         * Platform/cocoa/WKCrashReporter.mm:
547
548 2018-12-17  Suresh Koppisetty  <skoppisettyt@apple.com>
549
550         Rollout r235411
551         https://bugs.webkit.org/show_bug.cgi?id=192778
552         <rdar://46789485>
553
554         Disabling access to CoreServices is causing a performance
555         regression in process launch time.  See <rdar://46141878>
556
557         Reviewed by Alex Christensen.
558
559         * WebProcess/com.apple.WebProcess.sb.in:
560
561 2018-12-17  Zan Dobersek  <zdobersek@igalia.com>
562
563         Unreviewed WPE build fix after r239277.
564
565         * UIProcess/API/C/WKContext.cpp:
566         (WKContextClearCurrentModifierStateForTesting):
567         Use the WebKit:: namespace specifier as it is used across this file.
568
569 2018-12-17  Commit Queue  <commit-queue@webkit.org>
570
571         Unreviewed, rolling out r239265 and r239274.
572         https://bugs.webkit.org/show_bug.cgi?id=192765
573
574         unorm_normalize is deprecated, and broke an internal build
575         (Requested by Truitt on #webkit).
576
577         Reverted changesets:
578
579         "[GTK][WPE] Need a function to convert internal URI to display
580         ("pretty") URI"
581         https://bugs.webkit.org/show_bug.cgi?id=174816
582         https://trac.webkit.org/changeset/239265
583
584         "Fix the Apple Internal Mac build with a newer SDK"
585         https://trac.webkit.org/changeset/239274
586
587 2018-12-17  Daniel Bates  <dabates@apple.com>
588
589         Implement UIScriptController::toggleCapsLock() for iOS
590         https://bugs.webkit.org/show_bug.cgi?id=191815
591
592         Reviewed by Andy Estes.
593
594         Add test infrastructure to clear the current modifier state. We will use this to ensure that
595         the caps lock state does not persist between tests.
596
597         * UIProcess/API/C/WKContext.cpp:
598         (WKContextClearCurrentModifierStateForTesting): Added.
599         * UIProcess/API/C/WKContextPrivate.h:
600         * UIProcess/WebProcessPool.cpp:
601         (WebKit::WebProcessPool::clearCurrentModifierStateForTesting): Added.
602         * UIProcess/WebProcessPool.h:
603         * WebProcess/WebProcess.cpp:
604         (WebKit::WebProcess::clearCurrentModifierStateForTesting): Added.
605         * WebProcess/WebProcess.h:
606         * WebProcess/WebProcess.messages.in:
607
608 2018-12-17  David Kilzer  <ddkilzer@apple.com>
609
610         REGRESSION (r239262): Fix broken builds prior to Mojave
611         <https://bugs.webkit.org/show_bug.cgi?id=192373>
612         <rdar://problem/46462670>
613
614         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
615         Wrap header in ENABLE(ACCESSIBILITY_EVENTS) to fix the build.
616
617 2018-12-17  Daniel Bates  <dabates@apple.com>
618
619         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
620         https://bugs.webkit.org/show_bug.cgi?id=192633
621
622         Reviewed by Wenson Hsieh.
623
624         Update code to use the modern initializer.
625
626         * UIProcess/ios/WKWebEvent.mm:
627         (-[WKWebEvent initWithEvent:]):
628
629 2018-12-17  Matt Lewis  <jlewis3@apple.com>
630
631         Unreviewed, rolling out r239254.
632
633         This broke the Windows 10 Debug build
634
635         Reverted changeset:
636
637         "Replace many uses of String::format with more type-safe
638         alternatives"
639         https://bugs.webkit.org/show_bug.cgi?id=192742
640         https://trac.webkit.org/changeset/239254
641
642 2018-12-17  David Kilzer  <ddkilzer@apple.com>
643
644         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
645         <https://webkit.org/b/192751>
646         <rdar://problem/46771623>
647
648         Reviewed by Daniel Bates.
649
650         Change loop variables to const references to avoid unnecessary
651         copies.
652
653         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
654         (WebKit::WebSWServerConnection::~WebSWServerConnection):
655         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
656         (WebKit::RemoteLayerTreeTransaction::encode const):
657         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
658         (WebKit::toNSErrors):
659         * UIProcess/Automation/WebAutomationSession.cpp:
660         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
661         (WebKit::WebAutomationSession::performKeyboardInteractions):
662         (WebKit::WebAutomationSession::performInteractionSequence):
663         * UIProcess/Plugins/PluginProcessManager.cpp:
664         (WebKit::PluginProcessManager::getPluginProcess):
665         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
666         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
667         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
668         * UIProcess/WebPageProxy.cpp:
669         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
670         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
671         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
672         (WebKit::LocalStorageDatabaseTracker::origins const):
673         (WebKit::LocalStorageDatabaseTracker::originDetails):
674         * WebProcess/WebPage/WebPage.cpp:
675         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
676         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
677         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
678
679 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
680
681         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
682         https://bugs.webkit.org/show_bug.cgi?id=174816
683
684         Reviewed by Michael Catanzaro.
685
686         Add webkit_uri_for_display for GTK and WPE.
687
688         * PlatformGTK.cmake:
689         * PlatformWPE.cmake:
690         * SourcesGTK.txt:
691         * SourcesWPE.txt:
692         * UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
693         (webkit_uri_for_display):
694         * UIProcess/API/gtk/WebKitURIUtilities.h: Added.
695         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
696         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
697         * UIProcess/API/gtk/webkit2.h:
698         * UIProcess/API/wpe/WebKitURIUtilities.h: Added.
699         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
700         * UIProcess/API/wpe/docs/wpe-docs.sgml:
701         * UIProcess/API/wpe/webkit.h:
702
703 2018-12-17  Carlos Garcia Campos  <cgarcia@igalia.com>
704
705         [WPE] Add API to notify about frame displayed view backend callback
706         https://bugs.webkit.org/show_bug.cgi?id=192224
707
708         Reviewed by Michael Catanzaro.
709
710         Add API to add a callback to the view to be called when the view backend notifies that a frame has been
711         displayed.
712
713         * UIProcess/API/glib/WebKitWebView.cpp:
714         (FrameDisplayedCallback::FrameDisplayedCallback):
715         (FrameDisplayedCallback::~FrameDisplayedCallback):
716         (webkit_web_view_add_frame_displayed_callback):
717         (webkit_web_view_remove_frame_displayed_callback):
718         * UIProcess/API/wpe/WebKitWebView.h:
719         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
720
721 2018-12-16  Chris Fleizach  <cfleizach@apple.com>
722
723         AX: Support keyboard access preference for iOS in WebKit
724         https://bugs.webkit.org/show_bug.cgi?id=192373
725         <rdar://problem/46462670>
726
727         Reviewed by Tim Horton.
728
729         * Platform/spi/ios/AccessibilitySupportSPI.h:
730         * PlatformMac.cmake:
731         * SourcesCocoa.txt:
732         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added.
733         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added.
734         (platformIsFullKeyboardAccessEnabled):
735         (-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
736         (-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
737         (-[WKFullKeyboardAccessWatcher init]):
738         (+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
739         * UIProcess/ios/WebProcessProxyIOS.mm:
740         (WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
741         * UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed.
742         * UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed.
743         * WebKit.xcodeproj/project.pbxproj:
744
745 2018-12-16  Adrian Perez de Castro  <aperez@igalia.com>
746
747         Unreviewed follow up after r239260
748         https://bugs.webkit.org/show_bug.cgi?id=192714
749         <rdar://problem/46762407>
750
751         * Platform/win/SharedMemoryWin.cpp:
752         (WebKit::SharedMemory::allocate): Use PAGE_READWRITE directly instead
753         of going through the protectAttribute() function, which is removed
754         because it is now unused.
755
756 2018-12-16  Adrian Perez de Castro  <aperez@igalia.com>
757
758         Unify SharedMemory factory functions
759         https://bugs.webkit.org/show_bug.cgi?id=192714
760
761         Reviewed by Darin Adler.
762
763         This unifies SharedMemory so in the following way, across platforms:
764
765         - SharedMemory::create() is removed, to avoid ambiguity.
766         - SharedMemory::allocate() always allocates a new block of shared memory.
767         - SharedMemory::wrapMap() always creates a SharedMemory object which refers to an
768           existing region of memory resulting from memory-mapping a file.
769
770         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
771         (WebKit::NetworkCache::Data::tryCreateSharedMemory const): Use SharedMemory::wrapMap().
772         * Platform/SharedMemory.h: Remove the definition of SharedMemory::create(), and make
773         SharedMemory::wrapMap() available on OS(DARWIN) as well.
774         * Platform/cocoa/SharedMemoryCocoa.cpp:
775         (WebKit::SharedMemory::wrapMap): Renamed from ::create().
776         * Platform/unix/SharedMemoryUnix.cpp:
777         (WebKit::SharedMemory::allocate): Renamed from ::create().
778         * Platform/win/SharedMemoryWin.cpp:
779         (WebKit::SharedMemory::allocate): Renamed from ::create()
780         * UIProcess/API/APIContentRuleListStore.cpp:
781         (API::createExtension): Use NetworkCache::Data::tryCreateSharedMemory() instead of
782         SharedMemory::create().
783
784 2018-12-15  Chris Fleizach  <cfleizach@apple.com>
785
786         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
787         https://bugs.webkit.org/show_bug.cgi?id=192449
788         <rdar://problem/46595508>
789
790         Reviewed by Darin Adler.
791
792         Part 7: Files in UIProcess/API
793
794         * UIProcess/API/APIContentRuleListStore.cpp:
795         * UIProcess/API/APIHitTestResult.cpp:
796         * UIProcess/API/APINavigation.cpp:
797         * UIProcess/API/APIOpenPanelParameters.cpp:
798         * UIProcess/API/APIPageConfiguration.cpp:
799         * UIProcess/API/C/WKApplicationCacheManager.cpp:
800         (WKApplicationCacheManagerGetTypeID):
801         (WKApplicationCacheManagerGetApplicationCacheOrigins):
802         (WKApplicationCacheManagerDeleteEntriesForOrigin):
803         (WKApplicationCacheManagerDeleteAllEntries):
804         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
805         (WKAuthenticationDecisionListenerGetTypeID):
806         (WKAuthenticationDecisionListenerUseCredential):
807         (WKAuthenticationDecisionListenerCancel):
808         (WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue):
809         * UIProcess/API/C/WKBackForwardListItemRef.cpp:
810         (WKBackForwardListItemGetTypeID):
811         (WKBackForwardListItemCopyURL):
812         (WKBackForwardListItemCopyTitle):
813         (WKBackForwardListItemCopyOriginalURL):
814         * UIProcess/API/C/WKContext.cpp:
815         (WKContextGetTypeID):
816         (WKContextCreate):
817         (WKContextCreateWithInjectedBundlePath):
818         (WKContextCreateWithConfiguration):
819         (WKContextSetClient):
820         (WKContextSetInjectedBundleClient):
821         (WKContextSetHistoryClient):
822         (WKContextSetDownloadClient):
823         (WKContextSetConnectionClient):
824         (WKContextDownloadURLRequest):
825         (WKContextResumeDownload):
826         (WKContextSetInitializationUserDataForInjectedBundle):
827         (WKContextPostMessageToInjectedBundle):
828         (WKContextGetGlobalStatistics):
829         (WKContextAddVisitedLink):
830         (WKContextClearVisitedLinks):
831         (WKContextSetCacheModel):
832         (WKContextGetCacheModel):
833         (WKContextSetMaximumNumberOfProcesses):
834         (WKContextGetMaximumNumberOfProcesses):
835         (WKContextSetAlwaysUsesComplexTextCodePath):
836         (WKContextSetShouldUseFontSmoothing):
837         (WKContextSetAdditionalPluginsDirectory):
838         (WKContextRefreshPlugIns):
839         (WKContextRegisterURLSchemeAsEmptyDocument):
840         (WKContextRegisterURLSchemeAsSecure):
841         (WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
842         (WKContextRegisterURLSchemeAsCachePartitioned):
843         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
844         (WKContextSetDomainRelaxationForbiddenForURLScheme):
845         (WKContextSetCanHandleHTTPSServerTrustEvaluation):
846         (WKContextSetPrewarmsProcessesAutomatically):
847         (WKContextSetCustomWebContentServiceBundleIdentifier):
848         (WKContextSetDiskCacheSpeculativeValidationEnabled):
849         (WKContextPreconnectToServer):
850         (WKContextGetCookieManager):
851         (WKContextGetWebsiteDataStore):
852         (WKContextGetGeolocationManager):
853         (WKContextGetMediaSessionFocusManager):
854         (WKContextGetNotificationManager):
855         (WKContextStartMemorySampler):
856         (WKContextStopMemorySampler):
857         (WKContextAllowSpecificHTTPSCertificateForHost):
858         (WKContextDisableProcessTermination):
859         (WKContextEnableProcessTermination):
860         (WKContextSetHTTPPipeliningEnabled):
861         (WKContextWarmInitialProcess):
862         (WKContextGetStatistics):
863         (WKContextGetStatisticsWithOptions):
864         (WKContextJavaScriptConfigurationFileEnabled):
865         (WKContextSetJavaScriptConfigurationFileEnabled):
866         (WKContextGarbageCollectJavaScriptObjects):
867         (WKContextSetJavaScriptGarbageCollectorTimerEnabled):
868         (WKContextUseTestingNetworkSession):
869         (WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
870         (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
871         (WKContextClearCachedCredentials):
872         (WKContextCopyPlugInAutoStartOriginHashes):
873         (WKContextSetPlugInAutoStartOriginHashes):
874         (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
875         (WKContextSetPlugInAutoStartOrigins):
876         (WKContextSetInvalidMessageFunction):
877         (WKContextSetMemoryCacheDisabled):
878         (WKContextSetFontWhitelist):
879         (WKContextTerminateNetworkProcess):
880         (WKContextTerminateServiceWorkerProcess):
881         (WKContextGetNetworkProcessIdentifier):
882         (WKContextAddSupportedPlugin):
883         (WKContextClearSupportedPlugins):
884         (WKContextSetIDBPerOriginQuota):
885         * UIProcess/API/C/WKPage.cpp:
886         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
887         (WKPageLoadURLWithUserData):
888         (WKPageLoadURLRequestWithUserData):
889         (WKPageSetPaginationMode):
890         (WKPageGetPaginationMode):
891         (WKPageSetPageLoaderClient):
892         (WKPageSetPagePolicyClient):
893         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
894
895 2018-12-15  Darin Adler  <darin@apple.com>
896
897         Use warning-ignoring macros more consistently and simply
898         https://bugs.webkit.org/show_bug.cgi?id=192743
899
900         Reviewed by Mark Lam.
901
902         * UIProcess/ios/WKDrawingView.mm:
903         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
904         Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
905         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
906         (-[WKFullScreenWindowController _EVOrganizationName]): Ditto.
907
908         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use
909         IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END
910         because there is no need to accomodate non-clang compilers here.
911         Also use #pragma once, add a missing "explicit", and fix conditionals.
912
913 2018-12-15  Darin Adler  <darin@apple.com>
914
915         Replace many uses of String::format with more type-safe alternatives
916         https://bugs.webkit.org/show_bug.cgi?id=192742
917
918         Reviewed by Mark Lam.
919
920         * Shared/WebMemorySampler.cpp:
921         (WebKit::WebMemorySampler::writeHeaders): Use makeString.
922
923         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
924         (WebKit::LocalAuthenticator::makeCredential): Use string concatentation.
925
926         * UIProcess/WebInspectorUtilities.cpp:
927         (WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
928         * UIProcess/WebProcessPool.cpp:
929         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
930         (WebKit::WebProcessPool::startMemorySampler): Ditto.
931
932 2018-12-14  Ryan Haddad  <ryanhaddad@apple.com>
933
934         Unreviewed, fix the build with recent SDKs.
935
936         * UIProcess/ios/WKDrawingView.mm:
937         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
938
939 2018-12-14  Jiewen Tan  <jiewen_tan@apple.com>
940
941         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
942         https://bugs.webkit.org/show_bug.cgi?id=192061
943
944         Reviewed by Dewei Zhu.
945
946         Part 2.
947
948         Add some additional temporary logging info. Since the failure cannot be reproduced easily by human, we have to
949         rely on the test infrastructure to reporoduce it. Once the bug is determined and fixed, we should remove all
950         logging added in this patch.
951
952         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
953         (WebKit::HidService::deviceAdded):
954         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
955         (WebKit::CtapHidAuthenticator::makeCredential):
956         (WebKit::CtapHidAuthenticator::getAssertion):
957         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
958         (WebKit::CtapHidDriver::Worker::write):
959         (WebKit::CtapHidDriver::Worker::read):
960         (WebKit::CtapHidDriver::Worker::returnMessage):
961         (WebKit::CtapHidDriver::transact):
962         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
963         (WebKit::CtapHidDriver::continueAfterResponseReceived):
964
965 2018-12-14  Adrian Perez de Castro  <aperez@igalia.com>
966
967         [GTK] Unreviewed build fix.
968
969         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Add missing WebPolicyAction.h include.
970
971 2018-12-14  Chris Dumez  <cdumez@apple.com>
972
973         Unreviewed, fix assertion failure in API test after r239210.
974
975         * WebProcess/WebPage/WebPage.cpp:
976         (WebKit::WebPage::createDocumentLoader):
977
978 2018-12-14  Adrian Perez de Castro  <aperez@igalia.com>
979
980         [SOUP] Unreviewed build fix after r239219
981
982         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
983         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Remove
984         handling of PolicyAction::Suspend, which is no longer available.
985
986 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
987
988         Unreviewed, apply post-landing review comments after r239221.
989
990         * UIProcess/WebPageDebuggable.cpp:
991         (WebKit::WebPageDebuggable::url const):
992         Switch to WTF::blankURL() instead of using "about:blank" directly.
993
994 2018-12-14  Chris Dumez  <cdumez@apple.com>
995
996         [PSON] Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls
997         https://bugs.webkit.org/show_bug.cgi?id=192704
998
999         Reviewed by Geoffrey Garen.
1000
1001         Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls. This
1002         is because we were failing to pass the ShouldTreatAsContinuingLoad flag to the WebContent process when
1003         doing a LoadData.
1004
1005         * UIProcess/WebPageProxy.cpp:
1006         (WebKit::WebPageProxy::loadData):
1007         (WebKit::WebPageProxy::loadDataWithNavigation):
1008         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1009         * UIProcess/WebPageProxy.h:
1010         * WebProcess/WebPage/WebPage.cpp:
1011         (WebKit::WebPage::loadDataImpl):
1012         (WebKit::WebPage::loadData):
1013         (WebKit::WebPage::loadAlternateHTML):
1014         * WebProcess/WebPage/WebPage.h:
1015
1016 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
1017
1018         Web Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url
1019         https://bugs.webkit.org/show_bug.cgi?id=192691
1020         <rdar://problem/46719798>
1021
1022         Reviewed by Darin Adler.
1023
1024         * UIProcess/WebPageDebuggable.cpp:
1025         (WebKit::WebPageDebuggable::url const):
1026         Instead of an empty string, return "about:blank" in bail cases.
1027         When inspecting the page that matches the contents.
1028
1029 2018-12-14  Chris Dumez  <cdumez@apple.com>
1030
1031         [PSON] Stop exposing PolicyAction::Suspend to WebCore
1032         https://bugs.webkit.org/show_bug.cgi?id=192701
1033
1034         Reviewed by Brady Eidson.
1035
1036         Introduce a new WebPolicyAction enum that is used at WebKit2 layer and augments
1037         WebCore::PolicyAction with a "Suspend" value.
1038
1039         * NetworkProcess/NetworkDataTaskBlob.cpp:
1040         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
1041         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1042         (toNSURLSessionResponseDisposition):
1043         * Shared/WebPolicyAction.h: Added.
1044         * UIProcess/WebFramePolicyListenerProxy.cpp:
1045         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
1046         (WebKit::WebFramePolicyListenerProxy::use):
1047         (WebKit::WebFramePolicyListenerProxy::download):
1048         (WebKit::WebFramePolicyListenerProxy::ignore):
1049         * UIProcess/WebFramePolicyListenerProxy.h:
1050         * UIProcess/WebFrameProxy.cpp:
1051         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
1052         * UIProcess/WebFrameProxy.h:
1053         * UIProcess/WebPageProxy.cpp:
1054         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1055         (WebKit::WebPageProxy::receivedPolicyDecision):
1056         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1057         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1058         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1059         (WebKit::WebPageProxy::decidePolicyForResponse):
1060         * UIProcess/WebPageProxy.h:
1061         * UIProcess/WebPageProxy.messages.in:
1062         * WebKit.xcodeproj/project.pbxproj:
1063         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1064         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1065         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1066         * WebProcess/WebPage/WebFrame.cpp:
1067         (WebKit::toPolicyAction):
1068         (WebKit::WebFrame::didReceivePolicyDecision):
1069         * WebProcess/WebPage/WebFrame.h:
1070         * WebProcess/WebPage/WebPage.cpp:
1071         (WebKit::WebPage::didReceivePolicyDecision):
1072         * WebProcess/WebPage/WebPage.h:
1073         * WebProcess/WebPage/WebPage.messages.in:
1074
1075 2018-12-14  David Quesada  <david_quesada@apple.com>
1076
1077         Remove a global 'using namespace WebKit' in WebViewImpl.mm
1078         https://bugs.webkit.org/show_bug.cgi?id=192690
1079
1080         Reviewed by Tim Horton.
1081
1082         * UIProcess/Cocoa/WebViewImpl.mm:
1083         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
1084         (-[WKTextListTouchBarViewController _selectList:]):
1085         (-[WKTextListTouchBarViewController setCurrentListType:]):
1086         (-[WKTextTouchBarItemController initWithWebViewImpl:]):
1087
1088 2018-12-14  Chris Dumez  <cdumez@apple.com>
1089
1090         [PSON] WebsitePolicies are lost on process-swap
1091         https://bugs.webkit.org/show_bug.cgi?id=192694
1092         <rdar://problem/46715748>
1093
1094         Reviewed by Brady Eidson.
1095
1096         In case of process-swap on navigation, instead of sending the websitePolicies to the old
1097         process, send them to the new process as we trigger the navigation. We tell the new process
1098         that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.
1099
1100         * Shared/LoadParameters.cpp:
1101         (WebKit::LoadParameters::encode const):
1102         (WebKit::LoadParameters::decode):
1103         * Shared/LoadParameters.h:
1104         * UIProcess/WebPageProxy.cpp:
1105         (WebKit::WebPageProxy::reattachToWebProcessForReload):
1106         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1107         (WebKit::WebPageProxy::loadRequestWithNavigation):
1108         (WebKit::WebPageProxy::loadDataWithNavigation):
1109         (WebKit::WebPageProxy::goToBackForwardItem):
1110         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1111         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1112         * UIProcess/WebPageProxy.h:
1113         * WebProcess/WebPage/WebPage.cpp:
1114         (WebKit::WebPage::loadRequest):
1115         (WebKit::WebPage::loadDataImpl):
1116         (WebKit::WebPage::loadData):
1117         (WebKit::WebPage::loadAlternateHTML):
1118         (WebKit::WebPage::goToBackForwardItem):
1119         (WebKit::WebPage::createDocumentLoader):
1120         * WebProcess/WebPage/WebPage.h:
1121         * WebProcess/WebPage/WebPage.messages.in:
1122
1123 2018-12-14  Patrick Griffis  <pgriffis@igalia.com>
1124
1125         [GTK][WPE] Fix forwarding webkit socket to flatpak sandbox
1126         https://bugs.webkit.org/show_bug.cgi?id=192622
1127
1128         Reviewed by Michael Catanzaro.
1129
1130         This fixes running with the sandbox enabled in Flatpak.
1131
1132         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
1133         (WebKit::flatpakSpawn):
1134         * UIProcess/Launcher/glib/FlatpakLauncher.h:
1135         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1136         (WebKit::ProcessLauncher::launchProcess):
1137
1138 2018-12-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1139
1140         [WPE] Use new view state API from libwpe
1141         https://bugs.webkit.org/show_bug.cgi?id=191906
1142
1143         Reviewed by Žan Doberšek.
1144
1145         Remove WKViewSetViewState from the C API.
1146
1147         * UIProcess/API/C/wpe/WKAPICastWPE.h:
1148         * UIProcess/API/C/wpe/WKView.cpp:
1149         * UIProcess/API/C/wpe/WKView.h:
1150         * UIProcess/API/wpe/WPEView.cpp:
1151         (WKWPE::View::View): Add implementation for activity_state_changed vfunc of the view backend client.):
1152         (WKWPE::View::setViewState): Remove the default flags.
1153         * UIProcess/API/wpe/WPEView.h:
1154         (WKWPE::View::setViewState const): Make it private.
1155
1156 2018-12-13  Joseph Pecoraro  <pecoraro@apple.com>
1157
1158         [iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
1159         https://bugs.webkit.org/show_bug.cgi?id=192689
1160         <rdar://problem/46323610>
1161
1162         Reviewed by Simon Fraser.
1163
1164         * UIProcess/WebPageProxy.cpp:
1165         (WebKit::WebPageProxy::close):
1166         * UIProcess/WebPageProxy.h:
1167         Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
1168         which broadcasts it as a remote inspector target. Terminate this
1169         as soon as the WebPageProxy closes and becomes invalid.
1170
1171 2018-12-13  Chris Dumez  <cdumez@apple.com>
1172
1173         Unreviewed build fix for tvOS.
1174
1175         * Platform/cocoa/WKCrashReporter.mm:
1176
1177 2018-12-13  Chris Dumez  <cdumez@apple.com>
1178
1179         Unreviewed build fix for tvOS.
1180
1181         * Platform/cocoa/WKCrashReporter.mm:
1182
1183 2018-12-13  Chris Dumez  <cdumez@apple.com>
1184
1185         [PSON] We should not need to navigate to 'about:blank' to suspend pages
1186         https://bugs.webkit.org/show_bug.cgi?id=192668
1187         <rdar://problem/46701466>
1188
1189         Reviewed by Alex Christensen.
1190
1191         To support PageCache when process-swap on cross-site navigation is enabled,
1192         we've been navigating the previous process to 'about:blank' when swapping.
1193         This would trigger PageCaching of the page in the old process. While
1194         convenient, this design has led to a lot of bugs because we did not really
1195         want a navigation to happen in the old process.
1196
1197         To address the issue, when a WebPage is asked to suspend (for process-swap),
1198         we now attempt to add it to PageCache and save it on the current HistoryItem,
1199         *without* triggering any navigation. Any pending navigation gets cancelled
1200         and we just suspend in place.
1201
1202         Later on, when we want to go back to this HistoryItem, we simply leverage the
1203         existing WebPage::goToBackForwardItem() code path. The only subtlety is that
1204         we're actually asking the WebPage to load a HistoryItem that is the current
1205         one in the History. I had to tweak a some logic / assertions to support this
1206         as this is not something we usually do. However, it actually works with very
1207         little changes and successfully restores the PageCache entry on the current
1208         HistoryItem.
1209
1210         There is no expected overall behavior change and ProcessSwap API tests (which
1211         cover PageCache) still pass. This is merely a simpler design because it avoids
1212         navigating to about:blank.
1213
1214         * UIProcess/SuspendedPageProxy.cpp:
1215         (WebKit::SuspendedPageProxy::didSuspend):
1216         (WebKit::SuspendedPageProxy::didReceiveMessage):
1217         * UIProcess/SuspendedPageProxy.h:
1218         * UIProcess/WebPageProxy.cpp:
1219         (WebKit::WebPageProxy::didSuspendAfterProcessSwap):
1220         * UIProcess/WebPageProxy.h:
1221         * UIProcess/WebPageProxy.messages.in:
1222         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1223         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1224         * WebProcess/WebPage/WebDocumentLoader.cpp:
1225         (WebKit::WebDocumentLoader::setNavigationID):
1226         * WebProcess/WebPage/WebFrame.cpp:
1227         (WebKit::WebFrame::didReceivePolicyDecision):
1228         * WebProcess/WebPage/WebPage.cpp:
1229         (WebKit::WebPage::suspendForProcessSwap):
1230         * WebProcess/WebPage/WebPage.h:
1231         * WebProcess/cocoa/WebProcessCocoa.mm:
1232         (WebKit::origin):
1233
1234 2018-12-13  Per Arne Vollan  <pvollan@apple.com>
1235
1236         [macOS] Remove with-report from 3 services that are currently needed on macOS
1237         https://bugs.webkit.org/show_bug.cgi?id=192593
1238         <rdar://problem/46604752>
1239
1240         Reviewed by Brent Fulgham.
1241
1242         * WebProcess/com.apple.WebProcess.sb.in:
1243
1244 2018-12-13  Youenn Fablet  <youenn@apple.com>
1245
1246         On page close, WebPage::m_userMediaPermissionRequestManager is nullified too early
1247         https://bugs.webkit.org/show_bug.cgi?id=192657
1248
1249         Reviewed by Eric Carlson.
1250
1251         Instead of nullifying the manager, make it a UniqueRef and clear it on closing the page.
1252         This ensures we revoke the sandbox extensions as early as possible and keep the manager lifetime simple.
1253
1254         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1255         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager):
1256         (WebKit::UserMediaPermissionRequestManager::clear):
1257         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1258         * WebProcess/WebPage/WebPage.cpp:
1259         (WebKit::WebPage::close):
1260         * WebProcess/WebPage/WebPage.h:
1261         (WebKit::WebPage::userMediaPermissionRequestManager):
1262
1263 2018-12-13  Chris Fleizach  <cfleizach@apple.com>
1264
1265         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1266         https://bugs.webkit.org/show_bug.cgi?id=192449
1267         <rdar://problem/46595508>
1268
1269         Reviewed by Darin Adler.
1270
1271         Part 6: Files in plugin process and UI process.
1272
1273         * PluginProcess/PluginControllerProxy.cpp:
1274         * PluginProcess/PluginProcess.cpp:
1275         * PluginProcess/WebProcessConnection.cpp:
1276         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1277         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
1278         * UIProcess/mac/WebPageProxyMac.mm:
1279
1280 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
1281
1282         [MediaStream] Calculate width or height when constraints contain only the other
1283         https://bugs.webkit.org/show_bug.cgi?id=192632
1284         <rdar://problem/46665734>
1285
1286         Reviewed by Youenn Fablet.
1287
1288         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1289         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable): Deleted,
1290         replaced with videoSampleAvailable.
1291
1292         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1293         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Use original frame
1294         size if necessary when calculating new frame size.
1295
1296 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1297
1298         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1299         https://bugs.webkit.org/show_bug.cgi?id=192449
1300         <rdar://problem/46595508>
1301
1302         Reviewed by Darin Adler.
1303
1304         Part 5: Files in WebProcess folder.
1305
1306         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1307         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1308         (mediaTimeToCurrentTime):
1309         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
1310         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1311         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
1312
1313 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
1314
1315         [MSVC] Unreviewed build fix for r239080.
1316
1317         * UIProcess/WebPageProxy.cpp:
1318         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
1319
1320 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1321
1322         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1323         https://bugs.webkit.org/show_bug.cgi?id=192449
1324         <rdar://problem/46595508>
1325
1326         Reviewed by Darin Adler.
1327
1328         Part 4: Handling NetworkProcess folder.
1329
1330         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1331         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1332         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1333         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1334         * NetworkProcess/ios/NetworkProcessIOS.mm:
1335         * NetworkProcess/mac/NetworkProcessMac.mm:
1336         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1337
1338 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1339
1340         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1341         https://bugs.webkit.org/show_bug.cgi?id=192449
1342         <rdar://problem/46595508>
1343
1344         Reviewed by Tim Horton.
1345
1346         Fix iosmac build.
1347
1348         * UIProcess/ios/WKContentViewInteraction.mm:
1349         (-[WKContentView _hoverGestureRecognizerChanged:]):
1350
1351 2018-12-12  Alex Christensen  <achristensen@webkit.org>
1352
1353         Implement safe browsing in WebKit on WatchOS
1354         https://bugs.webkit.org/show_bug.cgi?id=192641
1355         <rdar://problem/46376188>
1356
1357         Reviewed by Geoff Garen.
1358
1359         WatchOS has a few special requirements:
1360         1. The margin size needs to be smaller and the title font smaller to fit on the screen.
1361         2. The exclamation point cannot be beside the title or it won't fit on the screen.  I put it above the title.
1362         3. The application must be told when the safe browsing warning has been shown.  I added a new delegate callback.
1363         4. The UIScrollView's contentSize must be set even before the details are shown to be able to scroll down to the buttons.
1364            This was already an issue on small WKWebViews on iOS, so this fixes both operating systems.
1365
1366         * Configurations/WebKit.xcconfig:
1367         * UIProcess/API/APIUIClient.h:
1368         (API::UIClient::didShowSafeBrowsingWarning):
1369         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1370         * UIProcess/Cocoa/UIDelegate.h:
1371         * UIProcess/Cocoa/UIDelegate.mm:
1372         (WebKit::UIDelegate::setDelegate):
1373         (WebKit::UIDelegate::UIClient::didShowSafeBrowsingWarning):
1374         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1375         (fontOfSize):
1376         (buttonSize):
1377         (-[WKSafeBrowsingWarning addContent]):
1378         (-[WKSafeBrowsingWarning showDetailsClicked]):
1379         (-[WKSafeBrowsingWarning updateContentSize]):
1380         (buttonWidth): Deleted.
1381         * UIProcess/WebPageProxy.cpp:
1382         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1383
1384 2018-12-12  Commit Queue  <commit-queue@webkit.org>
1385
1386         Unreviewed, rolling out r239129 and r239131.
1387         https://bugs.webkit.org/show_bug.cgi?id=192646
1388
1389         Casued macOS and iOS Debug testing to fail early (Requested by
1390         Truitt on #webkit).
1391
1392         Reverted changesets:
1393
1394         "Unreviewed build fix for WinCairo Debug after r239080(?)."
1395         https://trac.webkit.org/changeset/239129
1396
1397         "Unreviewed fix for Cocoa Debug test instability following
1398         r239129."
1399         https://trac.webkit.org/changeset/239131
1400
1401 2018-12-12  Vivek Seth  <v_seth@apple.com>
1402
1403         HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
1404         https://bugs.webkit.org/show_bug.cgi?id=192375
1405         <rdar://problem/45851159>
1406
1407         Reviewed by Chris Dumez.
1408
1409         Use simulated redirect to tell clients that HTTPS Upgrade happened.
1410
1411         * NetworkProcess/NetworkLoadChecker.cpp:
1412         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1413         (WebKit::NetworkLoadChecker::checkRedirection):
1414         (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler):
1415         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
1416         (WebKit::NetworkLoadChecker::checkRequest):
1417         (WebKit::NetworkLoadChecker::continueCheckingRequestOrDoSyntheticRedirect):
1418         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1419         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded): Deleted.
1420         * NetworkProcess/NetworkLoadChecker.h:
1421         * NetworkProcess/NetworkResourceLoader.cpp:
1422         (WebKit::NetworkResourceLoader::start):
1423         * NetworkProcess/PingLoad.cpp:
1424
1425 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
1426
1427         Unreviewed fix for Cocoa Debug test instability following r239129.
1428
1429         * UIProcess/WebPageProxy.cpp:
1430         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): Deleted.
1431         * UIProcess/WebPageProxy.h:
1432         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
1433         Move the whole assertion to the declaration site.
1434
1435 2018-12-12  Chris Dumez  <cdumez@apple.com>
1436
1437         Add a preference to enable / disable devicemotion and deviceorientation events
1438         https://bugs.webkit.org/show_bug.cgi?id=192631
1439         <rdar://problem/46646244>
1440
1441         Reviewed by Geoffrey Garen.
1442
1443         Add setting to toggle support for the deviceorientation / devicemotion events:
1444         - https://w3c.github.io/deviceorientation/
1445
1446         * Shared/WebPreferences.yaml:
1447         * UIProcess/API/Cocoa/WKPreferences.mm:
1448         (-[WKPreferences _setDeviceOrientationEventEnabled:]):
1449         (-[WKPreferences _deviceOrientationEventEnabled]):
1450         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1451
1452 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
1453
1454         Unreviewed build fix for WinCairo Debug after r239080(?).
1455
1456         MSVC gives a redefinition error if noreturn is specified on the definition instead of the declaration.
1457
1458         * UIProcess/WebPageProxy.cpp:
1459         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
1460         * UIProcess/WebPageProxy.h:
1461         Move NO_RETURN_DUE_TO_ASSERT to the declaration site.
1462
1463 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1464
1465         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1466         https://bugs.webkit.org/show_bug.cgi?id=192449
1467         <rdar://problem/46595508>
1468
1469         Reviewed by Darin Adler.
1470
1471         Part 2: UIProcess/Cocoa and UIProcess/ios folders.
1472
1473         * UIProcess/Cocoa/WebViewImpl.h:
1474         * UIProcess/Cocoa/WebViewImpl.mm:
1475         * UIProcess/ios/WKContentView.mm:
1476         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1477         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
1478         (-[WKContentView dealloc]):
1479         (-[WKContentView page]):
1480         (-[WKContentView updateFixedClippingView:]):
1481         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1482         (-[WKContentView _updateForScreen:]):
1483         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
1484         (-[WKContentView _createDrawingAreaProxy]):
1485         (-[WKContentView _didCommitLayerTree:]):
1486         (-[WKContentView _wk_pageCountForPrintFormatter:]):
1487         * UIProcess/ios/WKContentViewInteraction.mm:
1488         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
1489         (hasAssistedNode):
1490         (-[WKContentView setupInteraction]):
1491         (-[WKContentView positionInformation]):
1492         (-[WKContentView _webTouchEventsRecognized:]):
1493         (inflateQuad):
1494         (-[WKContentView _updateTapHighlight]):
1495         (-[WKContentView _showTapHighlight]):
1496         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
1497         (-[WKContentView _displayFormNodeInputView]):
1498         (-[WKContentView inputView]):
1499         (-[WKContentView _actionForLongPressFromPositionInformation:]):
1500         (-[WKContentView currentPositionInformation]):
1501         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
1502         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
1503         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
1504         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
1505         (-[WKContentView gestureRecognizerShouldBegin:]):
1506         (-[WKContentView hasSelectablePositionAtPoint:]):
1507         (-[WKContentView pointIsNearMarkedText:]):
1508         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1509         (-[WKContentView webSelectionRectsForSelectionRects:]):
1510         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1511         (-[WKContentView _stylusSingleTapRecognized:]):
1512         (-[WKContentView _singleTapCommited:]):
1513         (-[WKContentView _attemptClickAtLocation:]):
1514         (-[WKContentView _positionInformationDidChange:]):
1515         (-[WKContentView requiresAccessoryView]):
1516         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
1517         (-[WKContentView _lookupForWebView:]):
1518         (-[WKContentView _shareForWebView:]):
1519         (-[WKContentView textStylingAtPosition:inDirection:]):
1520         (-[WKContentView canPerformActionForWebView:withSender:]):
1521         (-[WKContentView selectForWebView:]):
1522         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
1523         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
1524         (toGestureType):
1525         (toUIWKGestureType):
1526         (toSelectionTouch):
1527         (toUIWKSelectionTouch):
1528         (toGestureRecognizerState):
1529         (toUIGestureRecognizerState):
1530         (toUIWKSelectionFlags):
1531         (toWKTextGranularity):
1532         (toWKSelectionDirection):
1533         (selectionChangedWithGesture):
1534         (selectionChangedWithTouch):
1535         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
1536         (-[WKContentView autocorrectionData]):
1537         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
1538         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
1539         (-[WKContentView _updateAccessory]):
1540         (-[WKContentView selectedTextRange]):
1541         (-[WKContentView setMarkedText:selectedRange:]):
1542         (coreWritingDirection):
1543         (-[WKContentView closestPositionToPoint:]):
1544         (-[WKContentView insertText:]):
1545         (-[WKContentView textInputTraits]):
1546         (-[WKContentView handleKeyWebEvent:]):
1547         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
1548         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
1549         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
1550         (-[WKContentView assistedNodeInformation]):
1551         (-[WKContentView assistedNodeSelectOptions]):
1552         (isAssistableInputType):
1553         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1554         (-[WKContentView _stopAssistingNode]):
1555         (-[WKContentView updateCurrentAssistedNodeInformation:]):
1556         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1557         (-[WKContentView actionNameForFocusedFormControlView:]):
1558         (-[WKContentView selectWordForReplacement]):
1559         (-[WKContentView _updateChangedSelection:]):
1560         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
1561         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
1562         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
1563         (-[WKContentView _showRunOpenPanel:resultListener:]):
1564         (-[WKContentView _showShareSheet:completionHandler:]):
1565         (-[WKContentView positionInformationForActionSheetAssistant:]):
1566         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
1567         (-[WKContentView _startDrag:item:]):
1568         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
1569         (-[WKContentView _didHandleStartDataInteractionRequest:]):
1570         (dropOperationForWebCoreDragOperation):
1571         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
1572         (-[WKContentView _didConcludeEditDataInteraction:]):
1573         (-[WKContentView _didPerformDragOperation:]):
1574         (-[WKContentView _prepareToDragPromisedAttachment:]):
1575         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
1576         (-[WKContentView _autofillContext]):
1577         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
1578         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
1579         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
1580         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1581         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
1582         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
1583         (-[WKContentView dropInteraction:performDrop:]):
1584         (-[WKContentView dropInteraction:sessionDidEnd:]):
1585         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
1586         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
1587         (-[WKContentView numericInputModeForListViewController:]):
1588         (-[WKContentView textContentTypeForListViewController:]):
1589         (-[WKContentView allowsDictationInputForListViewController:]):
1590         (-[WKContentView _simulateLongPressActionAtLocation:]):
1591         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1592         (-[WKContentView _presentationRectsForPreviewItemController:]):
1593         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1594         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
1595         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
1596         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
1597         (-[WKFullScreenViewController videoControlsManagerDidChange]):
1598         (-[WKFullScreenViewController _manager]):
1599         (-[WKFullScreenViewController _togglePiPAction:]):
1600         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1601         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
1602         (-[WKFullScreenWindowController isFullScreen]):
1603         (-[WKFullScreenWindowController enterFullScreen]):
1604         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1605         (-[WKFullScreenWindowController exitFullScreen]):
1606         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1607         (-[WKFullScreenWindowController _completedExitFullScreen]):
1608         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
1609         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
1610         (-[WKFullScreenWindowController _manager]):
1611
1612 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1613
1614         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1615         https://bugs.webkit.org/show_bug.cgi?id=192449
1616         <rdar://problem/46595508>
1617
1618         Reviewed by Darin Adler.
1619
1620         Part 1: Files in Shared folder.
1621
1622         * Shared/API/c/WKRenderLayer.cpp:
1623         (WKRenderLayerGetFrameContentsLayer):
1624         * Shared/API/c/cf/WKErrorCF.cpp:
1625         (WKErrorCreateWithCFError):
1626         (WKErrorCopyCFError):
1627         * Shared/API/c/cg/WKImageCG.cpp:
1628         (WKImageCreateCGImage):
1629         (WKImageCreateFromCGImage):
1630         * Shared/API/c/mac/WKWebArchive.cpp:
1631         (WKWebArchiveGetTypeID):
1632         (WKWebArchiveCreate):
1633         (WKWebArchiveCreateWithData):
1634         (WKWebArchiveCreateFromRange):
1635         (WKWebArchiveCopyMainResource):
1636         (WKWebArchiveCopySubresources):
1637         (WKWebArchiveCopySubframeArchives):
1638         (WKWebArchiveCopyData):
1639         * Shared/API/c/mac/WKWebArchiveResource.cpp:
1640         (WKWebArchiveResourceGetTypeID):
1641         (WKWebArchiveResourceCreate):
1642         (WKWebArchiveResourceCopyData):
1643         (WKWebArchiveResourceCopyURL):
1644         (WKWebArchiveResourceCopyMIMEType):
1645         (WKWebArchiveResourceCopyTextEncoding):
1646         * Shared/ChildProcess.cpp:
1647         * Shared/ContextMenuContextData.cpp:
1648         * Shared/EditorState.cpp:
1649         * Shared/Plugins/NPIdentifierData.cpp:
1650         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1651         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1652         * Shared/SessionState.cpp:
1653         * Shared/SessionTracker.cpp:
1654         * Shared/ShareableBitmap.cpp:
1655         * Shared/ShareableResource.cpp:
1656         * Shared/VisibleContentRectUpdateInfo.cpp:
1657         * Shared/WebBackForwardListItem.cpp:
1658         * Shared/WebContextMenuItemData.cpp:
1659         * Shared/WebCoreArgumentCoders.cpp:
1660         * Shared/WebHitTestResultData.cpp:
1661         * Shared/WebImage.cpp:
1662         * Shared/WebMediaSessionMetadata.cpp:
1663         * Shared/WebMemorySampler.cpp:
1664         * Shared/WebMouseEvent.cpp:
1665         * Shared/WebRenderObject.cpp:
1666         * Shared/WebSQLiteDatabaseTracker.cpp:
1667         * Shared/WebWheelEvent.cpp:
1668         * Shared/cf/ArgumentCodersCF.cpp:
1669         * Shared/ios/WebPlatformTouchPointIOS.cpp:
1670
1671 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1672
1673         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1674         https://bugs.webkit.org/show_bug.cgi?id=192449
1675         <rdar://problem/46595508>
1676
1677         Reviewed by Darin Adler.
1678
1679         Part 1: Files in NetworkProcess.
1680
1681         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1682         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1683         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1684         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1685         * NetworkProcess/ios/NetworkProcessIOS.mm:
1686         * NetworkProcess/mac/NetworkProcessMac.mm:
1687         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1688
1689 2018-12-12  Chris Dumez  <cdumez@apple.com>
1690
1691         Unreviewed build with with recent macOS SDKs.
1692
1693         * Platform/cocoa/WKCrashReporter.mm:
1694
1695 2018-12-12  Chris Dumez  <cdumez@apple.com>
1696
1697         Unreviewed attempt to fix GTK build after r239104.
1698
1699         * UIProcess/WebPageProxy.cpp:
1700         (WebKit::WebPageProxy::performDragControllerAction):
1701
1702 2018-12-12  Chris Dumez  <cdumez@apple.com>
1703
1704         Unreviewed attempt to fix build with older SDKs after r239110.
1705
1706         * Platform/cocoa/WKCrashReporter.mm:
1707
1708 2018-12-12  Chris Dumez  <cdumez@apple.com>
1709
1710         Unreviewed, fix build with recent SDKs.
1711
1712         * Platform/cocoa/WKCrashReporter.mm:
1713
1714 2018-12-09  Darin Adler  <darin@apple.com>
1715
1716         [iOS] Zero memory containing the password for PDF documents when a WKPDFView is deallocated
1717         https://bugs.webkit.org/show_bug.cgi?id=192536
1718         rdar://problem/41174451
1719
1720         Reviewed by Tim Horton.
1721
1722         * UIProcess/ios/WKPDFView.mm: Took out PLATFORM(IOSMAC) since
1723         this class is not compiled on that platform at this time. Can always
1724         add it back later.
1725         (-[WKPDFView dealloc]): Zero out characters of _passwordForPrinting.
1726         (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
1727         Initialize _passwordForPrinting; use a CString instead of retaining
1728         an NSString since we can zero that out easily.
1729         (-[WKPDFView _ensureDocumentForPrinting]): Use _passwordForPrinting.
1730
1731 2018-12-12  Commit Queue  <commit-queue@webkit.org>
1732
1733         Unreviewed, rolling out r239103.
1734         https://bugs.webkit.org/show_bug.cgi?id=192627
1735
1736         It broke the built because it depends on another patch that
1737         didn't land yet (Requested by KaL on #webkit).
1738
1739         Reverted changeset:
1740
1741         "[WPE] Add API to notify about frame displayed view backend
1742         callback"
1743         https://bugs.webkit.org/show_bug.cgi?id=192224
1744         https://trac.webkit.org/changeset/239103
1745
1746 2018-12-12  Chris Dumez  <cdumez@apple.com>
1747
1748         Restore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect()
1749         https://bugs.webkit.org/show_bug.cgi?id=191982
1750         <rdar://problem/46258054>
1751
1752         Reviewed by Alex Christensen.
1753
1754         Have the WebPageProxy remember the local paths it previously visited so that the
1755         MESSAGE_CHECK_URL() checks still work when process-swap on navigation is enabled.
1756
1757         Add back MESSAGE_CHECK_URL() on sourceURL in didPerformClientRedirect().
1758
1759         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1760         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
1761         * UIProcess/RemoteWebInspectorProxy.cpp:
1762         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
1763         * UIProcess/WebInspectorProxy.cpp:
1764         (WebKit::WebInspectorProxy::createFrontendPage):
1765         * UIProcess/WebPageProxy.cpp:
1766         (WebKit::WebPageProxy::loadRequestWithNavigation):
1767         (WebKit::WebPageProxy::loadFile):
1768         (WebKit::WebPageProxy::loadDataWithNavigation):
1769         (WebKit::WebPageProxy::loadAlternateHTML):
1770         (WebKit::WebPageProxy::reload):
1771         (WebKit::WebPageProxy::didPerformClientRedirect):
1772         (WebKit::WebPageProxy::backForwardGoToItem):
1773         (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
1774         (WebKit::WebPageProxy::addPreviouslyVisitedPath):
1775         (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
1776         * UIProcess/WebPageProxy.h:
1777         * UIProcess/WebProcessProxy.cpp:
1778         (WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
1779         * UIProcess/WebProcessProxy.h:
1780         * UIProcess/mac/WebPageProxyMac.mm:
1781
1782 2018-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1783
1784         [WPE] Add API to notify about frame displayed view backend callback
1785         https://bugs.webkit.org/show_bug.cgi?id=192224
1786
1787         Reviewed by Michael Catanzaro.
1788
1789         Add API to add a callback to the view to be called when the view backend notifies that a frame has been
1790         displayed.
1791
1792         * UIProcess/API/glib/WebKitWebView.cpp:
1793         (FrameDisplayedCallback::FrameDisplayedCallback):
1794         (FrameDisplayedCallback::~FrameDisplayedCallback):
1795         (webkit_web_view_add_frame_displayed_callback):
1796         (webkit_web_view_remove_frame_displayed_callback):
1797         * UIProcess/API/wpe/WebKitWebView.h:
1798
1799 2018-12-11  Justin Michaud  <justin_michaud@apple.com>
1800
1801         Implement feature flag for CSS Typed OM
1802         https://bugs.webkit.org/show_bug.cgi?id=192610
1803
1804         Reviewed by Ryosuke Niwa.
1805
1806         * Configurations/FeatureDefines.xcconfig:
1807         * Shared/WebPreferences.yaml:
1808         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1809         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1810
1811 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
1812
1813         [Win][Clang] Fix warning -Wmissing-field-initializers
1814         https://bugs.webkit.org/show_bug.cgi?id=192584
1815
1816         Reviewed by Yusuke Suzuki.
1817
1818         Initialize a struct with '{ }' instead of '= {0}'.
1819
1820         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
1821         (WebKit::ProcessLauncher::launchProcess):
1822         * UIProcess/win/WebPopupMenuProxyWin.cpp:
1823         (WebKit::WebPopupMenuProxyWin::showPopupMenu):
1824         * UIProcess/win/WebView.cpp:
1825         (WebKit::WebView::initializeToolTipWindow):
1826         (WebKit::WebView::setToolTip):
1827
1828 2018-12-11  Chris Dumez  <cdumez@apple.com>
1829
1830         PSON logic gets confused by concurrent decidePolicyForNavigationAction requests
1831         https://bugs.webkit.org/show_bug.cgi?id=192482
1832         <rdar://problem/46470145>
1833
1834         Reviewed by Antti Koivisto.
1835
1836         It is possible to get 2 parallel decidePolicyForNavigationAction() requests from the
1837         WebProcess when a new load is started before responding to the existing policy
1838         decision. This would lead to several issues with regards to PSON:
1839         - We would decide to swap for the first policy decision and tell the WebProcess to
1840           suspend. However, because the WebProcess issued a new decidePolicyForNavigationAction
1841           since for the same frame, the previous one is invalidated and the WebProcess would
1842           ignore our request to suspend.
1843         - We would hit assertions later on because the navigation has been destroyed and yet
1844           we're getting a didStartProvisionalLoad for it.
1845         - swapToWebProcess() was asynchronous so that it would wait for the destination
1846           SuspendedPage to finish suspending before asking it to unsuspend. This led to various
1847           problems because anything can happen in the UIProcess while we're waiting for the
1848           suspension (e.g. another load). Also, we may create the SuspendedPageProxy for
1849           the current page too late and start getting IPC from the previous process about
1850           the suspension load to about:blank.
1851
1852         To address these issues, the following design is now implemented:
1853         - swapToWebProcess() is no longer asynchronous
1854         - instead, WebProcessPool::processForNavigation() is now asynchronous. This is better
1855           because at this point we have not yet told the WebProcess about the policy decision.
1856           We already properly deal with the policy decision being made asynchronously. This
1857           also allows us to choose another process if the SuspendedPage we'd like to use
1858           failed to suspend.
1859         - If the WebProcess receives a PolicyAction::Suspend but ignores it, have it send an
1860           IPC to the UIProcess so that the SuspendedPageProxy knows about it. We then destroy
1861           the SuspendedPageProxy and make sure it is not used.
1862         - After the asynchronous process selection, if the navigation has been destroy, abort
1863           the process-swap to avoid hitting assertions later on due to doing a load for a
1864           destroyed navigation.
1865
1866         * UIProcess/SuspendedPageProxy.cpp:
1867         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1868         Make sure m_whenReadyToConsume completion handler gets called if necessary if the
1869         SuspendedPageProxy gets destroyed. We pass null so that the SuspendedPage is not
1870         used.
1871
1872         (WebKit::SuspendedPageProxy::whenReadyToConsume):
1873         Add whenReadyToConsume() utility method to get a completion handler called when
1874         the SuspendedPageProxy is ready to be used. This basically means we have to wait
1875         for the page to finish its about:blank suspension load. If the suspension fails
1876         then we call the completion handler with null to indicate that the suspended
1877         page is not usable.
1878
1879         (WebKit::SuspendedPageProxy::unsuspendAndConsume):
1880         Rename unsuspend() to unsuspendAndConsume() and make it synchronous. This only gets
1881         called after whenReadyToConsume()'s completion handler has been called and if we
1882         do decide to use the SuspendedPageProxy. It tells the WebProcess to unsuspend and
1883         removes the SuspendedPageProxy from the WebProcessPool.
1884
1885         (WebKit::SuspendedPageProxy::didFinishLoad):
1886         rename m_finishedSuspendingHandler to m_whenReadyToConsume.
1887
1888         (WebKit::SuspendedPageProxy::didFailToSuspend):
1889         Add new didFailToSuspend() that gets called when the WebProcess sends us an IPC telling
1890         us it ignored our request to suspend. We then call m_whenReadyToConsume completion
1891         handler with null and destroy the SuspendedPageProxy.
1892
1893         (WebKit::SuspendedPageProxy::didReceiveMessage):
1894         * UIProcess/SuspendedPageProxy.h:
1895
1896         * UIProcess/WebNavigationState.h:
1897         (WebKit::WebNavigationState::hasNavigation const):
1898         Add utility function to query if a navigation is still valid.
1899
1900         * UIProcess/WebPageProxy.cpp:
1901         (WebKit::WebPageProxy::swapToWebProcess):
1902         Update method so that it is no longer asynchronous. Some of its code was also moved to
1903         continueNavigationInNewProcess() for clarity.
1904
1905         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1906         Deal with WebProcessPool::processForNavigation() now being asynchronous.
1907
1908         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1909         Update code now that swapToWebProcess() is no longer asynchronous. Some of the swapToWebProcess()
1910         code was also moved here for clarity.
1911
1912         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
1913
1914         * UIProcess/WebPageProxy.h:
1915         * UIProcess/WebPageProxy.messages.in:
1916         Add new DidFailToSuspendAfterProcessSwap IPC message.
1917
1918         * UIProcess/WebProcessPool.cpp:
1919         (WebKit::WebProcessPool::processForNavigation):
1920         (WebKit::WebProcessPool::processForNavigationInternal):
1921         * UIProcess/WebProcessPool.h:
1922         Make asynchronous. If we decide to use a SuspendedPageProxy's process, then call
1923         whenReadyToConsume() on it to wait for it to suspend. If the SuspendedPageProxy
1924         fails to suspend use a new process instead.
1925
1926         * WebProcess/WebPage/WebFrame.cpp:
1927         (WebKit::WebFrame::didReceivePolicyDecision):
1928         If we ignore the policy decision and the decision was "Suspend", send the DidFailToSuspendAfterProcessSwap
1929         IPC to the UIProcess so that the SuspendedPageProxy knows about it.
1930
1931 2018-12-11  Andy Estes  <aestes@apple.com>
1932
1933         Introduce makeBlockPtr for lambdas
1934         https://bugs.webkit.org/show_bug.cgi?id=192594
1935
1936         Reviewed by Alex Christensen.
1937
1938         Adopted makeBlockPtr.
1939
1940         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
1941         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
1942         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1943         (WebKit::NetworkCache::IOChannel::read):
1944         (WebKit::NetworkCache::IOChannel::write):
1945         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1946         (WebKit::NetworkProcess::clearDiskCache):
1947         (WebKit::saveCookies):
1948         * NetworkProcess/watchos/NetworkProximityAssertion.mm:
1949         (WebKit::BluetoothProximityAssertion::suspend):
1950         * UIProcess/API/Cocoa/WKWebView.mm:
1951         (-[WKWebView _setInputDelegate:]):
1952         * UIProcess/API/mac/WKView.mm:
1953         (-[WKView maybeInstallIconLoadingClient]):
1954         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1955         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
1956         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
1957         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1958         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1959         * UIProcess/Cocoa/AutomationSessionClient.mm:
1960         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
1961         (WebKit::AutomationSessionClient::requestSwitchToPage):
1962         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
1963         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
1964         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
1965         * UIProcess/Cocoa/DownloadClient.mm:
1966         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
1967         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
1968         * UIProcess/Cocoa/IconLoadingDelegate.mm:
1969         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
1970         * UIProcess/Cocoa/NavigationState.mm:
1971         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
1972         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1973         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1974         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1975         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1976         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
1977         * UIProcess/Cocoa/UIDelegate.mm:
1978         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1979         (WebKit::UIDelegate::UIClient::createNewPage):
1980         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
1981         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
1982         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
1983         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
1984         (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
1985         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
1986         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
1987         (WebKit::UIDelegate::UIClient::windowFrame):
1988         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
1989         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
1990         (WebKit::UIDelegate::UIClient::runOpenPanel):
1991         (WebKit::requestUserMediaAuthorizationForDevices):
1992         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
1993         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
1994         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
1995         (WebKit::UIDelegate::UIClient::requestPointerLock):
1996         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1997         (-[WKSafeBrowsingWarning clickedOnLink:]):
1998         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1999         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
2000         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
2001         (WebKit::HidConnection::send):
2002         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
2003         (WebKit::LocalConnection::getUserConsent const):
2004         (WebKit::LocalConnection::getAttestation const):
2005         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2006         (WebKit::MockHidConnection::send):
2007         * UIProcess/ios/PageClientImplIOS.mm:
2008         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
2009         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2010         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2011         * UIProcess/mac/ServicesController.mm:
2012         (WebKit::hasCompatibleServicesForItems):
2013         (WebKit::ServicesController::refreshExistingServices):
2014         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2015         (PageLoaderClient::didStartProvisionalLoadForFrame):
2016
2017 2018-12-11  Alex Christensen  <achristensen@webkit.org>
2018
2019         Fix an internal build failure after r239014
2020         https://bugs.webkit.org/show_bug.cgi?id=192205
2021
2022         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2023         (fontOfSize):
2024         There's a system that doesn't have safe browsing or UIFontTextStyleLargeTitle.
2025
2026 2018-12-11  Brian Burg  <bburg@apple.com>
2027
2028         SimulatedInputDispatcher::transitionInputSourceToState() can reuse a moved-from completion handler
2029         https://bugs.webkit.org/show_bug.cgi?id=191155
2030         <rdar://problem/45745569>
2031
2032         Reviewed by Joseph Pecoraro.
2033
2034         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2035         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
2036         Add an ASSERT to guard against unexpected inputs where >1 VirtualKey changes per state.
2037         webkitdriver needs to be updated to not produce such states in this scenario, but this will
2038         avoid a runtime crash caused by trying to call a moved-out completion handler a second time.
2039
2040 2018-12-11  Commit Queue  <commit-queue@webkit.org>
2041
2042         Unreviewed, rolling out r239071.
2043         https://bugs.webkit.org/show_bug.cgi?id=192588
2044
2045         Broke WPE build due to undefined references to toAPI() and
2046         toImpl() inside the C API (Requested by magomez on #webkit).
2047
2048         Reverted changeset:
2049
2050         "[meta][WebKit] Remove using namespace WebCore and WebKit in
2051         the global scope for unified source builds"
2052         https://bugs.webkit.org/show_bug.cgi?id=192449
2053         https://trac.webkit.org/changeset/239071
2054
2055 2018-12-10  Chris Fleizach  <cfleizach@apple.com>
2056
2057         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
2058         https://bugs.webkit.org/show_bug.cgi?id=192449
2059
2060         Reviewed by Darin Adler.
2061
2062         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
2063         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2064         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2065         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2066         * NetworkProcess/ios/NetworkProcessIOS.mm:
2067         * NetworkProcess/mac/NetworkProcessMac.mm:
2068         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2069         * Platform/spi/ios/AccessibilitySupportSPI.h:
2070         * PlatformMac.cmake:
2071         * PluginProcess/PluginControllerProxy.cpp:
2072         * PluginProcess/PluginProcess.cpp:
2073         * PluginProcess/WebProcessConnection.cpp:
2074         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
2075         * Shared/API/c/cf/WKErrorCF.cpp:
2076         (WKErrorCreateWithCFError):
2077         (WKErrorCopyCFError):
2078         * Shared/API/c/cg/WKImageCG.cpp:
2079         (WKImageCreateCGImage):
2080         (WKImageCreateFromCGImage):
2081         * Shared/ChildProcess.cpp:
2082         * Shared/ContextMenuContextData.cpp:
2083         * Shared/EditorState.cpp:
2084         * Shared/Plugins/NPIdentifierData.cpp:
2085         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
2086         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2087         * Shared/SessionState.cpp:
2088         * Shared/SessionTracker.cpp:
2089         * Shared/ShareableBitmap.cpp:
2090         * Shared/ShareableResource.cpp:
2091         * Shared/VisibleContentRectUpdateInfo.cpp:
2092         * Shared/WebBackForwardListItem.cpp:
2093         * Shared/WebContextMenuItemData.cpp:
2094         * Shared/WebCoreArgumentCoders.cpp:
2095         * Shared/WebHitTestResultData.cpp:
2096         * Shared/WebImage.cpp:
2097         * Shared/WebMediaSessionMetadata.cpp:
2098         * Shared/WebMemorySampler.cpp:
2099         * Shared/WebMouseEvent.cpp:
2100         * Shared/WebRenderObject.cpp:
2101         * Shared/WebSQLiteDatabaseTracker.cpp:
2102         * Shared/WebWheelEvent.cpp:
2103         * Shared/cf/ArgumentCodersCF.cpp:
2104         * Shared/ios/WebPlatformTouchPointIOS.cpp:
2105         * SourcesCocoa.txt:
2106         * UIProcess/API/APIContentRuleListStore.cpp:
2107         * UIProcess/API/APIHitTestResult.cpp:
2108         * UIProcess/API/APINavigation.cpp:
2109         * UIProcess/API/APIOpenPanelParameters.cpp:
2110         * UIProcess/API/APIPageConfiguration.cpp:
2111         * UIProcess/API/C/WKPage.cpp:
2112         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
2113         (WKPageLoadURLWithUserData):
2114         (WKPageLoadURLRequestWithUserData):
2115         (WKPageSetPaginationMode):
2116         (WKPageGetPaginationMode):
2117         (WKPageSetPageLoaderClient):
2118         (WKPageSetPagePolicyClient):
2119         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
2120         * UIProcess/Cocoa/WebViewImpl.h:
2121         * UIProcess/Cocoa/WebViewImpl.mm:
2122         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2123         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
2124         * UIProcess/ios/WKContentView.mm:
2125         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2126         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
2127         (-[WKContentView dealloc]):
2128         (-[WKContentView page]):
2129         (-[WKContentView updateFixedClippingView:]):
2130         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2131         (-[WKContentView _updateForScreen:]):
2132         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
2133         (-[WKContentView _createDrawingAreaProxy]):
2134         (-[WKContentView _didCommitLayerTree:]):
2135         (-[WKContentView _wk_pageCountForPrintFormatter:]):
2136         * UIProcess/ios/WKContentViewInteraction.mm:
2137         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
2138         (hasAssistedNode):
2139         (-[WKContentView setupInteraction]):
2140         (-[WKContentView positionInformation]):
2141         (-[WKContentView _webTouchEventsRecognized:]):
2142         (inflateQuad):
2143         (-[WKContentView _updateTapHighlight]):
2144         (-[WKContentView _showTapHighlight]):
2145         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2146         (-[WKContentView _displayFormNodeInputView]):
2147         (-[WKContentView inputView]):
2148         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2149         (-[WKContentView currentPositionInformation]):
2150         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
2151         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
2152         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
2153         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
2154         (-[WKContentView gestureRecognizerShouldBegin:]):
2155         (-[WKContentView hasSelectablePositionAtPoint:]):
2156         (-[WKContentView pointIsNearMarkedText:]):
2157         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2158         (-[WKContentView webSelectionRectsForSelectionRects:]):
2159         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
2160         (-[WKContentView _stylusSingleTapRecognized:]):
2161         (-[WKContentView _singleTapCommited:]):
2162         (-[WKContentView _attemptClickAtLocation:]):
2163         (-[WKContentView _positionInformationDidChange:]):
2164         (-[WKContentView requiresAccessoryView]):
2165         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
2166         (-[WKContentView _lookupForWebView:]):
2167         (-[WKContentView _shareForWebView:]):
2168         (-[WKContentView textStylingAtPosition:inDirection:]):
2169         (-[WKContentView canPerformActionForWebView:withSender:]):
2170         (-[WKContentView selectForWebView:]):
2171         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
2172         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
2173         (toGestureType):
2174         (toUIWKGestureType):
2175         (toSelectionTouch):
2176         (toUIWKSelectionTouch):
2177         (toGestureRecognizerState):
2178         (toUIGestureRecognizerState):
2179         (toUIWKSelectionFlags):
2180         (toWKTextGranularity):
2181         (toWKSelectionDirection):
2182         (selectionChangedWithGesture):
2183         (selectionChangedWithTouch):
2184         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
2185         (-[WKContentView autocorrectionData]):
2186         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2187         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2188         (-[WKContentView _updateAccessory]):
2189         (-[WKContentView selectedTextRange]):
2190         (-[WKContentView setMarkedText:selectedRange:]):
2191         (coreWritingDirection):
2192         (-[WKContentView closestPositionToPoint:]):
2193         (-[WKContentView insertText:]):
2194         (-[WKContentView textInputTraits]):
2195         (-[WKContentView handleKeyWebEvent:]):
2196         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
2197         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
2198         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
2199         (-[WKContentView assistedNodeInformation]):
2200         (-[WKContentView assistedNodeSelectOptions]):
2201         (isAssistableInputType):
2202         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2203         (-[WKContentView _stopAssistingNode]):
2204         (-[WKContentView updateCurrentAssistedNodeInformation:]):
2205         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2206         (-[WKContentView actionNameForFocusedFormControlView:]):
2207         (-[WKContentView selectWordForReplacement]):
2208         (-[WKContentView _updateChangedSelection:]):
2209         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
2210         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
2211         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
2212         (-[WKContentView _showRunOpenPanel:resultListener:]):
2213         (-[WKContentView _showShareSheet:completionHandler:]):
2214         (-[WKContentView positionInformationForActionSheetAssistant:]):
2215         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
2216         (-[WKContentView _startDrag:item:]):
2217         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
2218         (-[WKContentView _didHandleStartDataInteractionRequest:]):
2219         (dropOperationForWebCoreDragOperation):
2220         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
2221         (-[WKContentView _didConcludeEditDataInteraction:]):
2222         (-[WKContentView _didPerformDragOperation:]):
2223         (-[WKContentView _prepareToDragPromisedAttachment:]):
2224         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
2225         (-[WKContentView _autofillContext]):
2226         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
2227         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
2228         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2229         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2230         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
2231         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
2232         (-[WKContentView dropInteraction:performDrop:]):
2233         (-[WKContentView dropInteraction:sessionDidEnd:]):
2234         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
2235         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
2236         (-[WKContentView numericInputModeForListViewController:]):
2237         (-[WKContentView textContentTypeForListViewController:]):
2238         (-[WKContentView allowsDictationInputForListViewController:]):
2239         (-[WKContentView _simulateLongPressActionAtLocation:]):
2240         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2241         (-[WKContentView _presentationRectsForPreviewItemController:]):
2242         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2243         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
2244         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
2245         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
2246         (-[WKFullScreenViewController videoControlsManagerDidChange]):
2247         (-[WKFullScreenViewController _manager]):
2248         (-[WKFullScreenViewController _togglePiPAction:]):
2249         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2250         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
2251         (-[WKFullScreenWindowController isFullScreen]):
2252         (-[WKFullScreenWindowController enterFullScreen]):
2253         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2254         (-[WKFullScreenWindowController exitFullScreen]):
2255         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2256         (-[WKFullScreenWindowController _completedExitFullScreen]):
2257         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
2258         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
2259         (-[WKFullScreenWindowController _manager]):
2260         * UIProcess/mac/WebPageProxyMac.mm:
2261         * WebKit.xcodeproj/project.pbxproj:
2262         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2263         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2264         (mediaTimeToCurrentTime):
2265         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
2266         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2267         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2268
2269 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
2270
2271         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
2272         https://bugs.webkit.org/show_bug.cgi?id=192573
2273
2274         Reviewed by Simon Fraser.
2275
2276         * Configurations/FeatureDefines.xcconfig:
2277
2278 2018-12-10  Youenn Fablet  <youenn@apple.com>
2279
2280         Remove derived classes of RealtimeMediaSourceCenter
2281         https://bugs.webkit.org/show_bug.cgi?id=192546
2282
2283         Reviewed by Eric Carlson.
2284
2285         pdate code according WebCore changes.
2286
2287         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2288         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2289         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2290         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
2291         (WebKit::UserMediaCaptureManager::initialize):
2292
2293 2018-12-10  Tim Horton  <timothy_horton@apple.com>
2294
2295         Animated scrolling on Google Maps scrolls the page in addition to moving the map
2296         https://bugs.webkit.org/show_bug.cgi?id=192521
2297         <rdar://problem/46382007>
2298
2299         Reviewed by Sam Weinig.
2300
2301         * Platform/spi/ios/UIKitSPI.h:
2302         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2303         (-[WKKeyboardScrollViewAnimator rubberbandableDirections]):
2304         Only do keyboard-based rubber-banding in directions that we can actually
2305         scroll, not directions we can only finger-rubber-band in. This effectively
2306         means keyboard scrolling will ignore "alwaysBounce{Vertical, Horizontal}".
2307
2308 2018-12-10  Commit Queue  <commit-queue@webkit.org>
2309
2310         Unreviewed, rolling out r239023.
2311         https://bugs.webkit.org/show_bug.cgi?id=192571
2312
2313         Speculative rollout due to broken perf test (Requested by
2314         deanj on #webkit).
2315
2316         Reverted changeset:
2317
2318         "Enable HTTP and HTTPS proxies on iOS and make it a property
2319         of the NSURLSession"
2320         https://bugs.webkit.org/show_bug.cgi?id=192374
2321         https://trac.webkit.org/changeset/239023
2322
2323 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2324
2325         Unreviewed, fix the iOS build after r239039.
2326         https://bugs.webkit.org/show_bug.cgi?id=192568
2327
2328         * UIProcess/ios/WKContentViewInteraction.mm:
2329         (-[WKContentView dropInteraction:sessionDidUpdate:]):
2330
2331 2018-12-10  Alex Christensen  <achristensen@webkit.org>
2332
2333         Fix WatchOS build.
2334
2335         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2336         * UIProcess/ios/WKContentViewInteraction.mm:
2337         (-[WKContentView actionNameForFocusedFormControlView:]):
2338
2339 2018-12-10  Matt Lewis  <jlewis3@apple.com>
2340
2341         Unreviewed, rolling out r239029.
2342
2343         This patch caused internal build failures.
2344
2345         Reverted changeset:
2346
2347         "[meta][WebKit] Remove using namespace WebCore and WebKit in
2348         the global scope for unified source builds"
2349         https://bugs.webkit.org/show_bug.cgi?id=192449
2350         https://trac.webkit.org/changeset/239029
2351
2352 2018-12-10  Chris Dumez  <cdumez@apple.com>
2353
2354         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
2355         https://bugs.webkit.org/show_bug.cgi?id=192509
2356         <rdar://problem/46500832>
2357
2358         Reviewed by Alex Christensen.
2359
2360         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess instead of doing
2361         it at resource-level from the injected bundle.
2362
2363         The custom user-agent string can now be set on _WKWebsitePolicies during the
2364         decidePolicyForNavigationAction for the main feame, and will impact this main resource load as well as its
2365         future subresource loads.
2366
2367         * Shared/WebsitePoliciesData.cpp:
2368         (WebKit::WebsitePoliciesData::encode const):
2369         (WebKit::WebsitePoliciesData::decode):
2370         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2371         * Shared/WebsitePoliciesData.h:
2372         * UIProcess/API/APIWebsitePolicies.cpp:
2373         (API::WebsitePolicies::data):
2374         * UIProcess/API/APIWebsitePolicies.h:
2375         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2376         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2377         (-[_WKWebsitePolicies setCustomUserAgent:]):
2378         (-[_WKWebsitePolicies customUserAgent]):
2379         * UIProcess/Cocoa/NavigationState.mm:
2380         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2381
2382 2018-12-10  Alex Christensen  <achristensen@webkit.org>
2383
2384         Safe browsing warning should layout buttons vertically in narrow WKWebViews
2385         https://bugs.webkit.org/show_bug.cgi?id=192535
2386         <rdar://problem/46308364>
2387
2388         Reviewed by Tim Horton.
2389
2390         They're usually next to each other, but in narrow WKWebViews they currently get clipped.
2391         In order to make it more likely that both buttons are completely visible, put one above
2392         the other if the WKWebView is too narrow to completely show both.  This also helps with
2393         languages where the translations of "Go Back" or "Show Details" are rendered wider than English.
2394
2395         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2396         (buttonWidth):
2397         (-[WKSafeBrowsingWarning addContent]):
2398
2399 2018-12-10  Simon Fraser  <simon.fraser@apple.com>
2400
2401         Allow control over child order when adding nodes to the scrolling tree
2402         https://bugs.webkit.org/show_bug.cgi?id=176914
2403         <rdar://problem/46542237>
2404         
2405         Re-land r239010 after over-zealous rollout.
2406
2407         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2408         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2409
2410 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2411
2412         [iOS] Caret is obscured by finger when dragging over an editable element
2413         https://bugs.webkit.org/show_bug.cgi?id=192499
2414         <rdar://problem/46570101>
2415
2416         Reviewed by Tim Horton.
2417
2418         Add support for setting the `precise` property of `UIDropProposal` to YES when dragging over an editable area.
2419         When enabled, this property shifts the drop location up by a small amount, allowing the user to see the drop
2420         caret (currently, this is not the case, and it's difficult to drop text at a precise location on iOS). Changes
2421         are covered by adding to existing API tests.
2422
2423         * Scripts/webkit/messages.py:
2424         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2425
2426         Add a new version of `-_webView:willUpdateDataInteractionOperationToOperation:forSession:` that receives and
2427         returns a UIDropProposal, so that Mail can more easily port over existing logic in its legacy-WebKit-based
2428         compose implementation. iOS Safari is currently the only client of this private delegate, so the old version can
2429         be easily removed once Safari adopts this new version.
2430
2431         * UIProcess/WebPageProxy.cpp:
2432         (WebKit::WebPageProxy::didPerformDragControllerAction):
2433
2434         Add plumbing to send the latest drag handling method from WebPage to WebPageProxy.
2435
2436         (WebKit::WebPageProxy::resetCurrentDragInformation):
2437         * UIProcess/WebPageProxy.h:
2438         (WebKit::WebPageProxy::currentDragHandlingMethod const):
2439         * UIProcess/WebPageProxy.messages.in:
2440         * UIProcess/ios/WKContentViewInteraction.mm:
2441         (-[WKContentView dropInteraction:sessionDidUpdate:]):
2442
2443         Call the new UI delegate hook when determining the drop proposal to return to UIKit. Additionally set the
2444         `precise` bit on the drop proposal in the case where the drop handling method is either "editing rich text" or
2445         "editing plain text".
2446
2447         * WebProcess/WebPage/WebPage.cpp:
2448         (WebKit::WebPage::performDragControllerAction):
2449         * WebProcess/WebPage/WebPage.h:
2450
2451 2018-12-10  Youenn Fablet  <youenn@apple.com>
2452
2453         Make mock capture happen in the process used for real capture
2454         https://bugs.webkit.org/show_bug.cgi?id=192544
2455
2456         Reviewed by Eric Carlson.
2457
2458         Make mock capture happen in the right process by only overriding
2459         factories by mock factories for source types that UserMediaCaptureManager will not override.
2460         That way, UserMediaCaptureManager will be used to go to UIProcess, where mock will be used as if it was the real capture.
2461
2462         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2463         (WebKit::UserMediaCaptureManager::initialize):
2464
2465 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
2466
2467         Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
2468         https://bugs.webkit.org/show_bug.cgi?id=192428
2469
2470         Reviewed by Tim Horton.
2471
2472         * config.h:
2473
2474 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
2475
2476         Move more macros out of WebKit's config.h
2477         https://bugs.webkit.org/show_bug.cgi?id=192430
2478
2479         Reviewed by Tim Horton.
2480
2481         * config.h:
2482
2483 2018-12-10  Chris Fleizach  <cfleizach@apple.com>
2484
2485         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
2486         https://bugs.webkit.org/show_bug.cgi?id=192449
2487
2488         Reviewed by Darin Adler.
2489
2490         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
2491         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2492         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2493         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2494         * NetworkProcess/ios/NetworkProcessIOS.mm:
2495         * NetworkProcess/mac/NetworkProcessMac.mm:
2496         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2497         * Platform/spi/ios/AccessibilitySupportSPI.h:
2498         * PlatformMac.cmake:
2499         * PluginProcess/PluginControllerProxy.cpp:
2500         * PluginProcess/PluginProcess.cpp:
2501         * PluginProcess/WebProcessConnection.cpp:
2502         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
2503         * Shared/API/c/cf/WKErrorCF.cpp:
2504         (WKErrorCreateWithCFError):
2505         (WKErrorCopyCFError):
2506         * Shared/API/c/cg/WKImageCG.cpp:
2507         (WKImageCreateCGImage):
2508         (WKImageCreateFromCGImage):
2509         * Shared/ChildProcess.cpp:
2510         * Shared/ContextMenuContextData.cpp:
2511         * Shared/EditorState.cpp:
2512         * Shared/Plugins/NPIdentifierData.cpp:
2513         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
2514         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2515         * Shared/SessionState.cpp:
2516         * Shared/SessionTracker.cpp:
2517         * Shared/ShareableBitmap.cpp:
2518         * Shared/ShareableResource.cpp:
2519         * Shared/VisibleContentRectUpdateInfo.cpp:
2520         * Shared/WebBackForwardListItem.cpp:
2521         * Shared/WebContextMenuItemData.cpp:
2522         * Shared/WebCoreArgumentCoders.cpp:
2523         * Shared/WebHitTestResultData.cpp:
2524         * Shared/WebImage.cpp:
2525         * Shared/WebMediaSessionMetadata.cpp:
2526         * Shared/WebMemorySampler.cpp:
2527         * Shared/WebMouseEvent.cpp:
2528         * Shared/WebRenderObject.cpp:
2529         * Shared/WebSQLiteDatabaseTracker.cpp:
2530         * Shared/WebWheelEvent.cpp:
2531         * Shared/cf/ArgumentCodersCF.cpp:
2532         * Shared/ios/WebPlatformTouchPointIOS.cpp:
2533         * SourcesCocoa.txt:
2534         * UIProcess/API/APIContentRuleListStore.cpp:
2535         * UIProcess/API/APIHitTestResult.cpp:
2536         * UIProcess/API/APINavigation.cpp:
2537         * UIProcess/API/APIOpenPanelParameters.cpp:
2538         * UIProcess/API/APIPageConfiguration.cpp:
2539         * UIProcess/API/C/WKPage.cpp:
2540         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
2541         (WKPageLoadURLWithUserData):
2542         (WKPageLoadURLRequestWithUserData):
2543         (WKPageSetPaginationMode):
2544         (WKPageGetPaginationMode):
2545         (WKPageSetPageLoaderClient):
2546         (WKPageSetPagePolicyClient):
2547         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
2548         * UIProcess/Cocoa/WebViewImpl.h:
2549         * UIProcess/Cocoa/WebViewImpl.mm:
2550         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2551         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
2552         * UIProcess/ios/WKContentView.mm:
2553         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2554         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
2555         (-[WKContentView dealloc]):
2556         (-[WKContentView page]):
2557         (-[WKContentView updateFixedClippingView:]):
2558         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2559         (-[WKContentView _updateForScreen:]):
2560         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
2561         (-[WKContentView _createDrawingAreaProxy]):
2562         (-[WKContentView _didCommitLayerTree:]):
2563         (-[WKContentView _wk_pageCountForPrintFormatter:]):
2564         * UIProcess/ios/WKContentViewInteraction.mm:
2565         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
2566         (hasAssistedNode):
2567         (-[WKContentView setupInteraction]):
2568         (-[WKContentView positionInformation]):
2569         (-[WKContentView _webTouchEventsRecognized:]):
2570         (inflateQuad):
2571         (-[WKContentView _updateTapHighlight]):
2572         (-[WKContentView _showTapHighlight]):
2573         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2574         (-[WKContentView _displayFormNodeInputView]):
2575         (-[WKContentView inputView]):
2576         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2577         (-[WKContentView currentPositionInformation]):
2578         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
2579         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
2580         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
2581         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
2582         (-[WKContentView gestureRecognizerShouldBegin:]):
2583         (-[WKContentView hasSelectablePositionAtPoint:]):
2584         (-[WKContentView pointIsNearMarkedText:]):
2585         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2586         (-[WKContentView webSelectionRectsForSelectionRects:]):
2587         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
2588         (-[WKContentView _stylusSingleTapRecognized:]):
2589         (-[WKContentView _singleTapCommited:]):
2590         (-[WKContentView _attemptClickAtLocation:]):
2591         (-[WKContentView _positionInformationDidChange:]):
2592         (-[WKContentView requiresAccessoryView]):
2593         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
2594         (-[WKContentView _lookupForWebView:]):
2595         (-[WKContentView _shareForWebView:]):
2596         (-[WKContentView textStylingAtPosition:inDirection:]):
2597         (-[WKContentView canPerformActionForWebView:withSender:]):
2598         (-[WKContentView selectForWebView:]):
2599         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
2600         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
2601         (toGestureType):
2602         (toUIWKGestureType):
2603         (toSelectionTouch):
2604         (toUIWKSelectionTouch):
2605         (toGestureRecognizerState):
2606         (toUIGestureRecognizerState):
2607         (toUIWKSelectionFlags):
2608         (toWKTextGranularity):
2609         (toWKSelectionDirection):
2610         (selectionChangedWithGesture):
2611         (selectionChangedWithTouch):
2612         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
2613         (-[WKContentView autocorrectionData]):
2614         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2615         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2616         (-[WKContentView _updateAccessory]):
2617         (-[WKContentView selectedTextRange]):
2618         (-[WKContentView setMarkedText:selectedRange:]):
2619         (coreWritingDirection):
2620         (-[WKContentView closestPositionToPoint:]):
2621         (-[WKContentView insertText:]):
2622         (-[WKContentView textInputTraits]):
2623         (-[WKContentView handleKeyWebEvent:]):
2624         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
2625         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
2626         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
2627         (-[WKContentView assistedNodeInformation]):
2628         (-[WKContentView assistedNodeSelectOptions]):
2629         (isAssistableInputType):
2630         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2631         (-[WKContentView _stopAssistingNode]):
2632         (-[WKContentView updateCurrentAssistedNodeInformation:]):
2633         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2634         (-[WKContentView actionNameForFocusedFormControlView:]):
2635         (-[WKContentView selectWordForReplacement]):
2636         (-[WKContentView _updateChangedSelection:]):
2637         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
2638         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
2639         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
2640         (-[WKContentView _showRunOpenPanel:resultListener:]):
2641         (-[WKContentView _showShareSheet:completionHandler:]):
2642         (-[WKContentView positionInformationForActionSheetAssistant:]):
2643         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
2644         (-[WKContentView _startDrag:item:]):
2645         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
2646         (-[WKContentView _didHandleStartDataInteractionRequest:]):
2647         (dropOperationForWebCoreDragOperation):
2648         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
2649         (-[WKContentView _didConcludeEditDataInteraction:]):
2650         (-[WKContentView _didPerformDragOperation:]):
2651         (-[WKContentView _prepareToDragPromisedAttachment:]):
2652         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
2653         (-[WKContentView _autofillContext]):
2654         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
2655         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
2656         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2657         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2658         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
2659         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
2660         (-[WKContentView dropInteraction:performDrop:]):
2661         (-[WKContentView dropInteraction:sessionDidEnd:]):
2662         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
2663         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
2664         (-[WKContentView numericInputModeForListViewController:]):
2665         (-[WKContentView textContentTypeForListViewController:]):
2666         (-[WKContentView allowsDictationInputForListViewController:]):
2667         (-[WKContentView _simulateLongPressActionAtLocation:]):
2668         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2669         (-[WKContentView _presentationRectsForPreviewItemController:]):
2670         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2671         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
2672         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
2673         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
2674         (-[WKFullScreenViewController videoControlsManagerDidChange]):
2675         (-[WKFullScreenViewController _manager]):
2676         (-[WKFullScreenViewController _togglePiPAction:]):
2677         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2678         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
2679         (-[WKFullScreenWindowController isFullScreen]):
2680         (-[WKFullScreenWindowController enterFullScreen]):
2681         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2682         (-[WKFullScreenWindowController exitFullScreen]):
2683         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2684         (-[WKFullScreenWindowController _completedExitFullScreen]):
2685         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
2686         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
2687         (-[WKFullScreenWindowController _manager]):
2688         * UIProcess/mac/WebPageProxyMac.mm:
2689         * WebKit.xcodeproj/project.pbxproj:
2690         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2691         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2692         (mediaTimeToCurrentTime):
2693         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
2694         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2695         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2696
2697 2018-12-10  Tim Horton  <timothy_horton@apple.com>
2698
2699         WKWebView should support custom tintColor
2700         https://bugs.webkit.org/show_bug.cgi?id=192518
2701         <rdar://problem/37243261>
2702
2703         Reviewed by Wenson Hsieh.
2704
2705         * Platform/spi/ios/UIKitSPI.h:
2706         * UIProcess/ios/WKContentViewInteraction.mm:
2707         (-[WKContentView insertionPointColor]):
2708         (-[WKContentView selectionBarColor]):
2709         (-[WKContentView selectionHighlightColor]):
2710         Grab insertion point and selection colors from UITextInputTraits.
2711
2712         (-[WKContentView _updateInteractionTintColor]):
2713         Determine our effective tint color:
2714             - transparent if interaction is disabled
2715             - a CSS-derived color if caret-color style is applied
2716             - the _inheritedInteractionTintColor, which climbs up to the tintColor API
2717         Apply it to our UITextInputTraits.
2718
2719         (-[WKContentView tintColorDidChange]):
2720         (-[WKContentView textInputTraits]):
2721         Call _updateInteractionTintColor whenever we create a new UITextInputTraits
2722         or when the tint color changes.
2723
2724 2018-12-09  Youenn Fablet  <youenn@apple.com>
2725
2726         Move capture manager from RealtimeMediaSourceCenter to capture factory
2727         https://bugs.webkit.org/show_bug.cgi?id=192542
2728
2729         Reviewed by Eric Carlson.
2730
2731         Make sure to unregister for video capture as done for other capture types.
2732         Implement manager which should be doing nothing as the manager is used for enumeration of devices
2733         which should only happen in UIProcess.
2734
2735         Given that mock capture is interfering with UserMediaCaptureManager,
2736         switching on/off mock capture will require creating a new process.
2737         This shortcoming should be fixed once mock capture will be fully happening in
2738         the same process as regular capture.
2739
2740         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2741         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
2742         * WebProcess/cocoa/UserMediaCaptureManager.h:
2743
2744 2018-12-09  Saam barati  <sbarati@apple.com>
2745
2746         Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
2747         https://bugs.webkit.org/show_bug.cgi?id=192374
2748         <rdar://problem/46506286>
2749
2750         Reviewed by Alex Christensen.
2751
2752         This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
2753         To enable on iOS, you can do something like:
2754         $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
2755         $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
2756         
2757         This patch also changes the Proxy to be enabled on a per NSURLSession
2758         basis instead of a per process basis.
2759
2760         * NetworkProcess/NetworkProcess.cpp:
2761         (WebKit::NetworkProcess::initializeNetworkProcess):
2762         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2763         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2764         (WebKit::NetworkSessionCreationParameters::encode const):
2765         (WebKit::NetworkSessionCreationParameters::decode):
2766         * NetworkProcess/NetworkSessionCreationParameters.h:
2767         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2768         (WebKit::proxyDictionary):
2769         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2770         * NetworkProcess/mac/NetworkProcessMac.mm:
2771         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2772         (WebKit::overrideSystemProxies): Deleted.
2773         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2774         (-[WKWebsiteDataStore _initWithConfiguration:]):
2775         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2776         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
2777         (-[_WKWebsiteDataStoreConfiguration httpProxy]):
2778         (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
2779         (-[_WKWebsiteDataStoreConfiguration httpsProxy]):
2780         (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
2781         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2782         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2783         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2784         (WebKit::WebsiteDataStore::parameters):
2785         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
2786         (WebKit::WebsiteDataStoreConfiguration::copy):
2787         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
2788         (WebKit::WebsiteDataStoreConfiguration::httpProxy const):
2789         (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
2790         (WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
2791         (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
2792
2793 2018-12-09  Adrian Perez de Castro  <aperez@igalia.com>
2794
2795         Build failure due to missing include of APIWebsiteDataStore.h
2796         https://bugs.webkit.org/show_bug.cgi?id=192541
2797
2798         Reviewed by Youenn Fablet.
2799
2800         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Add missing
2801         include of APIWebsiteDataStore.h
2802
2803 2018-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2804
2805         [iOS device] Crash when attempting to call -[_WKAttachment info] for an editable image
2806         https://bugs.webkit.org/show_bug.cgi?id=192538
2807
2808         Reviewed by Tim Horton.
2809
2810         Fix the crash by ensuring that the result of `-renderedDrawing` survives long enough to be wrapped by a
2811         `RetainPtr` in `-PNGRepresentation`. This isn't currently testable, since this codepath isn't supported on the
2812         iOS simulator; instead, I manually verified using MobileAttachments.app.
2813
2814         * UIProcess/ios/WKDrawingView.mm:
2815         (-[WKDrawingView renderedDrawing]):
2816
2817 2018-12-09  Commit Queue  <commit-queue@webkit.org>
2818
2819         Unreviewed, rolling out r239010.
2820         https://bugs.webkit.org/show_bug.cgi?id=192537
2821
2822         Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
2823         scrolling-layers-state.html again (Requested by ap on
2824         #webkit).
2825
2826         Reverted changeset:
2827
2828         "Allow control over child order when adding nodes to the
2829         scrolling tree"
2830         https://bugs.webkit.org/show_bug.cgi?id=176914
2831         https://trac.webkit.org/changeset/239010
2832
2833 2018-12-08  Alex Christensen  <achristensen@webkit.org>
2834
2835         Don't programmatically capitalize safe browsing warning buttons
2836         https://bugs.webkit.org/show_bug.cgi?id=192531
2837         <rdar://problem/46417791>
2838
2839         Reviewed by Darin Adler.
2840
2841         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2842         (makeButton):
2843
2844 2018-12-08  Alex Christensen  <achristensen@webkit.org>
2845
2846         Safe browsing warning should respect text size from settings
2847         https://bugs.webkit.org/show_bug.cgi?id=192205
2848
2849         Reviewed by Tim Horton.
2850
2851         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2852         (fontWithSize):
2853         (makeButton):
2854         (-[WKSafeBrowsingWarning addContent]):
2855         (-[WKSafeBrowsingWarning showDetailsClicked]):
2856
2857 2018-12-08  Frederic Wang  <fwang@igalia.com>
2858
2859         Allow control over child order when adding nodes to the scrolling tree
2860         https://bugs.webkit.org/show_bug.cgi?id=176914
2861         <rdar://problem/46542237>
2862
2863         Reviewed by Simon Fraser.
2864
2865         Based on an earlier patch by Simon Fraser.
2866
2867         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2868         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2869
2870 2018-12-07  Rob Buis  <rbuis@igalia.com>
2871
2872         Remove unused API in NetworkProcess
2873         https://bugs.webkit.org/show_bug.cgi?id=192415
2874
2875         Reviewed by Alex Christensen.
2876
2877         This patch removed some unused API and headers in NetworkProcess.
2878
2879         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2880         (WebKit::NetworkCORSPreflightChecker::startPreflight):
2881         * NetworkProcess/NetworkCORSPreflightChecker.h:
2882         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2883         * NetworkProcess/NetworkConnectionToWebProcess.h:
2884         * NetworkProcess/NetworkContentRuleListManager.h:
2885         * NetworkProcess/NetworkDataTask.cpp:
2886         * NetworkProcess/NetworkDataTask.h:
2887         * NetworkProcess/NetworkDataTaskBlob.cpp:
2888         * NetworkProcess/NetworkLoad.cpp:
2889         * NetworkProcess/NetworkLoad.h:
2890         * NetworkProcess/NetworkLoadChecker.cpp:
2891         * NetworkProcess/NetworkLoadChecker.h:
2892         * NetworkProcess/NetworkLoadClient.h:
2893         * NetworkProcess/NetworkLoadParameters.h:
2894         * NetworkProcess/NetworkProcess.cpp:
2895         * NetworkProcess/NetworkProcess.h:
2896         * NetworkProcess/NetworkProcessCreationParameters.h:
2897         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2898         (WebKit::NetworkResourceLoadParameters::encode const):
2899         (WebKit::NetworkResourceLoadParameters::decode):
2900         * NetworkProcess/NetworkResourceLoadParameters.h:
2901         * NetworkProcess/NetworkResourceLoader.cpp:
2902         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2903         * NetworkProcess/NetworkResourceLoader.h:
2904         * NetworkProcess/NetworkSession.cpp:
2905         * NetworkProcess/NetworkSession.h:
2906         * NetworkProcess/NetworkSocketStream.cpp:
2907         * NetworkProcess/NetworkSocketStream.h:
2908         * NetworkProcess/PingLoad.cpp:
2909         (WebKit::PingLoad::PingLoad):
2910         * NetworkProcess/PingLoad.h:
2911         * NetworkProcess/PreconnectTask.cpp:
2912         (WebKit::PreconnectTask::PreconnectTask):
2913         (WebKit::PreconnectTask::frameID const): Deleted.
2914         (WebKit::PreconnectTask::pageID const): Deleted.
2915         * NetworkProcess/PreconnectTask.h:
2916
2917 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
2918
2919         [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
2920         https://bugs.webkit.org/show_bug.cgi?id=192511
2921         <rdar://problem/46562063>
2922
2923         Reviewed by Youenn Fablet.
2924
2925         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2926         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter.
2927         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback.
2928         * UIProcess/UserMediaPermissionCheckProxy.h:
2929         (WebKit::UserMediaPermissionCheckProxy::create):
2930         (WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted.
2931
2932         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2933         (WebKit::generateRequestID): New.
2934         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if
2935         the page does not have a granted request and does not have persistent access.
2936         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID.
2937         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name.
2938         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID.
2939         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2940
2941 2018-12-07  Saam Barati  <sbarati@apple.com>
2942
2943         WKWebProcessPlugInLoadDelegate should have API for saying which rendering events it wants to listen for
2944         https://bugs.webkit.org/show_bug.cgi?id=192473
2945
2946         Reviewed by Andy Estes.
2947
2948         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2949         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2950         (PageLoaderClient::layoutMilestones const):
2951
2952 2018-12-07  Youenn Fablet  <youenn@apple.com>
2953
2954         Update libwebrtc up to 0d007d7c4f
2955         https://bugs.webkit.org/show_bug.cgi?id=192316
2956
2957         Reviewed by Eric Carlson.
2958
2959         Update code base according new libwebrtc backend
2960         In particular, use directly int64_t for packet time.
2961
2962         * Configurations/WebKit.xcconfig:
2963         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
2964         (WebKit::LibWebRTCSocketClient::signalReadPacket):
2965         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
2966         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2967         * NetworkProcess/webrtc/NetworkRTCSocket.h:
2968         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2969         (WebKit::LibWebRTCSocket::signalReadPacket):
2970
2971 2018-12-07  Truitt Savell  <tsavell@apple.com>
2972
2973         Unreviewed, rolling out r238947.
2974
2975         Revision caused fast/visual-viewport/tiled-drawing/zoomed-
2976         fixed-scrolling-layers-state.html to constantly fail
2977
2978         Reverted changeset:
2979
2980         "Allow control over child order when adding nodes to the
2981         scrolling tree"
2982         https://bugs.webkit.org/show_bug.cgi?id=176914
2983         https://trac.webkit.org/changeset/238947
2984
2985 2018-12-06  David Kilzer  <ddkilzer@apple.com>
2986
2987         Injected bundle for WebKitTestRunner leaks WKTypeRef objects
2988         <https://webkit.org/b/192481>
2989         <rdar://problem/46539059>
2990
2991         Reviewed by Simon Fraser.
2992
2993         Change function parameter name from `returnData[Ref]` to
2994         `returnRetainedData[Ref]` to document that the value returned is
2995         a +1 retained WKTypeRef object.
2996
2997         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2998         (WKBundlePostSynchronousMessage):
2999         * WebProcess/InjectedBundle/API/c/WKBundle.h:
3000         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3001         (WKBundlePagePostSynchronousMessageForTesting):
3002         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3003
3004 2018-12-06  Frederic Wang  <fwang@igalia.com>
3005
3006         Allow control over child order when adding nodes to the scrolling tree
3007         https://bugs.webkit.org/show_bug.cgi?id=176914
3008
3009         Reviewed by Simon Fraser.
3010
3011         Based on an earlier patch by Simon Fraser.
3012
3013         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3014         (WebKit::RemoteScrollingCoordinatorTransaction::decode): Make explicit that we want to append
3015         the new node at the end of child list.
3016
3017 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
3018
3019         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
3020         https://bugs.webkit.org/show_bug.cgi?id=192377
3021         <rdar://problem/46364206>
3022
3023         Reviewed by Tim Horton.
3024
3025         Since we are using page's viewport arguments to decide the default viewport parameters and
3026         whether we can use mininum effective device width, we should always call setViewportArguments()
3027         regardless of shouldIgnoreMetaViewport settings.
3028
3029         * WebProcess/WebPage/WebPage.cpp:
3030         (WebKit::WebPage::viewportPropertiesDidChange): Always call setViewportArguments().
3031         (WebKit::WebPage::didCommitLoad): Ditto.
3032
3033 2018-12-06  Tim Horton  <timothy_horton@apple.com>
3034
3035         Web Share API: share overlay does not stick to the Safari window
3036         https://bugs.webkit.org/show_bug.cgi?id=192469
3037         <rdar://problem/46074833>
3038
3039         Reviewed by Wenson Hsieh.
3040
3041         * UIProcess/Cocoa/WKShareSheet.mm:
3042         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
3043         (-[WKShareSheet sharingServicePicker:delegateForSharingService:]):
3044         (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]):
3045         (-[WKShareSheet sharingService:didFailToShareItems:error:]):
3046         (-[WKShareSheet sharingService:didShareItems:]):
3047         Implement another NSSharingServicePickerDelegate method to return
3048         an *NSSharingService* delegate when needed.
3049
3050         Implement an NSSharingServiceDelegate method to return the window that
3051         the service's UI should attach to.
3052
3053         Also, instead of notifying the Web Content process when a service is picked
3054         (or not) in the NSSharingServicePicker, wait until the share has completed
3055         (or failed) to send didComplete. This both makes the return completion
3056         value more accurate (matching iOS, if you cancel the share during the
3057         recipient choice step, it will now fail), and avoids explicitly tearing
3058         down the NSSharingServicePicker too early, which breaks the UI attaching mechanism.
3059
3060 2018-12-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3061
3062         [iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard
3063         https://bugs.webkit.org/show_bug.cgi?id=187554
3064         <rdar://problem/42075638>
3065
3066         Reviewed by Tim Horton.
3067
3068         Add support for automatically switching the base writing direction to the default writing direction with respect
3069         to the current keyboard in an editable WKWebView by implementing `-setBaseWritingDirection:forRange:`. On iOS 12
3070         and earlier, UIKit invokes this protocol method whenever the keyboard is changed to one with a different writing
3071         direction, although in some other versions of iOS, this only happens when first focusing an editable area.
3072
3073         Test: editing/input/ios/rtl-keyboard-input-on-focus.html
3074
3075         * Platform/spi/ios/UIKitSPI.h:
3076
3077         Declare UIKeyboardImpl IPI methods mostly for use in WebKitTestRunner (with the exception of
3078         `-setInitialDirection`, which we may invoke when we receive the first post-layout EditorState update after
3079         focusing an editable element).
3080
3081         * UIProcess/PageClient.h:
3082         * UIProcess/WebPageProxy.cpp:
3083         (WebKit::WebPageProxy::increaseListLevel):
3084         (WebKit::WebPageProxy::decreaseListLevel):
3085         (WebKit::WebPageProxy::changeListType):
3086         (WebKit::WebPageProxy::setBaseWritingDirection):
3087
3088         Drive-by style fixes: make these bail and return early if `!isValid()`.
3089
3090         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3091
3092         Reset assisted node state in the UI process upon web process termination.
3093
3094         * UIProcess/WebPageProxy.h:
3095
3096         Add plumbing for `setBaseWritingDirection`, from `WebPageProxy` to `WebPage` to `Editor`.
3097
3098         * UIProcess/ios/PageClientImplIOS.h:
3099         * UIProcess/ios/PageClientImplIOS.mm:
3100         (WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus):
3101         * UIProcess/ios/WKContentViewInteraction.h:
3102         * UIProcess/ios/WKContentViewInteraction.mm:
3103         (-[WKContentView baseWritingDirectionForPosition:inDirection:]):
3104         (coreWritingDirection):
3105         (-[WKContentView setBaseWritingDirection:forRange:]):
3106
3107         Support `-setBaseWritingDirectionForPosition:forRange:`, but only in the case where the given range is the
3108         selected range. This is all that's currently needed to fulfill the requirements in <rdar://problem/42075638>,
3109         though we could potentially add full support for this in the future by mapping the given text range to a DOM
3110         range and moving the selection prior to setting the base writing direction.
3111
3112         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
3113
3114         Add a hook to notify WKContentView when the first post-layout EditorState has been received in the UI process.
3115         When this is invoked, if the web view is editable and the selection is not a range, we call into `UIKeyboardImpl`
3116         to change the initial writing direction if necessary.
3117
3118         * UIProcess/ios/WebPageProxyIOS.mm:
3119         (WebKit::WebPageProxy::startAssistingNode):
3120         (WebKit::WebPageProxy::stopAssistingNode):
3121         (WebKit::WebPageProxy::editorStateChanged):
3122         * WebProcess/WebPage/WebPage.cpp:
3123         (WebKit::WebPage::setBaseWritingDirection):
3124         * WebProcess/WebPage/WebPage.h:
3125         * WebProcess/WebPage/WebPage.messages.in:
3126
3127 2018-12-06  David Quesada  <david_quesada@apple.com>
3128
3129         -[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
3130         https://bugs.webkit.org/show_bug.cgi?id=192411
3131         rdar://problem/46492487
3132
3133         Reviewed by Alex Christensen.
3134
3135         * UIProcess/API/C/WKContext.cpp:
3136         (WKContextResumeDownload):
3137         * UIProcess/API/Cocoa/WKProcessPool.mm:
3138         (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
3139         (-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.
3140         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3141         * UIProcess/WebProcessPool.cpp:
3142         (WebKit::WebProcessPool::resumeDownload):
3143          - Set the originating page of the DownloadProxy.
3144          - If the originating page is non-null, use its session ID for the download.
3145          - Remove a FIXME. It's possible to do this now by providing the web view whose session
3146            should be used for the download.
3147         * UIProcess/WebProcessPool.h:
3148
3149 2018-12-06  Jiewen Tan  <jiewen_tan@apple.com>
3150
3151         Unreviewed, a quick fix after r238919
3152
3153         Add an early return such that the error message is actually meaningful.
3154
3155         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
3156         (WebKit::MockHidService::platformStartDiscovery):
3157
3158 2018-12-06  Alex Christensen  <achristensen@webkit.org>
3159
3160         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
3161         https://bugs.webkit.org/show_bug.cgi?id=192452
3162
3163         Reviewed by Anders Carlsson.
3164
3165         This was introduced in r210835 but never used.
3166         It's preventing me from making the disk cache associated with a SessionID/NetworkSession.
3167
3168         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3169         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): Deleted.
3170         * NetworkProcess/NetworkConnectionToWebProcess.h:
3171         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3172         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3173         (WebKit::NetworkResourceLoadParameters::encode const):
3174         (WebKit::NetworkResourceLoadParameters::decode):
3175         * NetworkProcess/NetworkResourceLoadParameters.h:
3176         * NetworkProcess/NetworkResourceLoader.cpp:
3177         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
3178         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3179         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): Deleted.
3180         * NetworkProcess/NetworkResourceLoader.h:
3181         * WebProcess/Network/WebLoaderStrategy.cpp:
3182         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3183         (WebKit::WebLoaderStrategy::storeDerivedDataToCache): Deleted.
3184         * WebProcess/Network/WebLoaderStrategy.h:
3185         * WebProcess/Network/WebResourceLoader.cpp:
3186         (WebKit::WebResourceLoader::didRetrieveDerivedData): Deleted.
3187         * WebProcess/Network/WebResourceLoader.messages.in:
3188
3189 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
3190
3191         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
3192         https://bugs.webkit.org/show_bug.cgi?id=191997
3193
3194         Reviewed by Philippe Normand.
3195
3196         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
3197
3198         * Shared/WebEventConversion.cpp:
3199         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
3200
3201 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
3202
3203         REGRESSION(PSON): Process swapping code doesn't set DisplayID in WebContent process
3204         https://bugs.webkit.org/show_bug.cgi?id=192290
3205
3206         Reviewed by Simon Fraser.
3207
3208         Fixed the bug by updating the DisplayID upon attaching to a WebContent process
3209         after a process swap as well as after the previous WebContent process had crashed.
3210
3211         Unfortunately no new tests since WebKitTestRunner / DumpRenderTree should use 0 as DisplayID
3212         as they have an off-screen NSWindow. The issue that this results in no fallback for
3213         the animation timer is tracked by webkit.org/b/192448.
3214
3215         * UIProcess/Cocoa/WebViewImpl.mm:
3216         (WebKit::WebViewImpl::didRelaunchProcess):
3217
3218 2018-12-05  Youenn Fablet  <youenn@apple.com>
3219
3220         Remove a document entry from NetworkMDNSRegister::m_services when document goes away
3221         https://bugs.webkit.org/show_bug.cgi?id=192429
3222
3223         Reviewed by Eric Carlson.
3224
3225         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
3226         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
3227         We should remove the entry to limit the size of the map.
3228
3229 2018-12-05  Jiewen Tan  <jiewen_tan@apple.com>
3230
3231         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
3232         https://bugs.webkit.org/show_bug.cgi?id=192061
3233
3234         Reviewed by Dewei Zhu.
3235
3236         Part 1.
3237
3238         Add some loggings to determine possible causes for the flakiness.
3239
3240         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
3241         (WebKit::HidService::continueAddDeviceAfterGetInfo):
3242         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
3243         (WebKit::MockHidService::platformStartDiscovery):
3244
3245 2018-12-05  Chris Dumez  <cdumez@apple.com>
3246
3247         Simplify logic inside WebPageProxy::continueNavigationInNewProcess()
3248         https://bugs.webkit.org/show_bug.cgi?id=192404
3249
3250         Reviewed by Alex Christensen.
3251
3252         Simplify get the item state from the current back/forward list item, instead of
3253         relying on WebBackForwardList::filteredItemStates().
3254
3255         * UIProcess/WebPageProxy.cpp:
3256         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3257
3258 2018-12-05  Youenn Fablet  <youenn@apple.com>
3259
3260         Enable the possibility to do video capture in UIProcess
3261         https://bugs.webkit.org/show_bug.cgi?id=192394
3262
3263         Reviewed by Eric Carlson.
3264
3265         Add two web preferences to toggle audio/video capture in UIProcess or WebProcess.
3266         Add mechanism for video capture that was not implemented yet.
3267
3268         * Shared/WebPreferences.yaml:
3269         * Shared/WebPreferencesDefaultValues.h:
3270         * Shared/WebProcessCreationParameters.cpp:
3271         (WebKit::WebProcessCreationParameters::encode const):
3272         (WebKit::WebProcessCreationParameters::decode):
3273         * Shared/WebProcessCreationParameters.h:
3274         * UIProcess/API/APIProcessPoolConfiguration.h:
3275         * UIProcess/API/C/WKPreferences.cpp:
3276         (WKPreferencesSetCaptureAudioInUIProcessEnabled):
3277         (WKPreferencesGetCaptureAudioInUIProcessEnabled):
3278         (WKPreferencesSetCaptureVideoInUIProcessEnabled):
3279         (WKPreferencesGetCaptureVideoInUIProcessEnabled):
3280         * UIProcess/API/C/WKPreferencesRef.h:
3281         * UIProcess/WebPreferences.cpp:
3282         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
3283         * UIProcess/WebProcessPool.cpp:
3284         (WebKit::WebProcessPool::initializeNewWebProcess):
3285         (WebKit::WebProcessPool::createWebPage):
3286         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3287         (WebKit::UserMediaCaptureManager::initialize):
3288
3289 2018-12-05  Alex Christensen  <achristensen@webkit.org>
3290
3291         Make WebsiteDataStoreConfiguration a proper API object
3292         https://bugs.webkit.org/show_bug.cgi?id=192380
3293
3294         Reviewed by Youenn Fablet.
3295
3296         In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
3297         Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
3298         like all our other ObjC API objects are.
3299
3300         * Shared/API/APIObject.h:
3301         (API::Object::wrapper const):
3302         (API::Object::wrapper): Deleted.
3303         * Shared/Cocoa/APIObject.mm:
3304         (API::Object::ref const):
3305         (API::Object::deref const):
3306         (API::Object::newObject):
3307         (API::Object::ref): Deleted.
3308         (API::Object::deref): Deleted.
3309         * Sources.txt:
3310         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3311         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
3312         * UIProcess/API/APIProcessPoolConfiguration.h:
3313         * UIProcess/API/APIWebsiteDataStore.cpp:
3314         (API::WebsiteDataStore::createLegacy):
3315         (API::WebsiteDataStore::WebsiteDataStore):
3316         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
3317         * UIProcess/API/APIWebsiteDataStore.h:
3318         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3319         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3320         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3321         (-[WKWebsiteDataStore _initWithConfiguration:]):
3322         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
3323         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
3324         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
3325         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
3326         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
3327         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
3328         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
3329         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
3330         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
3331         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
3332         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
3333         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
3334         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
3335         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
3336         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
3337         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
3338         (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
3339         (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
3340         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
3341         (-[_WKWebsiteDataStoreConfiguration _apiObject]):
3342         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
3343         * UIProcess/Network/NetworkProcessProxy.cpp:
3344         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
3345         * UIProcess/WebProcessPool.cpp:
3346         (WebKit::legacyWebsiteDataStoreConfiguration):
3347         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
3348         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3349         (WebKit::WebsiteDataStore::parameters):
3350         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3351         (WebKit::WebsiteDataStore::create):
3352         (WebKit::WebsiteDataStore::WebsiteDataStore):
3353         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
3354         (WebKit::WebsiteDataStore::fetchDataAndApply):
3355         (WebKit::WebsiteDataStore::removeData):
3356         (WebKit::WebsiteDataStore::parameters):
3357         (WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
3358         * UIProcess/WebsiteData/WebsiteDataStore.h:
3359         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
3360         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
3361         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
3362         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
3363         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
3364         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
3365         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
3366         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
3367         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
3368         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
3369         (WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
3370         (WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
3371         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
3372         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
3373         (WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
3374         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
3375         (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
3376         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
3377         (WebKit::WebsiteDataStoreConfiguration::create):
3378         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
3379         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
3380         (WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
3381         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
3382         (WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
3383         (WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
3384         (WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
3385         (WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
3386         (WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
3387         (WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
3388         (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
3389         (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
3390         (WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
3391         (WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
3392         (WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
3393         (WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
3394         (WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
3395         (WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
3396         (WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
3397         (WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
3398         (WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
3399         (WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
3400         (WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
3401         (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
3402         (WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
3403         (WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
3404         (WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
3405         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
3406         (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
3407         (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
3408         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
3409         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
3410         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
3411         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
3412         * WebKit.xcodeproj/project.pbxproj:
3413
3414 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3415
3416         Turn WritingDirection into an enum class
3417         https://bugs.webkit.org/show_bug.cgi?id=192401
3418         Work towards <rdar://problem/42075638>
3419
3420         Reviewed by Dan Bernstein.
3421
3422         Change WritingDirection from an enum to an enum class. No change in behavior.
3423
3424         * WebProcess/WebPage/WebFrame.cpp:
3425         (WebKit::WebFrame::setTextDirection):
3426
3427 2018-12-05  Rob Buis  <rbuis@igalia.com>
3428
3429         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
3430         https://bugs.webkit.org/show_bug.cgi?id=114965
3431
3432         Reviewed by Frédéric Wang.
3433
3434         HEAD requests should not be changed to GET after 303 redirects, see [1].
3435         This was fixed earlier for GTK [2].
3436
3437         Behavior matches Firefox and Chrome.
3438
3439         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
3440         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
3441
3442         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
3443                web-platform-tests/fetch/api/redirect/redirect-method-worker.html