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