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