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