db43de90c60fb77274785298acd8054e100c2c2f
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-12-09  Adrian Perez de Castro  <aperez@igalia.com>
2
3         Build failure due to missing include of APIWebsiteDataStore.h
4         https://bugs.webkit.org/show_bug.cgi?id=192541
5
6         Reviewed by Youenn Fablet.
7
8         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Add missing
9         include of APIWebsiteDataStore.h
10
11 2018-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
12
13         [iOS device] Crash when attempting to call -[_WKAttachment info] for an editable image
14         https://bugs.webkit.org/show_bug.cgi?id=192538
15
16         Reviewed by Tim Horton.
17
18         Fix the crash by ensuring that the result of `-renderedDrawing` survives long enough to be wrapped by a
19         `RetainPtr` in `-PNGRepresentation`. This isn't currently testable, since this codepath isn't supported on the
20         iOS simulator; instead, I manually verified using MobileAttachments.app.
21
22         * UIProcess/ios/WKDrawingView.mm:
23         (-[WKDrawingView renderedDrawing]):
24
25 2018-12-09  Commit Queue  <commit-queue@webkit.org>
26
27         Unreviewed, rolling out r239010.
28         https://bugs.webkit.org/show_bug.cgi?id=192537
29
30         Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
31         scrolling-layers-state.html again (Requested by ap on
32         #webkit).
33
34         Reverted changeset:
35
36         "Allow control over child order when adding nodes to the
37         scrolling tree"
38         https://bugs.webkit.org/show_bug.cgi?id=176914
39         https://trac.webkit.org/changeset/239010
40
41 2018-12-08  Alex Christensen  <achristensen@webkit.org>
42
43         Don't programmatically capitalize safe browsing warning buttons
44         https://bugs.webkit.org/show_bug.cgi?id=192531
45         <rdar://problem/46417791>
46
47         Reviewed by Darin Adler.
48
49         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
50         (makeButton):
51
52 2018-12-08  Alex Christensen  <achristensen@webkit.org>
53
54         Safe browsing warning should respect text size from settings
55         https://bugs.webkit.org/show_bug.cgi?id=192205
56
57         Reviewed by Tim Horton.
58
59         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
60         (fontWithSize):
61         (makeButton):
62         (-[WKSafeBrowsingWarning addContent]):
63         (-[WKSafeBrowsingWarning showDetailsClicked]):
64
65 2018-12-08  Frederic Wang  <fwang@igalia.com>
66
67         Allow control over child order when adding nodes to the scrolling tree
68         https://bugs.webkit.org/show_bug.cgi?id=176914
69         <rdar://problem/46542237>
70
71         Reviewed by Simon Fraser.
72
73         Based on an earlier patch by Simon Fraser.
74
75         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
76         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
77
78 2018-12-07  Rob Buis  <rbuis@igalia.com>
79
80         Remove unused API in NetworkProcess
81         https://bugs.webkit.org/show_bug.cgi?id=192415
82
83         Reviewed by Alex Christensen.
84
85         This patch removed some unused API and headers in NetworkProcess.
86
87         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
88         (WebKit::NetworkCORSPreflightChecker::startPreflight):
89         * NetworkProcess/NetworkCORSPreflightChecker.h:
90         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
91         * NetworkProcess/NetworkConnectionToWebProcess.h:
92         * NetworkProcess/NetworkContentRuleListManager.h:
93         * NetworkProcess/NetworkDataTask.cpp:
94         * NetworkProcess/NetworkDataTask.h:
95         * NetworkProcess/NetworkDataTaskBlob.cpp:
96         * NetworkProcess/NetworkLoad.cpp:
97         * NetworkProcess/NetworkLoad.h:
98         * NetworkProcess/NetworkLoadChecker.cpp:
99         * NetworkProcess/NetworkLoadChecker.h:
100         * NetworkProcess/NetworkLoadClient.h:
101         * NetworkProcess/NetworkLoadParameters.h:
102         * NetworkProcess/NetworkProcess.cpp:
103         * NetworkProcess/NetworkProcess.h:
104         * NetworkProcess/NetworkProcessCreationParameters.h:
105         * NetworkProcess/NetworkResourceLoadParameters.cpp:
106         (WebKit::NetworkResourceLoadParameters::encode const):
107         (WebKit::NetworkResourceLoadParameters::decode):
108         * NetworkProcess/NetworkResourceLoadParameters.h:
109         * NetworkProcess/NetworkResourceLoader.cpp:
110         (WebKit::NetworkResourceLoader::didReceiveBuffer):
111         * NetworkProcess/NetworkResourceLoader.h:
112         * NetworkProcess/NetworkSession.cpp:
113         * NetworkProcess/NetworkSession.h:
114         * NetworkProcess/NetworkSocketStream.cpp:
115         * NetworkProcess/NetworkSocketStream.h:
116         * NetworkProcess/PingLoad.cpp:
117         (WebKit::PingLoad::PingLoad):
118         * NetworkProcess/PingLoad.h:
119         * NetworkProcess/PreconnectTask.cpp:
120         (WebKit::PreconnectTask::PreconnectTask):
121         (WebKit::PreconnectTask::frameID const): Deleted.
122         (WebKit::PreconnectTask::pageID const): Deleted.
123         * NetworkProcess/PreconnectTask.h:
124
125 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
126
127         [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
128         https://bugs.webkit.org/show_bug.cgi?id=192511
129         <rdar://problem/46562063>
130
131         Reviewed by Youenn Fablet.
132
133         * UIProcess/UserMediaPermissionCheckProxy.cpp:
134         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter.
135         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback.
136         * UIProcess/UserMediaPermissionCheckProxy.h:
137         (WebKit::UserMediaPermissionCheckProxy::create):
138         (WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted.
139
140         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
141         (WebKit::generateRequestID): New.
142         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if
143         the page does not have a granted request and does not have persistent access.
144         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID.
145         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name.
146         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID.
147         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
148
149 2018-12-07  Saam Barati  <sbarati@apple.com>
150
151         WKWebProcessPlugInLoadDelegate should have API for saying which rendering events it wants to listen for
152         https://bugs.webkit.org/show_bug.cgi?id=192473
153
154         Reviewed by Andy Estes.
155
156         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
157         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
158         (PageLoaderClient::layoutMilestones const):
159
160 2018-12-07  Youenn Fablet  <youenn@apple.com>
161
162         Update libwebrtc up to 0d007d7c4f
163         https://bugs.webkit.org/show_bug.cgi?id=192316
164
165         Reviewed by Eric Carlson.
166
167         Update code base according new libwebrtc backend
168         In particular, use directly int64_t for packet time.
169
170         * Configurations/WebKit.xcconfig:
171         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
172         (WebKit::LibWebRTCSocketClient::signalReadPacket):
173         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
174         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
175         * NetworkProcess/webrtc/NetworkRTCSocket.h:
176         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
177         (WebKit::LibWebRTCSocket::signalReadPacket):
178
179 2018-12-07  Truitt Savell  <tsavell@apple.com>
180
181         Unreviewed, rolling out r238947.
182
183         Revision caused fast/visual-viewport/tiled-drawing/zoomed-
184         fixed-scrolling-layers-state.html to constantly fail
185
186         Reverted changeset:
187
188         "Allow control over child order when adding nodes to the
189         scrolling tree"
190         https://bugs.webkit.org/show_bug.cgi?id=176914
191         https://trac.webkit.org/changeset/238947
192
193 2018-12-06  David Kilzer  <ddkilzer@apple.com>
194
195         Injected bundle for WebKitTestRunner leaks WKTypeRef objects
196         <https://webkit.org/b/192481>
197         <rdar://problem/46539059>
198
199         Reviewed by Simon Fraser.
200
201         Change function parameter name from `returnData[Ref]` to
202         `returnRetainedData[Ref]` to document that the value returned is
203         a +1 retained WKTypeRef object.
204
205         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
206         (WKBundlePostSynchronousMessage):
207         * WebProcess/InjectedBundle/API/c/WKBundle.h:
208         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
209         (WKBundlePagePostSynchronousMessageForTesting):
210         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
211
212 2018-12-06  Frederic Wang  <fwang@igalia.com>
213
214         Allow control over child order when adding nodes to the scrolling tree
215         https://bugs.webkit.org/show_bug.cgi?id=176914
216
217         Reviewed by Simon Fraser.
218
219         Based on an earlier patch by Simon Fraser.
220
221         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
222         (WebKit::RemoteScrollingCoordinatorTransaction::decode): Make explicit that we want to append
223         the new node at the end of child list.
224
225 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
226
227         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
228         https://bugs.webkit.org/show_bug.cgi?id=192377
229         <rdar://problem/46364206>
230
231         Reviewed by Tim Horton.
232
233         Since we are using page's viewport arguments to decide the default viewport parameters and
234         whether we can use mininum effective device width, we should always call setViewportArguments()
235         regardless of shouldIgnoreMetaViewport settings.
236
237         * WebProcess/WebPage/WebPage.cpp:
238         (WebKit::WebPage::viewportPropertiesDidChange): Always call setViewportArguments().
239         (WebKit::WebPage::didCommitLoad): Ditto.
240
241 2018-12-06  Tim Horton  <timothy_horton@apple.com>
242
243         Web Share API: share overlay does not stick to the Safari window
244         https://bugs.webkit.org/show_bug.cgi?id=192469
245         <rdar://problem/46074833>
246
247         Reviewed by Wenson Hsieh.
248
249         * UIProcess/Cocoa/WKShareSheet.mm:
250         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
251         (-[WKShareSheet sharingServicePicker:delegateForSharingService:]):
252         (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]):
253         (-[WKShareSheet sharingService:didFailToShareItems:error:]):
254         (-[WKShareSheet sharingService:didShareItems:]):
255         Implement another NSSharingServicePickerDelegate method to return
256         an *NSSharingService* delegate when needed.
257
258         Implement an NSSharingServiceDelegate method to return the window that
259         the service's UI should attach to.
260
261         Also, instead of notifying the Web Content process when a service is picked
262         (or not) in the NSSharingServicePicker, wait until the share has completed
263         (or failed) to send didComplete. This both makes the return completion
264         value more accurate (matching iOS, if you cancel the share during the
265         recipient choice step, it will now fail), and avoids explicitly tearing
266         down the NSSharingServicePicker too early, which breaks the UI attaching mechanism.
267
268 2018-12-06  Wenson Hsieh  <wenson_hsieh@apple.com>
269
270         [iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard
271         https://bugs.webkit.org/show_bug.cgi?id=187554
272         <rdar://problem/42075638>
273
274         Reviewed by Tim Horton.
275
276         Add support for automatically switching the base writing direction to the default writing direction with respect
277         to the current keyboard in an editable WKWebView by implementing `-setBaseWritingDirection:forRange:`. On iOS 12
278         and earlier, UIKit invokes this protocol method whenever the keyboard is changed to one with a different writing
279         direction, although in some other versions of iOS, this only happens when first focusing an editable area.
280
281         Test: editing/input/ios/rtl-keyboard-input-on-focus.html
282
283         * Platform/spi/ios/UIKitSPI.h:
284
285         Declare UIKeyboardImpl IPI methods mostly for use in WebKitTestRunner (with the exception of
286         `-setInitialDirection`, which we may invoke when we receive the first post-layout EditorState update after
287         focusing an editable element).
288
289         * UIProcess/PageClient.h:
290         * UIProcess/WebPageProxy.cpp:
291         (WebKit::WebPageProxy::increaseListLevel):
292         (WebKit::WebPageProxy::decreaseListLevel):
293         (WebKit::WebPageProxy::changeListType):
294         (WebKit::WebPageProxy::setBaseWritingDirection):
295
296         Drive-by style fixes: make these bail and return early if `!isValid()`.
297
298         (WebKit::WebPageProxy::resetStateAfterProcessExited):
299
300         Reset assisted node state in the UI process upon web process termination.
301
302         * UIProcess/WebPageProxy.h:
303
304         Add plumbing for `setBaseWritingDirection`, from `WebPageProxy` to `WebPage` to `Editor`.
305
306         * UIProcess/ios/PageClientImplIOS.h:
307         * UIProcess/ios/PageClientImplIOS.mm:
308         (WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus):
309         * UIProcess/ios/WKContentViewInteraction.h:
310         * UIProcess/ios/WKContentViewInteraction.mm:
311         (-[WKContentView baseWritingDirectionForPosition:inDirection:]):
312         (coreWritingDirection):
313         (-[WKContentView setBaseWritingDirection:forRange:]):
314
315         Support `-setBaseWritingDirectionForPosition:forRange:`, but only in the case where the given range is the
316         selected range. This is all that's currently needed to fulfill the requirements in <rdar://problem/42075638>,
317         though we could potentially add full support for this in the future by mapping the given text range to a DOM
318         range and moving the selection prior to setting the base writing direction.
319
320         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
321
322         Add a hook to notify WKContentView when the first post-layout EditorState has been received in the UI process.
323         When this is invoked, if the web view is editable and the selection is not a range, we call into `UIKeyboardImpl`
324         to change the initial writing direction if necessary.
325
326         * UIProcess/ios/WebPageProxyIOS.mm:
327         (WebKit::WebPageProxy::startAssistingNode):
328         (WebKit::WebPageProxy::stopAssistingNode):
329         (WebKit::WebPageProxy::editorStateChanged):
330         * WebProcess/WebPage/WebPage.cpp:
331         (WebKit::WebPage::setBaseWritingDirection):
332         * WebProcess/WebPage/WebPage.h:
333         * WebProcess/WebPage/WebPage.messages.in:
334
335 2018-12-06  David Quesada  <david_quesada@apple.com>
336
337         -[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
338         https://bugs.webkit.org/show_bug.cgi?id=192411
339         rdar://problem/46492487
340
341         Reviewed by Alex Christensen.
342
343         * UIProcess/API/C/WKContext.cpp:
344         (WKContextResumeDownload):
345         * UIProcess/API/Cocoa/WKProcessPool.mm:
346         (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
347         (-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.
348         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
349         * UIProcess/WebProcessPool.cpp:
350         (WebKit::WebProcessPool::resumeDownload):
351          - Set the originating page of the DownloadProxy.
352          - If the originating page is non-null, use its session ID for the download.
353          - Remove a FIXME. It's possible to do this now by providing the web view whose session
354            should be used for the download.
355         * UIProcess/WebProcessPool.h:
356
357 2018-12-06  Jiewen Tan  <jiewen_tan@apple.com>
358
359         Unreviewed, a quick fix after r238919
360
361         Add an early return such that the error message is actually meaningful.
362
363         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
364         (WebKit::MockHidService::platformStartDiscovery):
365
366 2018-12-06  Alex Christensen  <achristensen@webkit.org>
367
368         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
369         https://bugs.webkit.org/show_bug.cgi?id=192452
370
371         Reviewed by Anders Carlsson.
372
373         This was introduced in r210835 but never used.
374         It's preventing me from making the disk cache associated with a SessionID/NetworkSession.
375
376         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
377         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): Deleted.
378         * NetworkProcess/NetworkConnectionToWebProcess.h:
379         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
380         * NetworkProcess/NetworkResourceLoadParameters.cpp:
381         (WebKit::NetworkResourceLoadParameters::encode const):
382         (WebKit::NetworkResourceLoadParameters::decode):
383         * NetworkProcess/NetworkResourceLoadParameters.h:
384         * NetworkProcess/NetworkResourceLoader.cpp:
385         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
386         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
387         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): Deleted.
388         * NetworkProcess/NetworkResourceLoader.h:
389         * WebProcess/Network/WebLoaderStrategy.cpp:
390         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
391         (WebKit::WebLoaderStrategy::storeDerivedDataToCache): Deleted.
392         * WebProcess/Network/WebLoaderStrategy.h:
393         * WebProcess/Network/WebResourceLoader.cpp:
394         (WebKit::WebResourceLoader::didRetrieveDerivedData): Deleted.
395         * WebProcess/Network/WebResourceLoader.messages.in:
396
397 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
398
399         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
400         https://bugs.webkit.org/show_bug.cgi?id=191997
401
402         Reviewed by Philippe Normand.
403
404         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
405
406         * Shared/WebEventConversion.cpp:
407         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
408
409 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
410
411         REGRESSION(PSON): Process swapping code doesn't set DisplayID in WebContent process
412         https://bugs.webkit.org/show_bug.cgi?id=192290
413
414         Reviewed by Simon Fraser.
415
416         Fixed the bug by updating the DisplayID upon attaching to a WebContent process
417         after a process swap as well as after the previous WebContent process had crashed.
418
419         Unfortunately no new tests since WebKitTestRunner / DumpRenderTree should use 0 as DisplayID
420         as they have an off-screen NSWindow. The issue that this results in no fallback for
421         the animation timer is tracked by webkit.org/b/192448.
422
423         * UIProcess/Cocoa/WebViewImpl.mm:
424         (WebKit::WebViewImpl::didRelaunchProcess):
425
426 2018-12-05  Youenn Fablet  <youenn@apple.com>
427
428         Remove a document entry from NetworkMDNSRegister::m_services when document goes away
429         https://bugs.webkit.org/show_bug.cgi?id=192429
430
431         Reviewed by Eric Carlson.
432
433         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
434         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
435         We should remove the entry to limit the size of the map.
436
437 2018-12-05  Jiewen Tan  <jiewen_tan@apple.com>
438
439         [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
440         https://bugs.webkit.org/show_bug.cgi?id=192061
441
442         Reviewed by Dewei Zhu.
443
444         Part 1.
445
446         Add some loggings to determine possible causes for the flakiness.
447
448         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
449         (WebKit::HidService::continueAddDeviceAfterGetInfo):
450         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
451         (WebKit::MockHidService::platformStartDiscovery):
452
453 2018-12-05  Chris Dumez  <cdumez@apple.com>
454
455         Simplify logic inside WebPageProxy::continueNavigationInNewProcess()
456         https://bugs.webkit.org/show_bug.cgi?id=192404
457
458         Reviewed by Alex Christensen.
459
460         Simplify get the item state from the current back/forward list item, instead of
461         relying on WebBackForwardList::filteredItemStates().
462
463         * UIProcess/WebPageProxy.cpp:
464         (WebKit::WebPageProxy::continueNavigationInNewProcess):
465
466 2018-12-05  Youenn Fablet  <youenn@apple.com>
467
468         Enable the possibility to do video capture in UIProcess
469         https://bugs.webkit.org/show_bug.cgi?id=192394
470
471         Reviewed by Eric Carlson.
472
473         Add two web preferences to toggle audio/video capture in UIProcess or WebProcess.
474         Add mechanism for video capture that was not implemented yet.
475
476         * Shared/WebPreferences.yaml:
477         * Shared/WebPreferencesDefaultValues.h:
478         * Shared/WebProcessCreationParameters.cpp:
479         (WebKit::WebProcessCreationParameters::encode const):
480         (WebKit::WebProcessCreationParameters::decode):
481         * Shared/WebProcessCreationParameters.h:
482         * UIProcess/API/APIProcessPoolConfiguration.h:
483         * UIProcess/API/C/WKPreferences.cpp:
484         (WKPreferencesSetCaptureAudioInUIProcessEnabled):
485         (WKPreferencesGetCaptureAudioInUIProcessEnabled):
486         (WKPreferencesSetCaptureVideoInUIProcessEnabled):
487         (WKPreferencesGetCaptureVideoInUIProcessEnabled):
488         * UIProcess/API/C/WKPreferencesRef.h:
489         * UIProcess/WebPreferences.cpp:
490         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
491         * UIProcess/WebProcessPool.cpp:
492         (WebKit::WebProcessPool::initializeNewWebProcess):
493         (WebKit::WebProcessPool::createWebPage):
494         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
495         (WebKit::UserMediaCaptureManager::initialize):
496
497 2018-12-05  Alex Christensen  <achristensen@webkit.org>
498
499         Make WebsiteDataStoreConfiguration a proper API object
500         https://bugs.webkit.org/show_bug.cgi?id=192380
501
502         Reviewed by Youenn Fablet.
503
504         In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
505         Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
506         like all our other ObjC API objects are.
507
508         * Shared/API/APIObject.h:
509         (API::Object::wrapper const):
510         (API::Object::wrapper): Deleted.
511         * Shared/Cocoa/APIObject.mm:
512         (API::Object::ref const):
513         (API::Object::deref const):
514         (API::Object::newObject):
515         (API::Object::ref): Deleted.
516         (API::Object::deref): Deleted.
517         * Sources.txt:
518         * UIProcess/API/APIProcessPoolConfiguration.cpp:
519         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
520         * UIProcess/API/APIProcessPoolConfiguration.h:
521         * UIProcess/API/APIWebsiteDataStore.cpp:
522         (API::WebsiteDataStore::createLegacy):
523         (API::WebsiteDataStore::WebsiteDataStore):
524         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
525         * UIProcess/API/APIWebsiteDataStore.h:
526         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
527         (API::WebsiteDataStore::defaultDataStoreConfiguration):
528         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
529         (-[WKWebsiteDataStore _initWithConfiguration:]):
530         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
531         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
532         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
533         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
534         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
535         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
536         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
537         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
538         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
539         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
540         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
541         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
542         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
543         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
544         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
545         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
546         (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
547         (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
548         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
549         (-[_WKWebsiteDataStoreConfiguration _apiObject]):
550         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
551         * UIProcess/Network/NetworkProcessProxy.cpp:
552         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
553         * UIProcess/WebProcessPool.cpp:
554         (WebKit::legacyWebsiteDataStoreConfiguration):
555         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
556         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
557         (WebKit::WebsiteDataStore::parameters):
558         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
559         (WebKit::WebsiteDataStore::create):
560         (WebKit::WebsiteDataStore::WebsiteDataStore):
561         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
562         (WebKit::WebsiteDataStore::fetchDataAndApply):
563         (WebKit::WebsiteDataStore::removeData):
564         (WebKit::WebsiteDataStore::parameters):
565         (WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
566         * UIProcess/WebsiteData/WebsiteDataStore.h:
567         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
568         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
569         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
570         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
571         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
572         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
573         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
574         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
575         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
576         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
577         (WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
578         (WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
579         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
580         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
581         (WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
582         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
583         (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
584         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
585         (WebKit::WebsiteDataStoreConfiguration::create):
586         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
587         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
588         (WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
589         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
590         (WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
591         (WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
592         (WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
593         (WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
594         (WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
595         (WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
596         (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
597         (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
598         (WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
599         (WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
600         (WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
601         (WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
602         (WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
603         (WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
604         (WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
605         (WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
606         (WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
607         (WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
608         (WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
609         (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
610         (WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
611         (WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
612         (WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
613         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
614         (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
615         (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
616         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
617         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
618         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
619         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
620         * WebKit.xcodeproj/project.pbxproj:
621
622 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
623
624         Turn WritingDirection into an enum class
625         https://bugs.webkit.org/show_bug.cgi?id=192401
626         Work towards <rdar://problem/42075638>
627
628         Reviewed by Dan Bernstein.
629
630         Change WritingDirection from an enum to an enum class. No change in behavior.
631
632         * WebProcess/WebPage/WebFrame.cpp:
633         (WebKit::WebFrame::setTextDirection):
634
635 2018-12-05  Rob Buis  <rbuis@igalia.com>
636
637         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
638         https://bugs.webkit.org/show_bug.cgi?id=114965
639
640         Reviewed by Frédéric Wang.
641
642         HEAD requests should not be changed to GET after 303 redirects, see [1].
643         This was fixed earlier for GTK [2].
644
645         Behavior matches Firefox and Chrome.
646
647         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
648         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
649
650         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
651                web-platform-tests/fetch/api/redirect/redirect-method-worker.html
652                http/tests/xmlhttprequest/head-redirection.html
653
654         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
655         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
656
657 2018-12-04  Fujii Hironori  <Hironori.Fujii@sony.com>
658
659         Remove using namespace WebCore and WebKit under WebKit/Shared/API
660         https://bugs.webkit.org/show_bug.cgi?id=192352
661
662         Reviewed by Alex Christensen.
663
664         Removed using namespace statements, and use namespace prefix
665         instead.
666
667         * Shared/API/APIURLRequest.cpp:
668         * Shared/API/APIURLResponse.cpp:
669         * Shared/API/c/WKArray.cpp:
670         * Shared/API/c/WKCertificateInfo.cpp:
671         * Shared/API/c/WKConnectionRef.cpp:
672         * Shared/API/c/WKContextMenuItem.cpp:
673         * Shared/API/c/WKData.cpp:
674         * Shared/API/c/WKDictionary.cpp:
675         * Shared/API/c/WKErrorRef.cpp:
676         * Shared/API/c/WKGeometry.cpp:
677         * Shared/API/c/WKImage.cpp:
678         * Shared/API/c/WKMutableArray.cpp:
679         * Shared/API/c/WKMutableDictionary.cpp:
680         * Shared/API/c/WKNumber.cpp:
681         * Shared/API/c/WKPluginInformation.cpp:
682         * Shared/API/c/WKRenderLayer.cpp:
683         * Shared/API/c/WKRenderObject.cpp:
684         * Shared/API/c/WKSecurityOriginRef.cpp:
685         * Shared/API/c/WKSerializedScriptValue.cpp:
686         * Shared/API/c/WKString.cpp:
687         * Shared/API/c/WKType.cpp:
688         * Shared/API/c/WKURL.cpp:
689         * Shared/API/c/WKURLRequest.cpp:
690         * Shared/API/c/WKURLResponse.cpp:
691         * Shared/API/c/WKUserContentURLPattern.cpp:
692         * Shared/API/c/cairo/WKImageCairo.cpp:
693         * Shared/API/c/curl/WKCertificateInfoCurl.cpp:
694
695 2018-12-04  Alex Christensen  <achristensen@webkit.org>
696
697         Remove source application identifiers from NetworkProcessCreationParameters
698         https://bugs.webkit.org/show_bug.cgi?id=192372
699
700         Reviewed by Brady Eidson.
701
702         The _WKWebProcessPoolConfiguration way of setting these was deprecated in http://trac.webkit.org/r235127
703         The replacement was adopted in <rdar://problem/46359330>
704         The transition process is done!  Time to remove the old code.
705
706         * NetworkProcess/NetworkProcessCreationParameters.cpp:
707         (WebKit::NetworkProcessCreationParameters::encode const):
708         (WebKit::NetworkProcessCreationParameters::decode):
709         * NetworkProcess/NetworkProcessCreationParameters.h:
710         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
711         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
712         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
713         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
714         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
715         (WebKit::globalSourceApplicationAuditTokenData): Deleted.
716         (WebKit::globalSourceApplicationBundleIdentifier): Deleted.
717         (WebKit::globalSourceApplicationSecondaryIdentifier): Deleted.
718         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData): Deleted.
719         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier): Deleted.
720         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): Deleted.
721         * UIProcess/API/APIProcessPoolConfiguration.cpp:
722         (API::ProcessPoolConfiguration::copy):
723         * UIProcess/API/APIProcessPoolConfiguration.h:
724         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
725         (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
726         (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
727         (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
728         (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
729         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
730         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
731         (WebKit::toPKPaymentRequest):
732         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
733         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
734         * UIProcess/WebsiteData/WebsiteDataStore.h:
735         (WebKit::WebsiteDataStore::configuration):
736
737 2018-12-04  Youenn Fablet  <youenn@apple.com>
738
739         Calling getUserMedia in a link that was opened with target="_blank" does not work the second time
740         https://bugs.webkit.org/show_bug.cgi?id=188088
741         <rdar://problem/42681448>
742
743         Reviewed by Eric Carlson.
744
745         On closing a page, we need to make sure to consider that the capture is ended,
746         as otherwise WebPageProxy will not get noticed from WebPage, since WebPageProxy is no longer an IPC receiver.
747
748         * UIProcess/UserMediaProcessManager.cpp:
749         (WebKit::UserMediaProcessManager::endedCaptureSession):
750         * UIProcess/WebPageProxy.cpp:
751         (WebKit::WebPageProxy::close):
752
753 2018-12-04  Chris Dumez  <cdumez@apple.com>
754
755         Regression(r238817) PSON Page Cache API tests are failing
756         https://bugs.webkit.org/show_bug.cgi?id=192348
757
758         Reviewed by Alex Christensen.
759
760         Before suspending a WebProcess on iOS, we normally fake a memory pressure signal
761         so that the suspended process uses as little memory as possible while suspended.
762         Among other things, this will clear the page cache. This is an issue in the case
763         of process-swap on navigation because we keep suspended web processes around to
764         keep Page Cache functional.
765
766         To address the issue, when a WebProcess is about to get suspended, we check if
767         the process has any suspended WebPage (WebPage used for PSON PageCache support)
768         and we bypass the PageCache clearing if it does.
769
770         Our API tests did not catch this before r238817 because the NavigationState's
771         assertion was preventing the old WebProcesses from suspending for 3 seconds,
772         which was enough for those tests to complete.
773
774         * UIProcess/SuspendedPageProxy.cpp:
775         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
776         (WebKit::SuspendedPageProxy::didFinishLoad):
777         * UIProcess/SuspendedPageProxy.h:
778         Take a background assertion until the suspension load is complete, to make sure
779         the suspension load has a chance to complete before the process gets suspended.
780
781         * WebProcess/WebProcess.cpp:
782         (WebKit::WebProcess::initializeWebProcess):
783         (WebKit::WebProcess::hasPageRequiringPageCacheWhileSuspended const):
784         (WebKit::WebProcess::actualPrepareToSuspend):
785         * WebProcess/WebProcess.h:
786
787 2018-12-04  Youenn Fablet  <youenn@apple.com>
788
789         Device orientation may be wrong on page reload after crash
790         https://bugs.webkit.org/show_bug.cgi?id=192349
791         <rdar://problem/46359466>
792
793         Reviewed by Eric Carlson.
794
795         On page crash, the process is relaunched and the page is reloaded.
796         At that point, the orientation information of the page is not reset until the next device orientation change.
797         To fix that, add the device orientation to the page creation parameters so that we pass it everytime we create a page.
798         Covered by manual testing.
799
800         * Shared/WebPageCreationParameters.cpp:
801         (WebKit::WebPageCreationParameters::encode const):
802         (WebKit::WebPageCreationParameters::decode):
803         * Shared/WebPageCreationParameters.h:
804         * UIProcess/WebPageProxy.cpp:
805         (WebKit::WebPageProxy::creationParameters):
806         * WebProcess/WebPage/WebPage.cpp:
807
808 2018-12-04  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
809
810         [WPE] Add gtk-doc
811         https://bugs.webkit.org/show_bug.cgi?id=178900
812
813         Reviewed by Michael Catanzaro.
814
815         Add gtk-doc to WPE port. This patch tries to reuse as much code from
816         WebKitGTK+ as possible.
817
818         * PlatformWPE.cmake: Write variables to gtkdoc-wpe.cfg and gtkdoc-webextensions that is used by python script later.
819         * UIProcess/API/wpe/WebKitWebContext.h: Placed sandbox functions in the same location as in the WebKitGTK+ for consistency.
820         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added.
821         * UIProcess/API/wpe/docs/wpe-docs.sgml: Added.
822         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Placed webkit_web_page_get_dom_document
823         in the same position as in the WebKitGTK+ for consistency.
824         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: Added.
825         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml: Added.
826
827 2018-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
828
829         [SOUP] Move URLSoup back to WebCore after r238771
830         https://bugs.webkit.org/show_bug.cgi?id=192306
831
832         Reviewed by Michael Catanzaro.
833
834         Include GUniquePtrSoup from WebCore again and fix several build failures that showed up after removing the soup
835         includes from URL header.
836
837         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
838         (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate):
839         * PluginProcess/PluginProcess.cpp:
840         * Shared/API/glib/WebKitURIRequest.cpp:
841         * Shared/API/glib/WebKitURIResponse.cpp:
842         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
843         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
844         (webkit_uri_scheme_request_finish_error): Use soupURIToURL().
845         * UIProcess/API/glib/WebKitWebView.cpp:
846         (webkit_web_view_load_uri): Use soupURIToURL().
847         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
848         * UIProcess/Launcher/glib/BubblewrapLauncher.h:
849         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
850         * UIProcess/Launcher/glib/FlatpakLauncher.h:
851
852 2018-12-04  Tim Horton  <timothy_horton@apple.com>
853
854         Fix the watchOS build; stop unnecessarily linking CorePDF
855         https://bugs.webkit.org/show_bug.cgi?id=192356
856         <rdar://problem/46427844>
857
858         Reviewed by Wenson Hsieh.
859
860         * Configurations/WebKit.xcconfig:
861         * Platform/spi/ios/CorePDFSPI.h:
862
863 2018-12-03  Tim Horton  <timothy_horton@apple.com>
864
865         Make it possible to disable animated keyboard scrolling behavior
866         https://bugs.webkit.org/show_bug.cgi?id=192331
867         <rdar://problem/45586859>
868
869         Reviewed by Simon Fraser.
870
871         * UIProcess/API/Cocoa/WKWebView.mm:
872         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
873         (-[WKKeyboardScrollingAnimator invalidate]):
874         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
875         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
876         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
877         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]):
878         (-[WKKeyboardScrollingAnimator stopRepeatTimer]):
879         (-[WKKeyboardScrollingAnimator performDiscreteScroll]):
880         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
881         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
882         * WebKit.xcodeproj/project.pbxproj:
883
884 2018-12-03  Fujii Hironori  <Hironori.Fujii@sony.com>
885
886         Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API
887         https://bugs.webkit.org/show_bug.cgi?id=192301
888
889         Reviewed by Alex Christensen.
890
891         Removed "using namespace WebKit" statement, and use "WebKit::"
892         namespace prefix instead.
893
894         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
895         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
896         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
897         * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
898         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
899         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
900         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
901         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
902         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
903         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
904         * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp:
905         * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp:
906         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
907         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
908         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
909
910 2018-12-03  Chris Dumez  <cdumez@apple.com>
911
912         Regression(PSON) Google OAuth is broken in private sessions
913         https://bugs.webkit.org/show_bug.cgi?id=192337
914         <rdar://problem/46353558>
915
916         Reviewed by Alex Christensen.
917
918         In WebPageProxy::swapToWebProcess(), we would call removeWebPage() on the old WebProcessProxy and then
919         addExistingWebPage() on the new WebProcessProxy, as you would expect in case of process swap.
920
921         The issue is that WebProcessProxy::removeWebPage() calls WebProcessPool::pageEndUsingWebsiteDataStore()
922         which would cause the session to get destroyed assuming this was the last page using it. We would
923         therefore lose session cookies after a process-swap in private session.
924
925         To address the issue, a parameter to WebProcessPool::pageEndUsingWebsiteDataStore() and
926         WebProcessPool::pageBeginUsingWebsiteDataStore() to control if we want to tell the WebProcessPool
927         about the page beginning / ending its use of the session. In the case of a process-swap, we make
928         sure the process pool is not notified.
929
930         * UIProcess/WebPageProxy.cpp:
931         (WebKit::WebPageProxy::reattachToWebProcess):
932         (WebKit::WebPageProxy::swapToWebProcess):
933         (WebKit::WebPageProxy::finishAttachingToWebProcess):
934         (WebKit::WebPageProxy::close):
935         * UIProcess/WebProcessProxy.cpp:
936         (WebKit::WebProcessProxy::createWebPage):
937         (WebKit::WebProcessProxy::addExistingWebPage):
938         (WebKit::WebProcessProxy::removeWebPage):
939         * UIProcess/WebProcessProxy.h:
940
941 2018-12-03  Chris Dumez  <cdumez@apple.com>
942
943         [PSON] Request by the client to process-swap is ignored if the window has an opener
944         https://bugs.webkit.org/show_bug.cgi?id=192267
945         <rdar://problem/46386886>
946
947         Reviewed by Brady Eidson.
948
949         If the client forces a process-swap, we should process-swap, even if the browsing
950         context has an opener (or openees). Previously, we would only bypass the cross-site
951         check, not the openee / openees checks.
952
953         The issue when doing so is that the openee still has a opener link to the window
954         in the old process. They would see that the window is still there and navigated
955         to 'about:blank' due to our page suspension logic. To address the issue, we no
956         longer suspend the old WebPage if the process swap was forced by the client and
957         we make sure that the old WebPage gets closed.
958
959         * UIProcess/WebPageProxy.cpp:
960         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
961         (WebKit::WebPageProxy::swapToWebProcess):
962         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
963         (WebKit::WebPageProxy::continueNavigationInNewProcess):
964         * UIProcess/WebPageProxy.h:
965         * UIProcess/WebProcessPool.cpp:
966         (WebKit::WebProcessPool::processForNavigationInternal):
967
968 2018-12-03  Keith Rollin  <krollin@apple.com>
969
970         Add .xcfilelist files
971         https://bugs.webkit.org/show_bug.cgi?id=192082
972         <rdar://problem/46312533>
973
974         Reviewed by Brent Fulgham.
975
976         Add .xcfilelist files for Generate Derived Sources and Generate
977         Unified Sources build phases in Xcode. These are just being staged for
978         now; they'll be added to the Xcode projects later.
979
980         * DerivedSources-input.xcfilelist: Added.
981         * DerivedSources-output.xcfilelist: Added.
982         * UnifiedSources-input.xcfilelist: Added.
983         * UnifiedSources-output.xcfilelist: Added.
984
985 2018-12-03  Zalan Bujtas  <zalan@apple.com>
986
987         [iOS] Unreviewed build fix.
988
989         * Platform/Logging.h:
990
991 2018-12-03  Alex Christensen  <achristensen@webkit.org>
992
993         Remove unused NetworkProcessCreationParameters.diskCacheSizeOverride
994         https://bugs.webkit.org/show_bug.cgi?id=192246
995
996         Reviewed by Chris Dumez.
997
998         The last use of this functionality was removed in rdar://problem/46344871
999
1000         * NetworkProcess/NetworkProcess.cpp:
1001         (WebKit::NetworkProcess::initializeNetworkProcess):
1002         (WebKit::NetworkProcess::setCacheModel):
1003         * NetworkProcess/NetworkProcess.h:
1004         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1005         (WebKit::NetworkProcessCreationParameters::encode const):
1006         (WebKit::NetworkProcessCreationParameters::decode):
1007         * NetworkProcess/NetworkProcessCreationParameters.h:
1008         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1009         (API::ProcessPoolConfiguration::copy):
1010         * UIProcess/API/APIProcessPoolConfiguration.h:
1011         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1012         (WKContextConfigurationDiskCacheSizeOverride):
1013         (WKContextConfigurationSetDiskCacheSizeOverride):
1014         * UIProcess/API/C/WKContextConfigurationRef.h:
1015         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1016         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1017         (-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
1018         (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
1019         * UIProcess/WebProcessPool.cpp:
1020         (WebKit::WebProcessPool::ensureNetworkProcess):
1021
1022 2018-12-03  Alex Christensen  <achristensen@webkit.org>
1023
1024         Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler
1025         https://bugs.webkit.org/show_bug.cgi?id=192272
1026
1027         Reviewed by Brady Eidson.
1028
1029         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1030         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
1031         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
1032         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1033         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1034         (ResourceLoadClient::ResourceLoadClient):
1035         (ResourceLoadClient::loadDelegate const):
1036         (ResourceLoadClient::pluginContextController const):
1037         (PageLoaderClient::PageLoaderClient):
1038         (PageLoaderClient::loadDelegate const):
1039         (PageLoaderClient::pluginContextController const):
1040         (PageLoaderClient::didStartProvisionalLoadForFrame):
1041         (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
1042         (PageLoaderClient::didFinishLoadForFrame):
1043         (PageLoaderClient::globalObjectIsAvailableForFrame):
1044         (PageLoaderClient::didRemoveFrameFromHierarchy):
1045         (PageLoaderClient::didCommitLoadForFrame):
1046         (PageLoaderClient::didFinishDocumentLoadForFrame):
1047         (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame):
1048         (PageLoaderClient::didFailLoadWithErrorForFrame):
1049         (PageLoaderClient::didSameDocumentNavigationForFrame):
1050         (PageLoaderClient::didLayoutForFrame):
1051         (PageLoaderClient::didReachLayoutMilestone):
1052         (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
1053         (PageLoaderClient::didHandleOnloadEventsForFrame):
1054         (PageLoaderClient::userAgentForURL const):
1055         (ResourceLoadClient::willSendRequestForFrame):
1056         (ResourceLoadClient::didInitiateLoadForResource):
1057         (ResourceLoadClient::didFinishLoadForResource):
1058         (ResourceLoadClient::didFailLoadForResource):
1059         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
1060         (didStartProvisionalLoadForFrame): Deleted.
1061         (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
1062         (didFinishLoadForFrame): Deleted.
1063         (globalObjectIsAvailableForFrame): Deleted.
1064         (didRemoveFrameFromHierarchy): Deleted.
1065         (didCommitLoadForFrame): Deleted.
1066         (didFinishDocumentLoadForFrame): Deleted.
1067         (didFailProvisionalLoadWithErrorForFrame): Deleted.
1068         (didFailLoadWithErrorForFrame): Deleted.
1069         (didSameDocumentNavigationForFrame): Deleted.
1070         (didLayoutForFrame): Deleted.
1071         (didReachLayoutMilestone): Deleted.
1072         (didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
1073         (didHandleOnloadEventsForFrame): Deleted.
1074         (userAgentForURL): Deleted.
1075         (setUpPageLoaderClient): Deleted.
1076         (willSendRequestForFrame): Deleted.
1077         (didInitiateLoadForResource): Deleted.
1078         (didFinishLoadForResource): Deleted.
1079         (didFailLoadForResource): Deleted.
1080         (setUpResourceLoadClient): Deleted.
1081         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1082         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
1083         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1084         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1085         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
1086         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1087
1088 2018-12-03  Tim Horton  <timothy_horton@apple.com>
1089
1090         Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
1091         https://bugs.webkit.org/show_bug.cgi?id=192319
1092         <rdar://problem/45928708>
1093
1094         Reviewed by Simon Fraser.
1095
1096         * UIProcess/Cocoa/ViewGestureController.cpp:
1097         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
1098         * UIProcess/Cocoa/ViewGestureController.h:
1099         * UIProcess/ios/ViewGestureControllerIOS.mm:
1100         (WebKit::ViewGestureController::endSwipeGesture):
1101         In r236966, I reverted slightly too much of r232416.
1102         We still need to defer requesting a presentation update callback until
1103         after the provisional load starts. Otherwise, we could get the callback
1104         while we're in the 'paused' state, and drop it on the floor. That would
1105         then mean that we time out instead of promptly removing the snapshot.
1106
1107 2018-12-03  Alex Christensen  <achristensen@webkit.org>
1108
1109         Update process assertions after swapping processes
1110         https://bugs.webkit.org/show_bug.cgi?id=192318
1111         <rdar://problem/46377552>
1112
1113         Reviewed by Chris Dumez.
1114
1115         If the previous WebProcess had a ProcessAssertion to prevent it from being suspended,
1116         after navigation and process swapping we need the new WebProcess to update its process assertions.
1117
1118         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
1119         * UIProcess/Cocoa/NavigationState.h:
1120         * UIProcess/Cocoa/NavigationState.mm:
1121         (WebKit::NavigationState::didSwapWebProcesses):
1122         * UIProcess/PageLoadState.cpp:
1123         (WebKit::PageLoadState::didSwapWebProcesses):
1124         * UIProcess/PageLoadState.h:
1125         * UIProcess/WebPageProxy.cpp:
1126         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1127
1128 2018-12-03  Daniel Bates  <dabates@apple.com>
1129
1130         [iOS] Do not handle key events that are key commands
1131         https://bugs.webkit.org/show_bug.cgi?id=191608
1132         <rdar://problem/46046013>
1133
1134         Reviewed by Ryosuke Niwa.
1135
1136         A key down event may be associated with a key command. If it is then we want to execute the
1137         key command instead of inserting or deleting text. We need to ask UIKit to handle the current
1138         event as a key command to find out.
1139
1140         * UIProcess/ios/WKContentViewInteraction.mm:
1141         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Ask UIKit to handle the current event
1142         as a key command. If it handles it then we're done. Otherwise, do what we do now.
1143
1144 2018-12-03  Zalan Bujtas  <zalan@apple.com>
1145
1146         [iOS] Add logging channel for hover related content observation
1147         https://bugs.webkit.org/show_bug.cgi?id=192312
1148
1149         Reviewed by Simon Fraser.
1150
1151         * WebProcess/WebPage/ios/WebPageIOS.mm:
1152         (WebKit::WebPage::handleSyntheticClick):
1153         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1154
1155 2018-12-03  Tim Horton  <timothy_horton@apple.com>
1156
1157         Enable swipe snapshot removal logging in release builds
1158         https://bugs.webkit.org/show_bug.cgi?id=192313
1159
1160         Reviewed by Dean Jackson.
1161
1162         * UIProcess/Cocoa/ViewGestureController.cpp:
1163         (WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
1164         This is super-low-traffic and super-helpful logging.
1165         Turn it on all the time.
1166
1167 2018-12-03  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1168
1169         Use WallTime for file time
1170         https://bugs.webkit.org/show_bug.cgi?id=192287
1171
1172         Reviewed by Darin Adler.
1173
1174         * Shared/SessionState.h:
1175         * Shared/WebCoreArgumentCoders.cpp:
1176         (IPC::ArgumentCoder<DatabaseDetails>::decode):
1177         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1178         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1179         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
1180         (decodeHTTPBody):
1181         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1182         (WebKit::PluginInfoCache::getPluginInfo):
1183         (WebKit::PluginInfoCache::updatePluginInfo):
1184         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1185         (WebKit::hasFileChangedSince):
1186         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1187         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
1188         (WebKit::LocalStorageDatabaseTracker::originDetails):
1189         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
1190         * UIProcess/mac/LegacySessionStateCoding.cpp:
1191         (WebKit::encodeFormDataElement):
1192         (WebKit::decodeFormDataElement):
1193         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1194         (WebKit::removeAllMediaKeyStorageForOriginPath):
1195         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin):
1196         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates):
1197         (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries):
1198         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
1199         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1200         (WebKit::toHTTPBody):
1201         (WebKit::toFormData):
1202
1203 2018-12-03  Darin Adler  <darin@apple.com>
1204
1205         [Cocoa] Check message IDs when decoding Mach messages in IPC::Connection
1206         https://bugs.webkit.org/show_bug.cgi?id=192300
1207         rdar://problem/46215523
1208
1209         Reviewed by Chris Dumez.
1210
1211         * Platform/IPC/mac/ConnectionMac.mm:
1212         (IPC::Connection::sendOutgoingMessage): Use message IDs other than 0 and 1 for
1213         the messages, as suggested by an expert at Apple.
1214         (IPC::createMessageDecoder): Update for the new message IDs.
1215         (IPC::Connection::receiveSourceEventHandler): Ignore messages with unexpected
1216         message IDs.
1217
1218 2018-12-03  Darin Adler  <darin@apple.com>
1219
1220         [Cocoa] Check descriptor types in createMessageDecoder
1221         https://bugs.webkit.org/show_bug.cgi?id=192302
1222
1223         Reviewed by Chris Dumez.
1224
1225         Not sure how to construct a test case for Connection, so not adding any
1226         tests at this time.
1227
1228         * Platform/IPC/mac/ConnectionMac.mm:
1229         (IPC::createMessageDecoder): Check descriptor types and return nullptr if they
1230         are incorrect. Retained the assertions to help with debugging.
1231         (IPC::Connection::receiveSourceEventHandler): Ignore the message if no decoder
1232         is created, which means the message is invalid.
1233
1234 2018-12-03  Darin Adler  <darin@apple.com>
1235
1236         Alignment padding needs to be zeroed out in IPC::Encoder
1237         https://bugs.webkit.org/show_bug.cgi?id=192304
1238
1239         Reviewed by Chris Dumez.
1240
1241         Might be useful to make a regression test for this, but I couldn't find any
1242         other tests for this code.
1243
1244         * Platform/IPC/Encoder.cpp:
1245         (IPC::Encoder::grow): Use std::memset to zero-fill padding bytes.
1246
1247         * UIProcess/mac/LegacySessionStateCoding.cpp:
1248         (WebKit::HistoryEntryDataEncoder::grow): Ditto.
1249
1250 2018-12-03  Darin Adler  <darin@apple.com>
1251
1252         [Cocoa] Streamline sandbox code a tiny bit
1253         https://bugs.webkit.org/show_bug.cgi?id=192299
1254
1255         Reviewed by Anders Carlsson.
1256
1257         * Shared/mac/SandboxUtilities.mm:
1258         (WebKit::processHasContainer): Removed separate function, just use the
1259         pathForProcessContainer instead of repeating logic. This costs a tiny
1260         bit of memory allocation overhead the first time this function is called,
1261         but in return we can eliminate a second copy of the code to call
1262         sandbox_container_path_for_pid.
1263
1264 2018-12-03  Eric Carlson  <eric.carlson@apple.com>
1265
1266         [MediaStream] 'devicechange' event when more capture device information are revealed.
1267         https://bugs.webkit.org/show_bug.cgi?id=192268
1268
1269         Reviewed by Youenn Fablet.
1270
1271         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1272         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Call captureDevicesChanged
1273         if a filtered device list was returned previously.
1274         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): Clear m_hasFilteredDeviceList.
1275         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess): New.
1276         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter device
1277         list and strip device IDs if gUM permission hasn't been given.
1278         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear m_hasFilteredDeviceList.
1279         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1280
1281 2018-12-03  Keith Rollin  <krollin@apple.com>
1282
1283         Remove Network Capture
1284         https://bugs.webkit.org/show_bug.cgi?id=192296
1285         <rdar://problem/46408648>
1286
1287         Reviewed by Daniel Bates.
1288
1289         r209498 introduced an embedded record and replay facility for network
1290         resource loading. This facility was added in order to support a new
1291         implementation of the PLT and related performance tests. The PLT is
1292         currenty taking a different direction, and so this record/replace
1293         facility is no longer needed. Removing it as unused code.
1294
1295         * CMakeLists.txt:
1296         * NetworkProcess/NetworkLoad.cpp:
1297         (WebKit::NetworkLoad::NetworkLoad):
1298         (WebKit::NetworkLoad::setDefersLoading):
1299         (WebKit::NetworkLoad::continueWillSendRequest):
1300         (WebKit::NetworkLoad::willPerformHTTPRedirection):
1301         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1302         (WebKit::NetworkLoad::didReceiveData):
1303         (WebKit::NetworkLoad::didCompleteWithError):
1304         (WebKit::NetworkLoad::initializeForRecord): Deleted.
1305         (WebKit::NetworkLoad::initializeForReplay): Deleted.
1306         * NetworkProcess/NetworkLoad.h:
1307         * NetworkProcess/NetworkProcess.cpp:
1308         (WebKit::NetworkProcess::initializeNetworkProcess):
1309         (WebKit::NetworkProcess::terminate):
1310         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1311         (WebKit::NetworkProcessCreationParameters::encode const):
1312         (WebKit::NetworkProcessCreationParameters::decode):
1313         * NetworkProcess/NetworkProcessCreationParameters.h:
1314         * NetworkProcess/capture/NetworkCaptureEvent.cpp: Removed.
1315         * NetworkProcess/capture/NetworkCaptureEvent.h: Removed.
1316         * NetworkProcess/capture/NetworkCaptureLogging.h: Removed.
1317         * NetworkProcess/capture/NetworkCaptureManager.cpp: Removed.
1318         * NetworkProcess/capture/NetworkCaptureManager.h: Removed.
1319         * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Removed.
1320         * NetworkProcess/capture/NetworkCaptureRecorder.h: Removed.
1321         * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Removed.
1322         * NetworkProcess/capture/NetworkCaptureReplayer.h: Removed.
1323         * NetworkProcess/capture/NetworkCaptureResource.cpp: Removed.
1324         * NetworkProcess/capture/NetworkCaptureResource.h: Removed.
1325         * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Removed.
1326         * NetworkProcess/capture/NetworkDataTaskReplay.h: Removed.
1327         * NetworkProcess/capture/json.hpp: Removed.
1328         * Sources.txt:
1329         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1330         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1331         * WebKit.xcodeproj/project.pbxproj:
1332         * config.h:
1333
1334 2018-12-02  Zalan Bujtas  <zalan@apple.com>
1335
1336         Add a runtime feature flag for LayoutFormattingContext.
1337         https://bugs.webkit.org/show_bug.cgi?id=192280
1338
1339         Reviewed by Simon Fraser.
1340
1341         * Configurations/FeatureDefines.xcconfig:
1342         * Shared/WebPreferences.yaml:
1343         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1344         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1345
1346 2018-12-01  Chris Dumez  <cdumez@apple.com>
1347
1348         [PSON] process-swapping may occur even though opener has handle to openee
1349         https://bugs.webkit.org/show_bug.cgi?id=192277
1350
1351         Reviewed by Antti Koivisto.
1352
1353         * Shared/NavigationActionData.cpp:
1354         (WebKit::NavigationActionData::encode const):
1355         (WebKit::NavigationActionData::decode):
1356         * Shared/NavigationActionData.h:
1357         * UIProcess/API/APINavigation.h:
1358         (API::Navigation::openedByDOMWithOpener const):
1359         (API::Navigation::openedViaWindowOpenWithOpener const): Deleted.
1360         (API::Navigation::opener const): Deleted.
1361         * UIProcess/WebProcessPool.cpp:
1362         (WebKit::WebProcessPool::processForNavigationInternal):
1363         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1364         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1365
1366 2018-12-01  Alexey Proskuryakov  <ap@apple.com>
1367
1368         Modernize version check for _suppressedAutoAddedHTTPHeaders
1369         https://bugs.webkit.org/show_bug.cgi?id=192175
1370
1371         Reviewed by Tim Horton.
1372
1373         * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1374         Also removed selector check - we only need to support running on 10.13.0 when building
1375         with 10.13.0 SDK.
1376
1377 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1378
1379         Fix Windows build.
1380
1381         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
1382         (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
1383
1384 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1385
1386         Move URL from WebCore to WTF
1387         https://bugs.webkit.org/show_bug.cgi?id=190234
1388
1389         Reviewed by Keith Miller.
1390
1391         * NetworkProcess/Cookies/WebCookieManager.cpp:
1392         * NetworkProcess/Cookies/WebCookieManager.h:
1393         * NetworkProcess/Cookies/WebCookieManager.messages.in:
1394         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
1395         * NetworkProcess/Downloads/Download.h:
1396         * NetworkProcess/Downloads/DownloadManager.cpp:
1397         (WebKit::DownloadManager::publishDownloadProgress):
1398         * NetworkProcess/Downloads/DownloadManager.h:
1399         * NetworkProcess/Downloads/PendingDownload.cpp:
1400         (WebKit::PendingDownload::publishProgress):
1401         * NetworkProcess/Downloads/PendingDownload.h:
1402         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1403         (WebKit::Download::publishProgress):
1404         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1405         (WebKit::NetworkBlobRegistry::registerBlobURL):
1406         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1407         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1408         (WebKit::NetworkBlobRegistry::blobSize):
1409         (WebKit::NetworkBlobRegistry::filesInBlob):
1410         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1411         * NetworkProcess/NetworkConnectionToWebProcess.h:
1412         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1413         * NetworkProcess/NetworkDataTask.cpp:
1414         (WebKit::NetworkDataTask::didReceiveResponse):
1415         * NetworkProcess/NetworkDataTaskBlob.cpp:
1416         * NetworkProcess/NetworkLoadChecker.h:
1417         (WebKit::NetworkLoadChecker::setContentExtensionController):
1418         (WebKit::NetworkLoadChecker::url const):
1419         * NetworkProcess/NetworkProcess.cpp:
1420         (WebKit::NetworkProcess::writeBlobToFilePath):
1421         (WebKit::NetworkProcess::publishDownloadProgress):
1422         (WebKit::NetworkProcess::preconnectTo):
1423         * NetworkProcess/NetworkProcess.h:
1424         * NetworkProcess/NetworkProcess.messages.in:
1425         * NetworkProcess/NetworkResourceLoadParameters.h:
1426         * NetworkProcess/NetworkResourceLoader.cpp:
1427         (WebKit::logBlockedCookieInformation):
1428         (WebKit::logCookieInformationInternal):
1429         * NetworkProcess/NetworkResourceLoader.h:
1430         * NetworkProcess/NetworkSocketStream.cpp:
1431         (WebKit::NetworkSocketStream::create):
1432         * NetworkProcess/NetworkSocketStream.h:
1433         * NetworkProcess/PingLoad.h:
1434         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1435         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
1436         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1437         * NetworkProcess/cache/CacheStorageEngine.cpp:
1438         (WebKit::CacheStorage::Engine::retrieveRecords):
1439         * NetworkProcess/cache/CacheStorageEngine.h:
1440         * NetworkProcess/cache/CacheStorageEngineCache.h:
1441         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1442         (WebKit::CacheStorageEngineConnection::retrieveRecords):
1443         * NetworkProcess/cache/CacheStorageEngineConnection.h:
1444         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
1445         * NetworkProcess/cache/NetworkCache.h:
1446         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1447         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
1448         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
1449         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1450         (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies const):
1451         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
1452         (WebKit::NetworkCapture::Request::operator WebCore::ResourceRequest const):
1453         (WebKit::NetworkCapture::Response::operator WebCore::ResourceResponse const):
1454         (WebKit::NetworkCapture::Error::operator WebCore::ResourceError const):
1455         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1456         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
1457         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1458         (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
1459         * NetworkProcess/capture/NetworkCaptureManager.h:
1460         * NetworkProcess/capture/NetworkCaptureResource.cpp:
1461         (WebKit::NetworkCapture::Resource::url):
1462         (WebKit::NetworkCapture::Resource::queryParameters):
1463         * NetworkProcess/capture/NetworkCaptureResource.h:
1464         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1465         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1466         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1467         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
1468         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1469         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1470         * PluginProcess/mac/PluginProcessMac.mm:
1471         (WebKit::openCFURLRef):
1472         (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
1473         * Shared/API/APIURL.h:
1474         (API::URL::create):
1475         (API::URL::equals):
1476         (API::URL::URL):
1477         (API::URL::url const):
1478         (API::URL::parseURLIfNecessary const):
1479         * Shared/API/APIUserContentURLPattern.h:
1480         (API::UserContentURLPattern::matchesURL const):
1481         * Shared/API/c/WKURLRequest.cpp:
1482         * Shared/API/c/WKURLResponse.cpp:
1483         * Shared/API/c/cf/WKURLCF.mm:
1484         (WKURLCreateWithCFURL):
1485         (WKURLCopyCFURL):
1486         * Shared/API/glib/WebKitURIRequest.cpp:
1487         * Shared/API/glib/WebKitURIResponse.cpp:
1488         * Shared/APIWebArchiveResource.mm:
1489         (API::WebArchiveResource::WebArchiveResource):
1490         * Shared/AssistedNodeInformation.h:
1491         * Shared/Cocoa/WKNSURLExtras.mm:
1492         (-[NSURL _web_originalDataAsWTFString]):
1493         (): Deleted.
1494         * Shared/SessionState.h:
1495         * Shared/WebBackForwardListItem.cpp:
1496         (WebKit::WebBackForwardListItem::itemIsInSameDocument const):
1497         * Shared/WebCoreArgumentCoders.cpp:
1498         * Shared/WebCoreArgumentCoders.h:
1499         * Shared/WebErrors.h:
1500         * Shared/WebHitTestResultData.cpp:
1501         * Shared/cf/ArgumentCodersCF.cpp:
1502         (IPC::encode):
1503         (IPC::decode):
1504         * Shared/gtk/WebErrorsGtk.cpp:
1505         * Shared/ios/InteractionInformationAtPosition.h:
1506         * UIProcess/API/APIHTTPCookieStore.h:
1507         * UIProcess/API/APINavigation.cpp:
1508         (API::Navigation::appendRedirectionURL):
1509         * UIProcess/API/APINavigation.h:
1510         (API::Navigation::takeRedirectChain):
1511         * UIProcess/API/APINavigationAction.h:
1512         * UIProcess/API/APINavigationClient.h:
1513         (API::NavigationClient::signedPublicKeyAndChallengeString):
1514         (API::NavigationClient::contentRuleListNotification):
1515         (API::NavigationClient::webGLLoadPolicy const):
1516         (API::NavigationClient::resolveWebGLLoadPolicy const):
1517         * UIProcess/API/APIUIClient.h:
1518         (API::UIClient::saveDataToFileInDownloadsFolder):
1519         * UIProcess/API/APIUserScript.cpp:
1520         (API::UserScript::generateUniqueURL):
1521         * UIProcess/API/APIUserScript.h:
1522         * UIProcess/API/APIUserStyleSheet.cpp:
1523         (API::UserStyleSheet::generateUniqueURL):
1524         * UIProcess/API/APIUserStyleSheet.h:
1525         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
1526         (filePathsFromFileURLs):
1527         * UIProcess/API/C/WKPage.cpp:
1528         (WKPageLoadPlainTextStringWithUserData):
1529         (WKPageSetPageUIClient):
1530         (WKPageSetPageNavigationClient):
1531         * UIProcess/API/C/WKPageGroup.cpp:
1532         (WKPageGroupAddUserStyleSheet):
1533         (WKPageGroupAddUserScript):
1534         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1535         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
1536         (WKWebsiteDataStoreSetStatisticsLastSeen):
1537         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1538         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1539         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1540         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1541         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
1542         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1543         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1544         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1545         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1546         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1547         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1548         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1549         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1550         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1551         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
1552         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
1553         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
1554         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1555         * UIProcess/API/Cocoa/WKUserScript.mm:
1556         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
1557         * UIProcess/API/Cocoa/WKWebView.mm:
1558         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
1559         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
1560         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1561         (-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
1562         (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
1563         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1564         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1565         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
1566         (-[_WKApplicationManifest initWithCoder:]):
1567         (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
1568         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
1569         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
1570         * UIProcess/API/glib/IconDatabase.cpp:
1571         * UIProcess/API/glib/WebKitCookieManager.cpp:
1572         (webkit_cookie_manager_get_cookies):
1573         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
1574         * UIProcess/API/glib/WebKitSecurityOrigin.cpp:
1575         (webkit_security_origin_new_for_uri):
1576         * UIProcess/API/glib/WebKitUIClient.cpp:
1577         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
1578         * UIProcess/API/glib/WebKitWebView.cpp:
1579         (webkit_web_view_load_plain_text):
1580         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
1581         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1582         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
1583         (WebKit::WebPaymentCoordinatorProxy::validateMerchant):
1584         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1585         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
1586         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1587         (WebKit::toPKPaymentRequest):
1588         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
1589         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1590         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1591         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1592         * UIProcess/Automation/WebAutomationSession.cpp:
1593         (WebKit::WebAutomationSession::navigateBrowsingContext):
1594         (WebKit::domainByAddingDotPrefixIfNeeded):
1595         (WebKit::WebAutomationSession::addSingleCookie):
1596         (WebKit::WebAutomationSession::deleteAllCookies):
1597         * UIProcess/Cocoa/DownloadClient.mm:
1598         (WebKit::DownloadClient::didFinish):
1599         * UIProcess/Cocoa/NavigationState.h:
1600         * UIProcess/Cocoa/NavigationState.mm:
1601         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1602         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1603         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
1604         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
1605         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
1606         (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
1607         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Copied from Source/WebKit/WebProcess/Network/WebSocketProvider.h.
1608         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
1609         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
1610         (WebKit::reportAnErrorURL):
1611         (WebKit::malwareDetailsURL):
1612         (WebKit::safeBrowsingDetailsText):
1613         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
1614         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1615         (-[_WKPreviewControllerDataSource finish:]):
1616         (WebKit::SystemPreviewController::finish):
1617         * UIProcess/Cocoa/UIDelegate.h:
1618         * UIProcess/Cocoa/UIDelegate.mm:
1619         (WebKit::UIDelegate::UIClient::createNewPage):
1620         (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder):
1621         (WebKit::requestUserMediaAuthorizationForDevices):
1622         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
1623         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
1624         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
1625         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
1626         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1627         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
1628         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1629         * UIProcess/Cocoa/WebViewImpl.h:
1630         * UIProcess/Cocoa/WebViewImpl.mm:
1631         (WebKit::WebViewImpl::showSafeBrowsingWarning):
1632         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
1633         * UIProcess/Downloads/DownloadProxy.cpp:
1634         (WebKit::DownloadProxy::publishProgress):
1635         * UIProcess/Downloads/DownloadProxy.h:
1636         (WebKit::DownloadProxy::setRedirectChain):
1637         (WebKit::DownloadProxy::redirectChain const):
1638         * UIProcess/FrameLoadState.cpp:
1639         (WebKit::FrameLoadState::didStartProvisionalLoad):
1640         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
1641         (WebKit::FrameLoadState::didSameDocumentNotification):
1642         (WebKit::FrameLoadState::setUnreachableURL):
1643         * UIProcess/FrameLoadState.h:
1644         (WebKit::FrameLoadState::url const):
1645         (WebKit::FrameLoadState::setURL):
1646         (WebKit::FrameLoadState::provisionalURL const):
1647         (WebKit::FrameLoadState::unreachableURL const):
1648         * UIProcess/Network/NetworkProcessProxy.cpp:
1649         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
1650         * UIProcess/Network/NetworkProcessProxy.h:
1651         * UIProcess/PageClient.h:
1652         (WebKit::PageClient::showSafeBrowsingWarning):
1653         * UIProcess/PageLoadState.cpp:
1654         (WebKit::PageLoadState::hasOnlySecureContent):
1655         * UIProcess/Plugins/PluginInfoStore.cpp:
1656         * UIProcess/Plugins/PluginInfoStore.h:
1657         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1658         * UIProcess/SafeBrowsingResult.h: Copied from Source/WebKit/UIProcess/SystemPreviewController.h.
1659         (WebKit::SafeBrowsingResult::create):
1660         (WebKit::SafeBrowsingResult::url const):
1661         (WebKit::SafeBrowsingResult::provider const):
1662         (WebKit::SafeBrowsingResult::isPhishing const):
1663         (WebKit::SafeBrowsingResult::isMalware const):
1664         (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
1665         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
1666         * UIProcess/SafeBrowsingWarning.h:
1667         (WebKit::SafeBrowsingWarning::create):
1668         * UIProcess/SuspendedPageProxy.cpp:
1669         * UIProcess/SystemPreviewController.h:
1670         * UIProcess/WebCookieManagerProxy.h:
1671         * UIProcess/WebFrameProxy.h:
1672         (WebKit::WebFrameProxy::url const):
1673         (WebKit::WebFrameProxy::provisionalURL const):
1674         (WebKit::WebFrameProxy::unreachableURL const):
1675         * UIProcess/WebInspectorProxy.h:
1676         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
1677         * UIProcess/WebPageProxy.cpp:
1678         (WebKit::WebPageProxy::loadDataWithNavigation):
1679         (WebKit::WebPageProxy::loadAlternateHTML):
1680         (WebKit::WebPageProxy::loadWebArchiveData):
1681         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
1682         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1683         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1684         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
1685         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1686         (WebKit::WebPageProxy::contentRuleListNotification):
1687         (WebKit::WebPageProxy::processDidTerminate):
1688         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
1689         (WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
1690         * UIProcess/WebPageProxy.h:
1691         * UIProcess/WebPageProxy.messages.in:
1692         * UIProcess/WebProcessPool.cpp:
1693         (WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
1694         * UIProcess/WebProcessPool.h:
1695         * UIProcess/WebProcessProxy.cpp:
1696         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1697         * UIProcess/WebProcessProxy.h:
1698         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1699         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1700         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
1701         * UIProcess/WebResourceLoadStatisticsStore.h:
1702         * UIProcess/ios/DragDropInteractionState.h:
1703         * UIProcess/ios/PageClientImplIOS.h:
1704         * UIProcess/ios/PageClientImplIOS.mm:
1705         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1706         * UIProcess/ios/WKActionSheetAssistant.mm:
1707         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
1708         * UIProcess/ios/WKContentViewInteraction.mm:
1709         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
1710         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
1711         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1712         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
1713         * UIProcess/ios/WKLegacyPDFView.mm:
1714         (-[WKLegacyPDFView actionSheetAssistant:shareElementWithURL:rect:]):
1715         * UIProcess/ios/WKPDFView.mm:
1716         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
1717         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1718         (-[WKFullScreenWindowController _updateLocationInfo]):
1719         * UIProcess/mac/LegacySessionStateCoding.cpp:
1720         (WebKit::decodeLegacySessionState):
1721         * UIProcess/mac/PageClientImplMac.h:
1722         * UIProcess/mac/PageClientImplMac.mm:
1723         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1724         * UIProcess/mac/WKImmediateActionController.mm:
1725         (-[WKImmediateActionController _defaultAnimationController]):
1726         * UIProcess/win/WebInspectorProxyWin.cpp:
1727         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1728         (WebKit::WebPaymentCoordinator::showPaymentUI):
1729         (WebKit::WebPaymentCoordinator::validateMerchant):
1730         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1731         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1732         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
1733         * WebProcess/Cache/WebCacheStorageConnection.h:
1734         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1735         (WebKit::BlobRegistryProxy::registerFileBlobURL):
1736         * WebProcess/FileAPI/BlobRegistryProxy.h:
1737         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1738         (API::InjectedBundle::PageLoaderClient::willLoadDataRequest):
1739         (API::InjectedBundle::PageLoaderClient::userAgentForURL const):
1740         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1741         (WKBundleFrameAllowsFollowingLink):
1742         (WKBundleFrameCopySuggestedFilenameForResourceWithURL):
1743         (WKBundleFrameCopyMIMETypeForResourceWithURL):
1744         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1745         (WKBundlePageHasLocalDataForURL):
1746         * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp:
1747         (convertToUTF8String):
1748         * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h:
1749         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
1750         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1751         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1752         * WebProcess/Network/WebLoaderStrategy.cpp:
1753         (WebKit::WebLoaderStrategy::preconnectTo):
1754         * WebProcess/Network/WebLoaderStrategy.h:
1755         * WebProcess/Network/WebSocketProvider.h:
1756         * WebProcess/Network/WebSocketStream.cpp:
1757         (WebKit::WebSocketStream::WebSocketStream):
1758         * WebProcess/Network/WebSocketStream.h:
1759         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1760         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1761         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
1762         * WebProcess/Plugins/PDF/PDFPlugin.h:
1763         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1764         (WebKit::PDFPlugin::clickedLink):
1765         * WebProcess/Plugins/Plugin.h:
1766         * WebProcess/Plugins/PluginController.h:
1767         * WebProcess/Plugins/PluginProxy.h:
1768         * WebProcess/Plugins/PluginView.cpp:
1769         (WebKit::PluginView::performURLRequest):
1770         (WebKit::PluginView::performJavaScriptURLRequest):
1771         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1772         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
1773         * WebProcess/Plugins/WebPluginInfoProvider.h:
1774         * WebProcess/Storage/WebSWClientConnection.h:
1775         * WebProcess/Storage/WebSWContextManagerConnection.h:
1776         * WebProcess/UserContent/WebUserContentController.h:
1777         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1778         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
1779         * WebProcess/WebCoreSupport/WebChromeClient.h:
1780         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1781         * WebProcess/WebCoreSupport/WebDragClient.h:
1782         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1783         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1784         (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL):
1785         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1786         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1787         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
1788         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1789         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1790         (WebKit::WebDragClient::declareAndWriteDragImage):
1791         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1792         * WebProcess/WebPage/VisitedLinkTableController.h:
1793         * WebProcess/WebPage/WebFrame.cpp:
1794         (WebKit::WebFrame::allowsFollowingLink const):
1795         * WebProcess/WebPage/WebFrame.h:
1796         * WebProcess/WebPage/WebPage.cpp:
1797         (WebKit::WebPage::loadURLInFrame):
1798         (WebKit::WebPage::loadData):
1799         (WebKit::WebPage::loadAlternateHTML):
1800         (WebKit::WebPage::dumpHistoryForTesting):
1801         (WebKit::WebPage::sendCSPViolationReport):
1802         (WebKit::WebPage::addUserScript):
1803         (WebKit::WebPage::addUserStyleSheet):
1804         * WebProcess/WebPage/WebPage.h:
1805         * WebProcess/WebPage/WebPage.messages.in:
1806         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1807         (WebKit::WebPrintOperationGtk::frameURL const):
1808         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
1809         * WebProcess/WebProcess.cpp:
1810         (WebKit::WebProcess::sendPrewarmInformation):
1811         * WebProcess/WebProcess.h:
1812         * WebProcess/cocoa/WebProcessCocoa.mm:
1813         (WebKit::activePagesOrigins):
1814
1815 2018-11-30  Per Arne Vollan  <pvollan@apple.com>
1816
1817         [macOS] Add more logging of sandbox call entries.
1818         https://bugs.webkit.org/show_bug.cgi?id=192261
1819         rdar://problem/45772445
1820
1821         Reviewed by Dean Jackson.
1822
1823         * WebProcess/com.apple.WebProcess.sb.in:
1824
1825 2018-11-30  Tim Horton  <timothy_horton@apple.com>
1826
1827         Editable images should always return some data, even if the canvas doesn't have a size yet
1828         https://bugs.webkit.org/show_bug.cgi?id=192265
1829         <rdar://problem/46385911>
1830
1831         Reviewed by Wenson Hsieh.
1832
1833         * UIProcess/ios/WKDrawingView.mm:
1834         (-[WKDrawingView layoutSubviews]):
1835         (emptyImage):
1836         (-[WKDrawingView renderedDrawing]):
1837         (-[WKDrawingView PNGRepresentation]):
1838         Some clients strongly depend on there being some data in an image, even if
1839         it's not of a usable size yet. We'll invalidate the attachment when the
1840         canvas size changes, so it will eventually settle at a usable size (after
1841         the first layer tree commit that includes the editable image).
1842
1843 2018-11-30  Don Olmstead  <don.olmstead@sony.com>
1844
1845         Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
1846         https://bugs.webkit.org/show_bug.cgi?id=192197
1847
1848         Reviewed by Jiewen Tan.
1849
1850         * Configurations/FeatureDefines.xcconfig:
1851         * UIProcess/API/C/WKPage.cpp:
1852         (WKPageSetPageNavigationClient):
1853         * UIProcess/WebPageProxy.cpp:
1854         * UIProcess/WebPageProxy.h:
1855         * UIProcess/WebPageProxy.messages.in:
1856         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1857         * WebProcess/WebCoreSupport/WebChromeClient.h:
1858
1859 2018-11-30  Alexey Proskuryakov  <ap@apple.com>
1860
1861         Move USE_CFNETWORK_IGNORE_HSTS to its proper place
1862         https://bugs.webkit.org/show_bug.cgi?id=192173
1863
1864         Reviewed by Tim Horton.
1865
1866         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1867         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
1868         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1869         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1870
1871 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1872
1873         Remove unused WebProcessCreationParameters.uiProcessCookieStorageIdentifier
1874         https://bugs.webkit.org/show_bug.cgi?id=192157
1875
1876         Reviewed by Chris Dumez.
1877
1878         * Shared/WebProcessCreationParameters.cpp:
1879         (WebKit::WebProcessCreationParameters::encode const):
1880         (WebKit::WebProcessCreationParameters::decode):
1881         * Shared/WebProcessCreationParameters.h:
1882         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1883         (WebKit::WebProcessPool::platformInitializeWebProcess):
1884
1885 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1886
1887         Remove privateBrowsingEnabled from NetworkProcessCreationParameters
1888         https://bugs.webkit.org/show_bug.cgi?id=192156
1889
1890         Reviewed by Chris Dumez.
1891
1892         * NetworkProcess/NetworkProcess.cpp:
1893         (WebKit::NetworkProcess::initializeNetworkProcess):
1894         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1895         (WebKit::NetworkProcessCreationParameters::encode const):
1896         (WebKit::NetworkProcessCreationParameters::decode):
1897         * NetworkProcess/NetworkProcessCreationParameters.h:
1898         * UIProcess/WebProcessPool.cpp:
1899         (WebKit::WebProcessPool::ensureNetworkProcess):
1900
1901 2018-11-30  Basuke Suzuki  <basuke.suzuki@sony.com>
1902
1903         [Curl] Add API for ProtectionSpace.
1904         https://bugs.webkit.org/show_bug.cgi?id=191648
1905
1906         Reviewed by Alex Christensen.
1907
1908         Added API to get certificate information from protection space.
1909
1910         * PlatformWin.cmake:
1911         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
1912         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1913         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
1914         * UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp: Added.
1915         (WKProtectionSpaceCopyCertificateInfo):
1916         * UIProcess/API/C/curl/WKProtectionSpaceCurl.h: Added.
1917
1918 2018-11-30  David Quesada  <david_quesada@apple.com>
1919
1920         -[WKProcessPool _downloadURLRequest:] should allow specifying the initiating web view
1921         https://bugs.webkit.org/show_bug.cgi?id=192212
1922         rdar://problem/46363706
1923
1924         Reviewed by Alex Christensen.
1925
1926         * UIProcess/API/Cocoa/WKProcessPool.mm:
1927         (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
1928         (-[WKProcessPool _downloadURLRequest:]): Deleted.
1929         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1930
1931 2018-11-30  Per Arne Vollan  <pvollan@apple.com>
1932
1933         Remove invalid character in sandbox introduced in r238703.
1934
1935         Unreviewed sandbox fix.
1936
1937         * WebProcess/com.apple.WebProcess.sb.in:
1938
1939 2018-11-30  Andy Estes  <aestes@apple.com>
1940
1941         [Cocoa] Add some WKA extension points
1942         https://bugs.webkit.org/show_bug.cgi?id=192131
1943         <rdar://problem/46330293>
1944
1945         Reviewed by Tim Horton.
1946
1947         * DerivedSources.make: Added an extension point for WebPreferences.yaml.
1948         * Platform/IPC/MessageSender.h:
1949         (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
1950         * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
1951         * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
1952         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1953         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
1954         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
1955         WebPaymentCoordinatorProxy.
1956         * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
1957         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
1958         WebPaymentCoordinator.
1959
1960 2018-11-30  Frederic Wang  <fwang@igalia.com>
1961
1962         [WebAuthN] Support CTAP HID authenticators on macOS
1963         https://bugs.webkit.org/show_bug.cgi?id=188623
1964
1965         Unreviewed build fix.
1966
1967         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Add missing header.
1968
1969 2018-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1970
1971         REGRESSION (r238635): Dragging a text selection within WKWebView causes the selection highlight to get into a bad state
1972         https://bugs.webkit.org/show_bug.cgi?id=192165
1973         <rdar://problem/46346682>
1974
1975         Reviewed by Daniel Bates.
1976
1977         Fixes a bug in PageClientImpl::isViewFocused. Consider the following scenario:
1978         1. WKWebView is hosted within the view hierarchy
1979         2. First responder is *not* WKContentView
1980         3. The active focus retain count is nonzero
1981
1982         Before r238635, we would return true, due to condition (3). However, after r238635, we only consider whether the
1983         first responder is WKContentView, since the web view is in the view hierarchy. This breaks scenarios where
1984         WebKit or UIKit attempts to retain focus and later restore the content view to be the first responder (an
1985         example of this is dragging a text selection between editable elements in the same web view).
1986
1987         To fix this, simply bail early and return true if focus is being retained.
1988
1989         * UIProcess/ios/PageClientImplIOS.mm:
1990         (WebKit::PageClientImpl::isViewFocused):
1991
1992 2018-11-29  Tim Horton  <timothy_horton@apple.com>
1993
1994         Inform clients when editable image attachment backing data changes
1995         https://bugs.webkit.org/show_bug.cgi?id=192206
1996         <rdar://problem/46350277>
1997
1998         Reviewed by Wenson Hsieh.
1999
2000         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
2001         (API::Attachment::invalidateGeneratedFileWrapper):
2002         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2003         * UIProcess/API/Cocoa/WKWebView.mm:
2004         (-[WKWebView _didInvalidateDataForAttachment:]):
2005         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2006         * UIProcess/Cocoa/PageClientImplCocoa.h:
2007         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2008         (WebKit::PageClientImplCocoa::didInvalidateDataForAttachment):
2009         * UIProcess/PageClient.h:
2010         (WebKit::PageClient::didInvalidateDataForAttachment):
2011         * UIProcess/WebPageProxy.cpp:
2012         (WebKit::WebPageProxy::didInvalidateDataForAttachment):
2013         * UIProcess/WebPageProxy.h:
2014         Plumb file-wrapper-invalidation through from APIAttachment to WKUIDelegate.
2015
2016 2018-11-29  Eric Carlson  <eric.carlson@apple.com>
2017
2018         [MediaStream] DeviceIdHashSaltStorage should use iframe and top level documents
2019         https://bugs.webkit.org/show_bug.cgi?id=192182
2020
2021         Reviewed by Youenn Fablet.
2022
2023         * UIProcess/DeviceIdHashSaltStorage.cpp:
2024         (WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Key off of request and top 
2025         level documents.
2026         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins): Ditto.
2027         * UIProcess/DeviceIdHashSaltStorage.h:
2028         (WebKit::DeviceIdHashSaltStorage::HashSaltForOrigin::HashSaltForOrigin):
2029
2030         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2031         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Pass both documents.
2032         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
2033         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
2034
2035 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
2036
2037         Unreviewed, rolling out r238713.
2038
2039         Breaks internal builds.
2040
2041         Reverted changeset:
2042
2043         "[Cocoa] Add some WKA extension points"
2044         https://bugs.webkit.org/show_bug.cgi?id=192131
2045         https://trac.webkit.org/changeset/238713
2046
2047 2018-11-29  Simon Fraser  <simon.fraser@apple.com>
2048
2049         Add an internal feature flag to enable async overflow scrolling
2050         https://bugs.webkit.org/show_bug.cgi?id=192184
2051
2052         Reviewed by Tim Horton.
2053
2054         Add a new internal feature flag that will enable async overflow-scrolling for
2055         most overflow:scroll elements. Defaults to off.
2056
2057         * Shared/WebPreferences.yaml:
2058
2059 2018-11-29  Andy Estes  <aestes@apple.com>
2060
2061         [Cocoa] Add some WKA extension points
2062         https://bugs.webkit.org/show_bug.cgi?id=192131
2063         <rdar://problem/46330293>
2064
2065         Reviewed by Tim Horton.
2066
2067         * DerivedSources.make: Added an extension point for WebPreferences.yaml.
2068         * Platform/IPC/MessageSender.h:
2069         (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
2070         * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
2071         * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
2072         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2073         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
2074         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
2075         WebPaymentCoordinatorProxy.
2076         * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
2077         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
2078         WebPaymentCoordinator.
2079
2080 2018-11-29  Tim Horton  <timothy_horton@apple.com>
2081
2082         Try to fix the build.
2083
2084         * Platform/spi/ios/PencilKitSPI.h:
2085
2086 2018-11-29  David Quesada  <david_quesada@apple.com>
2087
2088         Add SPI to publish NSProgress on active downloads
2089         https://bugs.webkit.org/show_bug.cgi?id=192021
2090         rdar://problem/44405661
2091
2092         Reviewed by Alex Christensen.
2093
2094         Make it possible for clients to allow other processes to monitor the state of active
2095         downloads. On Cocoa platforms, this can be done by creating an NSProgress, publishing
2096         it on an appropriate file URL (potentially a different file URL than where the download
2097         data is being written), updating properties on it as the download makes progress, and
2098         wiring up a cancellation handler that allows it to be remotely canceled. Interested
2099         clients can then subscribe to progress on that URL and receive a proxy to the progress
2100         that WebKit publishes.
2101
2102         * NetworkProcess/Downloads/Download.cpp:
2103         (WebKit::Download::~Download):
2104         (WebKit::Download::platformDestroyDownload):
2105             Add a platform-customizable hook for destructing the Download. DownloadCocoa.mm
2106             will interact with its Objective-C NSProgress instance at this point.
2107
2108         * NetworkProcess/Downloads/Download.h:
2109         * NetworkProcess/Downloads/DownloadManager.cpp:
2110         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
2111             See comments for publishDownloadProgress().
2112         (WebKit::DownloadManager::publishDownloadProgress):
2113             If the provided downloadID corresponds to a non-Pending Download, hand the URL
2114             and a matching sandbox extension to the Download so it can create its progress.
2115             Otherwise, store the URL and sandbox extension on the PendingDownload to be used
2116             later when the full Download is created. When this happens, dataTaskBecameDownloadTask()
2117             will tell the PendingDownload about the Download it has become. The PendingDownload
2118             will then relay the progress URL and sandbox extension to the Download.
2119
2120         * NetworkProcess/Downloads/DownloadManager.h:
2121         * NetworkProcess/Downloads/PendingDownload.cpp:
2122         (WebKit::PendingDownload::publishProgress):
2123             Store the progress info for later use, when the proper Download is created.
2124         (WebKit::PendingDownload::didBecomeDownload):
2125             If there was a progress URL provided earlier, tell the Download corresponding to this
2126             PendingDownload to publish its progress using that URL.
2127
2128         * NetworkProcess/Downloads/PendingDownload.h:
2129         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2130         (WebKit::Download::platformDestroyDownload):
2131             When the Download is destroyed (i.e. when the download succeeds, fails, or is canceled),
2132             unpublish the progress, since there is no longer any activity to report.
2133         (WebKit::Download::publishProgress):
2134             Resolve the sandbox extension, create a progress configured to reflect the progress of
2135             this Download's NSURLSessionDownloadTask, and publish it at the given file URL.
2136
2137         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownload.h.
2138         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Added.
2139         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
2140             Configure this progress, start observing properties on the download task that this
2141             progress will reflect, and connect the cancellation handler of the progress to cancel
2142             the corresponding Download.
2143         (-[WKDownloadProgress publish]):
2144         (-[WKDownloadProgress unpublish]):
2145             Override these methods to consume and revoke the sandbox extension to make sure the
2146             process has access to the progress file while the progress will be published.
2147         (-[WKDownloadProgress dealloc]):
2148         (-[WKDownloadProgress observeValueForKeyPath:ofObject:change:context:]):
2149             When either byte count (number received, or number expected to receive) of the download
2150             task changes, update this progress to reflect that.
2151
2152         * NetworkProcess/NetworkProcess.cpp:
2153         (WebKit::NetworkProcess::publishDownloadProgress):
2154         * NetworkProcess/NetworkProcess.h:
2155         * NetworkProcess/NetworkProcess.messages.in:
2156
2157         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2158         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2159             Allow looking up the services that manages published NSProgresses.
2160
2161         * UIProcess/API/Cocoa/_WKDownload.h:
2162         * UIProcess/API/Cocoa/_WKDownload.mm:
2163         (-[_WKDownload publishProgressAtURL:]):
2164         * UIProcess/Downloads/DownloadProxy.cpp:
2165         (WebKit::DownloadProxy::publishProgress):
2166         * UIProcess/Downloads/DownloadProxy.h:
2167         * WebKit.xcodeproj/project.pbxproj:
2168
2169 2018-11-29  Tim Horton  <timothy_horton@apple.com>
2170
2171         Make drawing tools available when an editable image is focused
2172         https://bugs.webkit.org/show_bug.cgi?id=192172
2173         <rdar://problem/30337960>
2174
2175         Reviewed by Dean Jackson.
2176
2177         * Platform/spi/ios/PencilKitSPI.h:
2178         Add some more SPI.
2179
2180         * Shared/AssistedNodeInformation.cpp:
2181         (WebKit::AssistedNodeInformation::encode const):
2182         (WebKit::AssistedNodeInformation::decode):
2183         * Shared/AssistedNodeInformation.h:
2184         * WebProcess/WebPage/ios/WebPageIOS.mm:
2185         (WebKit::WebPage::handleStylusSingleTapAtPoint):
2186         (WebKit::isAssistableElement):
2187         (WebKit::WebPage::getAssistedNodeInformation):
2188         Plumb the assisted node's embedded view ID, if available.
2189         Also add a new input type for drawings, and use it when appropriate.
2190
2191         * SourcesCocoa.txt:
2192         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2193         Add WKInputTypeDrawing.
2194
2195         * UIProcess/ios/PencilKitSoftLink.h: Added.
2196         * UIProcess/ios/PencilKitSoftLink.mm: Added.
2197         Pull soft-linking out into its own file, to fix unified sources.
2198
2199         * UIProcess/ios/WKContentViewInteraction.mm:
2200         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
2201         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2202         (-[WKContentView requiresAccessoryView]):
2203         Install a keyboard when a drawing is focused.
2204         Also, deduplicate one "curretUserInterfaceIdiomIsPad"; just fall through.
2205
2206         (-[WKContentView inputView]):
2207         Make a WKInkPickerControl when a drawing is focused.
2208
2209         (-[WKContentView textInputTraits]):
2210         (isAssistableInputType):
2211         * UIProcess/ios/WKDrawingView.h:
2212         * UIProcess/ios/WKDrawingView.mm:
2213         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
2214         (-[WKDrawingView PNGRepresentation]):
2215         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
2216         Adopt PencilKitSoftLink.
2217
2218         (-[WKDrawingView canvasView]):
2219         Expose the internal canvas view for use by WKInkPickerControl.
2220
2221         * UIProcess/ios/WKInkPickerControl.h: Copied from Source/WebKit/Platform/spi/ios/PencilKitSPI.h.
2222         * UIProcess/ios/WKInkPickerControl.mm: Added.
2223         (-[WKInkPickerView initWithFrame:drawingView:]):
2224         (-[WKInkPickerView didPickInk]):
2225         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
2226         (-[WKInkPickerView inlineInkPicker:didSelectTool:]):
2227         (-[WKInkPickerView inlineInkPicker:didSelectColor:]):
2228         (-[WKInkPickerView inkPickerSize]):
2229         (-[WKInkPickerView layoutSubviews]):
2230         (-[WKInkPickerView sizeThatFits:]):
2231         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
2232         (-[WKInkPickerControl initWithDrawingView:]):
2233         (-[WKInkPickerControl beginEditing]):
2234         (-[WKInkPickerControl endEditing]):
2235         (-[WKInkPickerControl assistantView]):
2236         Install and hook up a PKInlineInkPicker.
2237         Center it in the keyboard.
2238         Plumb changes through to the canvas view.
2239
2240         * WebKit.xcodeproj/project.pbxproj:
2241
2242 2018-11-29  Per Arne Vollan  <pvollan@apple.com>
2243
2244         [macOS] Add logging for some sandbox entries.
2245         https://bugs.webkit.org/show_bug.cgi?id=192126
2246
2247         Reviewed by Brent Fulgham.
2248
2249         Add logging for sandbox entries which are possibly not needed.
2250
2251         * WebProcess/com.apple.WebProcess.sb.in:
2252
2253 2018-11-29  Alex Christensen  <achristensen@webkit.org>
2254
2255         Fix _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier SPI introduced in r235127
2256         https://bugs.webkit.org/show_bug.cgi?id=192191
2257
2258         Reviewed by Andy Estes.
2259
2260         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2261         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2262         When trying to adopt the new SPI and verify it worked, I found that the strings are not copied in one place where they should be.
2263
2264 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
2265
2266         Move Lookup Code for better cross platform usage
2267         https://bugs.webkit.org/show_bug.cgi?id=191732
2268
2269         Reviewed by Alex Christensen.
2270
2271         Lookup is being replaced by Reveal. This framework should work on all platforms.
2272         The patch moves the code that we expect will be needed for all platforms to the more
2273         general cocoa area. This patch changes no funcationality, and should not change
2274         anything currently. This work will be build on later when Reveal is ready to support
2275         multiple platforms.
2276
2277         * Platform/spi/ios/UIKitSPI.h:
2278         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2279         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2280         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2281         * UIProcess/ios/WKContentViewInteraction.h:
2282         * UIProcess/ios/WKContentViewInteraction.mm:
2283         (-[WKContentView setupInteraction]):
2284         (-[WKContentView cleanupInteraction]):
2285         (-[WKContentView _removeDefaultGestureRecognizers]):
2286         (-[WKContentView _addDefaultGestureRecognizers]):
2287         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2288         (-[WKContentView _lookupGestureRecognized:]):
2289         * UIProcess/ios/WebPageProxyIOS.mm:
2290         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2291         * UIProcess/mac/WebPageProxyMac.mm:
2292         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2293         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
2294         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2295         (WebKit::WebPage::performDictionaryLookupAtLocation):
2296         (WebKit::WebPage::performDictionaryLookupForSelection):
2297         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
2298         (WebKit::WebPage::performDictionaryLookupForRange):
2299         (WebKit::WebPage::dictionaryPopupInfoForRange):
2300         * WebProcess/WebPage/WebPage.messages.in:
2301         * WebProcess/WebPage/ios/WebPageIOS.mm:
2302         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2303         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2304         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2305         * WebProcess/WebPage/mac/WebPageMac.mm:
2306         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2307         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2308         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
2309         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
2310         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2311
2312 2018-11-29  Zalan Bujtas  <zalan@apple.com>
2313
2314         [ContentObservation] Decouple content change and DOM timer scheduling observation
2315         https://bugs.webkit.org/show_bug.cgi?id=192170
2316
2317         Reviewed by Simon Fraser.
2318
2319         * WebProcess/WebPage/ios/WebPageIOS.mm:
2320         (WebKit::WebPage::handleSyntheticClick):
2321
2322 2018-11-29  Eric Carlson  <eric.carlson@apple.com>
2323
2324         [iOS] Tell AirPlay picker when a file has video
2325         https://bugs.webkit.org/show_bug.cgi?id=192155
2326         <rdar://problem/43843865>
2327
2328         Reviewed by Jer Noble.
2329
2330         * UIProcess/ios/WKContentViewInteraction.mm:
2331         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
2332         Add hasVideo parameter.
2333
2334         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2335         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2336         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]): Add
2337         hasVideo parameter, pass info to MPMediaControlsViewController.
2338         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Deleted.
2339
2340 2018-11-29  Alexey Proskuryakov  <ap@apple.com>
2341
2342         Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
2343         https://bugs.webkit.org/show_bug.cgi?id=192041
2344
2345         Reviewed by Tim Horton.
2346
2347         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2348         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
2349
2350 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
2351
2352         Unreviewed, rolling out r238678.
2353
2354         Breaks internal builds.
2355
2356         Reverted changeset:
2357
2358         "Move Lookup Code for better cross platform usage"
2359         https://bugs.webkit.org/show_bug.cgi?id=191732
2360         https://trac.webkit.org/changeset/238678
2361
2362 2018-11-29  Suresh Koppisetty  <skoppisetty@apple.com>
2363
2364         Addressed a FIXME by removing an unnecessary call to [NSApplication sharedApplication].
2365         https://bugs.webkit.org/show_bug.cgi?id=192099
2366
2367         Reviewed by Geoffrey Garen.
2368
2369         [NSApplication sharedApplication] call is no longer needed in platformInitializeWebProcess as [NSApplication _accessibilityInitialize] calls [NSApplication sharedApplication].
2370
2371         * WebProcess/cocoa/WebProcessCocoa.mm:
2372         (WebKit::WebProcess::platformInitializeWebProcess):
2373
2374 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
2375
2376         Move Lookup Code for better cross platform usage
2377         https://bugs.webkit.org/show_bug.cgi?id=191732
2378
2379         Reviewed by Alex Christensen.
2380
2381         Lookup is being replaced by Reveal. This framework should work on all platforms.
2382         The patch moves the code that we expect will be needed for all platforms to the more
2383         general cocoa area. This patch changes no funcationality, and should not change
2384         anything currently. This work will be build on later when Reveal is ready to support
2385         multiple platforms.
2386
2387         * Platform/spi/ios/UIKitSPI.h:
2388         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2389         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2390         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2391         * UIProcess/ios/WKContentViewInteraction.h:
2392         * UIProcess/ios/WKContentViewInteraction.mm:
2393         (-[WKContentView setupInteraction]):
2394         (-[WKContentView cleanupInteraction]):
2395         (-[WKContentView _removeDefaultGestureRecognizers]):
2396         (-[WKContentView _addDefaultGestureRecognizers]):
2397         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2398         (-[WKContentView _lookupGestureRecognized:]):
2399         * UIProcess/ios/WebPageProxyIOS.mm:
2400         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2401         * UIProcess/mac/WebPageProxyMac.mm:
2402         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2403         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
2404         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2405         (WebKit::WebPage::performDictionaryLookupAtLocation):
2406         (WebKit::WebPage::performDictionaryLookupForSelection):
2407         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
2408         (WebKit::WebPage::performDictionaryLookupForRange):
2409         (WebKit::WebPage::dictionaryPopupInfoForRange):
2410         * WebProcess/WebPage/WebPage.messages.in:
2411         * WebProcess/WebPage/ios/WebPageIOS.mm:
2412         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2413         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2414         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2415         * WebProcess/WebPage/mac/WebPageMac.mm:
2416         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2417         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2418         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
2419         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
2420         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2421
2422 2018-11-29  Conrad Shultz  <conrad_shultz@apple.com>
2423
2424         Factor out configuration of the file upload image picker
2425         https://bugs.webkit.org/show_bug.cgi?id=192138
2426         <rdar://problem/46334871>
2427
2428         Reviewed by Tim Horton.
2429
2430         By factoring configuration of the picker into its own method, it makes it easier
2431         to apply custom configuration in subclasses in the future.
2432
2433         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2434         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
2435         (-[WKFileUploadPanel _configureImagePicker:]):
2436
2437 2018-11-29  Tomas Popela  <tpopela@redhat.com>
2438
2439         [GTK][WPE] Fix BubblewrapLauncher clang warnings
2440         https://bugs.webkit.org/show_bug.cgi?id=192086
2441
2442         Reviewed by Michael Catanzaro.
2443
2444         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2445         (WebKit::bindPathVar): Initialize the i variable to 0.
2446         (WebKit::setupSeccomp): Initialize the optional datum_b member.
2447
2448 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
2449
2450         Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
2451         https://bugs.webkit.org/show_bug.cgi?id=192016
2452         <rdar://problem/46284417>
2453
2454         Reviewed by Devin Rousso.
2455
2456         Previously calling the Page's inspectorController.show()
2457         would create a frontend connection on the WebProcess side.
2458         However now the frontend connection is handed to the WebProcess
2459         once the UIProcess creates it. So queue actions that take place
2460         immediately after showing the inspector until we have a frontend
2461         to send the actions to.
2462
2463         * WebProcess/WebPage/WebInspector.h:
2464         * WebProcess/WebPage/WebInspector.cpp:
2465         (WebKit::WebInspector::setFrontendConnection):
2466         (WebKit::WebInspector::closeFrontendConnection):
2467         (WebKit::WebInspector::whenFrontendConnectionEstablished):
2468         (WebKit::WebInspector::showConsole):
2469         (WebKit::WebInspector::showResources):
2470         (WebKit::WebInspector::showTimelines):
2471         (WebKit::WebInspector::showMainResourceForFrame):
2472         (WebKit::WebInspector::startPageProfiling):
2473         (WebKit::WebInspector::stopPageProfiling):
2474         (WebKit::WebInspector::startElementSelection):
2475         (WebKit::WebInspector::stopElementSelection):
2476
2477 2018-11-28  Vivek Seth  <v_seth@apple.com>
2478
2479         Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
2480         https://bugs.webkit.org/show_bug.cgi?id=192094
2481         <rdar://problem/45851103> HTTPS Upgrade: Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
2482
2483         Reviewed by Chris Dumez.
2484
2485         For main page loads upgrade HTTP requests to HTTPS if the hostname belongs to a set of upgradable hostnames.
2486
2487         * NetworkProcess/NetworkLoadChecker.cpp:
2488         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded):
2489         (WebKit::NetworkLoadChecker::checkRequest):
2490         * NetworkProcess/NetworkLoadChecker.h:
2491         * NetworkProcess/NetworkResourceLoader.cpp:
2492         (WebKit::NetworkResourceLoader::start):
2493
2494 2018-11-28  Simon Fraser  <simon.fraser@apple.com>
2495
2496         REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
2497         https://bugs.webkit.org/show_bug.cgi?id=192127
2498         rdar://problem/44194179
2499
2500         Reviewed by Tim Horton.
2501         
2502         _restorePageStateToUnobscuredCenter: could receive an Optional<FloatRect> from the
2503         web process, and unconditionally called .value() even though it may not be engaged.
2504         
2505         No repro steps known, so no testcase.
2506
2507         * UIProcess/API/Cocoa/WKWebView.mm:
2508         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
2509
2510 2018-11-28  Commit Queue  <commit-queue@webkit.org>
2511
2512         Unreviewed, rolling out r238653 and r238656.
2513         https://bugs.webkit.org/show_bug.cgi?id=192130
2514
2515         Breaks iOS build (Requested by smfr on #webkit).
2516
2517         Reverted changesets:
2518
2519         "Move Lookup Code for better cross platform usage"
2520         https://bugs.webkit.org/show_bug.cgi?id=191732
2521         https://trac.webkit.org/changeset/238653
2522
2523         "Attempt to fix the iOS build by only including RevealSPI.h
2524         when it's needed."
2525         https://trac.webkit.org/changeset/238656
2526
2527 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2528
2529         Modernize BlobRegistry::writeBlobsToTemporaryFiles
2530         https://bugs.webkit.org/show_bug.cgi?id=192117
2531
2532         Reviewed by Dean Jackson.
2533
2534         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2535         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
2536         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
2537         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2538         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2539         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2540         * NetworkProcess/NetworkConnectionToWebProcess.h:
2541         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2542         * NetworkProcess/NetworkProcess.cpp:
2543         (WebKit::NetworkProcess::writeBlobToFilePath):
2544         * NetworkProcess/NetworkProcess.h:
2545         * NetworkProcess/NetworkProcess.messages.in:
2546         * UIProcess/ChildProcessProxy.h:
2547         (WebKit::ChildProcessProxy::sendWithAsyncReply):
2548         * UIProcess/Network/NetworkProcessProxy.cpp:
2549         (WebKit::NetworkProcessProxy::didClose):
2550         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
2551         (WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted.
2552         * UIProcess/Network/NetworkProcessProxy.h:
2553         * UIProcess/Network/NetworkProcessProxy.messages.in:
2554         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2555         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
2556         * WebProcess/FileAPI/BlobRegistryProxy.h:
2557         * WebProcess/Network/NetworkProcessConnection.cpp:
2558         (WebKit::NetworkProcessConnection::didClose):
2559         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
2560         (WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted.
2561         * WebProcess/Network/NetworkProcessConnection.h:
2562         * WebProcess/Network/NetworkProcessConnection.messages.in:
2563
2564 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2565
2566         Move loadThrottleLatency from NetworkProcessCreationParameters to NetworkSessionCreationParameters
2567         https://bugs.webkit.org/show_bug.cgi?id=192122
2568
2569         Reviewed by Dean Jackson.
2570
2571         This is part of an effort to reduce global variables in the NetworkProcess.
2572
2573         * NetworkProcess/NetworkLoad.cpp:
2574         (WebKit::NetworkLoad::NetworkLoad):
2575         (WebKit::NetworkLoad::didReceiveResponse):
2576         * NetworkProcess/NetworkLoad.h:
2577         * NetworkProcess/NetworkProcess.cpp:
2578         (WebKit::NetworkProcess::initializeNetworkProcess):
2579         * NetworkProcess/NetworkProcess.h:
2580         (WebKit::NetworkProcess::loadThrottleLatency const): Deleted.
2581         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2582         (WebKit::NetworkProcessCreationParameters::encode const):
2583         (WebKit::NetworkProcessCreationParameters::decode):
2584         * NetworkProcess/NetworkSession.h:
2585         (WebKit::NetworkSession::loadThrottleLatency const):
2586         * NetworkProcess/NetworkSessionCreationParameters.cpp: Added.
2587         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2588         (WebKit::NetworkSessionCreationParameters::encode const):
2589         (WebKit::NetworkSessionCreationParameters::decode):
2590         * NetworkProcess/NetworkSessionCreationParameters.h:
2591         (WebKit::NetworkSessionCreationParameters::encode const): Deleted.
2592         (WebKit::NetworkSessionCreationParameters::decode): Deleted.
2593         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2594         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2595         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2596         * Shared/WebsiteDataStoreParameters.cpp:
2597         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
2598         * Sources.txt:
2599         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2600         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2601         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2602         (WebKit::WebsiteDataStore::parameters):
2603         * WebKit.xcodeproj/project.pbxproj:
2604
2605 2018-11-15  Megan Gardner  <megan_gardner@apple.com>
2606
2607         Move Lookup Code for better cross platform usage
2608         https://bugs.webkit.org/show_bug.cgi?id=191732
2609
2610         Reviewed by Alex Christensen.
2611
2612         Lookup is being replaced by Reveal. This framework should work on all platforms.
2613         The patch moves the code that we expect will be needed for all platforms to the more
2614         general cocoa area. This patch changes no funcationality, and should not change
2615         anything currently. This work will be build on later when Reveal is ready to support
2616         multiple platforms.
2617
2618         * Platform/spi/ios/UIKitSPI.h:
2619         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2620         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2621         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2622         * UIProcess/ios/WKContentViewInteraction.h:
2623         * UIProcess/ios/WKContentViewInteraction.mm:
2624         (-[WKContentView setupInteraction]):
2625         (-[WKContentView cleanupInteraction]):
2626         (-[WKContentView _removeDefaultGestureRecognizers]):
2627         (-[WKContentView _addDefaultGestureRecognizers]):
2628         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2629         (-[WKContentView _lookupGestureRecognized:]):
2630         * UIProcess/ios/WebPageProxyIOS.mm:
2631         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2632         * UIProcess/mac/WebPageProxyMac.mm:
2633         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2634         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
2635         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2636         (WebKit::WebPage::performDictionaryLookupAtLocation):
2637         (WebKit::WebPage::performDictionaryLookupForSelection):
2638         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
2639         (WebKit::WebPage::performDictionaryLookupForRange):
2640         (WebKit::WebPage::dictionaryPopupInfoForRange):
2641         * WebProcess/WebPage/WebPage.messages.in:
2642         * WebProcess/WebPage/ios/WebPageIOS.mm:
2643         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2644         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2645         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2646         * WebProcess/WebPage/mac/WebPageMac.mm:
2647         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2648         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2649         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
2650         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
2651         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2652
2653 2018-11-28  Keith Rollin  <krollin@apple.com>
2654
2655         Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
2656         https://bugs.webkit.org/show_bug.cgi?id=192031
2657         <rdar://problem/46286816>
2658
2659         Reviewed by Alex Christensen.
2660
2661         The Generate Derived Sources and Generate Unified Sources build phases
2662         in Xcode need to have their inputs and outputs specified. This
2663         specification will come in the form of .xcfilelist files that will be
2664         attached to these build phases. There is one .xcfilelist file that
2665         lists the input file and one that lists the output files. As part of
2666         this work, the various generate-{derived,unified}-sources scripts that
2667         are executed in these Generate build phases are modified to help in
2668         the creation of these .xcfilelist files. In particular, they can now
2669         be invoked with command-line parameters. These parameters are then
2670         used to alter the normal execution of these scripts, causing them to
2671         produce the .xcfilelist files as opposed to actually generating the
2672         files that are listed in those files.
2673
2674         * Scripts/generate-derived-sources.sh:
2675         * Scripts/generate-unified-sources.sh:
2676
2677 2018-11-28  Keith Rollin  <krollin@apple.com>
2678
2679         Revert print_all_generated_files work in r238008; tighten up target specifications
2680         https://bugs.webkit.org/show_bug.cgi?id=192025
2681         <rdar://problem/46284301>
2682
2683         Reviewed by Alex Christensen.
2684
2685         In r238008, I added a facility for DerivedSources.make makefiles to
2686         print out the list of files that they generate. This output was used
2687         in the generation of .xcfilelist files used to specify the output of
2688         the associated Generate Derived Sources build phases in Xcode. This
2689         approach worked, but it meant that people would need to follow a
2690         specific convention to keep this mechanism working.
2691
2692         Instead of continuing this approach, I'm going to implement a new
2693         facility based on the output of `make` when passed the -d flag (which
2694         prints dependency information). This new mechanism is completely
2695         automatic and doesn't need maintainers to follow a convention. To that
2696         end, remove most of the work performed in r238008 that supports the
2697         print_all_generated_files target.
2698
2699         At the same time, it's important for the sets of targets and their
2700         dependencies to be complete and correct. Therefore, also include
2701         changes to bring those up-to-date. As part of that, you'll see
2702         prevalent use of a particular technique. Here's an example:
2703
2704             BYTECODE_FILES = \
2705                 Bytecodes.h \
2706                 BytecodeIndices.h \
2707                 BytecodeStructs.h \
2708                 InitBytecodes.asm \
2709             #
2710             BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))
2711
2712             all : $(BYTECODE_FILES)
2713
2714             $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
2715                 ...
2716
2717         These lines indicate a set of generated files (those specified in
2718         BYTECODE_FILES). These files are generated by the BytecodeList.rb
2719         tool. But, as opposed to the normal rule where a single foo.output is
2720         generated by foo.input plus some additional dependencies, this rule
2721         produces multiple output files from a tool whose connection to the
2722         output files is not immediately clear. A special approach is needed
2723         where a single rule produces multiple output files. The normal way to
2724         implement this is to use an .INTERMEDIATE target. However, we used
2725         this approach in the past and ran into a problem with it, addressing
2726         it with an alternate approach in r210507. The above example shows this
2727         approach. The .'s in the list of target files are replaced with %'s,
2728         and the result is used as the left side of the dependency rule.
2729
2730         * DerivedSources.make:
2731
2732 2018-11-28  Daniel Bates  <dabates@apple.com>
2733
2734         [iOS] Page not defocused when Find-in-page becomes first responder
2735         https://bugs.webkit.org/show_bug.cgi?id=192084
2736         <rdar://problem/46146777>
2737
2738         Reviewed by Tim Horton.
2739
2740         When -becomeFirstResponder and -resignFirstResponder is called the page should become focused
2741         and defocused, respectively. WebKit adjusts it behavior depending on whether it knows it has
2742         focus. This includes decisions about whether to allow an element to be focused. We need to
2743         ensure that WebKit knows whether the web view is focused for it to make good decisions.
2744
2745         * UIProcess/ios/PageClientImplIOS.mm:
2746         (WebKit::PageClientImpl::isViewFocused): Check if the content view is the first responder and
2747         hence is accepting keyboard input. Note that picture-in-picture views do not accept keyboard
2748         input.
2749         * UIProcess/ios/WKContentViewInteraction.mm:
2750         (-[WKContentView becomeFirstResponderForWebView]): Update activity state when the view
2751         becomes focused.
2752         (-[WKContentView resignFirstResponderForWebView]): Update activity state when the view
2753         becomes defocused.
2754
2755 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2756
2757         Remove dead code from an earlier attempt at implementing safe browsing
2758         https://bugs.webkit.org/show_bug.cgi?id=192067
2759
2760         Reviewed by Chris Dumez.
2761
2762         * Shared/LoadParameters.cpp:
2763         (WebKit::LoadParameters::encode const):
2764         (WebKit::LoadParameters::decode):
2765         * Shared/LoadParameters.h:
2766         * UIProcess/WebPageProxy.cpp:
2767         (WebKit::WebPageProxy::loadAlternateHTML):
2768         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2769         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2770         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2771         * UIProcess/WebPageProxy.h:
2772         * UIProcess/WebPageProxy.messages.in:
2773         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2774         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2775         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2776
2777 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2778
2779         Move logCookieInformation bool from NetworkProcess to NetworkSession
2780         https://bugs.webkit.org/show_bug.cgi?id=192049
2781
2782         Reviewed by Chris Dumez.
2783
2784         Part of an effort to remove globals in the NetworkProcess.
2785
2786         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2787         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
2788         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
2789         * NetworkProcess/NetworkProcess.cpp:
2790         (WebKit::NetworkProcess::initializeNetworkProcess):
2791         * NetworkProcess/NetworkProcess.h:
2792         (WebKit::NetworkProcess::shouldLogCookieInformation const): Deleted.
2793         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2794         (WebKit::NetworkProcessCreationParameters::encode const):
2795         (WebKit::NetworkProcessCreationParameters::decode):
2796         * NetworkProcess/NetworkProcessCreationParameters.h:
2797         * NetworkProcess/NetworkResourceLoader.cpp:
2798         (WebKit::NetworkResourceLoader::didFinishLoading):
2799         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
2800         (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
2801         (WebKit::NetworkResourceLoader::logCookieInformation const):
2802         (WebKit::logBlockedCookieInformation):
2803         (WebKit::logCookieInformationInternal):
2804         (WebKit::NetworkResourceLoader::logCookieInformation):
2805         * NetworkProcess/NetworkResourceLoader.h:
2806         * NetworkProcess/NetworkSession.h:
2807         (WebKit::NetworkSession::logCookieInformation const):
2808         * NetworkProcess/NetworkSessionCreationParameters.h:
2809         (WebKit::NetworkSessionCreationParameters::encode const):
2810         (WebKit::NetworkSessionCreationParameters::decode):
2811         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2812         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2813         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2814         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2815         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2816         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2817         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2818         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2819         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2820         (WebKit::WebsiteDataStore::parameters):
2821
2822 2018-11-28  Ryan Haddad  <ryanhaddad@apple.com>
2823
2824         Unreviewed, rolling out r238620.
2825
2826         Broke internal builds again.
2827
2828         Reverted changeset:
2829
2830         "Remove @no-unify of InjectedBundleRangeHandle.cpp and
2831         InjectedBundleNodeHandle.cpp"
2832         https://bugs.webkit.org/show_bug.cgi?id=191853
2833         https://trac.webkit.org/changeset/238620
2834
2835 2018-11-28  Yongjun Zhang  <yongjun_zhang@apple.com>
2836
2837         Allow WebKit clients to specify a minimum effective width for layout.
2838         https://bugs.webkit.org/show_bug.cgi?id=191499
2839         <rdar://problem/45362678>
2840
2841         Reviewed by Wenson Hsieh.
2842
2843         If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
2844         width. For clients that wish to lay out the content with a different width value, we would need to add a way
2845         to specify the effective width for layout.
2846
2847         * UIProcess/API/Cocoa/WKWebView.mm: Add an iVar _minimumEffectiveDeviceWidth.
2848         (-[WKWebView _dispatchSetViewLayoutSize:]): Call the new setViewportConfigurationViewLayoutSize method.
2849         (-[WKWebView _setViewScale:]): Ditto.
2850         (-[WKWebView _setMinimumEffectiveWidth:]): The setter for _minimumEffectiveDeviceWidth.
2851         (-[WKWebView _minimumEffectiveWidth]): Getter for _minimumEffectiveDeviceWidth
2852         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add a property _minimumEffectiveDeviceWidth to WKWebView.
2853         * UIProcess/WebPageProxy.h: Change setViewportConfigurationViewLayoutSize to take another argument minimumEffectiveDeviceWidth.
2854         * UIProcess/ios/WebPageProxyIOS.mm:
2855         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Also send effectiveWidth to WebContent process.
2856         * WebProcess/WebPage/WebPage.cpp:
2857         (WebKit::WebPage::WebPage): Set the initial effective width to 0 when creating a web page, this tells ViewportConfiguration
2858              to ignore the minimum effective width value.
2859         * WebProcess/WebPage/WebPage.h: Change setViewportConfigurationViewLayoutSize to take another argument effectiveWidth.
2860         * WebProcess/WebPage/WebPage.messages.in:
2861         * WebProcess/WebPage/ios/WebPageIOS.mm:
2862         (WebKit::WebPage::setViewportConfigurationViewLayoutSize): Also pass effectiveWidth value to ViewportConfiguration.
2863
2864 2018-11-28  Fujii Hironori  <Hironori.Fujii@sony.com>
2865
2866         Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
2867         https://bugs.webkit.org/show_bug.cgi?id=191853
2868
2869         Reviewed by Michael Catanzaro.
2870
2871         In r235845, I excluded InjectedBundleRangeHandle.cpp and
2872         InjectedBundleNodeHandle.cpp from unify source builds in order to
2873         work around a MSVC bug.
2874
2875         Then, I commited a different workaround for the MSVC bug in
2876         r238386. Now, we can include InjectedBundleRangeHandle.cpp and
2877         InjectedBundleNodeHandle.cpp in unified source builds. Revert
2878         r235845.
2879
2880         * Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp
2881         and InjectedBundleNodeHandle.cpp
2882         * WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership
2883         not to be compiled by XCode.
2884
2885 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
2886
2887         Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change doesn't re-show WebInspector
2888         https://bugs.webkit.org/show_bug.cgi?id=191971
2889
2890         Reviewed by Matt Baker.
2891
2892         * WebProcess/WebPage/WebInspector.cpp:
2893         (WebKit::WebInspector::reopen): Deleted.
2894         * WebProcess/WebPage/WebInspector.h:
2895         * WebProcess/WebPage/WebInspector.messages.in:
2896         Move reopen out of the WebProcess...
2897
2898         * UIProcess/WebInspectorProxy.cpp:
2899         (WebKit::WebInspectorProxy::reopen):
2900         * UIProcess/WebInspectorProxy.h:
2901         * UIProcess/WebInspectorProxy.messages.in:
2902         And into the UIProcess where the order of messages won't
2903         be as problematic.
2904
2905         * WebProcess/WebPage/WebInspectorUI.cpp:
2906         (WebKit::WebInspectorUI::reopen):
2907         Send a message to the WebInspectorProxy instead.
2908
2909 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
2910
2911         Remove another OS version check from NetworkDataTaskCocoa.mm
2912         https://bugs.webkit.org/show_bug.cgi?id=192046
2913
2914         Reviewed by Alex Christensen.
2915
2916         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2917         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
2918
2919 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
2920
2921         Modernize version checks for same site cookie support
2922         https://bugs.webkit.org/show_bug.cgi?id=192054
2923
2924         Reviewed by Tim Horton.
2925
2926         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
2927         Also removed runtime checks, which are no longer relevant.
2928
2929 2018-11-27  Mark Lam  <mark.lam@apple.com>
2930
2931         ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
2932         https://bugs.webkit.org/show_bug.cgi?id=192055
2933         <rdar://problem/46288783>
2934
2935         Reviewed by Saam Barati.
2936
2937         * Configurations/FeatureDefines.xcconfig:
2938
2939 2018-11-27  Alex Christensen  <achristensen@webkit.org>
2940
2941         Make synchronous IPC introduced in r237267 asynchronous
2942         https://bugs.webkit.org/show_bug.cgi?id=190757
2943
2944         Reviewed by Chris Dumez.
2945
2946         * UIProcess/API/Cocoa/WKProcessPool.mm:
2947         (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:completionHandler:]):
2948         (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:]): Deleted.
2949         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2950         * UIProcess/WebProcessPool.cpp:
2951         (WebKit::WebProcessPool::activePagesOriginsInWebProcessForTesting):
2952         * UIProcess/WebProcessPool.h:
2953         * UIProcess/WebProcessProxy.cpp:
2954         (WebKit::WebProcessProxy::activePagesDomainsForTesting):
2955         * UIProcess/WebProcessProxy.h:
2956         * WebProcess/WebProcess.cpp:
2957         (WebKit::WebProcess::getActivePagesOriginsForTesting):
2958         * WebProcess/WebProcess.messages.in:
2959         * WebProcess/cocoa/WebProcessCocoa.mm:
2960         (WebKit::WebProcess::getActivePagesOriginsForTesting):
2961
2962 2018-11-27  Alex Christensen  <achristensen@webkit.org>
2963
2964         Safe browsing warning text needs to be visible on High Sierra
2965         https://bugs.webkit.org/show_bug.cgi?id=192022
2966
2967         Reviewed by Tim Horton.
2968
2969         Something about AppKit, autolayout, view insertion order, and NSTextView makes the text lay
2970         out with initial size of {0, 0} on High Sierra. Using an NSTextField instead makes the details visible.
2971
2972         Covered by an API test.
2973
2974         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
2975         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2976         (makeLabel):
2977         (-[WKSafeBrowsingWarning addContent]):
2978         (-[WKSafeBrowsingWarning showDetailsClicked]):
2979         (-[WKSafeBrowsingWarning layoutText]):
2980         (makeTitleLabel): Deleted.
2981
2982 2018-11-27  Tim Horton  <timothy_horton@apple.com>
2983
2984         WKNavigation.AutomaticViewReloadAfterWebProcessCrash asserts after r238538
2985         https://bugs.webkit.org/show_bug.cgi?id=192038
2986         <rdar://problem/46288457>
2987
2988         Reviewed by Wenson Hsieh.
2989
2990         * UIProcess/WebPageProxy.cpp:
2991         (WebKit::m_resetRecentCrashCountTimer):
2992         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2993         (WebKit::WebPageProxy::resetState):
2994         (WebKit::m_editableImageController): Deleted.
2995         Properly invalidate m_editableImageController when resetting WebPageProxy.
2996         Otherwise, the MessageReceiverMaps get invalidated, then later when
2997         EditableImageController goes away we assert trying to remove the receiver.
2998
2999 2018-11-27  Jiewen Tan  <jiewen_tan@apple.com>
3000
3001         (r238246) [ MacOS Debug ] Layout Test http/wpt/webauthn/ctap-hid-failure.https.html is Crashing
3002         https://bugs.webkit.org/show_bug.cgi?id=191757
3003
3004         Reviewed by Chris Dumez.
3005
3006         Wrong nonce error causes retransmission, which then trigger wrong nonce error. This is expected
3007         behavior for mock testing. However, the main thread could time out when MockHidConnection::send
3008         is excuting the block on another thread. The block will then return without invoking the callback,
3009         which triggers this WTFCrash. The solution is always invoking the callback before return in the
3010         block.
3011
3012         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
3013         (WebKit::MockHidConnection::send):
3014
3015 2018-11-27  Keith Rollin  <krollin@apple.com>
3016
3017         Better parsing of comments in generate-message*.py
3018         https://bugs.webkit.org/show_bug.cgi?id=191866
3019         <rdar://problem/46189563>
3020
3021         Reviewed by Chris Dumez.
3022
3023         The script parsing the *.messages.in files would treat a line starting
3024         with '#' as a comment, but not a line starting with '<whitespace>#'.
3025         This means that jamming a '#' right in front of the first character of
3026         a message definition (as opposed to the beginning of a line) will have
3027         no effect and the line will get treated just the same as a
3028         non-commented line. Fix this by trimming all white space from the
3029         beginning and ending of the line before processing it.
3030
3031         * Scripts/webkit/parser.py:
3032         (parse):
3033         * Scripts/webkit/test-messages.in:
3034
3035 2018-11-27  Thibault Saunier  <tsaunier@igalia.com>
3036
3037         [GTK|WPE] Allow disabling WebRTC unified plan SDP through an env var
3038         https://bugs.webkit.org/show_bug.cgi?id=192024
3039
3040         Reviewed by Michael Catanzaro.
3041
3042         * UIProcess/API/glib/WebKitSettings.cpp:
3043         (webKitSettingsConstructed):
3044
3045 2018-11-27  Alexey Proskuryakov  <ap@apple.com>
3046
3047         Modernize the check for async _saveCookies existence
3048         https://bugs.webkit.org/show_bug.cgi?id=191987
3049
3050         Reviewed by Dean Jackson.
3051
3052         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3053         (WebKit::NetworkProcess::platformSyncAllCookies):
3054
3055 2018-11-27  Tim Horton  <timothy_horton@apple.com>
3056
3057         Serialize and deserialize editable image strokes
3058         https://bugs.webkit.org/show_bug.cgi?id=192002
3059         <rdar://problem/30900149>
3060
3061         Reviewed by Dean Jackson.
3062
3063         * UIProcess/API/APIAttachment.cpp:
3064         (API::Attachment::updateAttributes):
3065         * UIProcess/WebPageProxy.cpp:
3066         (WebKit::WebPageProxy::willUpdateAttachmentAttributes):
3067         * UIProcess/WebPageProxy.h:
3068         When an attachment would update its DOM attributes, plumb a notification
3069         to EditableImageController, and allow it to block the update (because
3070         we don't really want to set src for editable image attachments,
3071         we just want the UI process to fully own the data).
3072
3073         * Platform/spi/ios/PencilKitSPI.h:
3074         Add some SPI.
3075
3076         * UIProcess/ios/EditableImageController.h:
3077         * UIProcess/ios/EditableImageController.mm:
3078         (WebKit::EditableImageController::loadStrokesFromAttachment):
3079         Add a helper to load strokes from an attachment.
3080
3081         (WebKit::EditableImageController::associateWithAttachment):
3082         Try to load strokes from the attachment when initially associated.
3083         Don't create a file wrapper around a null image, so it will be regenerated later.
3084
3085         (WebKit::EditableImageController::willUpdateAttachmentAttributes):
3086         The aforementioned plumbing at update time.
3087
3088         * UIProcess/ios/WKDrawingView.h:
3089         * UIProcess/ios/WKDrawingView.mm:
3090         (-[WKDrawingView layoutSubviews]):
3091         Invalidate the attachment (so it will be regenerated upon request) if the
3092         canvas size changes.
3093
3094         (-[WKDrawingView PNGRepresentation]):
3095         Serialize strokes into the EXIF User Comment field.
3096         We will find a different field to use (ideally a custom vendor-specific
3097         field that nobody else will use for anything), but this works for now.
3098
3099         Don't try to render an image if we don't have a size or scale;
3100         PKImageRenderer will just fail anyway, so bail early.
3101
3102         In the iOS Simulator, PKImageRenderer currently returns an unusable image.
3103         Instead, so that we have a image on which to serialize the strokes,
3104         create a transparent 1x1 image. This makes it possible to serialize strokes
3105         even though we don't have a usable rendered image, so that we can still test
3106         this change (and future changes).
3107
3108         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
3109         If available, deserialize strokes from the EXIF User Comment field.
3110
3111         (-[WKDrawingView drawingDidChange:]):
3112         (-[WKDrawingView invalidateAttachment]):
3113         Factor invalidateAttachment out of drawingDidChange so we can call
3114         it from layoutSubviews too!
3115
3116 2018-11-27  Chris Dumez  <cdumez@apple.com>
3117
3118         Regression(PSON) crash under WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame()
3119         https://bugs.webkit.org/show_bug.cgi?id=191983
3120         <rdar://problem/46246863>
3121
3122         Reviewed by Geoffrey Garen.
3123
3124         * UIProcess/WebPageProxy.cpp:
3125         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3126         Make sure the navigation still exists in m_mainFrameCreationHandler and return early if it
3127         does not.
3128
3129         (WebKit::WebPageProxy::resetState):
3130         Clear out m_mainFrameCreationHandler / m_mainFrameWindowCreationHandler if we resetting the state
3131         after a crash. At this point, there is no chance the WebProcess will send us the IPC that will
3132         cause these to get called and we do not want old state to remain for future navigations.
3133
3134 2018-11-16  Jiewen Tan  <jiewen_tan@apple.com>
3135
3136         Disallow loading webarchives as iframes
3137         https://bugs.webkit.org/show_bug.cgi?id=191728
3138         <rdar://problem/45524528>
3139
3140         Reviewed by Youenn Fablet.
3141
3142         * UIProcess/WebPageProxy.cpp:
3143         (WebKit::WebPageProxy::unableToImplementPolicy):
3144         Add a check to prevent null pointer dereference.
3145
3146 2018-11-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3147
3148         WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
3149         https://bugs.webkit.org/show_bug.cgi?id=191996
3150
3151         Reviewed by Tim Horton.
3152
3153         This assertion is hit because `decode(Decoder& decoder, NSArray<Class> *allowedClasses)` expects the decoded
3154         object (of class `_NSArrayM`) to be equal to `NSArray.class`.
3155
3156         We fix the crash by relaxing the debug assertion when decoding securely-codable objects over IPC. Instead of
3157         checking that the class of the decoded object is equal to one of the allowed classes, check that the object is a
3158         kind of any of the allowed classes.
3159
3160         * Shared/Cocoa/ArgumentCodersCocoa.h:
3161         (IPC::isObjectClassAllowed):
3162         (IPC::decode):
3163
3164 2018-11-27  Tomas Popela  <tpopela@redhat.com>
3165
3166         [GTK][WPE] Remove temporary workaround in Source/WebKit/Platform*.cmake
3167         https://bugs.webkit.org/show_bug.cgi?id=192008
3168
3169         Reviewed by Michael Catanzaro.
3170
3171         Looks like it's not needed anymore as the code compiles fine without
3172         it.
3173
3174         * PlatformGTK.cmake:
3175         * PlatformWPE.cmake:
3176
3177 2018-11-27  Antti Koivisto  <antti@apple.com>
3178
3179         Factor mask layer applying in RemoteLayerTreePropertyApplier into a shared function
3180         https://bugs.webkit.org/show_bug.cgi?id=192001
3181
3182         Reviewed by Tim Horton.
3183
3184         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3185         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3186         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3187         (WebKit::RemoteLayerTreePropertyApplier::updateMask):
3188
3189         Shared function, with some special tricks for iOS backdrop layers.
3190
3191         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
3192
3193 2018-11-27  Antti Koivisto  <antti@apple.com>
3194
3195         Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree
3196         https://bugs.webkit.org/show_bug.cgi?id=192003
3197
3198         Reviewed by Tim Horton.
3199
3200         We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem
3201         to add anything except an extra hash lookup.
3202
3203         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3204         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3205         (WebKit::RemoteLayerTreeHost::updateLayerTree):
3206
3207         Pass m_nodes directly.
3208         Some random cleanups.
3209
3210 2018-11-27  Antti Koivisto  <antti@apple.com>
3211
3212         Remote tile layers shouldn't be UIViews
3213         https://bugs.webkit.org/show_bug.cgi?id=191953
3214
3215         Reviewed by Tim Horton.
3216
3217         They don't need any UIView functionality, nor do they ever have UIView descendants.
3218         We can use lighter weight objects.
3219
3220         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3221         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3222         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3223         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
3224
3225         Factor to a function shared between platforms.
3226         Support having both views and plain layers in the same tree.
3227         Assert that all siblings are of the same type and that we don't attempt to add views to layers.
3228
3229         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
3230         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3231         (WebKit::RemoteLayerTreeHost::makeNode):
3232
3233         Use new plain layer on Mac too.
3234
3235         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3236         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
3237         (-[WKPlainRemoteLayer description]):
3238
3239         Add a CALayer subclass so we can have a description, similar to WKCompositingView and pals.
3240
3241         (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
3242         (WebKit::RemoteLayerTreeNode::detachFromParent):
3243
3244         Support having null view.
3245
3246         (WebKit::RemoteLayerTreeNode::appendLayerDescription):
3247
3248         Helper for layer descriptions.
3249
3250         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3251         (WebKit::RemoteLayerTreeHost::makeNode):
3252
3253         Construct plain layers for tiles.
3254
3255         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3256         (-[WKCompositingView description]):
3257         (-[WKUIRemoteView description]):
3258         (-[WKBackdropView description]):
3259
3260 2018-11-27  Fujii Hironori  <Hironori.Fujii@sony.com>
3261
3262         Remove "using namespace WebCore" under Source/WebKit/WebProcess/InjectedBundle/API
3263         https://bugs.webkit.org/show_bug.cgi?id=191995
3264
3265         Reviewed by Alex Christensen.
3266
3267         The statement "using namespace WebCore" should be placed inside
3268         namespace WebKit for unified source builds. But, source files
3269         defining WebKit API can't be enclosed by namespace WebKit { }
3270         becuase they are defined in the global scope.
3271
3272         "using namespace WebCore" in global scope and unified source
3273         builds may cause build breaks (Bug 191853).
3274
3275         Remove "using namespace WebCore" in the global scope. Use
3276         "WebCore::" prefix instead.
3277
3278         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3279         (WKBundleClearAllDatabases):
3280         (WKBundleSetDatabaseQuota):
3281         (WKBundleClearResourceLoadStatistics):
3282         (WKBundleResourceLoadStatisticsNotifyObserver):
3283         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3284         (WKBundleFrameGetFrameLoadState):
3285         (WKBundleFrameClearOpener):
3286         (WKBundleFrameCallShouldCloseOnWebView):
3287         (WKBundleFrameCopySecurityOrigin):
3288         (WKBundleFrameFocus):
3289         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3290         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3291
3292 2018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3293
3294         [Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
3295         https://bugs.webkit.org/show_bug.cgi?id=169212
3296         <rdar://problem/30899656>
3297
3298         Reviewed by Tim Horton.
3299
3300         Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the
3301         first responder. Intended for use by clients, such as Mail, that embed native text input views and other views
3302         that may become first responder within the view hierarchy of the WKWebView.
3303
3304         * UIProcess/API/Cocoa/WKWebView.mm:
3305         (-[WKWebView _contentViewIsFirstResponder]):
3306         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3307
3308 2018-11-26  Tim Horton  <timothy_horton@apple.com>
3309
3310         Insert <attachment> elements under editable images to make their backing data accessible
3311         https://bugs.webkit.org/show_bug.cgi?id=191844
3312         <rdar://problem/30900149>
3313
3314         Reviewed by Simon Fraser.
3315
3316         * DerivedSources.make:
3317         * SourcesCocoa.txt:
3318         * UIProcess/API/APIAttachment.h:
3319         fileWrapper() is no longer a trivial getter; it can now construct
3320         the file wrapper from a file wrapper generator if necessary.
3321
3322         Add setFileWrapperGenerator() and invalidateGeneratedFileWrapper().
3323
3324         Make m_fileWrapper mutable so it can be adjusted inside its own getter.
3325
3326         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
3327         (API::Attachment::fileWrapper const):
3328         If we have a fileWrapperGenerator and don't have a cached file wrapper,
3329         create one before returning it.
3330
3331         (API::Attachment::invalidateGeneratedFileWrapper):
3332         Invalidate the currently-cached file wrapper. The next time a client
3333         requests the file wrapper it will be regenerated.
3334
3335         (API::Attachment::fileName const):
3336         (API::Attachment::fileSizeForDisplay const):
3337         (API::Attachment::enclosingImageData const):
3338         (API::Attachment::isEmpty const):
3339         (API::Attachment::createSerializedRepresentation const):
3340         Make use of fileWrapper() instead of m_fileWrapper directly, to ensure
3341         that it is created lazily if necessary.
3342
3343         (API::Attachment::setFileWrapperGenerator):
3344         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3345         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
3346         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
3347         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3348         (-[WKEmbeddedView initWithEmbeddedViewID:]):
3349         Defer to EditableImageController for creating WKDrawingViews for
3350         editable images. This is done primarily so we don't have to pollute
3351         Remote Layer Tree and DrawingArea interfaces with editable-image-specific messages.
3352
3353         * UIProcess/WebPageProxy.cpp:
3354         (WebKit::m_editableImageController):
3355         (WebKit::m_resetRecentCrashCountTimer): Deleted.
3356         * UIProcess/WebPageProxy.h:
3357         (WebKit::WebPageProxy::editableImageController):
3358         Keep an EditableImageController on the WebPageProxy.
3359
3360         * UIProcess/ios/EditableImageController.h: Added.
3361         * UIProcess/ios/EditableImageController.messages.in: Added.
3362         * UIProcess/ios/EditableImageController.mm: Added.
3363         (WebKit::EditableImageController::EditableImageController):
3364         (WebKit::EditableImageController::~EditableImageController):
3365         (WebKit::EditableImageController::ensureEditableImage):
3366         (WebKit::EditableImageController::editableImage):
3367         (WebKit::EditableImageController::didCreateEditableImage):
3368         (WebKit::EditableImageController::didDestroyEditableImage):
3369         (WebKit::EditableImageController::associateWithAttachment):
3370         (WebKit::EditableImageController::invalidateAttachmentForEditableImage):
3371         Add EditableImageController, which keeps track of EditableImages.
3372         It can be messaged directly to create or destroy the UI-side state
3373         of an editable image, and also to associate a WKDrawingView with
3374         a particular attachment.
3375
3376         * UIProcess/ios/WKDrawingView.h:
3377         * UIProcess/ios/WKDrawingView.mm:
3378         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
3379         Store the WebPageProxy (weakly) so that we can get to the EditableImageController.
3380
3381         (-[WKDrawingView layoutSubviews]):
3382         (-[WKDrawingView PNGRepresentation]):
3383         Synchronously render the PKCanvasView to PNG.
3384
3385         (-[WKDrawingView drawingDidChange:]):
3386         If the drawing changes, inform the APIAttachment that it needs
3387         to discard its NSFileWrapper; a new one will be generated lazily.
3388
3389         (-[WKDrawingView init]): Deleted.
3390         * WebKit.xcodeproj/project.pbxproj:
3391         * WebProcess/WebCoreSupport/WebChromeClient.h:
3392         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3393         (WebKit::WebChromeClient::associateEditableImageWithAttachment):
3394         (WebKit::WebChromeClient::didCreateEditableImage):
3395         (WebKit::WebChromeClient::didDestroyEditableImage):
3396
3397 2018-11-26  Jer Noble  <jer.noble@apple.com>
3398
3399         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
3400         https://bugs.webkit.org/show_bug.cgi?id=190951
3401         <rdar://problem/45213065>
3402
3403         Reviewed by Alex Christensen.
3404
3405         Add an asyncronous reply request to VideoFullscreenManager.
3406
3407         * Platform/IPC/MessageSender.h:
3408         (IPC::MessageSender::sendWithAsyncReply):
3409         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3410         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3411         (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
3412         * WebProcess/cocoa/VideoFullscreenManager.h:
3413         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
3414         * WebProcess/cocoa/VideoFullscreenManager.mm:
3415         (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
3416
3417 2018-11-26  Alex Christensen  <achristensen@webkit.org>
3418
3419         Rename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it for more than testing
3420         https://bugs.webkit.org/show_bug.cgi?id=191981
3421
3422         Reviewed by Tim Horton.
3423
3424         * UIProcess/API/Cocoa/WKWebView.mm:
3425         (-[WKWebView _safeBrowsingWarning]):
3426         (-[WKWebView _safeBrowsingWarningForTesting]): Deleted.
3427         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3428
3429 2018-11-26  Daniel Bates  <dabates@apple.com>
3430
3431         REGRESSION (r237738): Command Down Arrow doesn't scroll to the end of a page anymore
3432         https://bugs.webkit.org/show_bug.cgi?id=191967
3433         <rdar://problem/45976390>
3434
3435         Reviewed by Tim Horton.
3436
3437         Fixes an issue where pressing Command + Down Arrow does not scroll the view to the end of the page.
3438
3439         Following r237738 the value of the enumerations used to identify modifier keys (e.g. Shift) changed
3440         to match the values of the corresponding enumerations in GraphicsServices, which are the
3441         enumerations UIKit uses to computes the modifier flags bitmask when instantiating a WebEvent to
3442         pass to WebKit. Before r237738 WebKit was using enumerations whose values matched the values
3443         of the corresponding UIKit public API UIKeyModifier* enumerations. For non-content editable elements,
3444         WebKit intercepts UIKit events in -_handleKeyUIEvent, synthesizes and dispatches its own WebEvent.
3445         However it was creating WebEvents with a modifier flags bitmask built from the UIKeyModifier* enumerations,
3446         -_modifierFlags, as opposed to a bitmask from the GraphicsServices enumerations, -_gsModifierFlags.
3447         Instead WebKit should call -_gsModifierFlags to compute the GraphicsServices-compatible modifier
3448         flags bitmask when instantiating a WebEvent.
3449
3450         * Platform/spi/ios/UIKitSPI.h: Expose -_gsModifierFlags and remove -_modifierFlags.
3451         * UIProcess/ios/WKContentViewInteraction.mm:
3452         (-[WKContentView _handleKeyUIEvent:]): Remove unnecessary code to update the current modifier state.
3453         This will be done by the WebProcess when it receives the keyboard event.
3454         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Do not pass modifier flags changed events
3455         to the scrolling animator as it does not know how to handle these kinds of events and triggers an
3456         assertion failure when it tries to read the input string from the event (calls -charactersIgnoringModifiers).
3457         FlagsChanged WebEvents events do not have an input string just like a FlagsChanged NSEvent that
3458         they model on Mac.
3459         * UIProcess/ios/WKWebEvent.mm:
3460         (-[WKWebEvent initWithEvent:]): Pass the value of -_gsModifierFlags for the modifier flags bitmask
3461         instead of the value of -_modifierFlags.
3462
3463 2018-11-26  Chris Dumez  <cdumez@apple.com>
3464
3465         [PSON] process pre-warming should not be on for everyone
3466         https://bugs.webkit.org/show_bug.cgi?id=191966
3467         <rdar://problem/46138499>
3468
3469         Reviewed by Ryosuke Niwa.
3470
3471         If automatic process-prewarming is not explicitly turned on/off by the client, then we now only
3472         turn it on automatically after the first process swap. Previously, it was always enabled if
3473         process-swap on cross-site navigation was enabled (which is the case by default for all apps).
3474
3475         This is important because some apps do not actually browse (only display static content) or never
3476         browse cross-site, and thus would not benefit from process prewarming and yet pay a memory cost.
3477
3478         * UIProcess/API/APIProcessPoolConfiguration.h:
3479         Add m_clientWouldBenefitFromAutomaticProcessPrewarming flag which is false by default and is used
3480         as a fallback if the client did not call setIsAutomaticProcessWarmingEnabled().
3481
3482         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3483         (WKContextConfigurationPrewarmsProcessesAutomatically):
3484         (WKContextConfigurationSetPrewarmsProcessesAutomatically):
3485         Add C API to toggle automatic process prewarming. It is needed for Safari to turn on this feature
3486         by default for browsing. This way Safari does not have to wait for the first process swap to
3487         start prewarming.
3488
3489         * UIProcess/API/C/WKContextConfigurationRef.h:
3490         * UIProcess/WebProcessPool.cpp:
3491         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
3492         Only do automatic process prewarming if process-swap on cross-site navigation is also enabled.
3493         This is needed for clients like Safari that explicitly enable automatic process prewarming but
3494         only want to have it enabled if PSON is also enabled via experimental features.
3495
3496         (WebKit::WebProcessPool::processForNavigation):
3497         On first process swap, if the client did not explicitly turn on or off automatic process prewarming
3498         then we enable it then. This avoids paying the cost of process prewarming in apps that would not
3499         benefit from it.
3500
3501 2018-11-26  Andy Estes  <aestes@apple.com>
3502
3503         [Cocoa] Make it easier to encode NSObjects
3504         https://bugs.webkit.org/show_bug.cgi?id=191948
3505
3506         Reviewed by Dean Jackson.
3507
3508         It should be easier to encode objects that conform to NSSecureCoding for WebKit IPC. Right
3509         now, several argument coders duplicate the logic for encoding and decoding objects using
3510         NSKeyedArchiver and NSKeyedUnarchiver.
3511
3512         This patch adds encodeObject() and decodeObject() primitives for encoding and decoding using
3513         Foundation keyed archiving. It then partially specializes ArgumentCoder for raw pointers and
3514         RetainPtrs whose pointee conforms to NSSecureCoding to call these new primitives.
3515
3516         This allows us to use Encoder::operator<< to encode raw pointers or RetainPtrs and use
3517         Decoder::operator>> to decode to an optional RetainPtr. By default, IPC::decode infers the
3518         allowed class for decoding by calling `[T class]`. We can also specify the allowed classes
3519         explicitly for containers and classes that are loaded at runtime.
3520
3521         * Shared/Cocoa/ArgumentCodersCocoa.h: Added.
3522         * Shared/Cocoa/ArgumentCodersCocoa.mm: Added.
3523         * Shared/Cocoa/DataDetectionResult.mm:
3524         (WebKit::DataDetectionResult::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
3525         (WebKit::DataDetectionResult::decode): Ditto.
3526         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3527         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
3528         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
3529         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode): Ditto.
3530         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
3531         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
3532         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
3533         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
3534         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
3535         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
3536         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode): Ditto.
3537         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
3538         (WebKit::RemoteLayerTreeTransaction::description const): Added some needed namespaces due to unified source shuffling.
3539         * Shared/WebCoreArgumentCoders.h: Modernized several decoders.
3540         * Shared/ios/InteractionInformationAtPosition.mm:
3541         (WebKit::InteractionInformationAtPosition::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
3542         (WebKit::InteractionInformationAtPosition::decode): Ditto.
3543         * Shared/mac/WebCoreArgumentCodersMac.mm:
3544         (IPC::ArgumentCoder<WebCore::ProtectionSpace>::encodePlatformData): Ditto.
3545         (IPC::ArgumentCoder<WebCore::ProtectionSpace>::decodePlatformData): Ditto.
3546         (IPC::ArgumentCoder<WebCore::Credential>::encodePlatformData): Ditto.
3547         (IPC::ArgumentCoder<WebCore::Credential>::decodePlatformData): Ditto.
3548         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData): Ditto.
3549         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData): Ditto.
3550         (IPC::deviceContextKey): Deleted.
3551         * Shared/mac/WebHitTestResultData.mm:
3552         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
3553         (WebKit::WebHitTestResultData::platformDecode): Ditto.
3554         * SourcesCocoa.txt: Added ArgumentCodersCocoa.mm.
3555         * WebKit.xcodeproj/project.pbxproj: Ditto.
3556
3557 2018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3558
3559         CompletionHandler-based async IPC messages only work when the completion handler takes a single argument
3560         https://bugs.webkit.org/show_bug.cgi?id=191965
3561
3562         Reviewed by Tim Horton.
3563
3564         Teach `messages.py` to handle the case where an async IPC completion handler takes no arguments, or takes more
3565         than a single argument. Currently, the generated code attempts to wrap all arguments in a `WTFMove(*~)`, but
3566         this either results in `WTFMove(*)` in the case where there are no arguments, or `WTFMove(*foo, *bar, *baz)` in
3567         the case where there are several arguments. Both of these results fail to compile.
3568
3569         Instead, emit `completionHandler()` when there are no arguments, and
3570         `completionHandler(WTFMove(*foo), WTFMove(*bar), WTFMove(*baz))` when there are multiple arguments.
3571
3572         Tests:  TestAsyncMessageWithNoArguments
3573                 TestAsyncMessageWithMultipleArguments
3574
3575         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
3576         (Messages::WebPage::TestAsyncMessageWithNoArguments::callReply):
3577         (Messages::WebPage::TestAsyncMessageWithNoArguments::cancelReply):
3578         (Messages::WebPage::TestAsyncMessageWithNoArguments::send):
3579         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
3580         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
3581         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::send):
3582         (WebKit::WebPage::didReceiveMessage):
3583         * Scripts/webkit/MessagesSuperclass-expected.h:
3584         (Messages::WebPage::TestAsyncMessageWithNoArguments::receiverName):
3585         (Messages::WebPage::TestAsyncMessageWithNoArguments::name):
3586         (Messages::WebPage::TestAsyncMessageWithNoArguments::asyncMessageReplyName):
3587         (Messages::WebPage::TestAsyncMessageWithNoArguments::arguments const):
3588         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::receiverName):
3589         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::name):
3590         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::asyncMessageReplyName):
3591         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::arguments const):
3592         * Scripts/webkit/messages.py:
3593         * Scripts/webkit/messages_unittest.py:
3594
3595         Add new `messages.py` unit tests to cover these cases.
3596
3597         * Scripts/webkit/test-superclass-messages.in:
3598
3599 2018-11-26  Jeremy Jones  <jeremyj@apple.com>
3600
3601         Use Full Screen consistently in localizable strings.
3602         https://bugs.webkit.org/show_bug.cgi?id=190363
3603         rdar://problem/43882333
3604
3605         Reviewed by Jon Lee.
3606
3607         Rename "Fullscreen" to "Full Screen" in localizable strings for consistency.
3608
3609         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
3610         (-[WKFullScreenViewController _showPhishingAlert]):
3611
3612 2018-11-26  Daniel Bates  <dabates@apple.com>
3613
3614         Wire up ChromeClient::takeFocus() on iOS
3615         https://bugs.webkit.org/show_bug.cgi?id=191763
3616         <rdar://problem/18584508>
3617
3618         Reviewed by Dan Bernstein.
3619
3620         Expose existing Mac SPI for use on iOS. This will allow Safari to be notified when
3621         the engine has cycled through all the tab focusable elements on the page.
3622
3623         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3624         * UIProcess/Cocoa/UIDelegate.h:
3625         * UIProcess/Cocoa/UIDelegate.mm:
3626         (WebKit::UIDelegate::setDelegate):
3627
3628 2018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3629
3630         Unreviewed, fix the internal 32-bit macOS 10.13 build after r238471
3631
3632         r238471 added an `#include WebPageMessages.h` in `WebPage.h`, which causes the 32-bit macOS build using an
3633         internal macOS SDK ≤ 10.13 to fail. To address this, move the `#include` back under `PLATFORM(IOS_FAMILY)` by
3634         changing the parameters of `WebPage::removeDataDetectedLinks` and `WebPage::detectDataInAllFrames` to completion
3635         handlers rather than async IPC replies.
3636
3637         * WebProcess/WebPage/WebPage.cpp:
3638         (WebKit::WebPage::removeDataDetectedLinks):
3639         (WebKit::WebPage::detectDataInAllFrames):
3640         * WebProcess/WebPage/WebPage.h:
3641
3642 2018-11-26  Antti Koivisto  <antti@apple.com>
3643
3644         Clean up layer tree freezing logic in WebPage
3645         https://bugs.webkit.org/show_bug.cgi?id=191826
3646
3647         Reviewed by Dean Jackson.
3648
3649         Use OptionSet<LayerTreeFreezeReason> to track various reasons that can cause layer tree to get frozen.
3650
3651         * WebProcess/WebPage/WebPage.cpp:
3652         (WebKit::WebPage::reinitializeWebPage):
3653         (WebKit::WebPage::freezeLayerTree):
3654         (WebKit::WebPage::unfreezeLayerTree):
3655         (WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):
3656
3657         Layer tree is unfrozen when there there are no reasons to freeze it.
3658
3659         (WebKit::WebPage::didStartPageTransition):
3660         (WebKit::WebPage::didCompletePageTransition):
3661         (WebKit::WebPage::beginPrinting):
3662         (WebKit::WebPage::endPrinting):
3663         (WebKit::WebPage::setIsSuspended):
3664         (WebKit::WebPage::setLayerTreeStateIsFrozen): Deleted.
3665         * WebProcess/WebPage/WebPage.h:
3666         * WebProcess/WebPage/ios/WebPageIOS.mm:
3667         (WebKit::WebPage::applicationDidEnterBackground):
3668         (WebKit::WebPage::applicationWillEnterForeground):
3669         * WebProcess/WebProcess.cpp:
3670         (WebKit::WebProcess::actualPrepareToSuspend):
3671         (WebKit::WebProcess::cancelPrepareToSuspend):
3672         (WebKit::WebProcess::freezeAllLayerTrees):
3673         (WebKit::WebProcess::unfreezeAllLayerTrees):
3674         (WebKit::WebProcess::processDidResume):
3675         (WebKit::WebProcess::setAllLayerTreeStatesFrozen): Deleted.
3676         * WebProcess/WebProcess.h:
3677
3678 2018-11-25  Antti Koivisto  <antti@apple.com>
3679
3680         RemoteLayerTreeNode construction cleanups
3681         https://bugs.webkit.org/show_bug.cgi?id=191951
3682
3683         Reviewed by Tim Horton.
3684
3685         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
3686         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3687         (WebKit::RemoteLayerTreeHost::updateLayerTree):
3688
3689             Drop unused LayerProperties argument.
3690
3691         (WebKit::RemoteLayerTreeHost::createLayer):
3692
3693             Split the actual construction out to makeNode.
3694             Map updating is shared between platforms.
3695             Move setting of layerID and clearing default actions to RemoteLayerTreeNode.
3696
3697         (WebKit::RemoteLayerTreeHost::makeNode):
3698
3699             Returns RemoteLayerTreeNode.
3700
3701         (WebKit::RemoteLayerTreeHost::setLayerID): Deleted.
3702         (WebKit::RemoteLayerTreeHost::layerID): Deleted.
3703
3704             Move to RemoteLayerTreeNode.
3705
3706         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3707         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
3708         (WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
3709         (WebKit::RemoteLayerTreeNode::setLayerID):
3710         (WebKit::RemoteLayerTreeNode::layerID):
3711         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3712         (WebKit::RemoteLayerTreeHost::makeNode):
3713         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
3714         (WebKit::RemoteLayerTreeHost::createLayer): Deleted.
3715         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3716         (-[WKCompositingView description]):
3717         (-[WKUIRemoteView description]):
3718         (-[WKBackdropView description]):
3719         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
3720         (WebKit::addAnimationToLayer):
3721
3722 2018-11-25  Tim Horton  <timothy_horton@apple.com>
3723
3724         Make it possible to insert editable images with a gesture
3725         https://bugs.webkit.org/show_bug.cgi?id=191937
3726
3727         Reviewed by Wenson Hsieh.
3728
3729         * UIProcess/API/Cocoa/WKWebView.mm:
3730         (-[WKWebView _stylusTapGestureShouldCreateEditableImage]):
3731         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3732         Add a internal getter for a WKWebViewConfiguration property.
3733
3734         * UIProcess/WebEditCommandProxy.cpp:
3735         (WebKit::WebEditCommandProxy::nameForEditAction):
3736         Add a undo name.
3737
3738         * UIProcess/WebPageProxy.h:
3739         * UIProcess/ios/WKContentViewInteraction.h:
3740         * UIProcess/ios/WKContentViewInteraction.mm:
3741         (-[WKContentView setupInteraction]):
3742         (-[WKContentView cleanupInteraction]):
3743         (-[WKContentView _removeDefaultGestureRecognizers]):
3744         (-[WKContentView _addDefaultGestureRecognizers]):
3745         Add a single-stylus-tap gesture recognizer.
3746
3747         (-[WKContentView _stylusSingleTapRecognized:]):
3748         If allowed, request to insert an editable image when a stylus tap occurs.
3749
3750         * UIProcess/ios/WebPageProxyIOS.mm:
3751         (WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
3752         * WebProcess/WebPage/WebPage.h:
3753         * WebProcess/WebPage/WebPage.messages.in:
3754         * WebProcess/WebPage/ios/WebPageIOS.mm:
3755         (WebKit::WebPage::handleStylusSingleTapAtPoint):
3756         Do a hit test, select the hit position, insert an editable image, and
3757         then de-assist any assisted node (to make the keyboard go away).
3758         For now, we'll only insert if we hit non-replaced elements,
3759         though this heuristic will need to be enhanced significantly once we
3760         decide on a design.
3761
3762 2018-11-25  Tim Horton  <timothy_horton@apple.com>
3763
3764         Scrolling and drawing compete for incoming gestures
3765         https://bugs.webkit.org/show_bug.cgi?id=191940
3766
3767         Reviewed by Wenson Hsieh.
3768
3769         * Platform/spi/ios/PencilKitSPI.h:
3770         * UIProcess/API/Cocoa/WKWebView.mm:
3771         (-[WKWebView _initializeWithConfiguration:]):
3772         * UIProcess/ios/WKDrawingView.mm:
3773         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
3774         Make scrolling and drawing mutually exclusive if editable images
3775         are enabled.
3776
3777 2018-11-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3778
3779         [Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm
3780         https://bugs.webkit.org/show_bug.cgi?id=191945
3781
3782         Reviewed by Anders Carlsson.
3783
3784         Replace some a couple of command undo action name descriptions with "Undo action name", to match all other
3785         edit commands.
3786
3787         * UIProcess/WebEditCommandProxy.cpp:
3788         (WebKit::WebEditCommandProxy::nameForEditAction):
3789
3790 2018-11-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3791
3792         [Cocoa] Add WKWebView SPI to trigger and remove data detection
3793         https://bugs.webkit.org/show_bug.cgi?id=191918
3794         <rdar://problem/36185051>
3795
3796         Reviewed by Tim Horton.
3797
3798         Adds support for two new WKWebView SPI methods, `-_detectDataWithTypes:completionHandler:` and
3799         `-_removeAllDataDetectedLinks:`, to allow internal WebKit clients to run data detection and add links to data
3800         detected content, or remove all data detected links from the document.
3801
3802         Test: WebKit.AddAndRemoveDataDetectors
3803
3804         * Shared/Cocoa/DataDetectionResult.h:
3805         * Shared/Cocoa/DataDetectionResult.mm:
3806         (WebKit::DataDetectionResult::decode):
3807
3808         Modernize DataDetectionResult's IPC decoding, so that it can be used with reply-based async IPC.
3809
3810         * UIProcess/API/Cocoa/WKWebView.mm:
3811         (-[WKWebView _removeDataDetectedLinks:]):
3812         (-[WKWebView _detectDataWithTypes:completionHandler:]):
3813         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3814         * UIProcess/WebPageProxy.cpp:
3815         (WebKit::WebPageProxy::detectDataInAllFrames):
3816         (WebKit::WebPageProxy::removeDataDetectedLinks):
3817
3818         Add or remove data detected links from each frame in the page, and then propagate the new data detector
3819         results of the main frame to the UI process (this matches current behavior, where the results of -[WKWebView
3820         _dataDetectionResults] only reflects data detection results in the main frame of the page).
3821
3822         * UIProcess/WebPageProxy.h:
3823         * WebProcess/WebPage/WebPage.cpp:
3824         (WebKit::WebPage::removeDataDetectedLinks):
3825         (WebKit::WebPage::detectDataInAllFrames):
3826         * WebProcess/WebPage/WebPage.h:
3827         * WebProcess/WebPage/WebPage.messages.in:
3828
3829 2018-11-24  Andy Estes  <aestes@apple.com>
3830
3831         [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
3832         https://bugs.webkit.org/show_bug.cgi?id=191899
3833
3834         Reviewed by Dean Jackson.
3835
3836         * Shared/cocoa/WebCoreArgumentCodersCocoa.mm:
3837         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3838         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
3839
3840 2018-11-23  Antti Koivisto  <antti@apple.com>
3841
3842         Replace LayerOrView typedef with a class
3843         https://bugs.webkit.org/show_bug.cgi?id=191927
3844
3845         Reviewed by Tim Horton.
3846
3847         This typedef restricts remote layer representation to be either a CA layer or a view. We might want
3848         have more flexibility, for example tiles don't really need to be UIViews. It will also make it easier
3849         to unify Mac and iOS code, and hopefully make it less confusing too.
3850
3851         This patch introduces RemoteLayerTreeNode class that replaces most uses of LayerOrView typedef
3852         (the rest are converted to pure CALayer). It also does a bunch of related cleanup.
3853
3854         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3855         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3856         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
3857         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3858         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
3859         (WebKit::applyPropertiesToLayer): Deleted.
3860         * SourcesCocoa.txt:
3861         * UIProcess/API/Cocoa/WKWebView.mm:
3862         (-[WKWebView _propertiesOfLayerWithID:]):
3863         * UIProcess/Cocoa/LayerRepresentation.h: Removed.
3864         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3865         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
3866         * UIProcess/PageClient.h:
3867         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
3868         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3869         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3870         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
3871         (WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting const):
3872         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
3873         (WebKit::RemoteLayerTreeHost::rootNode const):
3874         (WebKit::RemoteLayerTreeHost::rootLayer const): Deleted.
3875         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3876         (WebKit::RemoteLayerTreeHost::updateLayerTree):
3877         (WebKit::RemoteLayerTreeHost::nodeForID const):
3878         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
3879         (WebKit::RemoteLayerTreeHost::animationDidStart):
3880         (WebKit::RemoteLayerTreeHost::animationDidEnd):
3881         (WebKit::RemoteLayerTreeHost::clearLayers):
3882         (WebKit::RemoteLayerTreeHost::layerWithIDForTesting const):
3883         (WebKit::RemoteLayerTreeHost::layerForID const):
3884         (WebKit::RemoteLayerTreeHost::rootLayer const):
3885         (WebKit::RemoteLayerTreeHost::createLayer):
3886         (WebKit::RemoteLayerTreeHost::detachRootLayer):
3887         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
3888         (WebKit::RemoteLayerTreeHost::getLayer const): Deleted.
3889         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: Added.
3890         (WebKit::RemoteLayerTreeNode::layer const):
3891         (WebKit::RemoteLayerTreeNode::uiView const):
3892         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: Added.
3893         (WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
3894         (WebKit::RemoteLayerTreeNode::detachFromParent):
3895         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm:
3896         (WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount const):
3897         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3898         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3899         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3900         (WebKit::RemoteLayerTreeHost::createLayer):
3901         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3902         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3903         (WebKit::layerRepresentationFromLayerOrView): Deleted.
3904         * UIProcess/WebAuthentication/Cocoa/HidService.h:
3905         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
3906         * UIProcess/WebPageProxy.h:
3907         * UIProcess/ios/LayerRepresentation.mm: Removed.
3908         * UIProcess/ios/PageClientImplIOS.h:
3909         * UIProcess/ios/PageClientImplIOS.mm:
3910         (WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
3911         (WebKit::PageClientImpl::acceleratedCompositingRootLayer const):
3912         (WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
3913         * UIProcess/ios/WebPageProxyIOS.mm:
3914         (WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
3915         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
3916         * UIProcess/mac/PageClientImplMac.h:
3917         * UIProcess/mac/PageClientImplMac.mm:
3918         (WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
3919         (WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
3920         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3921         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
3922         * UIProcess/mac/WebPageProxyMac.mm:
3923         (WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
3924         (WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
3925         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
3926         * WebKit.xcodeproj/project.pbxproj:
3927         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
3928         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
3929
3930 2018-11-23  Jiewen Tan  <jiewen_tan@apple.com>
3931
3932         [WebAuthN] Enable Web Authentication as an experimental feature for macOS
3933         https://bugs.webkit.org/show_bug.cgi?id=191932
3934         rdar://problem/46225210
3935
3936         Reviewed by Brent Fulgham.
3937
3938         * Shared/WebPreferences.yaml:
3939
3940 2018-11-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3941
3942         Enable drag and drop support for iOSMac
3943         https://bugs.webkit.org/show_bug.cgi?id=191818
3944         <rdar://problem/43907454>
3945
3946         Reviewed by Dean Jackson.
3947
3948         * Configurations/FeatureDefines.xcconfig:
3949         * Shared/WebPreferencesDefaultValues.cpp:
3950         (defaultCustomPasteboardDataEnabled):
3951
3952         Enable custom pasteboard data by default on iOSMac. While writing and reading custom pasteboard data is
3953         currently broken in iOSMac due to the lack of `teamData` and `preferredPresentationStyle`, opting into custom
3954         pasteboard data at least allows us to avoid writing unsanitized data types to the pasteboard.
3955
3956         * WebProcess/WebPage/ios/WebPageIOS.mm:
3957         (WebKit::WebPage::platformEditorState const):
3958
3959         Fix a regression from <https://trac.webkit.org/r236619> wherein the web process crashes when attempting to edit
3960         a text field. This happens because the call to `-[UIKeyboard isInHardwareKeyboardMode]` on the iOSMac platform
3961         attempts to initialize a `UHASWorkspace` from the web process, which then attempts to connect to the UIKit host
3962         application. Instead, we can skip this call altogether on iOSMac, where the platform never considers a hardware
3963         keyboard to be "connected", even when typing.
3964
3965 2018-11-23  Antti Koivisto  <antti@apple.com>
3966
3967         UI side compositing doesn't paint on Mac
3968         https://bugs.webkit.org/show_bug.cgi?id=191908
3969
3970         Reviewed by Tim Horton.
3971
3972         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
3973         (WebKit::RemoteLayerBackingStore::bytesPerPixel const):
3974         (WebKit::RemoteLayerBackingStore::surfaceBufferFormat const):
3975
3976         These deep color formats are not supported on Mac.
3977
3978 2018-11-22  Chris Dumez  <cdumez@apple.com>
3979
3980         Regression(r238353) Load sometimes hangs when navigating back after a cross-site navigation
3981         https://bugs.webkit.org/show_bug.cgi?id=191914
3982
3983         Reviewed by Ryosuke Niwa.
3984
3985         When process-swapping on a cross-site server-side redirect, we end up doing a decidePolicyForNavigationResponse
3986         policy check for the about:blank suspension load. This policy decision is ignored by the UIProcess because
3987         SuspendedPageProxy does not handle this particular IPC message. To handle the issue, make sure the WebProcess
3988         never sends a DecidePolicyForNavigationResponse IPC to the UIProcess for about:blank suspension loads and let
3989         the load proceed.
3990
3991         The issue was already there before r238353 but it was made obvious by r238353 which caused a hang when trying
3992         to reuse a Suspended page which is hanging while trying to suspend.
3993
3994         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3995         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3996
3997 2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3998
3999         [Cocoa] clang emits a warning when building WebKit after r238293
4000         https://bugs.webkit.org/show_bug.cgi?id=191917
4001
4002         Reviewed by Dan Bernstein.
4003
4004         Move the implementations of -setSafeBrowsingEnabled: and -isSafeBrowsingEnabled to the main implementation of
4005         WKPreferences to fix the warning.
4006