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