77cce9454dfedeb8ffede17a17161e0f1934a6b9
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-09-07  Brent Fulgham  <bfulgham@apple.com>
2
3         Allow WebContent access to AVCSupported IOKit property in sandbox
4         https://bugs.webkit.org/show_bug.cgi?id=189429
5         <rdar://problem/43612229>
6
7         Reviewed by Eric Carlson.
8
9         Allow access to the IOKit properties AVCSupported and HEVCSupported to allow the WebContent process
10         to check for efficient video codecs.
11
12         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
13         * WebProcess/com.apple.WebProcess.sb.in:
14
15 2018-09-07  Frederic Wang  <fwang@igalia.com>
16
17         [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To)
18         https://bugs.webkit.org/show_bug.cgi?id=182230
19
20         Reviewed by Simon Fraser.
21
22         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
23         (webkit_dom_document_get_scrolling_element): Use the new name.
24
25 2018-09-07  Brent Fulgham  <bfulgham@apple.com>
26
27         [macOS] Remove unused XPC service from sandbox
28         https://bugs.webkit.org/show_bug.cgi?id=189406
29         <rdar://problem/43015423>
30
31         Reviewed by Youenn Fablet.
32
33         The API surface exposed by "com.apple.systemstats.analysis" is no longer used by the
34         WebContent process. Since there is no need for this sandbox opening, we should remove it.
35
36         * WebProcess/com.apple.WebProcess.sb.in:
37
38 2018-09-07  Brent Fulgham  <bfulgham@apple.com>
39
40         Unreviewed syntax fix after r235781
41
42         Don't use hash-quote syntax for these non-regex inputs.
43
44         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
45         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb:
46         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
47
48 2018-09-07  Brent Fulgham  <bfulgham@apple.com>
49
50         [iOS] Move default mach-lookup deny to after common.sb is imported
51         https://bugs.webkit.org/show_bug.cgi?id=189385
52         <rdar://problem/43624193>
53
54         Reviewed by Eric Carlson.
55
56         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Move the 'deny mach-lookup' call later in the file.
57         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Ditto.
58         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Ditto.
59
60 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
61
62         Refactor WebCore::EditAction to be an 8-bit enum class
63         https://bugs.webkit.org/show_bug.cgi?id=189383
64
65         Reviewed by Dan Bernstein.
66
67         * UIProcess/WebEditCommandProxy.cpp:
68         (WebKit::WebEditCommandProxy::nameForEditAction):
69         * WebProcess/WebPage/mac/WebPageMac.mm:
70         (WebKit::WebPage::changeFontAttributes):
71         (WebKit::WebPage::changeFont):
72
73 2018-09-06  Megan Gardner  <megan_gardner@apple.com>
74
75         Add Support for Conic Gradients
76         https://bugs.webkit.org/show_bug.cgi?id=189329
77         <rdar://problem/21444701>
78
79         Reviewed by Simon Fraser.
80
81         Connect up web preferences to allow conic gradients to be turned on in the
82         experimental features menu.
83
84         * Shared/WebPreferences.yaml:
85
86 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
87
88         [macOS] [WK2] Support changing attributes for selected text (text shadow, underline, strike-through)
89         https://bugs.webkit.org/show_bug.cgi?id=189356
90         <rdar://problem/44185674>
91
92         Reviewed by Tim Horton.
93
94         Implement -[WKWebView changeAttributes:], so that WKWebView can carry out more types of font style changes via
95         NSFontPanel. This patch makes it possible to (1) change text shadow, (2) add or remove strike-through, and (3)
96         add or remove underlines from selected text using the font panel.
97
98         This builds on the mechanisms introduced in r235748 to compute font attribute changes in the UI process and
99         propagate this information to the web process, where we're able to create and apply an EditingStyle to the
100         current selection.
101
102         * UIProcess/API/Cocoa/WKWebView.mm:
103         (-[WKWebView changeAttributes:]):
104         * UIProcess/Cocoa/WebViewImpl.h:
105         * UIProcess/Cocoa/WebViewImpl.mm:
106         (WebKit::WebViewImpl::changeFontAttributesFromSender):
107         * UIProcess/WebPageProxy.h:
108         * UIProcess/mac/WebPageProxyMac.mm:
109         (WebKit::WebPageProxy::changeFontAttributes):
110         * WebProcess/WebPage/WebPage.h:
111         * WebProcess/WebPage/WebPage.messages.in:
112
113         Add boilerplate IPC support.
114
115         * WebProcess/WebPage/mac/WebPageMac.mm:
116         (WebKit::WebPage::changeFontAttributes):
117
118 2018-09-06  Antti Koivisto  <antti@apple.com>
119
120         Actively prewarm processes created for prewarm pool
121         https://bugs.webkit.org/show_bug.cgi?id=189364
122
123         Reviewed by Chris Dumez.
124
125         * UIProcess/WebProcessPool.cpp:
126         (WebKit::WebProcessPool::createNewWebProcess):
127         * WebProcess/WebProcess.cpp:
128         (WebKit::WebProcess::prewarm):
129         * WebProcess/WebProcess.h:
130         * WebProcess/WebProcess.messages.in:
131
132 2018-09-06  Jer Noble  <jer.noble@apple.com>
133
134         Don't pause playback when locking screen if video is being displayed on second screen.
135         https://bugs.webkit.org/show_bug.cgi?id=189321
136
137         Reviewed by Eric Carlson.
138
139         Pass the "isPlayingOnSecondScreen" value across the process boundary.
140
141         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
142         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
143         (WebKit::PlaybackSessionModelContext::setPlayingOnSecondScreen):
144         (WebKit::PlaybackSessionManagerProxy::setPlayingOnSecondScreen):
145         * WebProcess/cocoa/PlaybackSessionManager.h:
146         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
147         * WebProcess/cocoa/PlaybackSessionManager.mm:
148         (WebKit::PlaybackSessionManager::setPlayingOnSecondScreen):
149
150 2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
151
152         [macOS] Cannot change font size at selection until font panel is shown
153         https://bugs.webkit.org/show_bug.cgi?id=189295
154         <rdar://problem/35593389>
155
156         Reviewed by Ryosuke Niwa.
157
158         Refactors NSFontManager support in WebKit2. See WebCore ChangeLog for more details.
159
160         * Scripts/webkit/messages.py:
161         * UIProcess/API/Cocoa/WKWebView.mm:
162         (-[WKWebView changeFont:]):
163         * UIProcess/API/mac/WKView.mm:
164         (-[WKView changeFont:]):
165         * UIProcess/Cocoa/WebViewImpl.h:
166         * UIProcess/Cocoa/WebViewImpl.mm:
167         (WebKit::WebViewImpl::changeFontFromFontManager):
168         (WebKit::WebViewImpl::changeFontFromFontPanel): Deleted.
169
170         Renamed this from changeFontFromFontPanel to changeFontFromFontManager. This new name is more accurate in the
171         case where a menu item is used to alter the font, which doesn't involve NSFontPanel at all.
172
173         * UIProcess/WebPageProxy.h:
174         * UIProcess/mac/WebPageProxyMac.mm:
175         (WebKit::WebPageProxy::changeFont):
176         (WebKit::WebPageProxy::setFont): Deleted.
177         * WebKit.xcodeproj/project.pbxproj:
178         * WebProcess/WebPage/WebPage.h:
179         * WebProcess/WebPage/WebPage.messages.in:
180         * WebProcess/WebPage/mac/WebPageMac.mm:
181         (WebKit::WebPage::changeFont):
182         (WebKit::WebPage::setFont): Deleted.
183
184 2018-09-06  Frederic Wang  <fwang@igalia.com>
185
186         Use more generic names than "overflow" for functions that can be used for subframes
187         https://bugs.webkit.org/show_bug.cgi?id=179125
188
189         Reviewed by Simon Fraser..
190
191         Some functions will be used by subframes when iframe scrolling is implemented on iOS (see
192         bug 149264). Currently they are only used for "overflow" nodes. This patch renames them to
193         use a more generic "scrolling node" name.
194
195         * UIProcess/PageClient.h:
196         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
197         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
198         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
199         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
200         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll):
201         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll):
202         * UIProcess/WebPageProxy.h:
203         * UIProcess/WebPageProxy.messages.in:
204         * UIProcess/ios/PageClientImplIOS.h:
205         * UIProcess/ios/PageClientImplIOS.mm:
206         (WebKit::PageClientImpl::scrollingNodeScrollViewWillStartPanGesture):
207         (WebKit::PageClientImpl::scrollingNodeScrollViewDidScroll):
208         (WebKit::PageClientImpl::scrollingNodeScrollWillStartScroll):
209         (WebKit::PageClientImpl::scrollingNodeScrollDidEndScroll):
210         (WebKit::PageClientImpl::overflowScrollViewWillStartPanGesture): Deleted.
211         (WebKit::PageClientImpl::overflowScrollViewDidScroll): Deleted.
212         (WebKit::PageClientImpl::overflowScrollWillStartScroll): Deleted.
213         (WebKit::PageClientImpl::overflowScrollDidEndScroll): Deleted.
214         * UIProcess/ios/WKContentViewInteraction.h:
215         * UIProcess/ios/WKContentViewInteraction.mm:
216         (-[WKContentView _scrollingNodeScrollingWillBegin]):
217         (-[WKContentView _scrollingNodeScrollingDidEnd]):
218         (-[WKContentView _overflowScrollingWillBegin]): Deleted.
219         (-[WKContentView _overflowScrollingDidEnd]): Deleted.
220         * UIProcess/ios/WebPageProxyIOS.mm:
221         (WebKit::WebPageProxy::scrollingNodeScrollViewWillStartPanGesture):
222         (WebKit::WebPageProxy::scrollingNodeScrollViewDidScroll):
223         (WebKit::WebPageProxy::scrollingNodeScrollWillStartScroll):
224         (WebKit::WebPageProxy::scrollingNodeScrollDidEndScroll):
225         (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture): Deleted.
226         (WebKit::WebPageProxy::overflowScrollViewDidScroll): Deleted.
227         (WebKit::WebPageProxy::overflowScrollWillStartScroll): Deleted.
228         (WebKit::WebPageProxy::overflowScrollDidEndScroll): Deleted.
229         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
230         (WebKit::WebChromeClient::didStartOverflowScroll):
231         (WebKit::WebChromeClient::didEndOverflowScroll):
232
233 2018-09-06  Chris Dumez  <cdumez@apple.com>
234
235         WebKit/Platform/IPC/mac/ConnectionMac.mm:222: _dispatch_bug_kevent_vanished
236         https://bugs.webkit.org/show_bug.cgi?id=189314
237         <rdar://problem/41248286>
238
239         Reviewed by Anders Carlsson.
240
241         There is a short period in time when m_isServer is true, after open() has been
242         called, but before we've receive the InitializeConnection IPC, where m_receiveSource
243         has been initialized but m_isConnected is still false. If platformInvalidate() gets
244         called during this period of time, we would fail to cancel / release m_receiveSource
245         and we would forcefully deallocate m_receivePort, leading to the libdispatch simulated
246         crashes.
247
248         To address the issue, platformInvalidate() now properly cancels / releases
249         m_receiveSource if present, and only deallocates m_receivePort manually if m_receiveSource
250         has not been initialized (i.e. open() has not been called yet).
251
252         * Platform/IPC/Connection.h:
253         * Platform/IPC/mac/ConnectionMac.mm:
254         (IPC::Connection::platformInvalidate):
255         (IPC::Connection::clearReceiveSource):
256
257 2018-09-05  David Kilzer  <ddkilzer@apple.com>
258
259         REGRESSION (r235489): WKSharingServicePickerDelegate.mm accidentally added back to Sources in WebKit project
260
261         * WebKit.xcodeproj/project.pbxproj:
262         (WKSharingServicePickerDelegate.mm): Let Xcode have its way with
263         the WebKit project file by removing this file from Sources.
264         It's already included in a UnifedSource file, so it should not
265         have been added back to Sources during merge conflict resolution
266         for r235489.
267
268 2018-09-05  David Kilzer  <ddkilzer@apple.com>
269
270         REGRESSION (r204222): UIProces/Gamepad/mac is missing in WebKit Xcode project
271
272         Found using `tidy-Xcode-project-file --missing` (see Bug
273         188754). Fixes applied manually.
274
275         * WebKit.xcodeproj/project.pbxproj:
276         (UIProces/Gamepad/mac): Fix path to "mac" directory, then remove
277         its now-redundant name.
278         (UIGamepadProviderMac.mm): Change path to be relative to its
279         group after the above change.
280
281 2018-09-05  David Kilzer  <ddkilzer@apple.com>
282
283         REGRESSION (r143543): PluginProcess/EntryPoint/XPCService/PluginService is missing in WebKit Xcode project
284
285         Found using `tidy-Xcode-project-file --missing` (see Bug
286         188754). Fixes applied manually.
287
288         * WebKit.xcodeproj/project.pbxproj:
289         (PluginProcess/EntryPoint/XPCService/PluginService): Remove path
290         to PluginService.64 directory, which was removed in r143543, so
291         that this becomes a virtual folder that inherits its path from
292         its parent.
293         (PluginService.32-64.Info.plist): Change path to be relative to
294         its group after the above change.  Delete redundant name value.
295
296 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
297
298         Add infrastructure to dump resource load statistics
299         https://bugs.webkit.org/show_bug.cgi?id=189213
300
301         Reviewed by Daniel Bates.
302
303         The dumping functionality is not currently used, but will be included in tests for
304         <https://bugs.webkit.org/show_bug.cgi?id=187773>.
305
306         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
307         (WKWebsiteDataStoreDumpResourceLoadStatistics):
308         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
309         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
310         (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics const):
311         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
312         * UIProcess/WebResourceLoadStatisticsStore.cpp:
313         (WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
314         * UIProcess/WebResourceLoadStatisticsStore.h:
315
316 2018-09-05  David Kilzer  <ddkilzer@apple.com>
317
318         REGRESSION (r235006): Let Xcode have its way with the WebKit project
319
320         * WebKit.xcodeproj/project.pbxproj: Let Xcode remove empty
321         settings.
322
323 2018-09-05  David Kilzer  <ddkilzer@apple.com>
324
325         REGRESSION (r110214): Remove deleted WebProcess/Fullscreen/mac folder from WebKit Xcode project
326
327         Found using `tidy-Xcode-project-file --missing` (see Bug
328         188754). Folder removed via Xcode.
329
330         * WebKit.xcodeproj/project.pbxproj:
331         (WebProcess/Fullscreen/mac): Remove empty folder.  Directory no
332         longer exists.  WebFullScreenManagerMac.{h,mm} files were
333         removed in r110214.
334
335 2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>
336
337         Added runtime feature flag for web API statistics
338         https://bugs.webkit.org/show_bug.cgi?id=189211
339
340         Reviewed by Daniel Bates.
341
342         Added functionality to set the runtime flag with a JavaScript exposed function
343         for testing.
344
345         * Shared/WebPreferences.yaml:
346         * WebProcess/InjectedBundle/InjectedBundle.cpp:
347         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
348
349 2018-09-05  Jer Noble  <jer.noble@apple.com>
350
351         Add MediaCapabilities as an Experimental Feature
352         https://bugs.webkit.org/show_bug.cgi?id=189209
353
354         Reviewed by Eric Carlson.
355
356         * Shared/WebPreferences.yaml:
357
358 2018-09-05  Jeremy Jones  <jeremyj@apple.com>
359
360         Cancelled fullscreen exit gesture leaves bad state for next exit request.
361         https://bugs.webkit.org/show_bug.cgi?id=189278
362
363         Reviewed by Jer Noble.
364
365         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
366         (-[WKFullScreenWindowController _dismissFullscreenViewController]):
367
368 2018-09-05  Eric Carlson  <eric.carlson@apple.com>
369
370         [MediaStream] Simplify logic when changing RealtimeMediaSource settings
371         https://bugs.webkit.org/show_bug.cgi?id=189284
372         <rdar://problem/44117948>
373
374         Reviewed by Youenn Fablet.
375
376         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
377         (WebKit::UserMediaCaptureManager::Source::setSettings):
378
379 2018-09-04  Frederic Wang  <fwang@igalia.com>
380
381         Add basic support for ScrollIntoViewOptions
382         https://bugs.webkit.org/show_bug.cgi?id=189258
383
384         Reviewed by Simon Fraser.
385
386         * DOM/DOMElement.mm: Add ScrollIntoViewOptions
387         header so that this file can build despite the new scrollIntoView function.
388
389 2018-09-04  Chris Dumez  <cdumez@apple.com>
390
391         Rename experimental feature for process swap on navigation
392         https://bugs.webkit.org/show_bug.cgi?id=189280
393
394         Reviewed by Antti Koivisto.
395
396         The "process swap on navigation" experimental feature on macOS Mojave does not work due to missing
397         browser changes, resulting in frequent load hangs. When enabling the experimental feature in WebKit
398         ToT or Safari Technology Preview for testing, it enables it as well for Mojave's system Safari which
399         is annoying.
400
401         This patch renames the experimental feature so that the feature stays disabled in Mojave's system
402         Safari even when enabled in WebKit ToT / STP.
403
404         * Shared/WebPreferences.yaml:
405         * UIProcess/API/C/WKPreferences.cpp:
406         (WKPreferencesSetProcessSwapOnNavigationEnabled):
407         (WKPreferencesGetProcessSwapOnNavigationEnabled):
408         * UIProcess/WebPreferences.cpp:
409         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
410         * UIProcess/WebProcessPool.cpp:
411         (WebKit::WebProcessPool::createWebPage):
412
413 2018-09-04  Dean Jackson  <dino@apple.com>
414
415         Post review Weinig fix-ups
416         https://bugs.webkit.org/show_bug.cgi?id=189288
417
418         Reviewed by Sam Weinig.
419
420         Fix-ups from https://bugs.webkit.org/show_bug.cgi?id=189252
421
422         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
423         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
424         (getUTIForMIMEType): Deleted.
425         * UIProcess/ios/WKSystemPreviewView.mm:
426         (getUTIForSystemPreviewMIMEType):
427         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
428         (getUTIForMIMEType): Deleted.
429
430 2018-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
431
432         Populate "text/uri-list" with multiple URLs when the pasteboard contains multiple URLs
433         https://bugs.webkit.org/show_bug.cgi?id=188890
434         <rdar://problem/43648605>
435
436         Reviewed by Tim Horton.
437
438         Add some plumbing through pasteboard classes to support `Pasteboard::readAllStrings`. See WebCore ChangeLog for
439         more detail.
440
441         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
442         (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
443         * UIProcess/WebPasteboardProxy.h:
444         * UIProcess/WebPasteboardProxy.messages.in:
445         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
446         (WebKit::WebPlatformStrategies::allStringsForType):
447         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
448
449 2018-09-04  Youenn Fablet  <youenn@apple.com>
450
451         Disable WebRTC unified plan runtime flag by default
452         https://bugs.webkit.org/show_bug.cgi?id=189264
453
454         Reviewed by Jer Noble.
455
456         * Shared/WebPreferences.yaml:
457         Disable unified plan flag by default.
458
459 2018-09-04  Chris Dumez  <cdumez@apple.com>
460
461         Add process pool configuration flag to turn on automatic process pre-warming
462         https://bugs.webkit.org/show_bug.cgi?id=189263
463         <rdar://problem/44101941>
464
465         Reviewed by Antti Koivisto.
466
467         Add process pool configuration flag to turn on automatic process pre-warming and disassociate
468         it from the warmInitialProcess() SPI.
469
470         For now, turning on "process swap on navigation" via experimental features also turns on
471         automatic process pre-warming.
472
473         * UIProcess/API/APIProcessPoolConfiguration.cpp:
474         (API::ProcessPoolConfiguration::copy):
475         * UIProcess/API/APIProcessPoolConfiguration.h:
476         * UIProcess/API/C/WKContext.cpp:
477         (WKContextSetPrewarmsProcessesAutomatically):
478         (WKContextWarmInitialProcess):
479         * UIProcess/API/C/WKContextPrivate.h:
480         * UIProcess/API/Cocoa/WKProcessPool.mm:
481         (-[WKProcessPool _warmInitialProcess]):
482         (-[WKProcessPool _hasPrewarmedWebProcess]):
483         (-[WKProcessPool _webProcessCountIgnoringPrewarmed]):
484         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
485         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
486         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
487         (-[_WKProcessPoolConfiguration setPrewarmsProcessesAutomatically:]):
488         (-[_WKProcessPoolConfiguration prewarmsProcessesAutomatically]):
489         * UIProcess/ServiceWorkerProcessProxy.cpp:
490         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
491         * UIProcess/WebProcessPool.cpp:
492         (WebKit::WebProcessPool::setMaximumNumberOfProcesses):
493         (WebKit::WebProcessPool::createNewWebProcess):
494         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
495         (WebKit::WebProcessPool::prewarmProcess):
496         (WebKit::WebProcessPool::disconnectProcess):
497         (WebKit::WebProcessPool::createWebPage):
498         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
499         * UIProcess/WebProcessPool.h:
500         (WebKit::WebProcessPool::sendToOneProcess):
501         * UIProcess/WebProcessProxy.cpp:
502         (WebKit::WebProcessProxy::create):
503         (WebKit::WebProcessProxy::WebProcessProxy):
504         (WebKit::m_isInPrewarmedPool):
505         * UIProcess/WebProcessProxy.h:
506
507 2018-09-03  Dean Jackson  <dino@apple.com>
508
509         Move SystemPreview code from WebKitAdditions to WebKit
510         https://bugs.webkit.org/show_bug.cgi?id=189252
511         <rdar://problem/44080245>
512
513         Reviewed by Wenson Hsieh.
514
515         Move the WebKitAdditions code into WebKit/WebCore.
516
517         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
518         (getUTIForMIMEType): Helper to get the system UTI for USDZ files.
519         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
520
521         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Use the new methods
522         in MIMETypeRegistry.
523         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
524
525         * UIProcess/SystemPreviewController.cpp: Ditto.
526         (WebKit::SystemPreviewController::canPreview const):
527
528         * UIProcess/ios/WKSystemPreviewView.mm:
529         (getUTIForMIMEType): Similar helper to above.
530         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
531
532 2018-09-04  Frederic Wang  <fwang@igalia.com>
533
534         Bug 189190 - REGRESSION(r235398) ASSERTION failure !m_client.didFinishDocumentLoadForFrame
535         https://bugs.webkit.org/show_bug.cgi?id=189190
536
537         Reviewed by Alex Christensen.
538
539         Assertions to prevent use of the deprecated WKPageSetPageLoaderClient class are hit when
540         running system Safari with the current macOS/iOS releases, making impossible to launch it.
541         This patch conditionally skips these assertions so that they are only verified for
542         macOS > 10.14 or other platforms.
543
544         * UIProcess/API/C/WKPage.cpp:
545         (WKPageSetPageLoaderClient): Only assert on future OS releases.
546
547 2018-09-04  Alex Christensen  <achristensen@webkit.org>
548
549         Clean up WebGL policy getting code path
550         https://bugs.webkit.org/show_bug.cgi?id=189003
551
552         Reviewed by Darin Adler.
553
554         * UIProcess/API/APINavigationClient.h:
555         (API::NavigationClient::webGLLoadPolicy const):
556         (API::NavigationClient::resolveWebGLLoadPolicy const):
557         * UIProcess/Cocoa/NavigationState.h:
558         * UIProcess/Cocoa/NavigationState.mm:
559         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
560         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
561         * WebProcess/WebPage/WebPage.cpp:
562         * WebProcess/WebPage/WebPage.h:
563         * WebProcess/WebPage/ios/WebPageIOS.mm:
564         (WebKit::WebPage::webGLPolicyForURL): Deleted.
565         (WebKit::WebPage::resolveWebGLPolicyForURL): Deleted.
566
567 2018-09-04  Zan Dobersek  <zdobersek@igalia.com>
568
569         REGRESSION(r235165): [GStreamer] Major video performance regression
570         https://bugs.webkit.org/show_bug.cgi?id=189224
571
572         Reviewed by Michael Catanzaro.
573
574         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
575         (WebKit::CoordinatedGraphicsScene::updateSceneState): Drop the early
576         return used when the scene state wasn't updated through a layer flush,
577         and instead always run through layer changes and backings. This way we
578         won't miss proxy objects that need swapping even if none of the layer
579         states were changed. Reducing the amount of work done here when scene
580         hasn't been updated might be possible, but it's not a huge bottleneck.
581
582 2018-09-01  Darin Adler  <darin@apple.com>
583
584         [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently
585         https://bugs.webkit.org/show_bug.cgi?id=189072
586
587         Reviewed by Dan Bernstein.
588
589         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Removed NSURLSessionTask
590         method declarations from this file, they are in CFNetworkSPI.h.
591
592         * NetworkProcess/cocoa/NetworkSessionCocoa.mm: Removed NSURLSessionConfiguration
593         method declarations from this file, they are in CFNetworkSPI.h.
594
595 2018-09-01  Dan Bernstein  <mitz@apple.com>
596
597         [Cocoa] Crash using KVO for 'serverTrust' property of WKWebView - "this class is not key value coding-compliant for the key serverTrust"
598         https://bugs.webkit.org/show_bug.cgi?id=189222
599         <rdar://problem/33283179>
600
601         Reviewed by Sam Weinig.
602
603         Test: TestWebKitAPI/Tests/WebKitCocoa/WKWebViewServerTrustKVC.mm
604
605         * UIProcess/API/Cocoa/WKWebView.mm:
606         (-[WKWebView valueForUndefinedKey:]): Override to handle the "serverTrust" key, which is not
607           handled automatically by the KVC machinery since the getter’s return type is not an
608           Objective-C type.
609
610 2018-08-31  John Wilander  <wilander@apple.com>
611
612         Storage Access API: Maintain access through same-site navigations
613         https://bugs.webkit.org/show_bug.cgi?id=188564
614         <rdar://problem/43445160>
615
616         Reviewed by Alex Christensen.
617
618         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
619         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
620             Now takes the current URL and the new URL as parameters
621             and only clears out storage access if the navigation is
622             cross-site, i.e. with differing eTLD+1s.
623         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
624
625 2018-08-31  Chris Dumez  <cdumez@apple.com>
626
627         Assertion hit in ~CompletionHandler() from ~WebFrame()
628         https://bugs.webkit.org/show_bug.cgi?id=189199
629         <rdar://problem/42657233>
630
631         Reviewed by Youenn Fablet.
632
633         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
634         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
635         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
636         * WebProcess/WebPage/WebFrame.cpp:
637         (WebKit::WebFrame::~WebFrame):
638         (WebKit::WebFrame::setUpWillSubmitFormListener):
639         (WebKit::WebFrame::invalidatePolicyListener):
640         * WebProcess/WebPage/WebFrame.h:
641
642 2018-08-31  Antti Koivisto  <antti@apple.com>
643
644         Replace OptionSet |= and -= operators with add() and remove() functions
645         https://bugs.webkit.org/show_bug.cgi?id=189169
646
647         Reviewed by Anders Carlsson.
648
649         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
650         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
651         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
652         (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
653         * Shared/WebEventConversion.cpp:
654         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
655         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
656         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
657         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
658         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
659         * Shared/WebsitePoliciesData.cpp:
660         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
661         * UIProcess/API/C/WKPage.cpp:
662         (WKPageReload):
663         * UIProcess/API/C/WKResourceCacheManager.cpp:
664         (toWebsiteDataTypes):
665         * UIProcess/API/C/WKWebsitePolicies.cpp:
666         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
667         * UIProcess/API/Cocoa/WKWebView.mm:
668         (-[WKWebView reload]):
669         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
670         (WebKit::toWebsiteDataTypes):
671         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
672         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
673         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
674         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
675         * UIProcess/Cocoa/WebViewImpl.mm:
676         (WebKit::WebViewImpl::viewDidMoveToWindow):
677         * UIProcess/WebPageProxy.cpp:
678         (WebKit::WebPageProxy::updateActivityState):
679         (WebKit::WebPageProxy::activityStateDidChange):
680         (WebKit::WebPageProxy::dispatchActivityStateChange):
681         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
682         (WebKit::WebsiteDataRecord::add):
683         (WebKit::WebsiteDataRecord::addCookieHostName):
684         (WebKit::WebsiteDataRecord::addPluginDataHostName):
685         (WebKit::WebsiteDataRecord::addHSTSCacheHostname):
686         (WebKit::WebsiteDataRecord::addOriginWithCredential):
687         * UIProcess/mac/WKInspectorViewController.mm:
688         (-[WKInspectorViewController inspectorWKWebViewReload:]):
689         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
690         (WebKit::imageForRect):
691         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
692         (WebKit::InjectedBundleRangeHandle::renderedImage):
693         * WebProcess/WebPage/FindController.cpp:
694         (WebKit::core):
695         (WebKit::FindController::findString):
696
697 2018-08-31  Chris Dumez  <cdumez@apple.com>
698
699         Rename ShouldProcessSwapIfPossible to ProcessSwapRequestedByClient for clarity
700         https://bugs.webkit.org/show_bug.cgi?id=189195
701
702         Reviewed by Alex Christensen.
703
704         Rename ShouldProcessSwapIfPossible to ProcessSwapRequestedByClient for clarity, since it indicates the client
705         requested a process swap via its navigation policy decision.
706
707         * UIProcess/API/C/WKFramePolicyListener.cpp:
708         (WKFramePolicyListenerUseInNewProcess):
709         (useWithPolicies):
710         (WKFramePolicyListenerUseWithPolicies):
711         (WKFramePolicyListenerUseInNewProcessWithPolicies):
712         * UIProcess/Cocoa/NavigationState.mm:
713         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
714         * UIProcess/WebFramePolicyListenerProxy.cpp:
715         (WebKit::WebFramePolicyListenerProxy::use):
716         (WebKit::WebFramePolicyListenerProxy::download):
717         (WebKit::WebFramePolicyListenerProxy::ignore):
718         * UIProcess/WebFramePolicyListenerProxy.h:
719         * UIProcess/WebFrameProxy.cpp:
720         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
721         * UIProcess/WebFrameProxy.h:
722         * UIProcess/WebPageProxy.cpp:
723         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
724         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
725         (WebKit::WebPageProxy::decidePolicyForResponse):
726         * UIProcess/WebPageProxy.h:
727         * UIProcess/WebProcessPool.cpp:
728         (WebKit::WebProcessPool::processForNavigation):
729         (WebKit::WebProcessPool::processForNavigationInternal):
730         * UIProcess/WebProcessPool.h:
731
732 2018-08-31  Aditya Keerthi  <akeerthi@apple.com>
733
734         [Datalist][iOS] Add suggestions UI for TextFieldInputTypes
735         https://bugs.webkit.org/show_bug.cgi?id=186714
736
737         Reviewed by Wenson Hsieh.
738
739         On iOS, we have less space to display suggestions from a datalist element compared
740         to macOS. Furthermore, iPhones and iPads have different form factors, leading to a
741         different approach on each device. The commonalities of the two implementations
742         can be found in WKDataListSuggestionsControl. This class is subclassed by the
743         device specific implementations.
744
745         On iPhone, we display the suggestions in a UIPickerView. This view is accessible
746         only after tapping on the datalist button element to the side of the input field.
747         This approach was chosen in order to avoid tricking the user into thinking that
748         the values displayed in the picker are the only accepted values.
749         WKDataListSuggestionsPicker is responsible for managing the interface shown on
750         iPhones.
751
752         On iPad, we display the suggestions in a popover, that is visible alongside the
753         keyboard. The suggestions in the popover update as the user types.
754         WKDataListSuggestionsPopover is responsible for managing the interface shown on
755         iPads.
756
757         Both devices display predictive text suggestions, taking the first three values
758         from the filtered suggestions list. In order to prevent other clients from
759         overwriting the suggestions provided by the datalist element, we prevent writing
760         to the predictive text bar if an input with the list attribute is the currently
761         assisted node.
762
763         * Shared/AssistedNodeInformation.cpp:
764         (WebKit::AssistedNodeInformation::encode const):
765         (WebKit::AssistedNodeInformation::decode):
766         * Shared/AssistedNodeInformation.h:
767         * Shared/ios/InteractionInformationAtPosition.h:
768         * Shared/ios/InteractionInformationAtPosition.mm:
769         (WebKit::InteractionInformationAtPosition::encode const):
770         (WebKit::InteractionInformationAtPosition::decode):
771         * SourcesCocoa.txt:
772         * UIProcess/WebDataListSuggestionsDropdownIOS.h: Added.
773         * UIProcess/WebDataListSuggestionsDropdownIOS.mm: Added.
774         (WebKit::WebDataListSuggestionsDropdownIOS::create):
775         (WebKit::WebDataListSuggestionsDropdownIOS::WebDataListSuggestionsDropdownIOS):
776         (WebKit::WebDataListSuggestionsDropdownIOS::show):
777         (WebKit::WebDataListSuggestionsDropdownIOS::handleKeydownWithIdentifier):
778         (WebKit::WebDataListSuggestionsDropdownIOS::close):
779         (WebKit::WebDataListSuggestionsDropdownIOS::didSelectOption):
780         (-[WKDataListSuggestionsControl initWithInformation:inView:]):
781         (-[WKDataListSuggestionsControl updateWithInformation:]):
782         (-[WKDataListSuggestionsControl showSuggestionsDropdown:activationType:]):
783         (-[WKDataListSuggestionsControl didSelectOptionAtIndex:]):
784         (-[WKDataListSuggestionsControl invalidate]):
785         (-[WKDataListSuggestionsControl textSuggestions]):
786         (-[WKDataListSuggestionsControl suggestionsCount]):
787         (-[WKDataListSuggestionsControl suggestionAtIndex:]):
788         (-[WKDataListSuggestionsControl textAlignment]):
789         (-[WKDataListSuggestionsPicker initWithInformation:inView:]):
790         (-[WKDataListSuggestionsPicker updateWithInformation:]):
791         (-[WKDataListSuggestionsPicker showSuggestionsDropdown:activationType:]):
792         (-[WKDataListSuggestionsPicker numberOfComponentsInPickerView:]):
793         (-[WKDataListSuggestionsPicker pickerView:numberOfRowsInComponent:]):
794         (-[WKDataListSuggestionsPicker pickerView:titleForRow:forComponent:]):
795         (-[WKDataListSuggestionsPicker invalidate]):
796         (-[WKDataListSuggestionsPickerView controlView]):
797         (-[WKDataListSuggestionsPickerView controlBeginEditing]):
798         (-[WKDataListSuggestionsPickerView controlEndEditing]):
799         (-[WKDataListSuggestionsPopover initWithInformation:inView:]):
800         (-[WKDataListSuggestionsPopover updateWithInformation:]):
801         (-[WKDataListSuggestionsPopover showSuggestionsDropdown:activationType:]):
802         (-[WKDataListSuggestionsPopover invalidate]):
803         (-[WKDataListSuggestionsPopover didSelectOptionAtIndex:]):
804         (-[WKDataListSuggestionsViewController reloadData]):
805         (-[WKDataListSuggestionsViewController tableView:numberOfRowsInSection:]):
806         (-[WKDataListSuggestionsViewController tableView:cellForRowAtIndexPath:]):
807         (-[WKDataListSuggestionsViewController tableView:didSelectRowAtIndexPath:]):
808         * UIProcess/WebPageProxy.cpp:
809         (WebKit::WebPageProxy::pageDidScroll):
810         * UIProcess/ios/PageClientImplIOS.mm:
811         (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
812         * UIProcess/ios/WKContentViewInteraction.h:
813         * UIProcess/ios/WKContentViewInteraction.mm:
814         (-[WKFormInputSession endEditing]):
815         (-[WKFormInputSession setSuggestions:]):
816         (-[WKContentView _formInputSession]):
817         (-[WKContentView resignFirstResponderForWebView]):
818         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
819         (-[WKContentView accessoryTab:]):
820         (-[WKContentView insertTextSuggestion:]):
821         * UIProcess/mac/WebDataListSuggestionsDropdownMac.h:
822         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
823         (WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
824         * WebKit.xcodeproj/project.pbxproj:
825         * WebProcess/WebPage/WebPage.cpp:
826         (WebKit::WebPage::didCloseSuggestions):
827         * WebProcess/WebPage/ios/WebPageIOS.mm:
828         (WebKit::WebPage::getPositionInformation):
829         (WebKit::WebPage::getAssistedNodeInformation):
830
831 2018-08-31  Frederic Wang  <fwang@igalia.com>
832
833         REGRESSION(r235484) _WKPreferencesGetWebRTCLegacyAPIEnabled symbol not found when running Safari with external SDK build
834         https://bugs.webkit.org/show_bug.cgi?id=189188
835
836         Reviewed by Youenn Fablet.
837
838         WebRTCLegacyAPI preference has been removed in r235484. However, the API is still used by
839         Safari when running external SDK builds. Hence we restore some dummy getter/setter for now.
840
841         * UIProcess/API/C/WKPreferences.cpp:
842         (WKPreferencesSetWebRTCLegacyAPIEnabled): no-op.
843         (WKPreferencesGetWebRTCLegacyAPIEnabled): Always return false.
844         * UIProcess/API/C/WKPreferencesRef.h:
845         * UIProcess/API/Cocoa/WKPreferences.mm:
846         (-[WKPreferences _webRTCLegacyAPIEnabled]): Always return false.
847         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): no-op.
848         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
849
850 2018-08-31  Frederic Wang  <fwang@igalia.com>
851
852         Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement
853         https://bugs.webkit.org/show_bug.cgi?id=182053
854
855         Reviewed by Simon Fraser.
856
857         Add developer flag to use standard behavior for scrolling* attributes.
858
859         * Shared/WebPreferences.yaml:
860         * UIProcess/API/C/WKPreferences.cpp:
861         (WKPreferencesSetCSSOMViewScrollingAPIEnabled):
862         (WKPreferencesGetCSSOMViewScrollingAPIEnabled):
863         * UIProcess/API/C/WKPreferencesRefPrivate.h:
864
865 2018-08-30  Tim Horton  <timothy_horton@apple.com>
866
867         One more build fix
868
869         * UIProcess/ios/WKContentViewInteraction.mm:
870         (-[WKContentView shareSheetDidDismiss:]):
871         Actually tested this time.
872
873 2018-08-30  Chris Dumez  <cdumez@apple.com>
874
875         Add WKPageLoadFile SPI variant which returns a navigation object
876         https://bugs.webkit.org/show_bug.cgi?id=189168
877         <rdar://problem/43899330>
878
879         Reviewed by Alex Christensen.
880
881         Add WKPageLoadFile SPI variant which returns a navigation object, similarly to WKPageLoadURLRequestReturningNavigation().
882         This is needed in order to implement <rdar://problem/40309266>.
883
884         * UIProcess/API/C/mac/WKPagePrivateMac.h:
885         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
886         (WKPageLoadFileReturningNavigation):
887
888 2018-08-30  Tim Horton  <timothy_horton@apple.com>
889
890         Try to fix the watchOS and tvOS build
891
892         * UIProcess/ios/WKContentViewInteraction.mm:
893         (-[WKContentView _showShareSheet:completionHandler:]):
894         (-[WKContentView shareSheetDidDismiss:]):
895
896 2018-08-30  Justin Michaud  <justin@justinmichaud.com>
897
898         [GTK] Touchscreen pinch to zoom should scale the page like other platforms
899         https://bugs.webkit.org/show_bug.cgi?id=188746
900
901         Changes the pinch-to-zoom gesture to magnify/scale the page, rather than zooming in. Also resets this magnification when the zoom level is changed.
902
903         Reviewed by Michael Catanzaro.
904
905         * UIProcess/API/glib/WebKitWebView.cpp:
906         (webkit_web_view_set_zoom_level):
907         * UIProcess/API/gtk/PageClientImpl.cpp:
908         (WebKit::PageClientImpl::zoom): Deleted.
909         * UIProcess/API/gtk/PageClientImpl.h:
910         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
911         * UIProcess/gtk/GestureController.cpp:
912         (WebKit::GestureController::ZoomGesture::handleZoom):
913         (WebKit::GestureController::ZoomGesture::scaleChanged):
914         * UIProcess/gtk/GestureController.h:
915
916 2018-08-30  Tim Horton  <timothy_horton@apple.com>
917
918         Bundle unified sources more tightly in projects with deep directory structures
919         https://bugs.webkit.org/show_bug.cgi?id=189009
920
921         Reviewed by Simon Fraser.
922
923         Fix a variety of unification errors due to reshuffling the bundles.
924
925         * Shared/APIWebArchive.mm:
926         * Shared/APIWebArchiveResource.mm:
927         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
928         * Shared/Plugins/Netscape/mac/PluginInformationMac.mm:
929         * SourcesCocoa.txt:
930         * SourcesGTK.txt:
931         * UIProcess/API/APIAutomationSessionClient.h:
932         (API::AutomationSessionClient::sessionIdentifier const):
933         (API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
934         (API::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
935         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
936         (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
937         (-[WKCustomProtocolLoader connection:didFailWithError:]):
938         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
939         * UIProcess/Plugins/PluginProcessProxy.cpp:
940         (WebKit::generatePluginProcessCallbackID):
941         (WebKit::PluginProcessProxy::fetchWebsiteData):
942         (WebKit::PluginProcessProxy::deleteWebsiteData):
943         (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
944         (WebKit::generateCallbackID): Deleted.
945         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
946         (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
947         * UIProcess/Storage/StorageProcessProxy.cpp:
948         (WebKit::generateStorageProcessCallbackID):
949         (WebKit::StorageProcessProxy::fetchWebsiteData):
950         (WebKit::StorageProcessProxy::deleteWebsiteData):
951         (WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins):
952         (WebKit::generateCallbackID): Deleted.
953         * WebKit.xcodeproj/project.pbxproj:
954         * WebProcess/Plugins/PDF/PDFPlugin.mm:
955         (-[WKPDFPluginAccessibilityObject accessibilityPerformAction:]):
956         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
957         (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
958         (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
959         (-[WKPDFLayerControllerDelegate updateScrollPosition:]):
960         (WebKit::PDFPlugin::updateCursor):
961         (WebKit::coreCursor):
962         (appendValuesInPDFNameSubtreeToVector): Deleted.
963         (getAllValuesInPDFNameTree): Deleted.
964         (getAllScriptsInPDFDocument): Deleted.
965
966 2018-08-30  Tim Horton  <timothy_horton@apple.com>
967
968         Fix the watchOS and tvOS build
969
970         * UIProcess/ios/WKContentViewInteraction.mm:
971         (-[WKContentView cleanupInteraction]):
972         (-[WKContentView invokeShareSheetWithResolution:]):
973
974 2018-08-30  Eric Carlson  <eric.carlson@apple.com>
975
976         Mock video devices should only support discrete sizes
977         https://bugs.webkit.org/show_bug.cgi?id=189000
978         <rdar://problem/43766551>
979
980         Reviewed by Youenn Fablet.
981
982         * UIProcess/WebProcessPool.cpp:
983         (WebKit::WebProcessPool::resetMockMediaDevices):
984         * WebProcess/WebProcess.cpp:
985         (WebKit::WebProcess::resetMockMediaDevices):
986
987 2018-08-30  Olivia Barnett  <obarnett@apple.com>
988
989         Web Share API compatible with AppleTV and WatchOS
990         https://bugs.webkit.org/show_bug.cgi?id=189157
991
992         Reviewed by Tim Horton.
993
994         * Shared/WebPreferencesDefaultValues.h:
995         * UIProcess/ios/WKContentViewInteraction.h:
996         * UIProcess/ios/WKContentViewInteraction.mm:
997         (-[WKContentView fileUploadPanelDidDismiss:]):
998         * UIProcess/ios/forms/WKShareSheet.h:
999         * UIProcess/ios/forms/WKShareSheet.mm:
1000         (-[WKShareSheet invokeShareSheetWithResolution:]):
1001         Added platform checks.
1002
1003 2018-08-30  Commit Queue  <commit-queue@webkit.org>
1004
1005         Unreviewed, rolling out r235413 and r235444.
1006         https://bugs.webkit.org/show_bug.cgi?id=189163
1007
1008         Causes crashes when running layout tests under GuardMalloc
1009         (Requested by ryanhaddad on #webkit).
1010
1011         Reverted changesets:
1012
1013         "NetworkLoad::didReceiveResponse should pass its completion
1014         handler to its client"
1015         https://bugs.webkit.org/show_bug.cgi?id=188701
1016         https://trac.webkit.org/changeset/235413
1017
1018         "Remove assertion introduced in r235413"
1019         https://bugs.webkit.org/show_bug.cgi?id=188701
1020         https://trac.webkit.org/changeset/235444
1021
1022 2018-08-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1023
1024         [Curl][WebKit] Bugfix on redirect.
1025         https://bugs.webkit.org/show_bug.cgi?id=189056
1026
1027         Reviewed by Alex Christensen.
1028
1029         Forget to call updateFromDelegatePreservingOldProperties in continueWillSendRequest like other ports do.
1030
1031         * NetworkProcess/NetworkLoad.cpp:
1032         (WebKit::NetworkLoad::continueWillSendRequest):
1033
1034 2018-08-30  Aditya Keerthi  <akeerthi@apple.com>
1035
1036         [macOS] Color picker layout is broken if suggested colors are specified
1037         https://bugs.webkit.org/show_bug.cgi?id=189117
1038
1039         Reviewed by Tim Horton.
1040
1041         NSPopoverColorWell recently changed the size of its swatches. We need to update
1042         the width of the swatches we provide to match the width of the other swatches,
1043         in order to avoid breaking the layout.
1044
1045         While such a solution is not a good precedent, we do not have fully-functional SPI
1046         to customize the suggested colors. A FIXME has been added for this reason.
1047         However, even once we obtain SPI, we will need to find a way to support older
1048         clients, making conditional compilation a potential necessity.
1049
1050         * UIProcess/mac/WebColorPickerMac.mm:
1051
1052 2018-08-30  Brent Fulgham  <bfulgham@apple.com>
1053
1054         [macOS] Whitelist Network process features for VPN
1055         https://bugs.webkit.org/show_bug.cgi?id=189023
1056         <rdar://problem/43310000>
1057
1058         Reviewed by Eric Carlson.
1059
1060         CFNetwork needs access to some VPN preference files to configure networking, and
1061         need to be allowed to communicate with the VPN process from the Network Process
1062         sandbox.
1063
1064         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1065
1066 2018-08-30  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
1067
1068         [ConnectionUnix] Shrink sizeof AttachmentInfo by reordering members
1069         https://bugs.webkit.org/show_bug.cgi?id=189149
1070
1071         Reviewed by Michael Catanzaro.
1072
1073         Reorder members to shrink the size of AttachmentInfo so that
1074         we can attach more attachments. 
1075
1076         * Platform/IPC/unix/ConnectionUnix.cpp:
1077
1078 2018-08-29  Chris Dumez  <cdumez@apple.com>
1079
1080         Avoid code duplication in ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords()
1081         https://bugs.webkit.org/show_bug.cgi?id=189130
1082
1083         Reviewed by Youenn Fablet.
1084
1085         Move if check inside the lambda instead of outside to avoid code duplication.
1086
1087         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1088         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
1089
1090 2018-08-29  Alex Christensen  <achristensen@webkit.org>
1091
1092         Revert some of r235398
1093         https://bugs.webkit.org/show_bug.cgi?id=189133
1094
1095         Reviewed by Tim Horton.
1096
1097         * UIProcess/API/APILoaderClient.h:
1098         (API::LoaderClient::processDidCrash):
1099         (API::LoaderClient::didChangeBackForwardList):
1100         (API::LoaderClient::didCommitLoadForFrame):
1101         * UIProcess/API/C/WKPage.cpp:
1102         (WKPageSetPageLoaderClient):
1103         * UIProcess/WebPageProxy.cpp:
1104         (WebKit::WebPageProxy::didChangeBackForwardList):
1105         (WebKit::WebPageProxy::didCommitLoadForFrame):
1106         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
1107
1108 2018-08-29  Olivia Barnett  <obarnett@apple.com>
1109
1110         Implement the Web Share API
1111         https://bugs.webkit.org/show_bug.cgi?id=171100
1112         <rdar://problem/31751734>
1113
1114         Reviewed by Tim Horton.
1115
1116         * Platform/spi/ios/UIKitSPI.h:
1117         Added NSURL _title property as in the WebCore UIKitSPI.
1118
1119         * Scripts/webkit/messages.py:
1120         ShareDataWithParsedURL special case for header for type.
1121         
1122         * Shared/ShareSheetCallbackID.h:
1123         Added a typedef for a share sheet callback id.       
1124
1125         * Shared/WebCoreArgumentCoders.cpp:
1126         (IPC::ArgumentCoder<ShareData>::encode):
1127         (IPC::ArgumentCoder<ShareData>::decode):
1128         (IPC::ArgumentCoder<ShareDataWithParsedURL>::encode):
1129         (IPC::ArgumentCoder<ShareDataWithParsedURL>::decode):
1130         * Shared/WebCoreArgumentCoders.h:
1131         Added encoding and decoding functionality for new structs.
1132
1133         * Shared/WebPreferences.yaml:
1134         * UIProcess/API/C/WKPreferences.cpp:
1135         (WKPreferencesSetWebShareEnabled):
1136         (WKPreferencesGetWebShareEnabled):
1137         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1138         Added switch for RuntimeEnabledFeature.
1139
1140         * UIProcess/API/Cocoa/WKWebView.mm:
1141         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1142         Added hook for share sheet testing.
1143
1144         * UIProcess/PageClient.h:
1145         (WebKit::PageClient::showShareSheet):
1146         Page client call to invoke share sheet.
1147
1148         * UIProcess/WebPageProxy.cpp:
1149         (WebKit::WebPageProxy::showShareSheet):
1150         * UIProcess/WebPageProxy.h:
1151         * UIProcess/WebPageProxy.messages.in:
1152         Web page proxy handling of call to invoke share sheet.
1153         Creates completion handler to send to WKShareSheet.mm
1154         Completion handler sends message to WebPage with message id.
1155
1156         * UIProcess/ios/PageClientImplIOS.h:
1157         * UIProcess/ios/PageClientImplIOS.mm:
1158         (WebKit::PageClientImpl::showShareSheet):
1159         Page client implementation call to invoke share sheet. 
1160
1161         * UIProcess/ios/WKContentViewInteraction.h:
1162         * UIProcess/ios/WKContentViewInteraction.mm:
1163         (-[WKContentView cleanupInteraction]):
1164         (-[WKContentView _showShareSheet:completionHandler:]):
1165         (-[WKContentView shareSheetDidDismiss:]):
1166         (-[WKContentView invokeShareSheetWithResolution:resolved):
1167         Call to WKShareSheet to invoke the share sheet and callback.
1168         Hook for share sheet resolution testing.
1169
1170         * UIProcess/ios/forms/WKShareSheet.h: Added.
1171         * UIProcess/ios/forms/WKShareSheet.mm: Added.
1172         (-[WKShareSheet initWithView:]):
1173         (-[WKShareSheet presentWithParameters:completionHandler:]):
1174         (-[WKShareSheet _dispatchDidDismiss]):
1175         (-[WKShareSheet _cancel]):
1176         (-[WKShareSheet dismiss]):
1177         (-[WKShareSheet _dismissDisplayAnimated:]):
1178         (-[WKShareSheet _presentFullscreenViewController:animated:]):
1179         (-[WKShareSheet invokeShareSheetWithResolution:resolved:]):
1180         Completion handler call and creation of share sheet with parameters.
1181         Hook that force resolves the share sheet completion handler for testing. 
1182
1183         * WebKit.xcodeproj/project.pbxproj:
1184
1185         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1186         (WebKit::WebChromeClient::showShareSheet):
1187         Call to page to invoke share sheet.
1188
1189         * WebProcess/WebCoreSupport/WebChromeClient.h:
1190         * WebProcess/WebPage/WebPage.cpp:
1191         (WebKit::nextShareSheetContextId):
1192         (WebKit::WebPage::showShareSheet):
1193         (WebKit::WebPage::showShareSheetResponse):
1194         WebPage calls proxy and saves context id for promise.        
1195
1196         * WebProcess/WebPage/WebPage.h:
1197         * WebProcess/WebPage/WebPage.messages.in:
1198         Callback for completed response.
1199
1200 2018-08-29  Chris Dumez  <cdumez@apple.com>
1201
1202         Crash under WebKit: WTF::Function<void ()>::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords(WTF::CompletionHandler<void ()>&&)::$_1>::call()
1203         https://bugs.webkit.org/show_bug.cgi?id=189098
1204         <rdar://problem/43179891>
1205
1206         Reviewed by Youenn Fablet.
1207
1208         The crash was caused by implicitly using |this| on the main thread by accessing member variables, even though
1209         |this| gets destroyed on the statistics queue. To address the issue, capture what we need on the statistics
1210         queue, *before* dispatching to the main thread.
1211
1212         Also stop capturing |this| in the lambdas to make this less error prone.
1213
1214         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1215         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1216         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
1217         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
1218
1219 2018-08-29  Youenn Fablet  <youenn@apple.com>
1220
1221         Remove WebRTC legacy API implementation
1222         https://bugs.webkit.org/show_bug.cgi?id=189040
1223
1224         Reviewed by Eric Carlson.
1225
1226         * Shared/WebPreferences.yaml:
1227         * UIProcess/API/C/WKPreferences.cpp:
1228         (WKPreferencesSetWebRTCLegacyAPIEnabled): Deleted.
1229         (WKPreferencesGetWebRTCLegacyAPIEnabled): Deleted.
1230         * UIProcess/API/C/WKPreferencesRef.h:
1231         * UIProcess/API/Cocoa/WKPreferences.mm:
1232         (-[WKPreferences _webRTCLegacyAPIEnabled]): Deleted.
1233         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): Deleted.
1234         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1235         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1236         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1237
1238 2018-08-29  Chris Dumez  <cdumez@apple.com>
1239
1240         [PSON] We should only process-swap when eTLD+1 changes on navigation
1241         https://bugs.webkit.org/show_bug.cgi?id=189090
1242         <rdar://problem/43799225>
1243
1244         Reviewed by Geoffrey Garen.
1245
1246         When navigating cross-origin, only process swap when the eTLD+1 (aka "Registrable
1247         domain") changes, instead of considering the full security origin.
1248
1249         This has performance benefits and is also needed to keep document.domain origin
1250         relaxation working.
1251
1252         * UIProcess/WebProcessPool.cpp:
1253         (WebKit::WebProcessPool::addProcessToOriginCacheSet):
1254         (WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
1255         (WebKit::WebProcessPool::processForNavigation):
1256         (WebKit::WebProcessPool::processForNavigationInternal):
1257         * UIProcess/WebProcessPool.h:
1258
1259 2018-08-29  Youenn Fablet  <youenn@apple.com>
1260
1261         Add a runtime flag for WebRTC unified plan
1262         https://bugs.webkit.org/show_bug.cgi?id=189068
1263
1264         Reviewed by Eric Carlson.
1265
1266         * Shared/WebPreferences.yaml:
1267         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1268         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1269
1270 2018-08-29  Aditya Keerthi  <akeerthi@apple.com>
1271
1272         Followup (r235427): Use the null string instead of std::nullopt when no suggestion is selected
1273         https://bugs.webkit.org/show_bug.cgi?id=189095
1274
1275         Reviewed by Tim Horton.
1276
1277         Followup to r235427 as per Darin's comment.
1278
1279         We can avoid unnecessary use of std::optional by taking advantage of the fact that
1280         WTF::String already has a null value distinct from the empty value.
1281
1282         No change in behavior.
1283
1284         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
1285         (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
1286         (-[WKDataListSuggestionsView currentSelectedString]):
1287
1288 2018-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1289
1290         Use the null string instead of std::nullopt for missing attachment file names and content types
1291         https://bugs.webkit.org/show_bug.cgi?id=189080
1292
1293         Reviewed by Tim Horton.
1294
1295         Replace instances of std::optional<String> with just String instead, and use the null string to represent a
1296         missing value instead of std::nullopt. No change in behavior.
1297
1298         * UIProcess/WebPageProxy.cpp:
1299         (WebKit::WebPageProxy::updateAttachmentAttributes):
1300         * WebProcess/WebPage/WebPage.cpp:
1301         (WebKit::WebPage::updateAttachmentAttributes):
1302         * WebProcess/WebPage/WebPage.h:
1303         * WebProcess/WebPage/WebPage.messages.in:
1304
1305 2018-08-28  Don Olmstead  <don.olmstead@sony.com>
1306
1307         [CMake] Use CMake's FindFreetype
1308         https://bugs.webkit.org/show_bug.cgi?id=189071
1309
1310         Reviewed by Michael Catanzaro.
1311
1312         * PlatformWPE.cmake:
1313
1314 2018-08-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1315
1316         Work towards: [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
1317         https://bugs.webkit.org/show_bug.cgi?id=189054
1318
1319         Reviewed by Andy Estes.
1320
1321         Remove the pasteboard type argument from readURLFromPasteboard.
1322
1323         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1324         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
1325         * UIProcess/WebPasteboardProxy.h:
1326         * UIProcess/WebPasteboardProxy.messages.in:
1327         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1328         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
1329         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1330
1331 2018-08-28  Alex Christensen  <achristensen@webkit.org>
1332
1333         Remove assertion introduced in r235413
1334         https://bugs.webkit.org/show_bug.cgi?id=188701
1335
1336         * NetworkProcess/NetworkResourceLoader.cpp:
1337         (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
1338         r235413 did not change behavior. The assertion was invalid.
1339
1340 2018-08-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1341
1342         Remove references to "APIAttachmentCocoa.h" in WebKit.xcodeproj
1343         Follow-up to https://bugs.webkit.org/show_bug.cgi?id=188933
1344
1345         Rubber-stamped by David Kilzer.
1346
1347         This header was not removed from the Xcode project file after being deleted.
1348
1349         * WebKit.xcodeproj/project.pbxproj:
1350
1351 2018-08-28  Sihui Liu  <sihui_liu@apple.com>
1352
1353         Add error information to help debug test failure in WKNavigation.ProcessCrashDuringCallback
1354         https://bugs.webkit.org/show_bug.cgi?id=189037
1355
1356         Reviewed by Chris Dumez.
1357
1358         * UIProcess/API/Cocoa/WKWebView.mm:
1359         (-[WKWebView _getMainResourceDataWithCompletionHandler:]):
1360         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
1361         (-[WKWebView _getContentsAsStringWithCompletionHandler:]):
1362
1363 2018-08-28  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1364
1365         [Curl] Fix issue that extra cookie is added when redirect happens.
1366         https://bugs.webkit.org/show_bug.cgi?id=187874
1367
1368         Reviewed by Alex Christensen.
1369
1370         When initial request has cookie set and redirect happens, it add extra Cookie header to that
1371         abd request was broken. Just stop modifying the original request by passing a value.
1372
1373         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1374         (WebKit::NetworkDataTaskCurl::createCurlRequest):
1375         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
1376         (WebKit::NetworkDataTaskCurl::restartWithCredential):
1377         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1378
1379 2018-08-28  Aditya Keerthi  <akeerthi@apple.com>
1380
1381         [macOS] Color wells should appear rounded and textured
1382         https://bugs.webkit.org/show_bug.cgi?id=189039
1383
1384         Reviewed by Tim Horton.
1385
1386         * UIProcess/mac/WebColorPickerMac.mm: Build fix.
1387
1388 2018-08-28  Aditya Keerthi  <akeerthi@apple.com>
1389
1390         [Datalist] Pressing enter without a selected option shouldn't change the input
1391         https://bugs.webkit.org/show_bug.cgi?id=189010
1392
1393         Reviewed by Tim Horton.
1394
1395         Currently, the value of an input field gets cleared if there is no selected
1396         datalist suggestion when the enter key is pressed. The correct behavior is to
1397         leave the value of the input as-is.
1398
1399         The incorrect behavior is a consequence of the fact that an empty string is
1400         returned by [WKDataListSuggestionsView currentSelectedString] if there is no
1401         selection. To fix the behavior, the method now returns an std::optional instead
1402         of an empty string. If std::nullopt is returned, we do not make any modification
1403         to the value of the input. This ensures that we can still change the value of
1404         an input field to an empty string in the case that an empty string is part of
1405         the suggestions.
1406
1407         Augmented test: fast/forms/datalist/datalist-textinput-keydown.html
1408
1409         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
1410         (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
1411         (-[WKDataListSuggestionCell drawRect:]): Quick fix. The mouseover color was incorrect.
1412         (-[WKDataListSuggestionsView currentSelectedString]):
1413
1414 2018-08-28  Aditya Keerthi  <akeerthi@apple.com>
1415
1416         [iOS] Support inputmode=none
1417         https://bugs.webkit.org/show_bug.cgi?id=188896
1418
1419         Reviewed by Tim Horton.
1420
1421         inputmode=none is used by content that renders its own keyboard control.
1422         Consequently, we should not display the virtual keyboard when a user interacts
1423         with an element that has the inputmode attribute set to the "none" value.
1424
1425         In order to achieve this behavior, we return a UIView with a bounds of CGRectZero
1426         as the inputView of the WKContentView when inputmode=none is present. Furthermore,
1427         we do not provide an accessory view in this case.
1428
1429         Updated the logic that zooms and scrolls to a control when it gains focus, as that
1430         behavior currently relies on an accessory view being present.
1431
1432         * UIProcess/ios/WKContentViewInteraction.mm:
1433         (-[WKContentView _displayFormNodeInputView]):
1434         (-[WKContentView inputView]):
1435         (-[WKContentView requiresAccessoryView]):
1436         (-[WKContentView textInputTraits]):
1437
1438 2018-08-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1439
1440         [Curl] Enable Proxy Authentication on WebKit.
1441         https://bugs.webkit.org/show_bug.cgi?id=188998
1442
1443         Reviewed by Alex Christensen.
1444
1445         Add support for proxy authentication to curl backend running on WebKit.
1446         This is follow up implementation of legacy implementation:
1447         - https://bugs.webkit.org/show_bug.cgi?id=185266
1448
1449         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1450         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
1451         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
1452         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1453         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1454         * PlatformWin.cmake:
1455
1456 2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1457
1458         [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends
1459         https://bugs.webkit.org/show_bug.cgi?id=189004
1460
1461         Reviewed by Dan Bernstein.
1462
1463         Removes all usage of WebCore::AttachmentDisplayOptions, and deletes an SPI method that isn't being used by any
1464         internal clients. Removal of _WKAttachmentDisplayOptions itself is still blocked on the submission of
1465         <rdar://problem/43357281>.
1466
1467         * Scripts/webkit/messages.py:
1468         * Shared/WebCoreArgumentCoders.cpp:
1469         * UIProcess/API/APIAttachment.cpp:
1470         (API::Attachment::setDisplayOptions): Deleted.
1471         * UIProcess/API/APIAttachment.h:
1472         * UIProcess/API/Cocoa/WKWebView.mm:
1473         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
1474         (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):
1475         (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
1476         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1477
1478         Deprecate -_insertAttachmentWithFileWrapper:contentType:options:completion:, in favor of
1479         -_insertAttachmentWithFileWrapper:contentType:completion:.
1480
1481         * UIProcess/API/Cocoa/_WKAttachment.h:
1482
1483         Remove -setDisplayOptions:completion:, since it is a now a noop, and also isn't used by any internal clients.
1484
1485         * UIProcess/API/Cocoa/_WKAttachment.mm:
1486         (-[_WKAttachmentDisplayOptions coreDisplayOptions]): Deleted.
1487         (-[_WKAttachment setDisplayOptions:completion:]): Deleted.
1488         * UIProcess/API/Cocoa/_WKAttachmentInternal.h:
1489         * UIProcess/WebPageProxy.cpp:
1490         (WebKit::WebPageProxy::insertAttachment):
1491         (WebKit::WebPageProxy::setAttachmentDisplayOptions): Deleted.
1492         * UIProcess/WebPageProxy.h:
1493         * WebProcess/WebPage/WebPage.cpp:
1494         (WebKit::WebPage::insertAttachment):
1495         (WebKit::WebPage::setAttachmentDisplayOptions): Deleted.
1496         * WebProcess/WebPage/WebPage.h:
1497         * WebProcess/WebPage/WebPage.messages.in:
1498
1499 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1500
1501         NetworkLoad::didReceiveResponse should pass its completion handler to its client
1502         https://bugs.webkit.org/show_bug.cgi?id=188701
1503
1504         Reviewed by Michael Catanzaro.
1505
1506         Right now we have a confusing enum ShouldContinueDidReceiveResponse and a complicated flow
1507         that involves many objects and implicitly using NetworkLoad's destructor as part of the
1508         loading flow.  This makes the responsibilities of the objects clear.
1509
1510         * NetworkProcess/Downloads/PendingDownload.cpp:
1511         (WebKit::PendingDownload::didReceiveResponse):
1512         * NetworkProcess/Downloads/PendingDownload.h:
1513         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1514         (WebKit::NetworkCORSPreflightChecker::didReceiveResponse):
1515         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession): Deleted.
1516         * NetworkProcess/NetworkCORSPreflightChecker.h:
1517         * NetworkProcess/NetworkDataTask.cpp:
1518         (WebKit::NetworkDataTask::didReceiveResponse):
1519         * NetworkProcess/NetworkDataTask.h:
1520         * NetworkProcess/NetworkLoad.cpp:
1521         (WebKit::NetworkLoad::~NetworkLoad):
1522         (WebKit::NetworkLoad::convertTaskToDownload):
1523         (WebKit::NetworkLoad::didReceiveResponse):
1524         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1525         (WebKit::NetworkLoad::continueDidReceiveResponse): Deleted.
1526         (WebKit::NetworkLoad::didReceiveResponseNetworkSession): Deleted.
1527         * NetworkProcess/NetworkLoad.h:
1528         * NetworkProcess/NetworkLoadClient.h:
1529         * NetworkProcess/NetworkResourceLoader.cpp:
1530         (WebKit::NetworkResourceLoader::~NetworkResourceLoader):
1531         (WebKit::NetworkResourceLoader::didReceiveResponse):
1532         (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
1533         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
1534         * NetworkProcess/NetworkResourceLoader.h:
1535         * NetworkProcess/PingLoad.cpp:
1536         (WebKit::PingLoad::didReceiveResponse):
1537         (WebKit::PingLoad::didReceiveResponseNetworkSession): Deleted.
1538         * NetworkProcess/PingLoad.h:
1539         * NetworkProcess/PreconnectTask.cpp:
1540         (WebKit::PreconnectTask::didReceiveResponse):
1541         * NetworkProcess/PreconnectTask.h:
1542         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1543         (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
1544         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1545         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1546         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
1547
1548 2018-08-27  Keith Rollin  <krollin@apple.com>
1549
1550         Unreviewed build fix -- disable LTO for production builds
1551
1552         * Configurations/Base.xcconfig:
1553
1554 2018-08-27  Per Arne Vollan  <pvollan@apple.com>
1555
1556         [macOS] Block CoreServices in sandbox.
1557         https://bugs.webkit.org/show_bug.cgi?id=189005
1558         <rdar://problem/35369091>
1559
1560         Reviewed by Brent Fulgham.
1561
1562         The sandbox for the WebContent process should block CoreServices.
1563
1564         * WebProcess/com.apple.WebProcess.sb.in:
1565
1566 2018-08-27  Simon Fraser  <simon.fraser@apple.com>
1567
1568         Teach WebKitTestRunner and DumpRenderTree about detecting world leaks
1569         https://bugs.webkit.org/show_bug.cgi?id=188994
1570
1571         Reviewed by Tim Horton.
1572
1573         This patch adds the notion of a "control command" in the protocol between webkitpy and 
1574         WebKitTestRunner/DumpRenderTree. A command is simply an input string starting with a #
1575         that is checked for before trying to parse the input as test URL. For now, just one
1576         commmand is supported, which is "#CHECK FOR WORLD LEAKS".
1577         
1578         In response to the command, the tool dumps an output block in the usual pseudo-MIME-style,
1579         with a trailing "#EOF". Future patches will add support to webkitpy to parse this output.
1580         
1581         DumpRenderTree stubs out the command, returning an empty block.
1582         
1583         WebKitTestRunner responds to the command by dumping the list of live documents, if it was
1584         run with the --check-for-world-leaks option.
1585         
1586         When run with --check-for-world-leaks, WebKitTestRunner gets the list of live documents via
1587         WKBundleGetLiveDocumentURLs() after every test (this allows it to detect the first test
1588         that leaked a document), and keeps them in a map of document identifier to test and live document URL.
1589         Then when it receives the "#CHECK FOR WORLD LEAKS" command, it calls into the bundle to
1590         clear the page and memory caches, runs a GC, then posts a task (in the Document::postTaks() sense)
1591         after which it requests the list of live documents for a final time, excluding any that are loaded
1592         in live Frames (thus omitting the about:blank that will be loaded at this point). Documents in this
1593         list are therefore leaked (or abandoned).
1594         
1595         Future patches will hook up webkitpy reporting for leaked documents.
1596
1597         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1598         (WKBundleGetLiveDocumentURLs):
1599         (WKBundleClearPageCache):
1600         (WKBundleClearMemoryCache):
1601         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1602         (WKBundlePagePostTask):
1603         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1604         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1605         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1606         (WebKit::InjectedBundle::liveDocumentURLs):
1607         * WebProcess/InjectedBundle/InjectedBundle.h:
1608
1609 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1610
1611         Fix plug-ins after r235398
1612         https://bugs.webkit.org/show_bug.cgi?id=188997
1613
1614         * UIProcess/WebPageProxy.cpp:
1615         (WebKit::WebPageProxy::findPlugin):
1616
1617 2018-08-27  Aditya Keerthi  <akeerthi@apple.com>
1618
1619         Consolidate ENABLE_INPUT_TYPE_COLOR and ENABLE_INPUT_TYPE_COLOR_POPOVER
1620         https://bugs.webkit.org/show_bug.cgi?id=188931
1621
1622         Reviewed by Wenson Hsieh.
1623
1624         A popover is the preferred interface for <input type=color> on macOS. The color
1625         panel is still accessible through a button on the popover, for fine-grained
1626         color selection. We can consolidate the two build flags, so that a popover is
1627         always displayed in the ENABLE(INPUT_TYPE_COLOR) build.
1628
1629         * Configurations/FeatureDefines.xcconfig: Removed ENABLE_INPUT_TYPE_COLOR_POPOVER.
1630         * UIProcess/WebPageProxy.cpp:
1631         (WebKit::WebPageProxy::showColorPicker):
1632         (WebKit::WebPageProxy::closeOverlayedViews):
1633         * UIProcess/mac/WebColorPickerMac.mm:
1634         (WebKit::WebColorPickerMac::WebColorPickerMac):
1635         (WebKit::WebColorPickerMac::showColorPicker):
1636
1637 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1638
1639         Pass webPageID and webFrameID to NetworkLoad for speculative loads
1640         https://bugs.webkit.org/show_bug.cgi?id=188682
1641
1642         Reviewed by Youenn Fablet.
1643
1644         This also removes an authentication shortcut I introduced in r234941
1645
1646         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1647         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1648         (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
1649         * Shared/Authentication/AuthenticationManager.cpp:
1650         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1651
1652 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1653
1654         Remove most of LoaderClient
1655         https://bugs.webkit.org/show_bug.cgi?id=188997
1656
1657         Reviewed by Tim Horton.
1658
1659         We still have a few clients using basic functionality that are transitioning to WKPageNavigationClient,
1660         but most of it can be removed.
1661
1662         * UIProcess/API/APILoaderClient.h:
1663         (API::LoaderClient::~LoaderClient):
1664         (API::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
1665         (API::LoaderClient::didFailLoadWithErrorForFrame):
1666         (API::LoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
1667         (API::LoaderClient::didReachLayoutMilestone):
1668         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
1669         (API::LoaderClient::didCommitLoadForFrame): Deleted.
1670         (API::LoaderClient::didFinishDocumentLoadForFrame): Deleted.
1671         (API::LoaderClient::didSameDocumentNavigationForFrame): Deleted.
1672         (API::LoaderClient::didReceiveTitleForFrame): Deleted.
1673         (API::LoaderClient::didFirstLayoutForFrame): Deleted.
1674         (API::LoaderClient::didDisplayInsecureContentForFrame): Deleted.
1675         (API::LoaderClient::didRunInsecureContentForFrame): Deleted.
1676         (API::LoaderClient::didDetectXSSForFrame): Deleted.
1677         (API::LoaderClient::didReceiveAuthenticationChallengeInFrame): Deleted.
1678         (API::LoaderClient::didStartProgress): Deleted.
1679         (API::LoaderClient::didChangeProgress): Deleted.
1680         (API::LoaderClient::didFinishProgress): Deleted.
1681         (API::LoaderClient::processDidBecomeUnresponsive): Deleted.
1682         (API::LoaderClient::processDidBecomeResponsive): Deleted.
1683         (API::LoaderClient::processDidCrash): Deleted.
1684         (API::LoaderClient::didChangeBackForwardList): Deleted.
1685         (API::LoaderClient::willGoToBackForwardListItem): Deleted.
1686         (API::LoaderClient::didNavigateWithNavigationData): Deleted.
1687         (API::LoaderClient::didPerformClientRedirect): Deleted.
1688         (API::LoaderClient::didPerformServerRedirect): Deleted.
1689         (API::LoaderClient::didUpdateHistoryTitle): Deleted.
1690         (API::LoaderClient::navigationGestureDidBegin): Deleted.
1691         (API::LoaderClient::navigationGestureWillEnd): Deleted.
1692         (API::LoaderClient::navigationGestureDidEnd): Deleted.
1693         (API::LoaderClient::pluginLoadPolicy): Deleted.
1694         (API::LoaderClient::didFailToInitializePlugin): Deleted.
1695         (API::LoaderClient::didBlockInsecurePluginVersion): Deleted.
1696         (API::LoaderClient::webGLLoadPolicy const): Deleted.
1697         (API::LoaderClient::resolveWebGLLoadPolicy const): Deleted.
1698         (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame): Deleted.
1699         (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame): Deleted.
1700         * UIProcess/API/C/WKPage.cpp:
1701         (WKPageSetPageLoaderClient):
1702         * UIProcess/WebPageProxy.cpp:
1703         (WebKit::WebPageProxy::didChangeBackForwardList):
1704         (WebKit::WebPageProxy::willGoToBackForwardListItem):
1705         (WebKit::WebPageProxy::didStartProgress):
1706         (WebKit::WebPageProxy::didChangeProgress):
1707         (WebKit::WebPageProxy::didFinishProgress):
1708         (WebKit::WebPageProxy::didCommitLoadForFrame):
1709         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1710         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1711         (WebKit::WebPageProxy::didReceiveTitleForFrame):
1712         (WebKit::WebPageProxy::didFirstLayoutForFrame):
1713         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
1714         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
1715         (WebKit::WebPageProxy::didDetectXSSForFrame):
1716         (WebKit::WebPageProxy::didNavigateWithNavigationData):
1717         (WebKit::WebPageProxy::didPerformClientRedirect):
1718         (WebKit::WebPageProxy::didPerformServerRedirect):
1719         (WebKit::WebPageProxy::didUpdateHistoryTitle):
1720         (WebKit::WebPageProxy::webGLPolicyForURL):
1721         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
1722         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
1723         (WebKit::WebPageProxy::processDidBecomeResponsive):
1724         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
1725         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
1726         (WebKit::WebPageProxy::navigationGestureDidBegin):
1727         (WebKit::WebPageProxy::navigationGestureWillEnd):
1728         (WebKit::WebPageProxy::navigationGestureDidEnd):
1729         * UIProcess/ios/WebPageProxyIOS.mm:
1730         (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame):
1731         (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):
1732
1733 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1734
1735         REGRESSION(r234985/r234989) WKPageLoadHTMLString with a 16-bit String has the wrong encoding
1736         https://bugs.webkit.org/show_bug.cgi?id=189002
1737
1738         Reviewed by Tim Horton.
1739
1740         * UIProcess/API/C/WKPage.cpp:
1741         (encodingOf):
1742
1743 2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1744
1745         [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory
1746         https://bugs.webkit.org/show_bug.cgi?id=188903
1747         <rdar://problem/43702993>
1748
1749         Reviewed by Tim Horton.
1750
1751         Fixes the bug by supporting NSFileWrappers of type directory, as well as NSFileWrappers with file that do not
1752         map to concrete type identifiers. Among other things, this patch ensures that:
1753         -       Inserting a directory file wrapper (or using -setFileWrapper:…: to change an existing _WKAttachment's
1754                 file wrapper to a directory) does not cause the attachment element to show "0 bytes" as the subtitle.
1755         -       In the above scenario, we also won't end up with a missing "type" attribute for the attachment element,
1756                 as well as a corresponding API::Attachment::contentType() that's an empty string.
1757         -       Dropping or pasting attachments backed by paths on disk also doesn't trigger these problems, if the path
1758                 is a directory or of unknown file type.
1759
1760         Changes are verified by 2 new API tests.
1761
1762         * UIProcess/API/APIAttachment.cpp:
1763         (API::Attachment::updateAttributes):
1764         (API::Attachment::fileSizeForDisplay const):
1765         * UIProcess/API/APIAttachment.h:
1766         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
1767         (API::Attachment::setFileWrapperAndUpdateContentType):
1768
1769         Add a helper that sets the file wrapper to the given NSFileWrapper, and either sets the content type to the
1770         given content type if it's specified, or infers it from the file extension of the new NSFileWrapper. Invoked
1771         whenever an NSFileWrapper and content type combination is set on an API attachment via WebKit SPI.
1772
1773         (API::Attachment::fileSizeForDisplay const):
1774
1775         Returns a file size to be displayed in the attachment element's subtitle. This returns an optional file size,
1776         where `std::nullopt` indicates that there should not be a file size shown. For now, this returns `std::nullopt`
1777         for directory file wrappers, though in the future, this should be done only in cases where we don't immediately
1778         have a size estimate for the file wrapper.
1779
1780         * UIProcess/API/Cocoa/WKWebView.mm:
1781         (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):
1782
1783         Use API::Attachment::setFileWrapperAndUpdateContentType() instead of trying to come up with a fallback UTI.
1784
1785         * UIProcess/API/Cocoa/_WKAttachment.mm:
1786         (-[_WKAttachment setFileWrapper:contentType:completion:]):
1787
1788         Use API::Attachment::setFileWrapperAndUpdateContentType() instead of trying to come up with a fallback UTI.
1789
1790         * UIProcess/WebPageProxy.cpp:
1791         (WebKit::WebPageProxy::insertAttachment):
1792
1793         Remove the separate arguments for file size, content type, and file name, and instead get them from the given
1794         API Attachment object.
1795
1796         (WebKit::WebPageProxy::updateAttachmentAttributes):
1797
1798         Remove separate arguments for file size, content type and file name and just take an API::Attachment instead.
1799         These separate pieces of information can simply be asked from the Attachment itself.
1800
1801         * UIProcess/WebPageProxy.h:
1802         * WebProcess/WebPage/WebPage.cpp:
1803         (WebKit::WebPage::insertAttachment):
1804         (WebKit::WebPage::updateAttachmentAttributes):
1805
1806         Adjust some interfaces here to allow the displayed file size to be optional.
1807
1808         * WebProcess/WebPage/WebPage.h:
1809         * WebProcess/WebPage/WebPage.messages.in:
1810
1811 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1812
1813         Fix internal builds after r235368
1814
1815         * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
1816         At least the ios macros need an introductory version.
1817
1818 2018-08-27  Keith Rollin  <krollin@apple.com>
1819
1820         Build system support for LTO
1821         https://bugs.webkit.org/show_bug.cgi?id=187785
1822         <rdar://problem/42353132>
1823
1824         Reviewed by Dan Bernstein.
1825
1826         Update Base.xcconfig and DebugRelease.xcconfig to optionally enable
1827         LTO.
1828
1829         * Configurations/Base.xcconfig:
1830         * Configurations/DebugRelease.xcconfig:
1831
1832 2018-08-27  Daniel Bates  <dabates@apple.com>
1833
1834         Remove extern variable and simplify state initialization in TextCheckerMac.mm
1835         https://bugs.webkit.org/show_bug.cgi?id=188820
1836
1837         Reviewed by Simon Fraser.
1838
1839         Use the same approach to initializing the TextCheckerState in TextCheckerMac.mm as we did in
1840         TextCheckerIOS.mm. Make use of a static, non-member, file-local function and NeverDestroyed
1841         to initialize a TextCheckerState object once and provide access to it from other implementation
1842         functions.
1843
1844         * UIProcess/mac/TextCheckerMac.mm:
1845         (WebKit::mutableState):
1846         (WebKit::TextChecker::state):
1847         (WebKit::TextChecker::setTestingMode):
1848         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
1849         (WebKit::TextChecker::setGrammarCheckingEnabled):
1850         (WebKit::TextChecker::setAutomaticSpellingCorrectionEnabled):
1851         (WebKit::TextChecker::setAutomaticQuoteSubstitutionEnabled):
1852         (WebKit::TextChecker::setAutomaticDashSubstitutionEnabled):
1853         (WebKit::TextChecker::setAutomaticLinkDetectionEnabled):
1854         (WebKit::TextChecker::setAutomaticTextReplacementEnabled):
1855         (WebKit::TextChecker::didChangeAutomaticTextReplacementEnabled):
1856         (WebKit::TextChecker::didChangeAutomaticSpellingCorrectionEnabled):
1857         (WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
1858         (WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
1859         (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
1860         (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
1861         (WebKit::initializeState): Deleted.
1862
1863 2018-08-27  Sihui Liu  <sihui_liu@apple.com>
1864
1865         Don't launch network process in WebCookieManagerProxy::setHTTPCookieAcceptPolicy
1866         https://bugs.webkit.org/show_bug.cgi?id=188906
1867         <rdar://problem/42875795>
1868
1869         Reviewed by Ryosuke Niwa.
1870
1871         Add callback in early return.
1872
1873         * UIProcess/WebCookieManagerProxy.cpp:
1874         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
1875
1876 2018-08-27  Alex Christensen  <achristensen@webkit.org>
1877
1878         Transition WKBrowsingContextController from WKPageLoaderClient to WKPageNavigationClient
1879         https://bugs.webkit.org/show_bug.cgi?id=188942
1880
1881         Reviewed by Andy Estes.
1882
1883         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1884         (didStartProvisionalNavigation):
1885         (didReceiveServerRedirectForProvisionalNavigation):
1886         (didFailProvisionalNavigation):
1887         (didCommitNavigation):
1888         (didFinishNavigation):
1889         (didFailNavigation):
1890         (canAuthenticateAgainstProtectionSpace):
1891         (didReceiveAuthenticationChallenge):
1892         (setUpPageLoaderClient):
1893         (-[WKBrowsingContextController setLoadDelegate:]):
1894         (didStartProvisionalLoadForFrame): Deleted.
1895         (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
1896         (didFailProvisionalLoadWithErrorForFrame): Deleted.
1897         (didCommitLoadForFrame): Deleted.
1898         (didFinishLoadForFrame): Deleted.
1899         (didFailLoadWithErrorForFrame): Deleted.
1900         (canAuthenticateAgainstProtectionSpaceInFrame): Deleted.
1901         (didReceiveAuthenticationChallengeInFrame): Deleted.
1902         (didStartProgress): Deleted.
1903         (didChangeProgress): Deleted.
1904         (didFinishProgress): Deleted.
1905         (didChangeBackForwardList): Deleted.
1906         * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
1907
1908 2018-08-26  Darin Adler  <darin@apple.com>
1909
1910         [Cocoa] Adapt more WebKit code to be ARC-compatible
1911         https://bugs.webkit.org/show_bug.cgi?id=188955
1912
1913         Reviewed by Anders Carlsson.
1914
1915         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Use __strong for an in/out argument.
1916         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1917         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
1918         Use __strong for a in/out argument.
1919         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy): Call a NSURLSessionTask
1920         method using an explicit category declaration rather than by using performSelector:
1921         since ARC is unable to correctly compile a call when it doesn't know argument and
1922         result types.
1923
1924         * PluginProcess/mac/PluginProcessMac.mm:
1925         (WebKit::initializeCocoaOverrides): Add some __bridge casts.
1926
1927         * Shared/API/Cocoa/WKRemoteObjectCoder.mm: Use HashSet<CFTypeRef> instead of
1928         HashSet<Class> since Class ia an ARC-managed type and WTF hash tables can't
1929         currently handle those as key types.
1930         (-[WKRemoteObjectDecoder decodeValueOfObjCType:at:]): Changed types and added casts
1931         to adapt to the above.
1932         (decodeObjectFromObjectStream): Ditto.
1933         (checkIfClassIsAllowed): Ditto.
1934         (decodeInvocationArguments): Ditto.
1935         (decodeObject): Ditto.
1936         (-[WKRemoteObjectDecoder decodeObjectOfClasses:forKey:]): Ditto.
1937         (-[WKRemoteObjectDecoder allowedClasses]): Ditto.
1938         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
1939         (propertyListClasses): Ditto.
1940         (initializeMethod): Ditto.
1941         (-[_WKRemoteObjectInterface debugDescription]): Ditto.
1942         (classesForSelectorArgument): Ditto.
1943         (-[_WKRemoteObjectInterface classesForSelector:argumentIndex:ofReply:]): Ditto.
1944         (-[_WKRemoteObjectInterface setClasses:forSelector:argumentIndex:ofReply:]): Ditto.
1945         (-[_WKRemoteObjectInterface _allowedArgumentClassesForSelector:]): Ditto.
1946         (-[_WKRemoteObjectInterface _allowedArgumentClassesForReplyBlockOfSelector:]): Ditto.
1947         * Shared/API/Cocoa/_WKRemoteObjectInterfaceInternal.h: Ditto.
1948
1949         * Shared/API/c/cf/WKStringCF.mm:
1950         (WKStringCreateWithCFString): Use CFRetain instead of -[NSObject retain]. Also use
1951         a __bridge cast.
1952         * Shared/API/c/cf/WKURLCF.mm:
1953         (WKURLCreateWithCFURL): Ditto.
1954
1955         * Shared/Cocoa/APIObject.mm:
1956         (API::Object::ref): Added a __bridge cast.
1957         (API::Object::deref): Ditto.
1958         (API::allocateWKObject): Use class_createInstance instead of NSAllocateObject.
1959         (API::Object::wrap): Use a __bridge cast.
1960         (API::Object::unwrap): Ditto.
1961
1962         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: Use CFTypeRef for layers
1963         or views in the RelatedLayerMap since we don't want the items retained, and can't
1964         use __unsafe_uretained because the header is used in non-Objective-C contexts.
1965         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1966         (WebKit::RemoteLayerTreePropertyApplier::applyProperties): Added __bridge casts,
1967         needed because of the above change.
1968
1969         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1970         (WebKit::browsingContextControllerMap): Use __unsafe_unretained.
1971
1972         * UIProcess/API/Cocoa/WKConnection.mm:
1973         (didReceiveMessage): Use a __bridge cast.
1974
1975         * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
1976         (-[WKContentRuleListStore compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
1977         Use a retain here so we don't have to have a "releasesArgument:" boolean. The cost of a single
1978         retain/release pair should be infinitesmal compared to the entire process of compiling.
1979         (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
1980         Moved the code for the "releases argument" version here since the private method is now the
1981         actual method that does the work. The public method now simply calls this private one after
1982         doing a retain. The optimization of releasing the argument at the correct moment should be intact.
1983
1984         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: Use CFTypeRef for the key to the _observers
1985         HashMap since the WTF collections can't yet handle ARC types for keys.
1986         (-[WKHTTPCookieStore addObserver:]): Added __bridge cast for compatibility with the above.
1987         (-[WKHTTPCookieStore removeObserver:]): Ditto.
1988
1989         * UIProcess/API/Cocoa/WKProcessGroup.mm:
1990         (setUpConnectionClient): Added a __bridge cast.
1991         (setUpHistoryClient): Ditto.
1992
1993         * UIProcess/API/Cocoa/WKViewPrivate.h: Added a declaration of the
1994         -[WKView _shouldLoadIconWithParameters:completionHandler:] method. This peculiar idiom
1995         should be removed, but I didn't bother doing that since the entire WKView class is already
1996         deprecated and so will eventually be removed.
1997
1998         * UIProcess/API/Cocoa/WKWebView.mm: Use __unsafe_unretained for the keys in the page to
1999         view map.
2000         (accessibilityEventsEnabledChangedCallback): Use a __bridge cast.
2001         (-[WKWebView _certificateChain]): Ditto.
2002         (-[WKWebView certificateChain]): Ditto.
2003
2004         * UIProcess/API/mac/WKView.mm:
2005         (-[WKView maybeInstallIconLoadingClient]): Call the method
2006         _shouldLoadIconWithParameters:completionHandler: in a normal way rather than using
2007         performSelector:withObject:withObject: since ARC is unable to correctly compile a call
2008         when it doesn't know argument and result types.
2009
2010         * UIProcess/Cocoa/NavigationState.mm:
2011         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): Use the overload
2012         of API::Data::createWithoutCopying that knows how to work with an NSData rather than
2013         re-implementing it here.
2014         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2015         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. Also removed unneeded
2016         use of RetainPtr.
2017
2018         * UIProcess/Cocoa/WebViewImpl.h: Use NSObject * as the result type of
2019         immediateActionAnimationControllerForHitTestResult. Our techniques for defining such
2020         functions in headers while remaining compatible with non-Objective-C will still work
2021         fine given how we use this, and converting to and from void* rather than NSObject *
2022         would be difficult to do correctly under ARC.
2023
2024         * UIProcess/Cocoa/WebViewImpl.mm:
2025         (WebKit::WebViewImpl::acceptsFirstMouse): Use CFRetain/CFAutorelease instead of
2026         retain/autorelease.
2027         (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent): Ditto.
2028         (WebKit::WebViewImpl::immediateActionAnimationControllerForHitTestResult):
2029         Updated return type to NSObject *.
2030         (WebKit::WebViewImpl::performKeyEquivalent): Use CFRetain/CFAutorelease.
2031
2032         * UIProcess/PageClient.h: Use NSObject * as the result type, as above.
2033
2034         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2035         (WebKit::RemoteLayerTreeHost::updateLayerTree): Use __bridge casts to be compatible
2036         with the changes to the RelatedLayerMap types.
2037         (WebKit::recursivelyMapIOSurfaceBackingStore): Use __bridge cast.
2038
2039         * Source/WebKit/UIProcess/WebPageProxy.cpp:
2040         (WebKit::WebPageProxy::immediateActionAnimationControllerForHitTestResult):
2041         Use NSObject * as the result type, as above.
2042         * Source/WebKit/UIProcess/WebPageProxy.h: Ditto.
2043
2044         * UIProcess/mac/PageClientImplMac.h: Use NSObject * as the result type, as above.
2045         * UIProcess/mac/PageClientImplMac.mm:
2046         (WebKit::PageClientImpl::immediateActionAnimationControllerForHitTestResult):
2047         Ditto.
2048         (WebKit::PageClientImpl::refView): Use __bridge cast.
2049         (WebKit::PageClientImpl::derefView): Ditto.
2050
2051         * UIProcess/mac/ServicesController.mm:
2052         (WebKit::ServicesController::refreshExistingServices): Removed unnecessary use
2053         of NeverDestroyed for Objective-C object pointers. Simpler and more efficient
2054         both with and without ARC.
2055
2056         * UIProcess/mac/WKImmediateActionController.mm:
2057         (-[WKImmediateActionController _updateImmediateActionItem]): Removed unneeded
2058         cast now that immediateActionAnimationControllerForHitTestResult has a more
2059         accurate return type.
2060
2061         * UIProcess/mac/WKPrintingView.mm:
2062         (-[WKPrintingView dealloc]): Use a more direct approach to making sure we do the
2063         non-thread-safe actions on the main thread with a call to callOnMainThread.
2064         The old solution, WebCoreObjCScheduleDeallocateOnMainThread, may not be possible
2065         in an ARC-compatible way, but this one should work fine.
2066         (linkDestinationName): Changed to return an NSString * to make sure we get the
2067         object lifetimes correct under ARC.
2068         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Added __bridge casts.
2069
2070         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.h: Use __unsafe_unretained
2071         for the value types in DOM caches.
2072         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
2073         (WebKit::toWKDOMNode): Updated for the above.
2074         (WebKit::toWKDOMRange): Ditto.
2075
2076         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2077         (WebKit::NetscapePlugin::platformPreInitialize): Rewrote the class_replaceMethod
2078         call to sidestep the rules about not using @selector(release) under ARC.
2079         (WebKit::NetscapePlugin::updatePluginLayer): Use __bridge casts.
2080
2081         * WebProcess/Plugins/PDF/PDFPlugin.mm: Added an include of
2082         WebAccessibilityObjectWrapperMac.h, without which this code doesn't compile
2083         under ARC.
2084
2085         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2086         (WebKit::changeWordCase): Use a function rather than a selector, since ARC is unable
2087         to correctly compile a method call when it doesn't know argument and result types.
2088         (WebKit::WebEditorClient::uppercaseWord): Updated to use a function rather than a selector.
2089         (WebKit::WebEditorClient::lowercaseWord): Ditto.
2090         (WebKit::WebEditorClient::capitalizeWord): Ditto.
2091
2092         * WebProcess/cocoa/WebProcessCocoa.mm: Added an include of
2093         WebAccessibilityObjectWrapperIOS/Mac.h, without which this code doesn't compile
2094         under ARC.
2095
2096 2018-08-27  Alex Christensen  <achristensen@webkit.org>
2097
2098         Fix authentication for clients of WKPageLoaderClient after r234941
2099         https://bugs.webkit.org/show_bug.cgi?id=188939
2100
2101         Reviewed by Youenn Fablet.
2102
2103         I simplified the authentication code path elegantly for clients of WKPageNavigationClient/WKNavigationDelegate,
2104         but clients of WKPageLoaderClient that do not implement didReceiveAuthenticationChallengeInFrame would hang.
2105         This fixes that.  I've also made the performDefaultHandling (when delegates are not implemented) and rejectProtectionSpaceAndContinue
2106         (when canAuthenticationAgainstProtectionSpace returns false) behave correctly.
2107
2108         * UIProcess/API/APILoaderClient.h:
2109         (API::LoaderClient::didReachLayoutMilestone):
2110         (API::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): Deleted.
2111         * UIProcess/API/C/WKPage.cpp:
2112         (WKPageSetPageLoaderClient):
2113         (WKPageSetPageNavigationClient):
2114         * UIProcess/Cocoa/NavigationState.mm:
2115         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
2116
2117 2018-08-26  Sam Weinig  <sam@webkit.org>
2118
2119         Using _WKRemoteObjectInterface with a protocol that inherits from a non-NSObject protocol crashes
2120         https://bugs.webkit.org/show_bug.cgi?id=188958
2121
2122         Reviewed by Anders Carlsson.
2123
2124         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
2125         (initializeMethods):
2126         Fix infinite recursion by using the passed in protocol rather
2127         than always using the one from the initial interface. 
2128
2129 2018-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2130
2131         [Attachment Support] Dropping and pasting images should insert inline image elements with _WKAttachments
2132         https://bugs.webkit.org/show_bug.cgi?id=188933
2133         <rdar://problem/43699724>
2134
2135         Reviewed by Darin Adler.
2136
2137         Support the ability to drop and paste images as image elements, with attachment elements, only if attachment
2138         elements are enabled. See changes below for more detail.
2139
2140         * Shared/WebCoreArgumentCoders.cpp:
2141         (IPC::ArgumentCoder<PromisedAttachmentInfo>::encode):
2142         (IPC::ArgumentCoder<PromisedAttachmentInfo>::decode):
2143
2144         Rename "filename" to "fileName", for consistency with WKContentView and WebViewImpl.
2145
2146         * UIProcess/API/APIAttachment.cpp:
2147         (API::Attachment::mimeType const):
2148         (API::Attachment::fileName const):
2149         * UIProcess/API/APIAttachment.h:
2150
2151         Push getters for MIME type, UTI, and the file name down from _WKAttachment to API::Attachment. This allows
2152         WKContentView and WebViewImpl to ask an API::Attachment questions about its UTI and file name without
2153         additionally creating a wrapper object.
2154
2155         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm: Added.
2156         (API::mimeTypeInferredFromFileExtension):
2157         (API::isDeclaredOrDynamicTypeIdentifier):
2158         (API::Attachment::mimeType const):
2159         (API::Attachment::utiType const):
2160         (API::Attachment::fileName const):
2161         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2162
2163         Add a private delegate hook to notify the UI delegate when a drop has been performed. This is used by tests to
2164         know when a drop with file promises has been processed by the page.
2165
2166         * UIProcess/API/Cocoa/WKWebView.mm:
2167         (-[WKWebView _web_didPerformDragOperation:]):
2168         * UIProcess/API/Cocoa/_WKAttachment.mm:
2169         (-[_WKAttachmentInfo initWithFileWrapper:filePath:mimeType:utiType:]):
2170         (-[_WKAttachmentInfo fileWrapper]):
2171         (-[_WKAttachmentInfo contentType]):
2172         (-[_WKAttachment info]):
2173         (-[_WKAttachmentInfo initWithFileWrapper:filePath:contentType:]): Deleted.
2174         (isDeclaredOrDynamicTypeIdentifier): Deleted.
2175         (-[_WKAttachmentInfo _typeIdentifierFromPathExtension]): Deleted.
2176         (-[_WKAttachmentInfo mimeType]): Deleted.
2177         (-[_WKAttachmentInfo utiType]): Deleted.
2178
2179         Moved to APIAttachmentCocoa.mm.
2180
2181         * UIProcess/API/mac/WKView.mm:
2182         (-[WKView _web_didPerformDragOperation:]):
2183         * UIProcess/Cocoa/WebViewImpl.h:
2184         * UIProcess/Cocoa/WebViewImpl.mm:
2185         (-[WKPromisedAttachmentContext initWithIdentifier:blobURL:fileName:]):
2186
2187         Adjust this constructor to take each piece of data separately. This is because, in the case where our
2188         PromisedAttachmentInfo contains an attachment identifier, we determine the UTI and file name from the associated
2189         file wrapper.
2190
2191         (-[WKPromisedAttachmentContext fileName]):
2192         (WebKit::WebViewImpl::fileNameForFilePromiseProvider):
2193         (WebKit::WebViewImpl::didPerformDragOperation):
2194         (WebKit::WebViewImpl::startDrag):
2195
2196         Determine UTI and file name from the attachment element corresponding to the attachment identifier when
2197         dragging. This is because the attachment element in the web process shouldn't need to have type and title
2198         attributes set when starting a drag if it already has an identifier that maps to attachment data in the UI
2199         process. An example of this is in inline images backed by attachments, for which we don't need to bother keeping
2200         specifying display attributes, since they are never visible.
2201
2202         (-[WKPromisedAttachmentContext initWithAttachmentInfo:]): Deleted.
2203         (-[WKPromisedAttachmentContext filename]): Deleted.
2204         * UIProcess/PageClient.h:
2205         (WebKit::PageClient::didPerformDragOperation):
2206         * UIProcess/WebPageProxy.cpp:
2207         (WebKit::WebPageProxy::didPerformDragOperation):
2208         * UIProcess/WebPageProxy.h:
2209         * UIProcess/WebPageProxy.messages.in:
2210
2211         Rename DidPerformDataInteractionControllerOperation to DidPerformDragOperation, and make it cross-platform (this
2212         was previously only sent on iOS). Add plumbing through PageClient and friends on macOS to notify the UI
2213         delegate when a drop is handled by the web process.
2214
2215         * UIProcess/ios/PageClientImplIOS.h:
2216         * UIProcess/ios/PageClientImplIOS.mm:
2217         (WebKit::PageClientImpl::didPerformDragOperation):
2218         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation): Deleted.
2219         * UIProcess/ios/WKContentViewInteraction.h:
2220         * UIProcess/ios/WKContentViewInteraction.mm:
2221         (-[WKContentView _didPerformDragOperation:]):
2222         (-[WKContentView _prepareToDragPromisedAttachment:]):
2223
2224         Just like in WebViewImpl::startDrag, infer content type and file name from the API attachment object.
2225
2226         (-[WKContentView _didPerformDataInteractionControllerOperation:]): Deleted.
2227         * UIProcess/ios/WebPageProxyIOS.mm:
2228         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation): Deleted.
2229         * UIProcess/mac/PageClientImplMac.h:
2230         * UIProcess/mac/PageClientImplMac.mm:
2231         (WebKit::PageClientImpl::didPerformDragOperation):
2232         * WebKit.xcodeproj/project.pbxproj:
2233         * WebProcess/WebPage/WebPage.cpp:
2234         (WebKit::WebPage::performDragControllerAction):
2235
2236 2018-08-23  Jeff Miller  <jeffm@apple.com>
2237
2238         Remove -[WKNavigationDelegate _webView:decidePolicyForPluginLoadWithCurrentPolicy:pluginInfo:unavailabilityDescription:]
2239         https://bugs.webkit.org/show_bug.cgi?id=188889
2240
2241         Reviewed by Alex Christensen.
2242
2243         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2244         Remove obsolete method.
2245
2246         * UIProcess/Cocoa/NavigationState.h:
2247         Remove obsolete flag.
2248
2249         * UIProcess/Cocoa/NavigationState.mm:
2250         (WebKit::NavigationState::setNavigationDelegate):
2251         Remove obsolete flag.
2252
2253         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
2254         Remove support for obsolete delegate method.
2255
2256 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
2257
2258         Pass in IsComposed flag to Event constructors
2259         https://bugs.webkit.org/show_bug.cgi?id=188720
2260         <rdar://problem/43580387>
2261
2262         Reviewed by Simon Fraser.
2263
2264         * WebProcess/WebPage/WebPage.cpp:
2265         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): A trusted click event is composed regardless of
2266         whether it's simulated or not.
2267
2268 2018-08-24  Alex Christensen  <achristensen@webkit.org>
2269
2270         Add WKWebView._mainFrame SPI
2271         https://bugs.webkit.org/show_bug.cgi?id=188925
2272
2273         Reviewed by Brian Burg.
2274
2275         * UIProcess/API/Cocoa/WKWebView.mm:
2276         (-[WKWebView _mainFrame]):
2277         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2278
2279 2018-08-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2280
2281         [Curl] Match the interface used in NetworkDataTask and ResourceHandle.
2282         https://bugs.webkit.org/show_bug.cgi?id=188922
2283
2284         Reviewed by Alex Christensen.
2285
2286         The interfaces for NetworkDataTask and ResourceHandle are diverged.
2287         It should be same for the same purpose because they do same thing.
2288
2289         No change in behavior.
2290
2291         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2292         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
2293         (WebKit::NetworkDataTaskCurl::createCurlRequest):
2294         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
2295         (WebKit::NetworkDataTaskCurl::restartWithCredential):
2296         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2297
2298 2018-08-24  Alex Christensen  <achristensen@webkit.org>
2299
2300         Follow up to r235323
2301         https://bugs.webkit.org/show_bug.cgi?id=188923
2302         <rdar://problem/34657861>
2303
2304         * UIProcess/API/C/mac/WKInspectorPrivateMac.h:
2305         * UIProcess/mac/WebInspectorProxyMac.mm:
2306         (-[WKWebInspectorProxyObjCAdapter inspector]):
2307         A _WKInspector * accessor in the WKWebInspectorProxyObjCAdapter is nice, too.
2308
2309 2018-08-24  Alex Christensen  <achristensen@webkit.org>
2310
2311         Introduce _WKInspector
2312         https://bugs.webkit.org/show_bug.cgi?id=188923
2313         <rdar://problem/34657861>
2314
2315         Reviewed by Brian Burg.
2316
2317         * Shared/Cocoa/APIObject.mm:
2318         (API::Object::newObject):
2319         * UIProcess/API/Cocoa/WKWebView.mm:
2320         (-[WKWebView _inspector]):
2321         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2322         * UIProcess/API/Cocoa/_WKInspector.h: Added.
2323         * UIProcess/API/Cocoa/_WKInspector.mm: Added.
2324         (-[_WKInspector webView]):
2325         (-[_WKInspector isConnected]):
2326         (-[_WKInspector isVisible]):
2327         (-[_WKInspector isFront]):
2328         (-[_WKInspector isProfilingPage]):
2329         (-[_WKInspector isElementSelectionActive]):
2330         (-[_WKInspector connect]):
2331         (-[_WKInspector show]):
2332         (-[_WKInspector hide]):
2333         (-[_WKInspector close]):
2334         (-[_WKInspector showConsole]):
2335         (-[_WKInspector showResources]):
2336         (-[_WKInspector showMainResourceForFrame:]):
2337         (-[_WKInspector attach]):
2338         (-[_WKInspector detach]):
2339         (-[_WKInspector showTimelines]):
2340         (-[_WKInspector togglePageProfiling]):
2341         (-[_WKInspector toggleElementSelection]):
2342         (-[_WKInspector printErrorToConsole:]):
2343         (-[_WKInspector _apiObject]):
2344         * UIProcess/API/Cocoa/_WKInspectorInternal.h: Added.
2345         * WebKit.xcodeproj/project.pbxproj:
2346
2347 2018-08-24  Sihui Liu  <sihui_liu@apple.com>
2348
2349         Don't launch network process in WebCookieManagerProxy::setHTTPCookieAcceptPolicy
2350         https://bugs.webkit.org/show_bug.cgi?id=188906
2351         <rdar://problem/43539661>
2352
2353         Reviewed by Geoffrey Garen.
2354
2355         In WebCookieManagerProxy::setHTTPCookieAcceptPolicy, we persist the cookieAcceptPolicy of 
2356         sharedCookieStorage. When we launch the network process later, we pass the 
2357         identifier of sharedCookieStorage to network process, so network process has the correct 
2358         cookieAcceptPolicy. Therefore, we don't have to launch the network process and send the 
2359         setting message if the network process is not launched.
2360
2361         * UIProcess/WebCookieManagerProxy.cpp:
2362         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
2363
2364 2018-08-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2365
2366         [GTK][WPE] Add API to inject/register user content in isolated worlds
2367         https://bugs.webkit.org/show_bug.cgi?id=188883
2368
2369         Reviewed by Michael Catanzaro.
2370
2371         Add new API to create user scripts/stylesheets for a given script world and to register/unregister user script
2372         messages in a given script world.
2373
2374         * UIProcess/API/glib/WebKitUserContent.cpp:
2375         (webkitUserContentWorld):
2376         (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
2377         (webkit_user_style_sheet_new):
2378         (webkit_user_style_sheet_new_for_world):
2379         (_WebKitUserScript::_WebKitUserScript):
2380         (webkit_user_script_new):
2381         (webkit_user_script_new_for_world):
2382         * UIProcess/API/glib/WebKitUserContentManager.cpp:
2383         (webkit_user_content_manager_register_script_message_handler_in_world):
2384         (webkit_user_content_manager_unregister_script_message_handler_in_world):
2385         * UIProcess/API/glib/WebKitUserContentPrivate.h:
2386         * UIProcess/API/gtk/WebKitUserContent.h:
2387         * UIProcess/API/gtk/WebKitUserContentManager.h:
2388         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2389         * UIProcess/API/wpe/WebKitUserContent.h:
2390         * UIProcess/API/wpe/WebKitUserContentManager.h:
2391         * WebProcess/UserContent/WebUserContentController.cpp:
2392         (WebKit::WebUserContentController::addUserContentWorlds):
2393
2394 2018-08-23  Tim Horton  <timothy_horton@apple.com>
2395
2396         Use unified build for UIProcess
2397         https://bugs.webkit.org/show_bug.cgi?id=185014
2398
2399         Reviewed by Alex Christensen.
2400
2401         * Sources.txt:
2402         * SourcesCocoa.txt:
2403         * UIProcess/API/APIWebsiteDataStore.h:
2404         * UIProcess/API/Cocoa/WKWebView.mm:
2405         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2406         (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
2407         * UIProcess/API/glib/IconDatabase.cpp:
2408         * UIProcess/API/gtk/PageClientImpl.cpp:
2409         * UIProcess/API/gtk/WebKitColorChooser.cpp:
2410         * UIProcess/API/gtk/WebKitPopupMenu.cpp:
2411         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2412         * UIProcess/ApplicationStateTracker.mm:
2413         * UIProcess/Authentication/mac/WebCredentialMac.mm:
2414         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
2415         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
2416         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2417         * UIProcess/Cocoa/NavigationState.mm:
2418         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2419         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2420         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2421         * UIProcess/Cocoa/ViewGestureController.cpp:
2422         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2423         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
2424         (-[WKWebViewContentProviderRegistry addPage:]):
2425         (-[WKWebViewContentProviderRegistry removePage:]):
2426         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2427         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2428         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2429         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
2430         * UIProcess/Cocoa/WebViewImpl.mm:
2431         (-[WKTextTouchBarItemController itemForIdentifier:]):
2432         (WebKit::WebViewImpl::performDragOperation):
2433         * UIProcess/Downloads/DownloadProxy.cpp:
2434         * UIProcess/DrawingAreaProxy.cpp:
2435         * UIProcess/Gamepad/UIGamepad.cpp:
2436         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2437         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
2438         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
2439         * UIProcess/Network/NetworkProcessProxy.cpp:
2440         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2441         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
2442         * UIProcess/Plugins/PluginInfoStore.cpp:
2443         * UIProcess/Plugins/PluginProcessProxy.cpp:
2444         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2445         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2446         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2447         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2448         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm:
2449         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2450         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2451         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2452         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2453         * UIProcess/RemoteWebInspectorProxy.cpp:
2454         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
2455         * UIProcess/ServiceWorkerProcessProxy.cpp:
2456         * UIProcess/Storage/StorageProcessProxy.cpp:
2457         * UIProcess/SuspendedPageProxy.cpp:
2458         * UIProcess/TextCheckerCompletion.cpp:
2459         * UIProcess/UIMessagePortChannelProvider.cpp:
2460         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2461         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2462         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2463         * UIProcess/VisitedLinkStore.cpp:
2464         * UIProcess/WKInspectorHighlightView.mm:
2465         (findIntersectionOnLineBetweenPoints):
2466         (quadIntersection):
2467         (layerPathWithHole):
2468         (layerPath):
2469         (-[WKInspectorHighlightView _layoutForNodeHighlight:offset:]):
2470         (-[WKInspectorHighlightView _layoutForNodeListHighlight:]):
2471         (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
2472         (-[WKInspectorHighlightView update:]):
2473         * UIProcess/WebBackForwardList.cpp:
2474         * UIProcess/WebContextMenuListenerProxy.cpp:
2475         * UIProcess/WebCookieManagerProxy.cpp:
2476         * UIProcess/WebEditCommandProxy.cpp:
2477         * UIProcess/WebFrameProxy.cpp:
2478         * UIProcess/WebFullScreenManagerProxy.cpp:
2479         * UIProcess/WebInspectorProxy.cpp:
2480         * UIProcess/WebNavigationState.cpp:
2481         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2482         * UIProcess/WebPageInjectedBundleClient.cpp:
2483         * UIProcess/WebPageProxy.cpp:
2484         * UIProcess/WebProcessPool.cpp:
2485         * UIProcess/WebProcessProxy.cpp:
2486         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2487         * UIProcess/WebURLSchemeHandler.cpp:
2488         * UIProcess/WebURLSchemeTask.cpp:
2489         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2490         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2491         * UIProcess/ios/DragDropInteractionState.mm:
2492         * UIProcess/ios/InputViewUpdateDeferrer.mm:
2493         * UIProcess/ios/PageClientImplIOS.mm:
2494         (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
2495         (-[WKEditCommandObjC command]):
2496         * UIProcess/ios/SmartMagnificationController.mm:
2497         * UIProcess/ios/TextCheckerIOS.mm:
2498         * UIProcess/ios/ViewGestureControllerIOS.mm:
2499         (WebKit::ViewGestureController::beginSwipeGesture):
2500         (WebKit::ViewGestureController::removeSwipeSnapshot):
2501         * UIProcess/ios/WKActionSheetAssistant.mm:
2502         (presentationStyleForView):
2503         * UIProcess/ios/WKApplicationStateTrackingView.mm:
2504         (-[WKApplicationStateTrackingView initWithFrame:webView:]):
2505         (-[WKApplicationStateTrackingView _applicationDidEnterBackground]):
2506         (-[WKApplicationStateTrackingView _applicationDidFinishSnapshottingAfterEnteringBackground]):
2507         (-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
2508         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2509         (-[WKGeolocationProviderIOS _startUpdating]):
2510         (-[WKGeolocationProviderIOS _stopUpdating]):
2511         (-[WKGeolocationProviderIOS _setEnableHighAccuracy:]):
2512         (-[WKGeolocationProviderIOS init]):
2513         (-[WKGeolocationProviderIOS initWithProcessPool:]):
2514         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:completionHandler:view:]):
2515         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2516         (-[WKLegacyCoreLocationProvider positionChanged:]):
2517         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2518         (-[WKKeyboardScrollingAnimator _scrollOffsetForEvent:]):
2519         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
2520         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
2521         (-[WKKeyboardScrollingAnimator startAnimatedScroll]):
2522         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
2523         * UIProcess/ios/WKLegacyPDFView.mm:
2524         * UIProcess/ios/WKPDFView.mm:
2525         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2526         * UIProcess/ios/WKScrollView.mm:
2527         (-[WKScrollView _systemContentInset]):
2528         * UIProcess/ios/WKSystemPreviewView.mm:
2529         * UIProcess/ios/WebPageProxyIOS.mm:
2530         * UIProcess/mac/CorrectionPanel.mm:
2531         (correctionIndicatorType):
2532         * UIProcess/mac/PageClientImplMac.mm:
2533         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
2534         (-[WKRemoteWebInspectorProxyObjCAdapter initWithRemoteWebInspectorProxy:]):
2535         * UIProcess/mac/TextCheckerMac.mm:
2536         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2537         * UIProcess/mac/ViewGestureControllerMac.mm:
2538         * UIProcess/mac/ViewSnapshotStore.mm:
2539         * UIProcess/mac/WKFullKeyboardAccessWatcher.mm:
2540         (-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
2541         * UIProcess/mac/WKFullScreenWindowController.mm:
2542         (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
2543         (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
2544         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
2545         (-[WKFullScreenWindowController enterFullScreen:]):
2546         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
2547         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2548         (-[WKFullScreenWindowController windowDidEnterFullScreen:]):
2549         (-[WKFullScreenWindowController windowDidExitFullScreen:]):
2550         (-[WKFullScreenWindowController _manager]):
2551         (-[WKFullScreenWindowController _replaceView:with:]):
2552         (zoomAnimation):
2553         (createMask):
2554         (maskAnimation):
2555         * UIProcess/mac/WKImmediateActionController.mm:
2556         (-[WKImmediateActionController initWithPage:view:viewImpl:recognizer:]):
2557         (-[WKImmediateActionController willDestroyView:]):
2558         (-[WKImmediateActionController _clearImmediateActionState]):
2559         (-[WKImmediateActionController didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
2560         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
2561         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2562         (-[WKImmediateActionController _webHitTestResult]):
2563         (-[WKImmediateActionController _defaultAnimationController]):
2564         (-[WKImmediateActionController menuItem:maxSizeForPoint:]):
2565         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
2566         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
2567         (-[WKImmediateActionController _animationControllerForText]):
2568         * UIProcess/mac/WKInspectorViewController.mm:
2569         (-[WKInspectorViewController initWithInspectedPage:]):
2570         (-[WKInspectorViewController webView]):
2571         (-[WKInspectorViewController configuration]):
2572         (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
2573         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
2574         (-[WKInspectorViewController inspectorWKWebViewReload:]):
2575         * UIProcess/mac/WKPrintingView.mm:
2576         (-[WKPrintingView _expectedPreviewCallbackForRect:]):
2577         (pageDidDrawToImage):
2578         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
2579         (pageDidComputePageRects):
2580         (-[WKPrintingView _askPageToComputePageRects]):
2581         (-[WKPrintingView _pageForRect:]):
2582         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
2583         (-[WKPrintingView _drawPreview:]):
2584         (-[WKPrintingView drawRect:]):
2585         (-[WKPrintingView rectForPage:]):
2586         * UIProcess/mac/WKTextFinderClient.mm:
2587         (-[WKTextFinderClient initWithPage:view:]):
2588         (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
2589         (-[WKTextFinderClient getSelectedText:]):
2590         (arrayFromRects):
2591         (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]):
2592         (-[WKTextFinderClient didGetImageForMatchResult:]):
2593         * UIProcess/mac/WKTextInputWindowController.mm:
2594         * UIProcess/mac/WKViewLayoutStrategy.mm:
2595         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:viewImpl:mode:]):
2596         (-[WKViewLayoutStrategy initWithPage:view:viewImpl:mode:]):
2597         (-[WKViewViewSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
2598         (-[WKViewFixedSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
2599         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:viewImpl:mode:]):
2600         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
2601         * UIProcess/mac/WebColorPickerMac.mm:
2602         * UIProcess/mac/WebContextMenuProxyMac.mm:
2603         (-[WKMenuTarget forwardContextMenuAction:]):
2604         (WebKit::menuItemIdentifier):
2605         (WebKit::WebContextMenuProxyMac::createContextMenuItem):
2606         * UIProcess/mac/WebInspectorProxyMac.mm:
2607         (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]):
2608         * UIProcess/mac/WebPageProxyMac.mm:
2609         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2610         * UIProcess/win/PageClientImpl.cpp:
2611         * UIProcess/win/TextCheckerWin.cpp:
2612         * UIProcess/win/WebContextMenuProxyWin.cpp:
2613         * UIProcess/win/WebPopupMenuProxyWin.cpp:
2614         * UIProcess/win/WebView.cpp:
2615         * UIProcess/wpe/TextCheckerWPE.cpp:
2616         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
2617         * WebKit.xcodeproj/project.pbxproj:
2618
2619 2018-08-23  Sihui Liu  <sihui_liu@apple.com>
2620
2621         Move legacy directory configuration from WebProcessPool to API::WebsiteDataStore
2622         https://bugs.webkit.org/show_bug.cgi?id=188765
2623         <rdar://problem/43633183>
2624
2625         Reviewed by Geoffrey Garen.
2626
2627         Diretories are parameters of websiteDataStore instead of webProcessPool, so we should move
2628         legacy default paths to API::WebsiteDataStore, which already stores default paths for 
2629         non-legacy cases.
2630
2631         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2632         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2633         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2634         * UIProcess/API/APIWebsiteDataStore.cpp:
2635         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
2636         * UIProcess/API/APIWebsiteDataStore.h:
2637         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2638         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
2639         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
2640         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
2641         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
2642         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
2643         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
2644         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
2645         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
2646         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2647         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
2648         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
2649         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
2650         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
2651         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
2652         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
2653         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
2654         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
2655         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
2656         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
2657         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
2658         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
2659         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
2660         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
2661         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
2662         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
2663         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
2664         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2665         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
2666         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
2667         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
2668         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
2669         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
2670         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
2671         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
2672         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
2673         * UIProcess/WebProcessPool.h:
2674         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2675         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
2676         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
2677         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
2678         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
2679         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
2680         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
2681         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
2682         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
2683         * UIProcess/win/WebProcessPoolWin.cpp:
2684         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
2685         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
2686         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
2687         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
2688         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
2689         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
2690         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
2691         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
2692         * UIProcess/wpe/WebProcessPoolWPE.cpp:
2693         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
2694         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
2695         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
2696         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
2697         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
2698         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
2699         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
2700         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
2701
2702 2018-08-23  Alex Christensen  <achristensen@webkit.org>
2703
2704         Add new _webViewRequestPointerLock SPI with a completionHandler
2705         https://bugs.webkit.org/show_bug.cgi?id=188907
2706         <rdar://problem/35871109>
2707
2708         Reviewed by Andy Estes.
2709
2710         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2711         * UIProcess/Cocoa/UIDelegate.h:
2712         * UIProcess/Cocoa/UIDelegate.mm:
2713         (WebKit::UIDelegate::setDelegate):
2714         (WebKit::UIDelegate::UIClient::requestPointerLock):
2715
2716 2018-08-23  Andy Estes  <aestes@apple.com>
2717
2718         [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
2719         https://bugs.webkit.org/show_bug.cgi?id=188829
2720
2721         Reviewed by Tim Horton.
2722
2723         * Configurations/FeatureDefines.xcconfig:
2724         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2725         (WebKit::WebPaymentCoordinator::supportsVersion):
2726
2727 2018-08-23  Ryan Haddad  <ryanhaddad@apple.com>
2728
2729         Unreviewed, rolling out r234942.
2730
2731         Caused page loading issues in iTunes
2732
2733         Reverted changeset:
2734
2735         "Transition more WKWebViewConfiguration ivars to
2736         API::PageConfiguration values"
2737         https://bugs.webkit.org/show_bug.cgi?id=188663
2738         https://trac.webkit.org/changeset/234942
2739
2740 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
2741
2742         [iOS] Support the inputmode attribute on contenteditable elements
2743         https://bugs.webkit.org/show_bug.cgi?id=188878
2744
2745         Reviewed by Ryosuke Niwa.
2746
2747         Ensured that the assistedNodeInformation for a contenteditable element reflects
2748         the value of the element's inputmode attribute.
2749
2750         Moved logic to obtain the InputMode from the attribute value into WebCore.
2751
2752         * Shared/AssistedNodeInformation.h:
2753         * UIProcess/ios/WKContentViewInteraction.mm:
2754         * WebProcess/WebPage/ios/WebPageIOS.mm:
2755         (WebKit::WebPage::getAssistedNodeInformation):
2756
2757 2018-08-22  Ryosuke Niwa  <rniwa@webkit.org>
2758
2759         Assert in NetworkBlobRegistry::unregisterBlobURL after network process had terminated
2760         https://bugs.webkit.org/show_bug.cgi?id=188880
2761
2762         Reviewed by Saam Barati.
2763
2764         Removed the debug assertion. WebContent process might be asking this network process
2765         to unregister a blob registered from another network processs which had since crashed.
2766
2767         We could keep track of which blob had been registered with which network process
2768         in WebContent process and avoid sending IPC to the network process but that's a lot of
2769         house-keeping for virtually no benefit other than not hitting this assertion.
2770
2771         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2772         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
2773
2774 2018-08-23  Sihui Liu  <sihui_liu@apple.com>
2775
2776         Remove keys of defaults that are no longer used in webProcessPool
2777         https://bugs.webkit.org/show_bug.cgi?id=188855
2778
2779         Reviewed by Alex Christensen.
2780
2781         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2782         (WebKit::registerUserDefaultsIfNeeded):
2783
2784 2018-08-23  Dan Bernstein  <mitz@apple.com>
2785
2786         [Cocoa] First scroll gesture in pinned, non-rubber-banding WKWebView may fail to initiate back/forward swipe
2787         https://bugs.webkit.org/show_bug.cgi?id=188894
2788         <rdar://problem/43651434>
2789
2790         Reviewed by Tim Horton.
2791
2792         * WebProcess/WebPage/EventDispatcher.cpp:
2793         (WebKit::EventDispatcher::wheelEvent): Set the rubber-band state on the ScrollingTree
2794           synchronously rather than dispatching doing that to the scrolling thread. This is safe to
2795           do because ScrollingTree synchrnoizes access to the rubber-band state with an internal
2796           mutex.
2797
2798 2018-08-23  Youenn Fablet  <youenn@apple.com>
2799
2800         self.isSecureContext undefined in Service Worker
2801         https://bugs.webkit.org/show_bug.cgi?id=188842
2802
2803         Reviewed by Alex Christensen.
2804
2805         Enable isSecureContext runtime flag.
2806
2807         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2808         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
2809
2810 2018-08-23  Commit Queue  <commit-queue@webkit.org>
2811
2812         Unreviewed, rolling out r235216.
2813         https://bugs.webkit.org/show_bug.cgi?id=188887
2814
2815         Caused 50+ Layout Tests to Crash and 173 api Failures on Debug
2816         builds (Requested by Truitt on #webkit).
2817
2818         Reverted changeset:
2819
2820         "Move legacy directory configuration from WebProcessPool to
2821         API::WebsiteDataStore"
2822         https://bugs.webkit.org/show_bug.cgi?id=188765
2823         https://trac.webkit.org/changeset/235216
2824
2825 2018-08-23  Zan Dobersek  <zdobersek@igalia.com>
2826
2827         [CoordGraphics] Remove the remaining CoordinatedGraphicsLayerState cruft
2828         https://bugs.webkit.org/show_bug.cgi?id=188881
2829
2830         Reviewed by Carlos Garcia Campos.
2831
2832         Rid CompositingCoordinator class of code that manages now-deleted state
2833         tracking of layer creation, update and removal on the
2834         CoordinatedGraphicsState class. The syncLayerState() method is changed
2835         accordingly, now only enforcing a frame synchronization when called.
2836
2837         Use of Nicosia::PlatformLayer::LayerID is adopted since the
2838         CoordinatedLayerID type has been removed.
2839
2840         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2841         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
2842         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2843         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2844         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
2845         (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
2846         (WebKit::CompositingCoordinator::syncLayerState):
2847         (WebKit::CompositingCoordinator::createGraphicsLayer):
2848         (WebKit::CompositingCoordinator::detachLayer):
2849         (WebKit::CompositingCoordinator::attachLayer):
2850         (WebKit::CompositingCoordinator::clearPendingStateChanges): Deleted.
2851         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2852
2853 2018-08-22  Antti Koivisto  <antti@apple.com>
2854
2855         NetworkCache::Storage::lastStableVersion should be a developer-only feature
2856         https://bugs.webkit.org/show_bug.cgi?id=188843
2857         <rdar://problem/43574100>
2858
2859         Reviewed by Geoffrey Garen.
2860
2861         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2862         (WebKit::NetworkCache::Storage::deleteOldVersions):
2863
2864         Delete old cache versions unconditionally if we are system WebKit.
2865
2866         * Shared/ChildProcess.h:
2867         * Shared/mac/ChildProcessMac.mm:
2868         (WebKit::ChildProcess::isSystemWebKit):
2869
2870         Find out if WebKit is installed under '/System/'.
2871
2872 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
2873
2874         [CoordGraphics] Remove CoordinatedImageBacking and related functionality
2875         https://bugs.webkit.org/show_bug.cgi?id=188847
2876
2877         Reviewed by Michael Catanzaro.
2878
2879         Remove the CoordinatedImageBacking class and its intertwining use in the
2880         CoordinatedGraphics system.
2881
2882         Drop the CoordinatedImageBacking object management from the
2883         CompositingCoordinator class, along with the
2884         CoordinatedImageBacking::Client inheritance. The corresponding image
2885         backing state management on the CoordinatedGraphicsState class can be
2886         removed accordingly.
2887
2888         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2889         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
2890         (WebKit::CompositingCoordinator::clearPendingStateChanges):
2891         (WebKit::CompositingCoordinator::purgeBackingStores):
2892         (WebKit::CompositingCoordinator::createImageBackingIfNeeded): Deleted.
2893         (WebKit::CompositingCoordinator::createImageBacking): Deleted.
2894         (WebKit::CompositingCoordinator::updateImageBacking): Deleted.
2895         (WebKit::CompositingCoordinator::clearImageBackingContents): Deleted.
2896         (WebKit::CompositingCoordinator::removeImageBacking): Deleted.
2897         (WebKit::CompositingCoordinator::flushPendingImageBackingChanges): Deleted.
2898         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2899
2900 2018-08-22  Sihui Liu  <sihui_liu@apple.com>
2901
2902         Move legacy directory configuration from WebProcessPool to API::WebsiteDataStore
2903         https://bugs.webkit.org/show_bug.cgi?id=188765
2904
2905         Reviewed by Geoffrey Garen.
2906
2907         Diretories are parameters of websiteDataStore instead of webProcessPool, so we should move
2908         legacy default paths to API::WebsiteDataStore, which already stores default paths for 
2909         non-legacy cases.
2910
2911         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2912         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2913         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2914         * UIProcess/API/APIWebsiteDataStore.cpp:
2915         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
2916         * UIProcess/API/APIWebsiteDataStore.h:
2917         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2918         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
2919         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
2920         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
2921         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
2922         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
2923         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
2924         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
2925         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
2926         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2927         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
2928         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
2929         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
2930         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
2931         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
2932         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
2933         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
2934         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
2935         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
2936         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
2937         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
2938         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
2939         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
2940         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
2941         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
2942         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
2943         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
2944         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2945         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
2946         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
2947         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
2948         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
2949         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
2950         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
2951         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
2952         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
2953         * UIProcess/WebProcessPool.h:
2954         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2955         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
2956         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
2957         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
2958         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
2959         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
2960         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
2961         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
2962         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
2963         * UIProcess/win/WebProcessPoolWin.cpp:
2964         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
2965         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
2966         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
2967         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
2968         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
2969         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
2970         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
2971         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
2972         * UIProcess/wpe/WebProcessPoolWPE.cpp:
2973         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
2974         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
2975         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
2976         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
2977         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
2978         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
2979         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
2980         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
2981
2982 2018-08-22  John Wilander  <wilander@apple.com>
2983
2984         The Storage Access API prompt should show the eTLD+1s, not the full host names
2985         https://bugs.webkit.org/show_bug.cgi?id=188830
2986         <rdar://problem/43380645>
2987
2988         Reviewed by Brent Fulgham.
2989
2990         * UIProcess/WebPageProxy.cpp:
2991         (WebKit::WebPageProxy::requestStorageAccess):
2992
2993 2018-08-22  Tim Horton  <timothy_horton@apple.com>
2994
2995         De-unify WebPage
2996         https://bugs.webkit.org/show_bug.cgi?id=188865
2997
2998         Reviewed by Wenson Hsieh.
2999
3000         * Sources.txt:
3001         * WebKit.xcodeproj/project.pbxproj:
3002         WebPage being unified is causing mysterious build issues inside Carbon headers
3003         on High Sierra only. Also, WebPage by itself takes longer to build than
3004         most full unified source files, so it might not make sense to unify it
3005         with others (to maximize parallelism).
3006
3007 2018-08-22  David Fenton  <david_fenton@apple.com>
3008
3009         Unreviewed, rolling out r235204.
3010
3011         reverting previous rollout
3012
3013         Reverted changeset:
3014
3015         "Unreviewed, rolling out r235176."
3016         https://bugs.webkit.org/show_bug.cgi?id=185015
3017         https://trac.webkit.org/changeset/235204
3018
3019 2018-08-22  David Fenton  <david_fenton@apple.com>
3020
3021         Unreviewed, rolling out r235176.
3022
3023         broke internal builds
3024
3025         Reverted changeset:
3026
3027         "Use unified build for WebProcess"
3028         https://bugs.webkit.org/show_bug.cgi?id=185015
3029         https://trac.webkit.org/changeset/235176
3030
3031 2018-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3032
3033         [Attachment Support] Support dragging attachment elements out as files on macOS
3034         https://bugs.webkit.org/show_bug.cgi?id=181294
3035         <rdar://problem/36298801>
3036
3037         Reviewed by Tim Horton.
3038
3039         Add support for dragging attachment elements on macOS by writing promised files to drag pasteboard. See changes
3040         below for more details.
3041
3042         * UIProcess/API/Cocoa/WKWebView.mm:
3043         (-[WKWebView filePromiseProvider:fileNameForType:]):
3044         (-[WKWebView filePromiseProvider:writePromiseToURL:completionHandler:]):
3045         (-[WKWebView draggingSession:sourceOperationMaskForDraggingContext:]):
3046         (-[WKWebView draggingSession:endedAtPoint:operation:]):
3047         * UIProcess/API/mac/WKView.mm:
3048         (-[WKView filePromiseProvider:fileNameForType:]):
3049         (-[WKView filePromiseProvider:writePromiseToURL:completionHandler:]):
3050         (-[WKView draggingSession:sourceOperationMaskForDraggingContext:]):
3051         (-[WKView draggingSession:endedAtPoint:operation:]):
3052
3053         Plumb NSFilePromiseProviderDelegate and NSDraggingSource method implementations to WebViewImpl.
3054
3055         * UIProcess/Cocoa/WebViewImpl.h:
3056         * UIProcess/Cocoa/WebViewImpl.mm:
3057         (-[WKPromisedAttachmentContext initWithAttachmentInfo:]):
3058         (-[WKPromisedAttachmentContext blobURL]):
3059         (-[WKPromisedAttachmentContext filename]):
3060         (-[WKPromisedAttachmentContext attachmentIdentifier]):
3061
3062         Add an object that contains the information needed to deliver a dragged attachment element's data via
3063         NSFilePromiseProvider. This is stored as the userInfo of the NSFilePromiseProvider created upon drag start.
3064
3065         (WebKit::WebViewImpl::draggedImage):
3066         (WebKit::WebViewImpl::sendDragEndToPage):
3067
3068         Add a helper method to handle cleanup after the dragging has finished, and call it from -draggedImage:… and
3069         -draggingSessionEnded:…. The latter is only triggered in the where -beginDraggingSessionWithItems:… is used,
3070         which currently only happens when dragging attachment elements.
3071
3072         (WebKit::WebViewImpl::fileNameForFilePromiseProvider):
3073         (WebKit::webKitUnknownError):
3074         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
3075
3076         Deliver either NSFileWrapper data to the destination URL (in the case where an attachment identifier is known
3077         and the corresponding API::Attachment is backed by a file wrapper), or save the contents of the blob URL to the
3078         destination.
3079
3080         (WebKit::WebViewImpl::dragSourceOperationMask):
3081         (WebKit::WebViewImpl::draggingSessionEnded):
3082         (WebKit::WebViewImpl::startDrag):
3083
3084 2018-08-22  Aditya Keerthi  <akeerthi@apple.com>
3085
3086         [iOS] Add support for the inputmode attribute
3087         https://bugs.webkit.org/show_bug.cgi?id=183621
3088
3089         Reviewed by Tim Horton.
3090
3091         The inputmode attribute specifies which input mechanism would be most helpful for
3092         users entering content in textfield inputs and textareas. This patch adds support
3093         for seven values: text, tel, url, email, numeric, decimal and search.
3094
3095         On iOS, we can specify UIKeyboardTypes that best match the supplied inputmode.
3096         - text: UIKeyboardTypeDefault
3097         - tel: UIKeyboardTypePhonePad
3098         - url: UIKeyboardTypeURL
3099         - email: UIKeyboardTypeEmailAddress
3100         - numeric: UIKeyboardTypeNumbersAndPunctuation
3101         - decimal: UIKeyboardTypeDecimalPad
3102         - search: UIKeyboardTypeWebSearch
3103
3104         In the case that the inputmode attribute is not specified, we fall back to using
3105         our existing heuristic to determine what kind of keyboard to show for textfields.
3106
3107         * Shared/AssistedNodeInformation.cpp:
3108         (WebKit::AssistedNodeInformation::encode const):
3109         (WebKit::AssistedNodeInformation::decode):
3110         * Shared/AssistedNodeInformation.h: Added inputMode field.
3111         * UIProcess/ios/WKContentViewInteraction.mm:
3112         (-[WKContentView textInputTraits]):
3113         * WebProcess/WebPage/ios/WebPageIOS.mm:
3114         (WebKit::inputModeForElement):
3115         (WebKit::WebPage::getAssistedNodeInformation):
3116
3117 2018-08-22  Jeff Miller  <jeffm@apple.com>
3118
3119         WKNavigationDelegate needs to allow clients to specify a custom blocked plug-in message
3120         https://bugs.webkit.org/show_bug.cgi?id=188764
3121
3122         Reviewed by Alex Christensen.
3123
3124         Add a new private WKNavigationDelegate method that takes a completion handler so clients can return
3125         a custom unavailability description in addition to the policy. Change WebPageProxy::findPlugin() to
3126         send a delayed reply and API::LoaderClient::pluginLoadPolicy()/API::NavigationClient::decidePolicyForPluginLoad()
3127         to take a completion handler to support this.
3128     
3129         * UIProcess/API/APILoaderClient.h:
3130         (API::LoaderClient::pluginLoadPolicy):
3131         Changed to take a completion handler. The default implementation doesn't return a custom
3132         unavailability description.
3133
3134         * UIProcess/API/APINavigationClient.h:
3135         (API::NavigationClient::decidePolicyForPluginLoad):
3136         Ditto.
3137
3138         * UIProcess/API/C/WKPage.cpp:
3139         (WKPageSetPageLoaderClient):
3140         Changed pluginLoadPolicy() to take a completion handler.
3141
3142         (WKPageSetPageNavigationClient):
3143         Changed decidePolicyForPluginLoad() to take a completion handler.
3144
3145         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3146         Add alternate version of -decidePolicyForPluginLoadWithCurrentPolicy: that allows clients to return
3147         the unavailibility description.
3148     
3149         * UIProcess/Cocoa/NavigationState.h:
3150         Add flag for new delegate method.
3151         Changed decidePolicyForPluginLoad() to take a completion handler.
3152     
3153         * UIProcess/Cocoa/NavigationState.mm:
3154         (WebKit::NavigationState::setNavigationDelegate):
3155         Calculate flag for new delegate method.
3156     
3157         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
3158         Changed to take a completion handler.
3159         Prefer new delegate method, if available.
3160     
3161         * UIProcess/WebPageProxy.cpp:
3162         (WebKit::WebPageProxy::findPlugin):
3163         Changed to send a delayed reply.
3164         Refactored some code into a lambda so it can be shared when using m_navigationClient->decidePolicyForPluginLoad().
3165         Removed unneeded UNUSED_PARAM() macros.
3166     
3167         * UIProcess/WebPageProxy.h:
3168         Changed findPlugin() to send a delayed reply.
3169     
3170         * UIProcess/WebPageProxy.messages.in:
3171         Ditto.
3172
3173 2018-08-22  Sihui Liu  <sihui_liu@apple.com>
3174
3175         Try removing defaultSessionParameters from NetworkProcessCreationParameters
3176         https://bugs.webkit.org/show_bug.cgi?id=188831
3177
3178         Reviewed by Alex Christensen.
3179
3180         * NetworkProcess/NetworkProcess.cpp:
3181         (WebKit::NetworkProcess::initializeNetworkProcess):
3182         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3183         (WebKit::NetworkProcessCreationParameters::encode const):
3184         (WebKit::NetworkProcessCreationParameters::decode):
3185         * NetworkProcess/NetworkProcessCreationParameters.h:
3186         * UIProcess/WebProcessPool.cpp:
3187         (WebKit::WebProcessPool::ensureNetworkProcess):
3188
3189 2018-08-22  Tim Horton  <timothy_horton@apple.com>
3190
3191         Use unified build for WebProcess
3192         https://bugs.webkit.org/show_bug.cgi?id=185015
3193
3194         Reviewed by Alex Christensen.
3195
3196         * Sources.txt:
3197         * SourcesCocoa.txt:
3198         * UIProcess/WebPageProxy.h:
3199         * WebKit.xcodeproj/project.pbxproj:
3200         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3201         * WebProcess/Databases/WebDatabaseProvider.cpp:
3202         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
3203         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3204         * WebProcess/FullScreen/WebFullScreenManager.cpp:
3205         * WebProcess/Gamepad/WebGamepadProvider.cpp:
3206         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
3207         * WebProcess/Geolocation/WebGeolocationManager.cpp:
3208         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
3209         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
3210         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
3211         * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp:
3212         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3213         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3214         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3215         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
3216         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
3217         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp:
3218         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
3219         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
3220         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3221         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
3222         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
3223         * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp:
3224         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3225         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
3226         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
3227         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
3228         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
3229         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
3230         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3231         * WebProcess/Network/NetworkProcessConnection.cpp:
3232         * WebProcess/Network/WebLoaderStrategy.cpp:
3233         * WebProcess/Network/WebResourceLoader.cpp:
3234         * WebProcess/Network/WebSocketProvider.cpp:
3235         * WebProcess/Network/WebSocketStream.cpp:
3236         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3237         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
3238         * WebProcess/Network/webrtc/LibWebRTCResolver.h:
3239         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
3240         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
3241         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
3242         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
3243         * WebProcess/Network/webrtc/WebRTCMonitor.h:
3244         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
3245         * WebProcess/Notifications/WebNotificationManager.cpp:
3246         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3247         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3248         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3249         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3250         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3251         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3252         * WebProcess/Plugins/Netscape/NetscapePluginNone.cpp:
3253         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
3254         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3255         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3256         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
3257         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
3258         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
3259         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
3260         * WebProcess/Plugins/Plugin.cpp:
3261         * WebProcess/Plugins/PluginProcessConnection.cpp:
3262         * WebProcess/Plugins/PluginProxy.cpp:
3263         * WebProcess/Plugins/PluginView.cpp:
3264         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3265         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3266         * WebProcess/Storage/WebSWClientConnection.cpp:
3267         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3268         * WebProcess/Storage/WebSWOriginTable.cpp:
3269         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
3270         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3271         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3272         * WebProcess/UserContent/WebUserContentController.cpp:
3273         * WebProcess/WebConnectionToUIProcess.cpp:
3274         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3275         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3276         * WebProcess/WebCoreSupport/WebColorChooser.cpp:
3277         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3278         * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
3279         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3280         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3281         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3282         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3283         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
3284         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3285         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
3286         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
3287         * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp:
3288         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3289         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
3290         * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
3291         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
3292         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
3293         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
3294         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3295         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3296         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
3297         * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
3298         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
3299         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3300         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3301         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3302         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
3303         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
3304         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp:
3305         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
3306         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
3307         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
3308         * WebProcess/WebPage/DrawingArea.cpp:
3309         * WebProcess/WebPage/EventDispatcher.cpp:
3310         * WebProcess/WebPage/FindController.cpp:
3311         * WebProcess/WebPage/LayerTreeHost.cpp:
3312         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
3313         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
3314         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
3315         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp:
3316         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
3317         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
3318         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3319         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
3320         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
3321         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3322         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3323         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3324         * WebProcess/WebPage/WebContextMenu.cpp:
3325         * WebProcess/WebPage/WebDocumentLoader.cpp:
3326         * WebProcess/WebPage/WebFrame.cpp:
3327         * WebProcess/WebPage/WebInspector.cpp:
3328         * WebProcess/WebPage/WebInspectorUI.cpp:
3329         * WebProcess/WebPage/WebPage.cpp:
3330         * WebProcess/WebPage/WebPageOverlay.cpp:
3331         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
3332         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
3333         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3334         * WebProcess/WebPage/ios/WebPageIOS.mm:
3335         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
3336         * WebProcess/WebPage/mac/PageBannerMac.mm:
3337         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3338         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3339         * WebProcess/WebPage/mac/WebPageMac.mm:
3340         * WebProcess/WebPage/win/WebPageWin.cpp:
3341         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
3342         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
3343         * WebProcess/WebProcess.cpp:
3344         * WebProcess/WebStorage/StorageAreaImpl.cpp:
3345         * WebProcess/WebStorage/StorageAreaMap.cpp:
3346         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
3347         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
3348         * WebProcess/cocoa/PlaybackSessionManager.mm:
3349         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3350         * WebProcess/cocoa/VideoFullscreenManager.mm:
3351         * WebProcess/cocoa/WebProcessCocoa.mm:
3352         * WebProcess/win/WebProcessMainWin.cpp:
3353         * WebProcess/win/WebProcessWin.cpp:
3354         * WebProcess/wpe/WebProcessMainWPE.cpp:
3355
3356 2018-08-22  Daniel Bates  <dabates@apple.com>
3357
3358         Cleanup: Add type alias for spell document tag
3359         https://bugs.webkit.org/show_bug.cgi?id=188817
3360
3361         Reviewed by Simon Fraser.
3362
3363         * UIProcess/TextChecker.h:
3364         * UIProcess/TextCheckerCompletion.h:
3365         * UIProcess/WebPageProxy.cpp:
3366         (WebKit::WebPageProxy::~WebPageProxy):
3367         (WebKit::WebPageProxy::spellDocumentTag):
3368         * UIProcess/WebPageProxy.h: Also addressed FIXME comment and modernized the code to use a std::optional
3369         while I am here.
3370         * UIProcess/gtk/TextCheckerGtk.cpp:
3371         (WebKit::TextChecker::uniqueSpellDocumentTag):
3372         (WebKit::TextChecker::closeSpellDocumentWithTag):
3373         (WebKit::TextChecker::checkSpellingOfString):
3374         (WebKit::TextChecker::checkGrammarOfString):
3375         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3376         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3377         (WebKit::TextChecker::getGuessesForWord):
3378         (WebKit::TextChecker::learnWord):
3379         (WebKit::TextChecker::ignoreWord):
3380         (WebKit::TextChecker::checkTextOfParagraph):
3381         * UIProcess/ios/TextCheckerIOS.mm:
3382         (WebKit::spellDocumentTagMap):
3383         (WebKit::TextChecker::uniqueSpellDocumentTag):
3384         (WebKit::TextChecker::closeSpellDocumentWithTag):
3385         (WebKit::textCheckerFor):
3386         (WebKit::TextChecker::checkTextOfParagraph):
3387         (WebKit::TextChecker::checkSpellingOfString):
3388         (WebKit::TextChecker::checkGrammarOfString):
3389         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3390         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3391         (WebKit::TextChecker::getGuessesForWord):
3392         (WebKit::TextChecker::learnWord):
3393         (WebKit::TextChecker::ignoreWord):
3394         * UIProcess/mac/TextCheckerMac.mm:
3395         (WebKit::TextChecker::uniqueSpellDocumentTag):
3396         (WebKit::TextChecker::closeSpellDocumentWithTag):
3397         (WebKit::TextChecker::checkTextOfParagraph):
3398         (WebKit::TextChecker::checkSpellingOfString):
3399         (WebKit::TextChecker::checkGrammarOfString):
3400         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3401         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3402         (WebKit::TextChecker::getGuessesForWord):
3403         (WebKit::TextChecker::learnWord):
3404         (WebKit::TextChecker::ignoreWord):
3405         * UIProcess/win/TextCheckerWin.cpp:
3406         (WebKit::TextChecker::uniqueSpellDocumentTag):
3407         (WebKit::TextChecker::closeSpellDocumentWithTag):
3408         (WebKit::TextChecker::checkSpellingOfString):
3409         (WebKit::TextChecker::checkGrammarOfString):
3410         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3411         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3412         (WebKit::TextChecker::getGuessesForWord):
3413         (WebKit::TextChecker::learnWord):
3414         (WebKit::TextChecker::ignoreWord):
3415         (WebKit::TextChecker::checkTextOfParagraph):
3416         * UIProcess/wpe/TextCheckerWPE.cpp:
3417         (WebKit::TextChecker::uniqueSpellDocumentTag):
3418         (WebKit::TextChecker::closeSpellDocumentWithTag):
3419         (WebKit::TextChecker::checkSpellingOfString):
3420         (WebKit::TextChecker::checkGrammarOfString):
3421         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3422         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3423         (WebKit::TextChecker::getGuessesForWord):
3424         (WebKit::TextChecker::learnWord):
3425         (WebKit::TextChecker::ignoreWord):
3426
3427 2018-08-22  Antti Koivisto  <antti@apple.com>
3428
3429         Use OptionSet for NetworkCache::Storage::TraverseFlags
3430         https://bugs.webkit.org/show_bug.cgi?id=188837
3431
3432         Reviewed by Anders Carlsson.
3433
3434         Type safe flags.
3435
3436         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3437         (WebKit::CacheStorage::Caches::initializeSize):
3438         (WebKit::CacheStorage::Caches::readRecordsList):
3439         * NetworkProcess/cache/NetworkCache.cpp:
3440         (WebKit::NetworkCache::Cache::traverse):
3441         (WebKit::NetworkCache::Cache::dumpContentsToFile):
3442         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3443         (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation):
3444         (WebKit::NetworkCache::Storage::traverse):
3445         * NetworkProcess/cache/NetworkCacheStorage.h:
3446         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3447         (WebKit::UserMediaPermissionRequestManager::captureDevicesChanged):
3448         (WebKit::UserMediaPermissionRequestManager::activityStateDidChange):
3449
3450         Also use OptionSet<>::containsAll() in a few places.
3451
3452 2018-08-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3453
3454         [WPE] pkg-config files should require libwpe
3455         https://bugs.webkit.org/show_bug.cgi?id=188835
3456
3457         Reviewed by Žan Doberšek.
3458
3459         * wpe/wpe-web-extension.pc.in:
3460         * wpe/wpe-webkit.pc.in:
3461
3462 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
3463
3464         [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking
3465         https://bugs.webkit.org/show_bug.cgi?id=188693
3466
3467         Reviewed by Carlos Garcia Campos.
3468
3469         Switch CoordinatedGraphicsScene to utilizing Nicosia::CompositionLayer
3470         objects for state updates of the TextureMapper layer tree.
3471
3472         CoordinatedGraphicsScene::paintToCurrentGLContext() now calls
3473         updateSceneState() at the beginning. This is a new method that manages
3474         all updates for a given Nicosia::Scene instance. Any removed layers
3475         have their composition-side state cleaned up, and the current set of
3476         layers is then iterated to ensure and update the corresponding
3477         TextureMapperLayer objects.
3478
3479         Layers with any backing (painted backing store, platform-layer or image
3480         content) are temporarly stored for updating outside of mutex-controlled
3481         scene update. Performing all other state updates outside of this mutex
3482         area will be investigated at a later point.
3483
3484         We then iterate over vectors for each layer backing, gathering any
3485         affected CoordinatedBackingStore or TextureMapperPlatformLayerProxy
3486         objects that we have to update.
3487
3488         This drops a bunch of member variables and helper methods off the
3489         CoordinatedGraphicsScene class. The applyStateChanges() method will be
3490         further simplified in the future. coordinateUpdateCompletionWithClient
3491         logic in ThreadedCompositor should be checked to see whether it still
3492         addresses any real-life problem, because at the moment it imposes a few
3493         additional operations in terms of scene updates that we could really do
3494         without. This will be checked later and removed if possible.
3495
3496         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3497         (WebKit::CoordinatedGraphicsScene::applyStateChanges):
3498         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
3499         (WebKit::compositionLayerImpl):
3500         (WebKit::contentLayerImpl):
3501         (WebKit::backingStoreImpl):
3502         (WebKit::imageBackingImpl):
3503         (WebKit::texmapLayer):
3504         (WebKit::updateBackingStore):
3505         (WebKit::updateImageBacking):
3506         (WebKit::removeLayer):
3507         (WebKit::CoordinatedGraphicsScene::commitSceneState):
3508         (WebKit::CoordinatedGraphicsScene::updateSceneState):
3509         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
3510         (WebKit::CoordinatedGraphicsScene::syncPlatformLayerIfNeeded): Deleted.
3511         (WebKit::CoordinatedGraphicsScene::setLayerChildrenIfNeeded): Deleted.
3512         (WebKit::CoordinatedGraphicsScene::setLayerFiltersIfNeeded): Deleted.
3513         (WebKit::CoordinatedGraphicsScene::setLayerState): Deleted.
3514         (WebKit::CoordinatedGraphicsScene::getLayerByIDIfExists): Deleted.
3515         (WebKit::CoordinatedGraphicsScene::createLayers): Deleted.
3516         (WebKit::CoordinatedGraphicsScene::createLayer): Deleted.
3517         (WebKit::CoordinatedGraphicsScene::deleteLayers): Deleted.
3518         (WebKit::CoordinatedGraphicsScene::deleteLayer): Deleted.
3519         (WebKit::CoordinatedGraphicsScene::setRootLayerID): Deleted.
3520         (WebKit::CoordinatedGraphicsScene::prepareContentBackingStore): Deleted.
3521         (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded): Deleted.
3522         (WebKit::CoordinatedGraphicsScene::removeBackingStoreIfNeeded): Deleted.
3523         (WebKit::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize): Deleted.
3524         (WebKit::CoordinatedGraphicsScene::createTilesIfNeeded): Deleted.
3525         (WebKit::CoordinatedGraphicsScene::removeTilesIfNeeded): Deleted.
3526         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded): Deleted.
3527         (WebKit::CoordinatedGraphicsScene::syncImageBackings): Deleted.
3528         (WebKit::CoordinatedGraphicsScene::createImageBacking): Deleted.
3529         (WebKit::CoordinatedGraphicsScene::updateImageBacking): Deleted.
3530         (WebKit::CoordinatedGraphicsScene::clearImageBackingContents): Deleted.
3531         (WebKit::CoordinatedGraphicsScene::removeImageBacking): Deleted.
3532         (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer): Deleted.
3533         (WebKit::CoordinatedGraphicsScene::setLayerAnimationsIfNeeded): Deleted.
3534         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3535         (WebKit::CoordinatedGraphicsScene::layerByID): Deleted.
3536         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3537         (WebKit::ThreadedCompositor::renderLayerTree):
3538         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3539         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
3540
3541 2018-08-21  Ryosuke Niwa  <rniwa@webkit.org>
3542
3543         Replace booleans for modifier keys in UIEventWithKeyState with OptionSet<Modifier>
3544         https://bugs.webkit.org/show_bug.cgi?id=188777
3545
3546         Reviewed by Simon Fraser.
3547
3548         Added two FIXMEs.
3549
3550         * WebProcess/WebPage/WebPage.cpp:
3551         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
3552
3553 2018-08-21  Alex Christensen  <achristensen@webkit.org>
3554
3555         Roll out r235139 and r235146
3556         https://bugs.webkit.org/show_bug.cgi?id=188805
3557
3558         It turns out shouldKeepCurrentBackForwardListItemInList has one use left.
3559
3560         * UIProcess/API/APILoaderClient.h:
3561         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
3562         * UIProcess/API/C/WKPage.cpp:
3563         (WKPageSetPageLoaderClient):
3564         * UIProcess/WebBackForwardList.cpp:
3565         (WebKit::WebBackForwardList::addItem):
3566         (WebKit::WebBackForwardList::goToItem):
3567         * UIProcess/WebPageProxy.cpp:
3568         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
3569         * UIProcess/WebPageProxy.h:
3570
3571 2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3572
3573         [Attachment Support] Remove _WKAttachments and notify the UI client upon mainframe navigation
3574         https://bugs.webkit.org/show_bug.cgi?id=188715
3575         <rdar://problem/43541790>
3576
3577         Reviewed by Tim Horton.
3578
3579         Adds logic for invalidating Attachment objects upon mainframe navigation, or upon web content process
3580         termination. An invalid Attachment's wrapper may still be retained by a UI client; however, calls to -info and
3581         other SPI methods will either return nil or immediately invoke their completion handlers with a nil result and
3582         an NSError. See changes below for more detail.
3583
3584         This patch also takes some extra measures to avoid sending redundant or unexpected removal updates to the UI
3585         client upon invalidating all Attachments.
3586
3587         See Tools changes for new API tests.
3588
3589         * UIProcess/API/APIAttachment.cpp:
3590         (API::Attachment::invalidate):
3591         * UIProcess/API/APIAttachment.h:
3592         * UIProcess/API/Cocoa/WKWebView.mm:
3593         (-[WKWebView _didInsertAttachment:withSource:]):
3594         (-[WKWebView _didRemoveAttachment:]):
3595
3596         Refactor these methods to take references to the API::Attachment that is being inserted or removed, rather than
3597         take attachment identifiers. This allows us to keep logic for setting the InsertionState of Attachment objects
3598         in WebPageProxy, rather than in platform code.
3599
3600         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3601         * UIProcess/API/Cocoa/_WKAttachment.h:
3602         * UIProcess/API/Cocoa/_WKAttachment.mm:
3603         (-[_WKAttachment info]):
3604
3605         If the attachment object is invalid, return nil.
3606
3607         (-[_WKAttachment setDisplayOptions:completion:]):
3608         (-[_WKAttachment setFileWrapper:contentType:completion:]):
3609
3610         If the attachment object is invalid, immediately invoke the completion block with an error.
3611
3612         (-[_WKAttachment isConnected]):
3613
3614         Add a new readonly property for a client to easily determine whether a _WKAttachment is connected to the
3615         document, without having to maintain the current set of connected attachment objects by observing insertion and
3616         removal callbacks.
3617
3618         * UIProcess/Cocoa/PageClientImplCocoa.h:
3619         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3620         (WebKit::PageClientImplCocoa::didInsertAttachment):
3621         (WebKit::PageClientImplCocoa::didRemoveAttachment):
3622
3623         Make these take API::Attachment&s rather than identifier strings.
3624
3625         * UIProcess/PageClient.h:
3626         (WebKit::PageClient::didInsertAttachment):
3627         (WebKit::PageClient::didRemoveAttachment):
3628
3629         Also make these take API::Attachment&s rather than identifier strings.
3630
3631         * UIProcess/WebPageProxy.cpp:
3632         (WebKit::WebPageProxy::didCommitLoadForFrame):
3633         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3634         (WebKit::WebPageProxy::invalidateAllAttachments):
3635
3636         Introduce a helper function that invalidates all Attachments and notifies the UI client if needed. This is
3637         invoked upon mainframe navigation, and when the web content process terminates.
3638
3639         (WebKit::WebPageProxy::platformRegisterAttachment):
3640         (WebKit::WebPageProxy::didInsertAttachmentWithIdentifier):
3641         (WebKit::WebPageProxy::didRemoveAttachmentWithIdentifier):
3642         (WebKit::WebPageProxy::didInsertAttachment):
3643         (WebKit::WebPageProxy::didRemoveAttachment):
3644
3645         Keep track of whether we've notified the UI client that an Attachment has been inserted into the document. This
3646         allows us to send removal updates to the UI client only for Attachments that are currently in the document, from
3647         the perspective of the UI client, and allows us to avoid sending extra removal updates in
3648         invalidateAllAttachments for Attachments that either have already been removed, or Attachments which we haven't
3649         inserted yet.
3650
3651         * UIProcess/WebPageProxy.h:
3652         * UIProcess/WebPageProxy.messages.in:
3653         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3654         (WebKit::WebEditorClient::didInsertAttachmentWithIdentifier):
3655         (WebKit::WebEditorClient::didRemoveAttachmentWithIdentifier):
3656         (WebKit::WebEditorClient::didInsertAttachment): Deleted.
3657         (WebKit::WebEditorClient::didRemoveAttachment): Deleted.
3658         * WebProcess/WebCoreSupport/WebEditorClient.h:
3659
3660         Rename did{Insert|Remove}Attachment to did{Insert|Remove}AttachmentWithIdentifier.
3661
3662 2018-08-21  Megan Gardner  <megan_gardner@apple.com>
3663
3664         Change Selection modification to not snap the grabber when selecting above or below the selection anchor
3665         https://bugs.webkit.org/show_bug.cgi?id=188826
3666
3667         Reviewed by Tim Horton.
3668
3669         Selecting single lines is sometimes difficult because we currently snap selections to single
3670         characters if we move past the position of the other anchor in our selection. This patch changes
3671         this behaviour to reflect the behaviour in the rest of this system, which snaps the selection
3672         to the position on the line of the other anchor, rather than snapping it all the way a single
3673         character.
3674
3675         * WebProcess/WebPage/ios/WebPageIOS.mm:
3676         (WebKit::rangeForPointInRootViewCoordinates):
3677
3678 2018-08-21  Daniel Bates  <dabates@apple.com>
3679
3680         Cleanup: Remove unused file-local static variable from TextCheckerIOS.mm
3681         https://bugs.webkit.org/show_bug.cgi?id=188818
3682
3683         Reviewed by Wenson Hsieh.
3684
3685         * UIProcess/ios/TextCheckerIOS.mm:
3686         (WebKit::TextChecker::isSmartInsertDeleteEnabled):
3687
3688 2018-08-21  Daniel Bates  <dabates@apple.com>
3689
3690         [iOS][WK2] Misspelled words are not underlined
3691         https://bugs.webkit.org/show_bug.cgi?id=188800
3692         <rdar://problem/34811332>
3693
3694         Reviewed by Wenson Hsieh.
3695
3696         Implement enough of TextChecker for iOS to compute the list of misspelled words in a
3697         paragraph and advertise support for continuous spell checking. The WebCore editing
3698         machinery queries TextChecker for the list of the misspelled words, creating document
3699         markers that demarcate the misspelled words. When we paint a line of text we paint
3700         the spelling correction dots under each misspelled word.
3701
3702         On iOS we make use of UITextChecker to perform spell checking of a string. We maintain
3703         a side table that maps a "spell document tag" to a UITextChecker* to conform to the
3704         shape of the TextChecker interface.
3705
3706         * Platform/spi/ios/UIKitSPI.h: Forward declare some SPI.
3707         * UIProcess/ios/TextCheckerIOS.mm:
3708         (WebKit::mutableState): Added.
3709         (WebKit::TextChecker::state): Turns around and returns mutableState().
3710         (WebKit::TextChecker::isContinuousSpellCheckingAllowed): Returns true if we are building
3711         with USE(UNIFIED_TEXT_CHECKING). Otherwise, do what we do now.
3712         (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Update state.
3713         (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged): Ditto.
3714         (WebKit::spellDocumentTagMap): Returns HashMap that maps a "spell document tag" (int64_t) to
3715         a RetainPtr<UITextChecker>>.
3716         (WebKit::TextChecker::uniqueSpellDocumentTag): Generates a unique identifier for the page
3717         this text checker is associated with.
3718         (WebKit::TextChecker::closeSpellDocumentWithTag): Removes the entry for the specified identifier
3719         from the HashMap.
3720         (WebKit::textCheckerFor): Query the HashMap for the UITextChecker for the specified spell
3721         document tag, if it exists. Otherwise, create a new UITextChecker and add a new map entry
3722         that associates it with the specified spell document tag. 
3723         (WebKit::TextChecker::checkTextOfParagraph): Spell check the specified string and return a list
3724         that represents the misspelled words.
3725         (WebKit::TextChecker::checkSpellingOfString): Added a comment to explain that iOS does not implement
3726         this function and instead implements checkTextOfParagraph().
3727         (WebKit::TextChecker::checkGrammarOfString): Ditto.
3728
3729 2018-08-21  Alex Christensen  <achristensen@webkit.org>
3730
3731         Transition ResizeReversePaginatedWebView API test from WKPageLoaderClient to WKPageNavigationClient
3732         https://bugs.webkit.org/show_bug.cgi?id=188821
3733
3734         Reviewed by Simon Fraser.
3735
3736         Add some more values to WKPageRenderingProgressEvents which were already supported by _WKRenderingProgressEvents and WKLayoutMilestones.
3737
3738         * UIProcess/API/C/WKPageRenderingProgressEvents.h:
3739         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
3740         (pageRenderingProgressEvents):
3741
3742 2018-08-21  Alex Christensen  <achristensen@webkit.org>
3743
3744         Fix API tests after r235139
3745         https://bugs.webkit.org/show_bug.cgi?id=188805
3746
3747         Apparently the call to didChangeBackForwardList with no changes was observable.  We should rename, but I'm restoring existing behavior for now.
3748
3749         * UIProcess/WebBackForwardList.cpp:
3750         (WebKit::WebBackForwardList::goToItem):
3751
3752 2018-08-21  John Wilander  <wilander@apple.com>
3753
3754         Storage Access API: The call to ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal() should send eTLD+1s, not full host names
3755         https://bugs.webkit.org/show_bug.cgi?id=188783
3756         <rdar://problem/43559215>
3757
3758         Reviewed by Alex Christensen.
3759
3760         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
3761         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
3762             Now sends the eTLD+1 for the top frame and sub frame.
3763
3764 2018-08-21  Megan Gardner  <megan_gardner@apple.com>
3765
3766         Use VisiblePosition to calculate selection ranges
3767         https://bugs.webkit.org/show_bug.cgi?id=188767
3768         <rdar://problem/43577166>
3769
3770         Reviewed by Ryosuke Niwa.
3771
3772         Switches to using VisiblePosition, instead of Position. This code used to use VisiblePosiiton,
3773         but it has been changed a lot lately, and using Position causes issues with next and previous
3774         when trying to snap a selection. VisiblePosition gives us the correct information, and does not 
3775         result in collapsed ranges.
3776
3777         * WebProcess/WebPage/ios/WebPageIOS.mm:
3778         (WebKit::rangeForPointInRootViewCoordinates):
3779
3780 2018-08-21  Alex Christensen  <achristensen@webkit.org>
3781
3782         Remove unused shouldKeepCurrentBackForwardListItemInList check
3783         https://bugs.webkit.org/show_bug.cgi?id=188805
3784
3785         Reviewed by Andy Estes.
3786
3787         The check was only done in WKPageLoaderClient, and nobody implements the check.
3788         It was not needed to put in WKPageNavigationClient or WKNavigationDelegate, so let's remove it!
3789         This removes the unused ability to go back and remove the current back/forward list item.
3790
3791         * UIProcess/API/APILoaderClient.h:
3792         (API::LoaderClient::didChangeBackForwardList):
3793         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): Deleted.
3794         * UIProcess/API/C/WKPage.cpp:
3795         (WKPageSetPageLoaderClient):
3796         * UIProcess/WebBackForwardList.cpp:
3797         (WebKit::WebBackForwardList::addItem):
3798         (WebKit::WebBackForwardList::goToItem):
3799         * UIProcess/WebPageProxy.cpp:
3800         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): Deleted.
3801         * UIProcess/WebPageProxy.h:
3802
3803 2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3804
3805         [Attachment Support] Augment _WKAttachment SPI to handle NSFileWrappers in addition to NSData
3806         https://bugs.webkit.org/show_bug.cgi?id=188496
3807         <rdar://problem/43216836>
3808
3809         Reviewed by Tim Horton.
3810
3811         Adjusts WebKit's attachment editing SPI with the following modifications:
3812         •   Deprecate `-_insertAttachmentWithFilename:contentType:data:options:completion:` in favor of
3813             `-_insertAttachmentWithFileWrapper:contentType:options:completion:`.
3814         •   Deprecate `-requestInfo:` and in favor of just `-info`.
3815         •   Add a `-fileWrapper` property to `_WKAttachmentInfo` that returns an `NSFileWrapper`.
3816         •   Remove some SPI methods that would otherwise be deprecated, but are not even necessary, since they're no
3817             longer even used by Mail.
3818
3819         To make this possible, we refactor where and how attachment data is tracked. Currently, the data is stored in
3820         the network process, and made accessible to the web process via blob URLs stored in the File object in the
3821         attachment element. As such, requests from the UI process for attachment data would first be routed through the
3822         web process to network process and back.
3823
3824         Instead, we now keep the relevant attachment data (in the form of NSFileWrapper on Cocoa platforms) in the UI
3825         process, on API::Attachment. We additionally keep a map of attachment identifiers to API::Attachments, which
3826         allows us to propagate the same _WKAttachment wrapper object to the SPI client for each uniquely identified
3827         attachment element. This also has the benefit of allowing us to remove the asynchronous version of `-requestInfo:`
3828         and replace it with just an `info` property.
3829
3830         Changes are covered by new and existing API tests.
3831
3832         * PlatformMac.cmake:
3833
3834         Remove APIAttachment.cpp, now that APIAttachment.cpp is listed in Sources.txt.
3835
3836         * Scripts/webkit/messages.py:
3837         * Shared/Cocoa/APIObject.mm:
3838         (API::Object::newObject):
3839
3840         Guard _WKAttachment creation with ENABLE_ATTACHMENT_ELEMENT.
3841
3842         * Shared/WebCoreArgumentCoders.cpp:
3843         (IPC::ArgumentCoder<PromisedAttachmentInfo>::encode):
3844         (IPC::ArgumentCoder<PromisedAttachmentInfo>::decode):
3845         (IPC::ArgumentCoder<PromisedBlobInfo>::encode): Deleted.
3846         (IPC::ArgumentCoder<PromisedBlobInfo>::decode): Deleted.
3847         (IPC::ArgumentCoder<AttachmentInfo>::encode): Deleted.
3848         (IPC::ArgumentCoder<AttachmentInfo>::decode): Deleted.
3849         * Shared/WebCoreArgumentCoders.h:
3850
3851         Continue removing encoding support for WebCore::AttachmentInfo. Additionally, rename PromisedBlobInfo to
3852         PromisedAttachmentInfo.
3853
3854         * Sources.txt:
3855         * SourcesCocoa.txt:
3856
3857         Move APIAttachment.cpp from the SourcesCocoa.txt to the platform-agnostic Sources.txt.
3858
3859         * UIProcess/API/APIAttachment.cpp:
3860         (API::Attachment::updateAttributes):
3861
3862         Rename setDataAndContentType to just updateAttributes; instead of sending data, only send the information needed
3863         to update the presentational attributes of the attachment element.
3864
3865         (API::Attachment::requestInfo): Deleted.
3866
3867         Just call the completion handler with the result of `self.info`.
3868
3869         (API::Attachment::setDataAndContentType): Deleted.
3870         * UIProcess/API/APIAttachment.h:
3871
3872         Add additional attributes: a content type, a file path, and (on Cocoa platforms) an NSFileWrapper.
3873
3874         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3875
3876         Remove -_webView:didInsertAttachment:, since this is unused by any client currently, and is superceded by
3877         -_webView:didInsertAttachment:withSource:.
3878
3879         * UIProcess/API/Cocoa/WKWebView.mm:
3880         (-[WKWebView _didInsertAttachment:withSource:]):
3881         (-[WKWebView _didRemoveAttachment:]):
3882
3883         Look up the API::Attachment corresponding to the identifier, and send its wrapper object to the client.
3884
3885         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
3886         (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):
3887
3888         Add a way to insert an attachment using NSFileWrapper, and reimplement _insertAttachmentWithFilename: using it.
3889
3890         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3891         * UIProcess/API/Cocoa/_WKAttachment.h:
3892         * UIProcess/API/Cocoa/_WKAttachment.mm:
3893         (-[_WKAttachmentInfo initWithFileWrapper:filePath:contentType:]):
3894         (-[_WKAttachmentInfo data]):
3895         (-[_WKAttachmentInfo name]):
3896         (isDeclaredOrDynamicTypeIdentifier):
3897         (-[_WKAttachmentInfo _typeIdentifierFromPathExtension]):
3898         (-[_WKAttachmentInfo contentType]):
3899         (-[_WKAttachmentInfo mimeType]):
3900         (-[_WKAttachmentInfo utiType]):
3901         (-[_WKAttachmentInfo fileWrapper]):
3902         (-[_WKAttachment info]):
3903         (-[_WKAttachment requestInfo:]):
3904
3905         Add a property on _WKAttachment to retrieve a _WKAttachmentInfo (a snapshot of the current state of the
3906         attachment, along with the NSFileWrapper). Reimplement requestInfo using this property.
3907
3908         (-[_WKAttachment setFileWrapper:contentType:completion:]):
3909         (-[_WKAttachment setData:newContentType:newFilename:completion:]):
3910
3911         Reimplemented by calling -setFileWrapper:contentType:completion: with an NSFileWrapper created using the given
3912         data. Additionally, create and associate the unique identifier with an API::Attachment right away.
3913
3914         (-[_WKAttachment uniqueIdentifier]):
3915         (-[_WKAttachment description]):
3916         (-[_WKAttachmentInfo initWithInfo:]): Deleted.
3917         (-[_WKAttachmentInfo fileLoadingError]): Deleted.
3918         (-[_WKAttachment isEqual:]): Deleted.
3919         (-[_WKAttachment hash]): Deleted.
3920
3921         There's no longer any point to implementing these methods, since the SPI client is now guaranteed a unique
3922         mapping of _WKAttachments to attachment elements in the document.
3923
3924         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3925         (WebKit::PageClientImplCocoa::didInsertAttachment):
3926         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3927         (WebKit::WebPageProxy::platformRegisterAttachment):
3928         (WebKit::WebPageProxy::platformCloneAttachment):
3929
3930         Extend the behavior of registering new attachment data on Cocoa platforms by additionally creating and setting
3931         NSFileWrappers on the API::Attachment.
3932
3933         * UIProcess/WebPageProxy.cpp:
3934         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3935
3936         Clear out the map of attachment identifiers to API::Attachments when the web content process is terminated.
3937
3938         (WebKit::WebPageProxy::attachmentForIdentifier const):
3939
3940         Helper function to look up an API::Attachment for the given attachment identifier. Returns null if the
3941         attachment is not found, or the attachment identifier is invalid.
3942
3943         (WebKit::WebPageProxy::insertAttachment):
3944         (WebKit::WebPageProxy::updateAttachmentAttributes):
3945         (WebKit::WebPageProxy::registerAttachmentIdentifierFromData):
3946         (WebKit::WebPageProxy::registerAttachmentIdentifierFromFilePath):
3947         (WebKit::WebPageProxy::cloneAttachmentData):
3948         (WebKit::WebPageProxy::platformRegisterAttachment):
3949         (WebKit::WebPageProxy::platformCloneAttachment):
3950         (WebKit::WebPageProxy::didInsertAttachment):
3951
3952         Create an entry in the attachment identifier to API::Attachment map when an attachment is inserted, if one does
3953         not already exist. An attachment mapping would not exist only in the case where an attachment element was
3954         created via bindings; in this case, the client wouldn't have access to an NSFileWrapper containing the contents
3955         of the file; in the future, this can be improved by adding a mechanism to register an attachment element with
3956         this data, but for now, this is unnecessary for Mail's purposes.
3957
3958         (WebKit::WebPageProxy::didRemoveAttachment):
3959         (WebKit::WebPageProxy::ensureAttachment):
3960
3961         Ensures an attachment identifier to API::Attachment mapping.
3962
3963         (WebKit::WebPageProxy::attachmentInfoCallback): Deleted.
3964         (WebKit::WebPageProxy::requestAttachmentInfo): Deleted.
3965         (WebKit::WebPageProxy::setAttachmentDataAndContentType): Deleted.
3966         * UIProcess/WebPageProxy.h:
3967         * UIProcess/WebPageProxy.messages.in:
3968         * UIProcess/ios/PageClientImplIOS.h:
3969         * UIProcess/ios/PageClientImplIOS.mm:
3970         * UIProcess/ios/WKContentViewInteraction.h:
3971         * UIProcess/ios/WKContentViewInteraction.mm:
3972         (-[WKContentView _startDrag:item:]):
3973         (-[WKContentView _prepareToDragPromisedAttachment:]):
3974         (-[WKContentView _prepareToDragPromisedBlob:]): Deleted.
3975
3976         Reimplement the way promised attachment data is delivered to the destination when an attachment element is
3977         dragged. Instead of relying on the blob URL of the File on the attachment element, first try to find an API
3978         Attachment object corresponding to the unique identifier of the dragged attachment, and use its NSFileWrapper to
3979         deliver promised data to the destination file URL. The blob URL codepath still exists in the case where script
3980         specifies the dragged attachment's File.
3981
3982         * UIProcess/mac/PageClientImplMac.h:
3983         * UIProcess/mac/PageClientImplMac.mm:
3984         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3985         (WebKit::WebEditorClient::registerAttachmentIdentifier):
3986         (WebKit::WebEditorClient::cloneAttachmentData):
3987         * WebProcess/WebCoreSupport/WebEditorClient.h:
3988         * WebProcess/WebPage/WebPage.cpp:
3989         (WebKit::WebPage::insertAttachment):
3990         (WebKit::WebPage::updateAttachmentAttributes):
3991         (WebKit::WebPage::requestAttachmentInfo): Deleted.
3992         (WebKit::WebPage::setAttachmentDataAndContentType): Deleted.
3993         * WebProcess/WebPage/WebPage.h:
3994         * WebProcess/WebPage/WebPage.messages.in:
3995
3996         More renaming and IPC message plumbing.
3997
3998 2018-08-21  Alex Christensen  <achristensen@webkit.org>
3999
4000         Increment NetworkCache::Storage::lastStableVersion after r233742
4001         https://bugs.webkit.org/show_bug.cgi?id=188798
4002         <rdar://43561761>
4003
4004         Reviewed by Geoffrey Garen.
4005
4006         * NetworkProcess/cache/NetworkCacheStorage.h:
4007
4008 2018-08-21  Brent Fulgham  <bfulgham@apple.com>
4009
4010         Remove experimental affiliated domain code now that StorageAccess API is available
4011  &nb