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