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