WebKit.ApplicationManifestBasic API test is failing when enabling PSON
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-11-14  Chris Dumez  <cdumez@apple.com>
2
3         WebKit.ApplicationManifestBasic API test is failing when enabling PSON
4         https://bugs.webkit.org/show_bug.cgi?id=191602
5
6         Reviewed by Alex Christensen.
7
8         Add support for process swapping for a [WKWebView loadHTML:] load by storing
9         the necessary data on the API::Navigation and doing a loadData() instead of
10         a loadRequest() after process swapping when this data is present on the
11         navigation.
12
13         * UIProcess/API/APINavigation.cpp:
14         (API::Navigation::Navigation):
15         * UIProcess/API/APINavigation.h:
16         (API::Navigation::create):
17         (API::Navigation::substituteData const):
18         * UIProcess/WebNavigationState.cpp:
19         (WebKit::WebNavigationState::createLoadDataNavigation):
20         * UIProcess/WebNavigationState.h:
21         * UIProcess/WebPageProxy.cpp:
22         (WebKit::WebPageProxy::loadData):
23         (WebKit::WebPageProxy::continueNavigationInNewProcess):
24
25 2018-11-14  Antti Koivisto  <antti@apple.com>
26
27         Align Mac WK2 layer flush throttling with iOS
28         https://bugs.webkit.org/show_bug.cgi?id=191632
29
30         Reviewed by Zalan Bujtas.
31
32         Currently Mac WK2 uses WebCore side throttling implementation in RenderLayerCompositor. This code has
33         throttling timer per-frame while the actual decision making and layer flushes itself are per page. These
34         timers generate way more flushes than expected in presence of multiple frames. There are also bugs in how
35         flushing state is updated when frames are created dynamically.
36
37         On iOS WK2 throttling is implemented on WebKit side and controlled by a per-page timer. Recent fixes also
38         make this implementation visually fast. We should align the Mac implementation and eventually unify them.
39
40         This patch implements throttling in TiledCoreAnimationDrawingArea mirroring the iOS RemoteLayerTreeDrawingArea
41         implementation. There are some adjustments for platform differences (local vs remote layers) and we continue
42         using runloop observer for the actual flushes. Timings are as in the existing Mac code.
43
44         The patch appears to be a significant performance progression.
45
46         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
47         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
48         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
49         (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
50
51         Schedule an immediate flush when layers are unfrozen.
52
53         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
54         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
55
56         Track pending flushes with m_hasPendingFlush bit.
57         Delay flush if the flush throttling timer is active. Start it if we throttling but it is not active yet.
58
59         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
60
61         Clear m_hasPendingFlush if the flush succeeded.
62         Restart the throttling timer if we are still throttling.
63         Manage runloop observer invalidation here instead of the caller (and stop returning value).
64
65         (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
66         (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
67
68         Returning 'true' here disables WebCore side throttling code.
69
70         Start or stop the throttling timer on state changes.
71
72         (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingIsActive const):
73
74         This is used to control style and layout timers on WebCore side. Return false on frozen
75         state since unfreezing depends on style and layout.
76
77         (WebKit::TiledCoreAnimationDrawingArea::startLayerFlushThrottlingTimer):
78         (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired):
79
80 2018-11-14  Chris Dumez  <cdumez@apple.com>
81
82         WebKit.WKHTTPCookieStoreWithoutProcessPool API test is failing with process prewarming is enabled
83         https://bugs.webkit.org/show_bug.cgi?id=191624
84
85         Reviewed by Alex Christensen.
86
87         Stop setting the WebProcessPool's primary data store (m_websiteDataStore) to the default one in
88         WebProcessPool::prewarmProcess(). We did not really need to, we can pass the default data store
89         to the new WebPageProxy without having to set m_websiteDataStore. m_websiteDataStore only gets
90         set upon constructor if thr default data store already exists or later on when creating a WebPage
91         that uses the default data store.
92
93         In the case of the API test, the following was happening:
94         1. Create an ephemeral data store EDS
95         2. Create a WebView V1 using datastore EDS
96         3. Do a load in V1
97         4. Process prewarming would kick in and wrongly associated V1's process pool PP1 with the default data store
98         5. Create/Get the default datastore and set a few cookies on it
99         6. Create a WebView V2 using default datastore and a fresh new process pool PP2
100         7. Do a load in V2 and expect the cookies to be there
101
102         In HTTPCookieStore::setCookie() that is called at step 5, we call:
103         m_owningDataStore->processPoolForCookieStorageOperations()
104
105         In this case, m_owningDataStore is the default datastore and this call would previously return null because
106         there is no WebProcessPool yet associated with the default datastore. However, with the process prewarming
107         bug at step 4, the process pool PP1 would be returned since it was wrongly associated with the default
108         data store. As a result, we would call setCookie() on PP1's WebCookieManagerProxy and this would fail
109         because PP1's network process knows nothing about this session ID (it was only ever used with an ephemeral
110         session).
111
112         * UIProcess/WebProcessPool.cpp:
113         (WebKit::WebProcessPool::prewarmProcess):
114
115 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
116
117         [WebAuthN] Support CTAP HID authenticators on macOS
118         https://bugs.webkit.org/show_bug.cgi?id=188623
119         <rdar://problem/43353777>
120
121         Reviewed by Brent Fulgham and Chris Dumez.
122
123         This patch introduces a primitive support of CTAP HID authenticators for WebAuthN in macOS.
124         It involves low level HID device management&communication, high level CTAP HID authenticator
125         management&communication, and mock testing. The above three aspects will be covered in details:
126         1) Low level HID device management&communication: HidService&HidConnection
127         It relies on IOHIDManager to discover appropriate hid devices by passing a matching dictionary:
128         { PrimaryUsagePage: 0xf1d0, PrimaryUsage: 0x01}. For communication, it utilizes HID reports.
129         To send a report, it calls IOHIDDeviceSetReport since the async version is not implemented.
130         To recieve a report, it calls IOHIDDeviceRegisterInputReportCallback to asynchronously wait
131         for incoming reports.
132         Here is the corresponding reference:
133         https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/HID/new_api_10_5/tn2187.html#//apple_ref/doc/uid/TP40000970-CH214-SW2
134         2) High level CTAP HID authenticator management&communication: HidService&CtapHidDriver
135         Whenever an appropriate hid device is discovered by IOHIDManager, an AuthenticatorGetInfo command
136         is sent to the device to determine properties of the authenticator, says, which version of protocol
137         it supports, i.e. CTAP or U2F. So far, we only support CTAP authenticators. Once the authenticator
138         is determined to support CTAP, we then instantiate CtapHidAuthenticator which will then take care
139         of even higher level WebAuthN requests&responses.
140         Binaries are constructed and packaged according to the CTAP HID porotocol. CtapHidDriver takes care
141         of concurrency and channels, i.e. allocating channel and establishing the actual request/response
142         transaction. At the meantime, CtapHidDriver::Worker is then responsible for each single transaction.
143         Here is the corresponding reference:
144         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#usb.
145         3) Mock Testing: MockHidService & MockHidConnection
146         A CTAP hid authenticator is simulated within MockHidConnection with options of specifying specific
147         error scenarios and of course could take care of successful cases. Four stages are presented in the
148         simulated authenticator to reflect: a) allocating channel for AuthenticatorGetInfo, b) sending
149         AuthenticatorGetInfo, c) allocating channel for actual request, and d) sending the actual request.
150
151         Besides implementing the above, it also does a few other things:
152         1) Make AuthenticatorManager::clearState asynchronous to avoid cyclic dependency:
153         Authenticator::returnResponse => AuthenticatorManager::respondReceived => AuthenticatorManager::clearState
154         => Authenticator::~Authenticator.
155         2) Reorganize unified build sources to make it clear that which files are .mm and which are .cpp.
156         3) Import LocalAuthentication.framework in LocalAuthenticationSoftLink instead of being scattered.
157
158         * Sources.txt:
159         * SourcesCocoa.txt:
160         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
161         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
162         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
163         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
164         (WebKit::AuthenticatorManagerInternal::collectTransports):
165         (WebKit::AuthenticatorManager::clearStateAsync):
166         (WebKit::AuthenticatorManager::respondReceived):
167         (WebKit::AuthenticatorManager::initTimeOutTimer):
168         * UIProcess/WebAuthentication/AuthenticatorManager.h:
169         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
170         (WebKit::AuthenticatorTransportService::create):
171         (WebKit::AuthenticatorTransportService::createMock):
172         (WebKit::AuthenticatorTransportService::startDiscovery):
173         (WebKit::AuthenticatorTransportService::startDiscovery const): Deleted.
174         * UIProcess/WebAuthentication/AuthenticatorTransportService.h:
175         * UIProcess/WebAuthentication/Cocoa/HidConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.h.
176         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Added.
177         (WebKit::reportReceived):
178         (WebKit::HidConnection::HidConnection):
179         (WebKit::HidConnection::~HidConnection):
180         (WebKit::HidConnection::initialize):
181         (WebKit::HidConnection::terminate):
182         (WebKit::HidConnection::send):
183         (WebKit::HidConnection::registerDataReceivedCallback):
184         (WebKit::HidConnection::unregisterDataReceivedCallback):
185         (WebKit::HidConnection::receiveReport):
186         (WebKit::HidConnection::consumeReports):
187         (WebKit::HidConnection::registerDataReceivedCallbackInternal):
188         * UIProcess/WebAuthentication/Cocoa/HidService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.h.
189         * UIProcess/WebAuthentication/Cocoa/HidService.mm: Added.
190         (WebKit::deviceAddedCallback):
191         (WebKit::deviceRemovedCallback):
192         (WebKit::HidService::HidService):
193         (WebKit::HidService::~HidService):
194         (WebKit::HidService::startDiscoveryInternal):
195         (WebKit::HidService::platformStartDiscovery):
196         (WebKit::HidService::createHidConnection const):
197         (WebKit::HidService::deviceAdded):
198         (WebKit::HidService::continueAddDeviceAfterGetInfo):
199         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
200         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
201         * UIProcess/WebAuthentication/Cocoa/LocalService.h:
202         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
203         (WebKit::LocalService::startDiscoveryInternal):
204         (WebKit::LocalService::startDiscoveryInternal const): Deleted.
205         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
206         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
207         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: Added.
208         (WebKit::MockHidConnection::MockHidConnection):
209         (WebKit::MockHidConnection::initialize):
210         (WebKit::MockHidConnection::terminate):
211         (WebKit::MockHidConnection::send):
212         (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
213         (WebKit::MockHidConnection::assembleRequest):
214         (WebKit::MockHidConnection::parseRequest):
215         (WebKit::MockHidConnection::feedReports):
216         (WebKit::MockHidConnection::stagesMatch const):
217         (WebKit::MockHidConnection::shouldContinueFeedReports):
218         (WebKit::MockHidConnection::continueFeedReports):
219         * UIProcess/WebAuthentication/Mock/MockHidConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h.
220         * UIProcess/WebAuthentication/Mock/MockHidService.cpp: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp.
221         (WebKit::MockHidService::MockHidService):
222         (WebKit::MockHidService::platformStartDiscovery):
223         (WebKit::MockHidService::createHidConnection const):
224         * UIProcess/WebAuthentication/Mock/MockHidService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h.
225         * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
226         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
227         * UIProcess/WebAuthentication/Mock/MockLocalService.mm: Renamed from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp.
228         (WebKit::MockLocalService::MockLocalService):
229         (WebKit::MockLocalService::platformStartDiscovery const):
230         (WebKit::MockLocalService::createLocalConnection const):
231         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
232         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp: Added.
233         (WebKit::CtapHidAuthenticator::CtapHidAuthenticator):
234         (WebKit::CtapHidAuthenticator::makeCredential):
235         (WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
236         (WebKit::CtapHidAuthenticator::getAssertion):
237         (WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived const):
238         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.h.
239         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: Added.
240         (WebKit::CtapHidDriver::Worker::Worker):
241         (WebKit::CtapHidDriver::Worker::~Worker):
242         (WebKit::CtapHidDriver::Worker::transact):
243         (WebKit::CtapHidDriver::Worker::write):
244         (WebKit::CtapHidDriver::Worker::read):
245         (WebKit::CtapHidDriver::Worker::returnMessage):
246         (WebKit::CtapHidDriver::CtapHidDriver):
247         (WebKit::CtapHidDriver::transact):
248         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
249         (WebKit::CtapHidDriver::continueAfterResponseReceived):
250         (WebKit::CtapHidDriver::returnResponse):
251         * UIProcess/WebAuthentication/fido/CtapHidDriver.h: Added.
252         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
253         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
254         * WebKit.xcodeproj/project.pbxproj:
255
256 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
257
258         Unreviewed correction to previous build fix to avoid any internal/downstream repercussions.
259
260         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
261
262 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
263
264         Unreviewed GTK/WPE build fix for r238159. 
265
266         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
267
268 2018-11-13  Timothy Hatcher  <timothy@apple.com>
269
270         Use a light scrollbar for transparent web views in dark mode.
271         https://bugs.webkit.org/show_bug.cgi?id=191559
272         rdar://problem/46000489
273
274         Reviewed by Dean Jackson.
275
276         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
277         (WebKit::InjectedBundleRangeHandle::renderedImage): Use FrameView's useDarkAppaearance().
278         * WebProcess/WebPage/WebPage.cpp:
279         (WebKit::WebPage::drawRect): Ditto.
280
281 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
282
283         [iOS] Do not show selection UI for editable elements with opacity near zero
284         https://bugs.webkit.org/show_bug.cgi?id=191442
285         <rdar://problem/45958625>
286
287         Reviewed by Simon Fraser.
288
289         Add support for suppressing native selection UI (for instance, selection highlight views, selection handles, and
290         selection-related gestures) when the selection is inside a transparent editable element. This helps maintain
291         compatibility with text editors that work by capturing key events and input events hidden contenteditable
292         elements, and reflect these changes in different document or different part of the document.
293
294         Since selection UI is rendered in the UI process on iOS using element geometry propagated from the web process,
295         selection rendering is entirely decoupled from the process of painting in the web process. This means that if
296         the editable root has an opacity of 0, we would correctly hide the caret and selection on macOS, but draw over
297         the transparent element on iOS. When these hidden editable elements are focused, this often results in unwanted
298         behaviors, such as double caret painting, native and custom selection UI from the page being drawn on top of one
299         another, and the ability to change selection via tap and loupe gestures within hidden text.
300
301         To fix this, we compute whether the focused element is transparent when an element is focused, or when the
302         selection changes, and send this information over to the UI process via `AssistedNodeInformation` and
303         `EditorState`. In the UI process, we then respect this information by suppressing the selection assistant if the
304         focused element is transparent; this disables showing and laying out selection views, as well as gestures
305         associated with selection overlays. However, this still allows for contextual autocorrection and spell checking.
306
307         * Shared/AssistedNodeInformation.cpp:
308         (WebKit::AssistedNodeInformation::encode const):
309         (WebKit::AssistedNodeInformation::decode):
310         * Shared/AssistedNodeInformation.h:
311         * Shared/EditorState.cpp:
312         (WebKit::EditorState::PostLayoutData::encode const):
313         (WebKit::EditorState::PostLayoutData::decode):
314         * Shared/EditorState.h:
315
316         Add `elementIsTransparent` flags, and also add boilerplate IPC code.
317
318         * UIProcess/ios/WKContentViewInteraction.mm:
319         (-[WKContentView _displayFormNodeInputView]):
320
321         Prevent zooming to the focused element if the focused element is hidden.
322
323         (-[WKContentView hasSelectablePositionAtPoint:]):
324         (-[WKContentView pointIsNearMarkedText:]):
325         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
326
327         Don't allow these text interaction gestures to begin while suppressing the selection assistant.
328
329         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
330
331         When an element is focused, begin suppressing the selection assistant if the element is fully transparent.
332
333         (-[WKContentView _stopAssistingNode]):
334
335         When the focused element is blurred, reset state by ending selection assistant suppression (additionally
336         reactivating the selection assistant if needed). This ensures that selection in non-editable text isn't broken
337         after focusing a hidden editable element.
338
339         (-[WKContentView _updateChangedSelection:]):
340
341         If needed, suppress or un-suppress the selection assistant when the selection changes. On certain rich text
342         editors, a combination of custom selection UI and native selection UI is used. For instance, on Microsoft Office
343         365, caret selections are rendered using the native caret view, but as soon as the selection becomes ranged, the
344         editable root becomes fully transparent, and Office's selection UI takes over.
345
346         (-[WKContentView _shouldSuppressSelectionCommands]):
347
348         Override this UIKit SPI hook to suppress selection commands (e.g. the callout bar) when suppressing the
349         selection assistant.
350
351         * WebProcess/WebPage/ios/WebPageIOS.mm:
352         (WebKit::WebPage::platformEditorState const):
353         (WebKit::WebPage::getAssistedNodeInformation):
354
355         Compute and set `elementIsTransparent` using the assisted node.
356
357 2018-11-13  Ryan Haddad  <ryanhaddad@apple.com>
358
359         Unreviewed, rolling out r238137.
360
361         Introduced API test failures on macOS.
362
363         Reverted changeset:
364
365         "Enable process swap on cross-site navigation by default on
366         macOS"
367         https://bugs.webkit.org/show_bug.cgi?id=191572
368         https://trac.webkit.org/changeset/238137
369
370 2018-11-13  Ryosuke Niwa  <rniwa@webkit.org>
371
372         Enable process swap on cross-site navigation by default on macOS
373         https://bugs.webkit.org/show_bug.cgi?id=191572
374
375         Reviewed by Chris Dumez.
376
377         Enabled the feature by default on macOS.
378
379         * Shared/WebPreferences.yaml:
380         * Shared/WebPreferencesDefaultValues.h:
381
382 2018-11-13  Daniel Bates  <dabates@apple.com>
383
384         Consolidate WebKit UIKitSPI.h and UIKitTestSPI.h
385         https://bugs.webkit.org/show_bug.cgi?id=173341
386         <rdar://problem/32752890>
387
388         Reviewed by Simon Fraser.
389
390         * Platform/spi/ios/UIKitSPI.h:
391
392 2018-11-13  Alex Christensen  <achristensen@webkit.org>
393
394         Fix internal builds after r238115
395         https://bugs.webkit.org/show_bug.cgi?id=191441
396
397         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
398         (-[WKSafeBrowsingTextView intrinsicContentSize]):
399         Some iOS-like operating systems don't have safe browsing.  Don't use symbols that don't exist on those systems.
400
401 2018-11-13  Ali Juma  <ajuma@chromium.org>
402
403         Turn Intersection Observer on by default
404         https://bugs.webkit.org/show_bug.cgi?id=191569
405
406         Reviewed by Simon Fraser.
407
408         * Shared/WebPreferences.yaml:
409
410 2018-11-12  Darshan Kadu  <darsh7807@gmail.com>
411
412         Implement Cache API support for WPE/GTK
413         https://bugs.webkit.org/show_bug.cgi?id=178316
414
415         Reviewed by Michael Catanzaro.
416
417         Added a new API function WKWebsiteDataStoreSetCacheStoragePerOriginQuota which sets the
418         cache limit per origin.
419
420         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
421         (WKWebsiteDataStoreSetCacheStoragePerOriginQuota):
422         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
423
424 2018-11-12  Alex Christensen  <achristensen@webkit.org>
425
426         [iOS] Implement safe browsing in WebKit
427         https://bugs.webkit.org/show_bug.cgi?id=191441
428
429         Reviewed by Tim Horton.
430
431         In r237863 I implemented this for Mac.  This refines the UI and implements it for iOS.
432
433         * Shared/WebPreferences.yaml:
434         * Shared/WebPreferencesDefaultValues.h:
435         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
436         (WKContextHandlesSafeBrowsing):
437         * UIProcess/API/Cocoa/WKWebView.mm:
438         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
439         (-[WKWebView _clearSafeBrowsingWarning]):
440         (-[WKWebView layoutSubviews]):
441         (-[WKWebView setFrameSize:]):
442         (+[WKWebView _handlesSafeBrowsing]):
443         (-[WKWebView _safeBrowsingWarningForTesting]):
444         * UIProcess/API/Cocoa/WKWebViewInternal.h:
445         * UIProcess/Cocoa/PageClientImplCocoa.h:
446         * UIProcess/Cocoa/PageClientImplCocoa.mm:
447         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
448         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
449         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
450         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
451         (confirmMalwareSentinel):
452         (visitUnsafeWebsiteSentinel):
453         (colorForItem):
454         (addLinkAndReplace):
455         (-[WKSafeBrowsingExclamationPoint drawRect:]):
456         (makeButton):
457         (makeTitleLabel):
458         (setBackground):
459         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
460         (-[WKSafeBrowsingWarning addContent]):
461         (-[WKSafeBrowsingWarning showDetailsClicked]):
462         (-[WKSafeBrowsingWarning layoutText]):
463         (-[WKSafeBrowsingWarning textView:clickedOnLink:atIndex:]):
464         (-[WKSafeBrowsingWarning layout]):
465         (-[WKSafeBrowsingWarning layoutSubviews]):
466         (-[WKSafeBrowsingWarning textView:shouldInteractWithURL:inRange:interaction:]):
467         (-[WKSafeBrowsingWarning didMoveToWindow]):
468         (-[WKSafeBrowsingWarning clickedOnLink:]):
469         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
470         (-[WKSafeBrowsingTextView intrinsicContentSize]):
471         (colorNamed): Deleted.
472         (+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]): Deleted.
473         (+[WKSafeBrowsingTextView viewWithString:]): Deleted.
474         (-[WKSafeBrowsingTextView clickedOnLink:atIndex:]): Deleted.
475         * UIProcess/ios/PageClientImplIOS.mm:
476         (WebKit::PageClientImpl::isViewWindowActive):
477         (WebKit::PageClientImpl::isViewFocused):
478         (WebKit::PageClientImpl::isViewVisible):
479         (WebKit::PageClientImpl::isViewInWindow):
480         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
481         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
482         (WebKit::PageClientImpl::showSafeBrowsingWarning):
483         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
484         (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
485         (WebKit::PageClientImpl::navigationGestureDidBegin):
486         (WebKit::PageClientImpl::navigationGestureWillEnd):
487         (WebKit::PageClientImpl::navigationGestureDidEnd):
488         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
489         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
490         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
491         * UIProcess/mac/PageClientImplMac.mm:
492         (WebKit::PageClientImpl::showShareSheet):
493         (WebKit::PageClientImpl::navigationGestureDidBegin):
494         (WebKit::PageClientImpl::navigationGestureWillEnd):
495         (WebKit::PageClientImpl::navigationGestureDidEnd):
496         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
497         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
498
499 2018-11-12  Tim Horton  <timothy_horton@apple.com>
500
501         Make it possible to edit images inline
502         https://bugs.webkit.org/show_bug.cgi?id=191352
503         <rdar://problem/30107985>
504
505         Reviewed by Dean Jackson.
506
507         * Platform/spi/ios/PencilKitSPI.h: Added.
508         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
509         (WebKit::RemoteLayerBackingStore::drawInContext):
510         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
511         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
512         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
513         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
514         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
515         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
516         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
517         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
518         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
519         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
520         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
521         (WebKit::PlatformCALayerRemote::embeddedViewID const):
522         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
523         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
524         (WebKit::RemoteLayerTreeContext::layerWasCreated):
525         Propagate EmbeddedViewID through the PlatformCALayer constructor and
526         through the layer creation parameters to the UI process.
527
528         * Shared/WebPreferences.yaml:
529         * UIProcess/API/Cocoa/WKWebView.mm:
530         (-[WKWebView _initializeWithConfiguration:]):
531         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
532         (-[WKWebViewConfiguration init]):
533         (-[WKWebViewConfiguration copyWithZone:]):
534         (-[WKWebViewConfiguration _setEditableImagesEnabled:]):
535         (-[WKWebViewConfiguration _editableImagesEnabled]):
536         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
537         Add a preference to enable editable images.
538
539         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
540         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
541         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
542         (WebKit::RemoteLayerTreeHost::clearLayers):
543         (WebKit::RemoteLayerTreeHost::createLayer):
544         Keep track of "embedded views" in two maps: embeddedViewID->UIView,
545         and layerID->embeddedViewID. Clean them up when layers go away.
546         If a embedded view is reparented, currently it must be added to a new
547         layer in the same commit as it is removed from the previous layer
548         in order to persist the view's state (otherwise the view will be
549         destroyed and recreated). This will be less of a problem after future
550         patches introduce serialization of image data and whatnot.
551
552         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
553         (WebKit::RemoteLayerTreeHost::createLayer):
554         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
555         Move the various remote layer tree UIView subclasses out into a separate file.
556
557         Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
558         and creates a WKDrawingView and sticks it in the maps.
559
560         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
561         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
562         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
563         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
564         (-[WKCompositingView hitTest:withEvent:]):
565         (-[WKCompositingView description]):
566         (+[WKTransformView layerClass]):
567         (+[WKSimpleBackdropView layerClass]):
568         (+[WKShapeView layerClass]):
569         (-[WKRemoteView initWithFrame:contextID:]):
570         (+[WKRemoteView layerClass]):
571         (-[WKBackdropView hitTest:withEvent:]):
572         (-[WKBackdropView description]):
573         (-[WKChildScrollView initWithFrame:]):
574         Move various remote layer tree UIView subclasses here, to their own file.
575         Make our UIView hit testing override test for views that conform to the
576         protocol "WKNativelyInteractible", which switches to normal UIView hit
577         testing. WKDrawingView will be the one such view.
578
579         Add WKChildScrollView and pull the one thing we customize out into it,
580         to make RemoteLayerTreeHost::createLayer less logic-ful.
581
582         * UIProcess/ios/WKDrawingView.h: Added.
583         * UIProcess/ios/WKDrawingView.mm: Added.
584         (-[WKDrawingView init]):
585         (-[WKDrawingView layoutSubviews]):
586         Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
587
588         * WebKit.xcodeproj/project.pbxproj:
589         * SourcesCocoa.txt:
590         Add the new files.
591
592 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
593
594         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
595         https://bugs.webkit.org/show_bug.cgi?id=189230
596         <rdar://problem/44050379>
597
598         Reviewed by Joseph Pecoraro.
599
600         Runs all png images through zopflipng. This results in a smaller file
601         size and takes care of this issue as a byproduct.
602
603         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png:
604         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png:
605         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png:
606         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png:
607         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png:
608         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png:
609
610 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
611
612         [MediaStream] Screen capture should be an experimental feature on OSX only
613         https://bugs.webkit.org/show_bug.cgi?id=191552
614         <rdar://problem/45994142>
615
616         Reviewed by Youenn Fablet.
617
618         * Shared/WebPreferences.yaml: Make ScreenCaptureEnabled.condition ENABLE(MEDIA_STREAM) && PLATFORM(MAC).
619
620 2018-11-12  Takashi Komori  <Takashi.Komori@sony.com>
621
622         Resurrect WebKitTestRunner for Windows port
623         https://bugs.webkit.org/show_bug.cgi?id=189257
624
625         Reviewed by Fujii Hironori.
626
627         * PlatformWin.cmake:
628
629 2018-11-12  Antoine Quint  <graouts@apple.com>
630
631         [Web Animations] Turn Web Animations experimental
632         https://bugs.webkit.org/show_bug.cgi?id=191543
633
634         Reviewed by Dean Jackson.
635
636         * Shared/WebPreferences.yaml:
637
638 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
639
640         Implement a new edit command to change the enclosing list type
641         https://bugs.webkit.org/show_bug.cgi?id=191487
642         <rdar://problem/45955922>
643
644         Reviewed by Ryosuke Niwa.
645
646         * UIProcess/WebEditCommandProxy.cpp:
647         (WebKit::WebEditCommandProxy::nameForEditAction):
648
649         Add undo/redo edit action strings for ConvertToOrderedList and ConvertToUnorderedList.
650
651         * WebProcess/WebPage/WebPage.cpp:
652         (WebKit::WebPage::increaseListLevel):
653         (WebKit::WebPage::decreaseListLevel):
654         (WebKit::WebPage::changeListType):
655
656         Remove preflight checks for these list editing commands. These are not necessary because these commands fall
657         back to being noops if these checks return false. This avoids an extraneous ancestor walk to determine the
658         enclosing list element when changing list type.
659
660 2018-11-11  Daniel Bates  <dabates@apple.com>
661
662         [iOS] Draw caps lock indicator in password fields
663         https://bugs.webkit.org/show_bug.cgi?id=190565
664         <rdar://problem/45262343>
665
666         Reviewed by Dean Jackson.
667
668         Notify the WebContent process with the current modifer state on window activation changes. Notify
669         the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
670
671         * UIProcess/API/Cocoa/WKWebView.mm:
672         (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
673         (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
674         (hardwareKeyboardAvailabilityChangedCallback): Added.
675         * UIProcess/WebPageProxy.cpp:
676         (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
677         * UIProcess/WebPageProxy.h:
678         * UIProcess/ios/WKContentViewInteraction.mm:
679         (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
680         keyboard flags changed event.
681         * UIProcess/ios/WebPageProxyIOS.mm:
682         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
683
684         * WebProcess/WebPage/WebPage.h:
685         * WebProcess/WebPage/WebPage.messages.in:
686         * WebProcess/WebPage/ios/WebPageIOS.mm:
687         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
688         Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
689         one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
690         so that we toggle visibility of the caps lock indicator.
691
692 2018-11-11  Dan Bernstein  <mitz@apple.com>
693
694         ProcessPoolConfiguration::copy() doesn’t copy m_customWebContentServiceBundleIdentifier
695         https://bugs.webkit.org/show_bug.cgi?id=191514
696
697         Reviewed by Geoffrey Garen.
698
699         Test: WebKitCocoa/WKProcessPoolConfiguration.mm
700
701         * UIProcess/API/APIProcessPoolConfiguration.cpp:
702         (API::ProcessPoolConfiguration::copy): Copy m_customWebContentServiceBundleIdentifier.
703
704 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
705
706         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
707         https://bugs.webkit.org/show_bug.cgi?id=191492
708
709         Reviewed by Alex Christensen.
710
711         * Platform/mac/StringUtilities.mm:
712         * UIProcess/ApplicationStateTracker.mm:
713         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
714         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
715
716 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
717
718         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
719         https://bugs.webkit.org/show_bug.cgi?id=191492
720
721         Reviewed by Alex Christensen.
722
723         * Platform/mac/StringUtilities.mm:
724         * UIProcess/ApplicationStateTracker.mm:
725         (WebKit::ApplicationStateTracker::applicationDidEnterBackground):
726         (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
727         (WebKit::ApplicationStateTracker::applicationWillEnterForeground):
728         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
729         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
730
731 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
732
733         Unreviewed, rolling out r238065.
734
735         Breaks internal builds.
736
737         Reverted changeset:
738
739         "Make it possible to edit images inline"
740         https://bugs.webkit.org/show_bug.cgi?id=191352
741         https://trac.webkit.org/changeset/238065
742
743 2018-11-10  Tim Horton  <timothy_horton@apple.com>
744
745         Make it possible to edit images inline
746         https://bugs.webkit.org/show_bug.cgi?id=191352
747         <rdar://problem/30107985>
748
749         Reviewed by Dean Jackson.
750
751         * Platform/spi/ios/PencilKitSPI.h: Added.
752         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
753         (WebKit::RemoteLayerBackingStore::drawInContext):
754         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
755         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
756         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
757         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
758         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
759         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
760         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
761         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
762         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
763         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
764         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
765         (WebKit::PlatformCALayerRemote::embeddedViewID const):
766         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
767         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
768         (WebKit::RemoteLayerTreeContext::layerWasCreated):
769         Propagate EmbeddedViewID through the PlatformCALayer constructor and
770         through the layer creation parameters to the UI process.
771
772         * Shared/WebPreferences.yaml:
773         * UIProcess/API/Cocoa/WKWebView.mm:
774         (-[WKWebView _initializeWithConfiguration:]):
775         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
776         (-[WKWebViewConfiguration init]):
777         (-[WKWebViewConfiguration copyWithZone:]):
778         (-[WKWebViewConfiguration _setEditableImagesEnabled:]):
779         (-[WKWebViewConfiguration _editableImagesEnabled]):
780         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
781         Add a preference to enable editable images.
782
783         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
784         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
785         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
786         (WebKit::RemoteLayerTreeHost::clearLayers):
787         (WebKit::RemoteLayerTreeHost::createLayer):
788         Keep track of "embedded views" in two maps: embeddedViewID->UIView,
789         and layerID->embeddedViewID. Clean them up when layers go away.
790         If a embedded view is reparented, currently it must be added to a new
791         layer in the same commit as it is removed from the previous layer
792         in order to persist the view's state (otherwise the view will be
793         destroyed and recreated). This will be less of a problem after future
794         patches introduce serialization of image data and whatnot.
795
796         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
797         (WebKit::RemoteLayerTreeHost::createLayer):
798         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
799         Move the various remote layer tree UIView subclasses out into a separate file.
800
801         Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
802         and creates a WKDrawingView and sticks it in the maps.
803
804         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
805         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
806         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
807         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
808         (-[WKCompositingView hitTest:withEvent:]):
809         (-[WKCompositingView description]):
810         (+[WKTransformView layerClass]):
811         (+[WKSimpleBackdropView layerClass]):
812         (+[WKShapeView layerClass]):
813         (-[WKRemoteView initWithFrame:contextID:]):
814         (+[WKRemoteView layerClass]):
815         (-[WKBackdropView hitTest:withEvent:]):
816         (-[WKBackdropView description]):
817         (-[WKChildScrollView initWithFrame:]):
818         Move various remote layer tree UIView subclasses here, to their own file.
819         Make our UIView hit testing override test for views that conform to the
820         protocol "WKNativelyInteractible", which switches to normal UIView hit
821         testing. WKDrawingView will be the one such view.
822
823         Add WKChildScrollView and pull the one thing we customize out into it,
824         to make RemoteLayerTreeHost::createLayer less logic-ful.
825
826         * UIProcess/ios/WKDrawingView.h: Added.
827         * UIProcess/ios/WKDrawingView.mm: Added.
828         (-[WKDrawingView init]):
829         (-[WKDrawingView layoutSubviews]):
830         Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
831
832         * WebKit.xcodeproj/project.pbxproj:
833         * SourcesCocoa.txt:
834         Add the new files.
835
836 2018-11-09  Zalan Bujtas  <zalan@apple.com>
837
838         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
839         https://bugs.webkit.org/show_bug.cgi?id=191078
840         <rdar://problem/45736178>
841
842         Reviewed by Antti Koivisto.
843
844         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
845         (WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
846         * WebProcess/WebCoreSupport/WebChromeClient.h:
847         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
848         (WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
849         * WebProcess/WebPage/AcceleratedDrawingArea.h:
850         * WebProcess/WebPage/DrawingArea.h:
851         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
852         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
853         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
854         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
855         (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
856         (WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
857         (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
858         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
859         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
860         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
861         (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
862
863 2018-11-09  John Wilander  <wilander@apple.com>
864
865         Add ability to configure document.cookie lifetime cap through user defaults
866         https://bugs.webkit.org/show_bug.cgi?id=191480
867         <rdar://problem/45240871>
868
869         Reviewed by Chris Dumez.
870
871         This change makes the capped lifetime in seconds configurable through
872         user defaults.
873
874         * NetworkProcess/NetworkProcess.cpp:
875         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
876         (WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies): Deleted.
877             Renamed setAgeCapForClientSideCookies().
878         * NetworkProcess/NetworkProcess.h:
879         * NetworkProcess/NetworkProcess.messages.in:
880         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
881         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
882         * UIProcess/Network/NetworkProcessProxy.cpp:
883         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
884         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
885         (WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies): Deleted.
886             Renamed setAgeCapForClientSideCookies().
887         (WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies): Deleted.
888             Renamed didSetAgeCapForClientSideCookies().
889         * UIProcess/Network/NetworkProcessProxy.h:
890         * UIProcess/Network/NetworkProcessProxy.messages.in:
891         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
892         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies):
893         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
894         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess):
895             New function that handles all the things that need to be done when a network
896             process has been created.
897         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
898         * UIProcess/WebResourceLoadStatisticsStore.cpp:
899         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
900             Now just calls the corresponding function on its memory store where all the
901             configuration parameters are available.
902         * UIProcess/WebResourceLoadStatisticsStore.h:
903         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
904         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
905         (WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies): Deleted.
906             Renamed setAgeCapForClientSideCookies().
907         * UIProcess/WebsiteData/WebsiteDataStore.h:
908
909 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
910
911         Unreviewed, rolling out r238047.
912
913         Introduced layout test failures on iOS simulator.
914
915         Reverted changeset:
916
917         "[iOS] Draw caps lock indicator in password fields"
918         https://bugs.webkit.org/show_bug.cgi?id=190565
919         https://trac.webkit.org/changeset/238047
920
921 2018-11-09  Chris Dumez  <cdumez@apple.com>
922
923         Suspended page persists even after back/forward list item is gone
924         https://bugs.webkit.org/show_bug.cgi?id=191488
925         <rdar://problem/45953006>
926
927         Reviewed by Geoffrey Garen.
928
929         Currently, the WebProcessPool owns the SuspendedPageProxy objects and makes sure we cap how
930         many we can have. The WebBackForwardListItem merely has a WeakPtr to its associated
931         SuspendedPageProxy. However, there is no point in having the WebProcessPool keeping a
932         SuspendedPageProxy object alive if there is no longer any WebBackForwardListItem pointing
933         to it.
934
935         To address the issue, WebBackForwardListItem nows tells the WebProcessPool to destroy
936         its SuspendedPageProxy when necessary. WebBackForwardList also takes care of nulling
937         out the WebBackForwardListItem's SuspendedPageProxy after the item has been removed
938         from the list (in case somebody keeps the item alive).
939
940         * Shared/WebBackForwardListItem.cpp:
941         (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
942         (WebKit::WebBackForwardListItem::setSuspendedPage):
943         (WebKit::WebBackForwardListItem::suspendedPageIsNoLongerNeeded):
944         * Shared/WebBackForwardListItem.h:
945         * UIProcess/SuspendedPageProxy.cpp:
946         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
947         * UIProcess/WebBackForwardList.cpp:
948         (WebKit::WebBackForwardList::didRemoveItem):
949         * UIProcess/WebProcessPool.cpp:
950         (WebKit::WebProcessPool::removeSuspendedPageProxy):
951         * UIProcess/WebProcessPool.h:
952
953 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
954
955         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
956         https://bugs.webkit.org/show_bug.cgi?id=191471
957         <rdar://problem/45952472>
958
959         Reviewed by Tim Horton.
960
961         Implement these method stubs by calling into Editor.
962
963         Test: WKWebViewEditActions.ModifyListLevel
964
965         * WebProcess/WebPage/WebPage.cpp:
966         (WebKit::WebPage::increaseListLevel):
967         (WebKit::WebPage::decreaseListLevel):
968         (WebKit::WebPage::changeListType):
969
970 2018-11-09  Keith Rollin  <krollin@apple.com>
971
972         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
973
974         Remove the use of .xcfilelists until their side-effects are better
975         understood.
976
977         * WebKit.xcodeproj/project.pbxproj:
978
979 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
980
981         [Curl][WebKit] Implement Proxy configuration API.
982         https://bugs.webkit.org/show_bug.cgi?id=189053
983
984         Reviewed by Youenn Fablet.
985
986         Added proxy configuration API to WebsiteDataStore. Three API were added in WKWebsiteDataStoreRefCurl.h:
987         - WKWebsiteDataStoreEnableDefaultNetworkProxySettings(WKWebsiteDataStoreRef)
988         - WKWebsiteDataStoreEnableCustomNetworkProxySettings(WKWebsiteDataStoreRef, WKURLRef, WKStringRef ignoreHosts)
989         - WKWebsiteDataStoreDisableNetworkProxySettings(WKWebsiteDataStoreRef)
990
991         * NetworkProcess/NetworkProcess.h:
992         * NetworkProcess/NetworkProcess.messages.in:
993         * NetworkProcess/NetworkSessionCreationParameters.h:
994         (WebKit::NetworkSessionCreationParameters::encode const):
995         (WebKit::NetworkSessionCreationParameters::decode):
996         * NetworkProcess/curl/NetworkProcessCurl.cpp:
997         (WebKit::NetworkProcess::setNetworkProxySettings):
998         * NetworkProcess/curl/NetworkSessionCurl.cpp:
999         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
1000         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
1001         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1002         * PlatformWin.cmake:
1003         * Shared/WebCoreArgumentCoders.h:
1004         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
1005         (IPC::ArgumentCoder<CurlProxySettings>::encode):
1006         (IPC::ArgumentCoder<CurlProxySettings>::decode):
1007         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
1008           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
1009         (WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
1010         (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
1011         (WKWebsiteDataStoreDisableNetworkProxySettings):
1012         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.h:
1013           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
1014         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1015         (WebKit::WebsiteDataStore::parameters):
1016         * UIProcess/WebsiteData/WebsiteDataStore.h:
1017         (WebKit::WebsiteDataStore::networkProxySettings const):
1018         * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
1019           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
1020         (WebKit::WebsiteDataStore::platformSetParameters):
1021         (WebKit::WebsiteDataStore::setNetworkProxySettings):
1022
1023 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1024
1025         [Cocoa] Introduce WKWebView SPI to insert nested ordered and unordered lists
1026         https://bugs.webkit.org/show_bug.cgi?id=191410
1027         <rdar://problem/45898610>
1028
1029         Reviewed by Dean Jackson.
1030
1031         Prefixes a few iOS-only SPI methods declared on WKWebView in r236867 with underscores, and also exposes some
1032         more cross-platform Cocoa editing SPI. Once the unprefixed SPI methods are no longer used by internal clients,
1033         these will need to be removed (see followup bug: webkit.org/b/191450). See below for more details.
1034
1035         Covered by new and existing API tests in WKWebViewEditActions.
1036
1037         * UIProcess/API/Cocoa/WKWebView.mm:
1038
1039         Hoist the definition (and undefinition) of `FORWARD_ACTION_TO_WKCONTENTVIEW` to encompass both the WKWebView
1040         implementation and the WKWebView (WKPrivate) implementation. This allows us to use this macro when implementing
1041         SPI methods in the WKPrivate category, as well as methods that are part of the main WKWebView implementation.
1042
1043         (-[WKWebView canPerformAction:withSender:]):
1044         (-[WKWebView targetForAction:withSender:]):
1045
1046         Add forwarding for the new editing commands in -canPerformAction: and -targetForAction:.
1047
1048         (-[WKWebView _toggleStrikeThrough:]):
1049         (-[WKWebView _increaseListLevel:]):
1050         (-[WKWebView _decreaseListLevel:]):
1051         (-[WKWebView _changeListType:]):
1052         (-[WKWebView _setFont:sender:]):
1053         (-[WKWebView _setFontSize:sender:]):
1054         (-[WKWebView _setTextColor:sender:]):
1055
1056         Add definitions for the new editing methods on WKWebView, using macros (`WEBCORE_PRIVATE_COMMAND` on macOS and
1057         `FORWARD_ACTION_TO_WKCONTENTVIEW` on iOS) to help reduce the code duplication.
1058
1059         (-[WKWebView _pasteAsQuotation:]): Deleted.
1060
1061         Remove this method definition, which is now replaced by macros on iOS and macOS.
1062
1063         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1064
1065         Introduce the new SPI to WKWebView (WKPrivate), and add FIXMEs to remove old, unprefixed variants of the SPI.
1066
1067         * UIProcess/WebPageProxy.cpp:
1068         (WebKit::WebPageProxy::increaseListLevel):
1069         (WebKit::WebPageProxy::decreaseListLevel):
1070         (WebKit::WebPageProxy::changeListType):
1071
1072         Add plumbing for these list editing commands.
1073
1074         * UIProcess/WebPageProxy.h:
1075         * UIProcess/ios/WKContentViewInteraction.h:
1076         * UIProcess/ios/WKContentViewInteraction.mm:
1077         (-[WKContentView _increaseListLevelForWebView:]):
1078         (-[WKContentView _decreaseListLevelForWebView:]):
1079         (-[WKContentView _changeListTypeForWebView:]):
1080         (-[WKContentView _toggleStrikeThroughForWebView:]):
1081         (-[WKContentView _setFontForWebView:sender:]):
1082         (-[WKContentView _setFontSizeForWebView:sender:]):
1083         (-[WKContentView _setTextColorForWebView:sender:]):
1084         (-[WKContentView toggleStrikeThroughForWebView:]):
1085         (-[WKContentView setFontForWebView:sender:]):
1086         (-[WKContentView setFontSizeForWebView:sender:]):
1087         (-[WKContentView setTextColorForWebView:sender:]):
1088         (-[WKContentView canPerformActionForWebView:withSender:]):
1089
1090         Check for the new action selectors here, and additionally add validation for `_pasteAsQuotation:`. Let the
1091         unprefixed versions of these methods simply call the prefixed versions (these method implementations will be
1092         removed in a followup once doing so would not affect any clients of WebKit).
1093
1094         * WebKit.xcodeproj/project.pbxproj:
1095         * WebProcess/WebPage/WebPage.cpp:
1096         (WebKit::WebPage::increaseListLevel):
1097         (WebKit::WebPage::decreaseListLevel):
1098         (WebKit::WebPage::changeListType):
1099         * WebProcess/WebPage/WebPage.h:
1100         * WebProcess/WebPage/WebPage.messages.in:
1101
1102         Add stubs for several list editing commands that are yet to be hooked up to WebCore. These will be implemented
1103         in a future patch.
1104
1105 2018-11-09  Antti Koivisto  <antti@apple.com>
1106
1107         Use OptionSet for layout milestones
1108         https://bugs.webkit.org/show_bug.cgi?id=191470
1109
1110         Reviewed by Dean Jackson.
1111
1112         * Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
1113         (renderingProgressEvents):
1114         * Shared/API/c/WKSharedAPICast.h:
1115         (WebKit::toWKLayoutMilestones):
1116         (WebKit::toLayoutMilestones):
1117         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1118         (WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const):
1119         (WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones):
1120         * Shared/WebPageCreationParameters.cpp:
1121         (WebKit::WebPageCreationParameters::encode const):
1122         (WebKit::WebPageCreationParameters::decode):
1123         * Shared/WebPageCreationParameters.h:
1124         * UIProcess/API/APILoaderClient.h:
1125         (API::LoaderClient::didReachLayoutMilestone):
1126         * UIProcess/API/APINavigationClient.h:
1127         (API::NavigationClient::renderingProgressDidChange):
1128         * UIProcess/API/C/WKPage.cpp:
1129         (WKPageSetPageLoaderClient):
1130         (WKPageSetPageNavigationClient):
1131         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
1132         (pageRenderingProgressEvents):
1133         * UIProcess/API/Cocoa/WKWebView.mm:
1134         (layoutMilestones):
1135         * UIProcess/Cocoa/NavigationState.h:
1136         * UIProcess/Cocoa/NavigationState.mm:
1137         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
1138         * UIProcess/WebPageProxy.cpp:
1139         (WebKit::WebPageProxy::listenForLayoutMilestones):
1140         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
1141         (WebKit::WebPageProxy::didReachLayoutMilestone):
1142         * UIProcess/WebPageProxy.h:
1143         * UIProcess/WebPageProxy.messages.in:
1144         * UIProcess/ios/WebPageProxyIOS.mm:
1145         (WebKit::WebPageProxy::didCommitLayerTree):
1146         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1147         (API::InjectedBundle::PageLoaderClient::didReachLayoutMilestone):
1148         (API::InjectedBundle::PageLoaderClient::layoutMilestones const):
1149         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1150         (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone):
1151         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
1152         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1153         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1154         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
1155         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1156         * WebProcess/WebPage/DrawingArea.h:
1157         (WebKit::DrawingArea::dispatchDidReachLayoutMilestone):
1158         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1159         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1160         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1161         (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone):
1162         * WebProcess/WebPage/WebPage.cpp:
1163         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1164         (WebKit::WebPage::listenForLayoutMilestones):
1165         (WebKit::WebPage::dispatchDidReachLayoutMilestone):
1166         * WebProcess/WebPage/WebPage.h:
1167         * WebProcess/WebPage/WebPage.messages.in:
1168         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1169         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1170         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones):
1171         (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone):
1172
1173 2018-11-09  Daniel Bates  <dabates@apple.com>
1174
1175         [iOS] Draw caps lock indicator in password fields
1176         https://bugs.webkit.org/show_bug.cgi?id=190565
1177         <rdar://problem/45262343>
1178
1179         Reviewed by Dean Jackson.
1180
1181         Notify the WebContent process with the current modifer state on window activation changes. Notify
1182         the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
1183
1184         * UIProcess/API/Cocoa/WKWebView.mm:
1185         (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
1186         (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
1187         (hardwareKeyboardAvailabilityChangedCallback): Added.
1188         * UIProcess/WebPageProxy.cpp:
1189         (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
1190         * UIProcess/WebPageProxy.h:
1191         * UIProcess/ios/WKContentViewInteraction.mm:
1192         (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
1193         keyboard flags changed event.
1194         * UIProcess/ios/WebPageProxyIOS.mm:
1195         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
1196
1197         * WebProcess/WebPage/WebPage.h:
1198         * WebProcess/WebPage/WebPage.messages.in:
1199         * WebProcess/WebPage/ios/WebPageIOS.mm:
1200         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
1201         Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
1202         one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
1203         so that we toggle visibility of the caps lock indicator.
1204
1205 2018-11-09  Tim Horton  <timothy_horton@apple.com>
1206
1207         Make use of _UIRemoteView instead of CALayerHost if possible for WKRemoteView
1208         https://bugs.webkit.org/show_bug.cgi?id=191449
1209         <rdar://problem/45884977>
1210
1211         Reviewed by Eric Carlson.
1212
1213         UIRemoteView has some nice process assertion management that it would
1214         be nice to not duplicate. So, we can just use it instead of CALayerHost!
1215
1216         * Platform/spi/ios/UIKitSPI.h:
1217         * UIProcess/DrawingAreaProxy.h:
1218         (WebKit::DrawingAreaProxy::page const):
1219         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1220         (-[WKUIRemoteView hitTest:withEvent:]):
1221         (-[WKUIRemoteView description]):
1222         (createRemoteView):
1223         (WebKit::RemoteLayerTreeHost::createLayer):
1224
1225 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
1226
1227         [MediaStream] Make screen capture an experimental feature
1228         https://bugs.webkit.org/show_bug.cgi?id=191472
1229         <rdar://problem/45946499>
1230
1231         Reviewed by Jer Noble.
1232
1233         * Shared/WebPreferences.yaml: Make ScreenCaptureEnabled an experimental feature.
1234
1235 2018-11-09  Daniel Bates  <dabates@apple.com>
1236
1237         [iOS] Pressing forward delete key in text field does nothing and we should not invoke an editor
1238         action when forward delete is pressed outside a text field
1239         https://bugs.webkit.org/show_bug.cgi?id=190566
1240         <rdar://problem/45262367>
1241
1242         Reviewed by Wenson Hsieh.
1243
1244         Override -_deleteForwardAndNotify to perform a forward deletion and remove the dead code that
1245         expected UIKit to send us a character string with 0xF728 for the forward delete key. UIKit
1246         ceased doing this many years ago. We may revist this decision once <rdar://problem/45772078>
1247         is fixed.
1248
1249         * UIProcess/ios/WKContentViewInteraction.mm:
1250         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1251         (-[WKContentView _deleteForwardAndNotify:]):
1252
1253 2018-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1254
1255         Unreviewed, try to fix the 32-bit macOS build
1256
1257         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1258         (WebKit::PDFPlugin::showDefinitionForAttributedString):
1259
1260 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1261
1262         Add an SPI to allow WebView clients to add additional supported image formats
1263         https://bugs.webkit.org/show_bug.cgi?id=190454
1264
1265         Reviewed by Simon Fraser.
1266
1267         * Platform/mac/StringUtilities.h:
1268         * Platform/mac/StringUtilities.mm:
1269         (WebKit::webCoreStringVectorFromNSStringArray):
1270         A helper function which converts an NSArray of NSStrings to a Vector of
1271         WTFString.
1272
1273         * Shared/WebPageCreationParameters.cpp:
1274         (WebKit::WebPageCreationParameters::encode const):
1275         (WebKit::WebPageCreationParameters::decode):
1276         * Shared/WebPageCreationParameters.h:
1277         Handle encoding and decoding the AdditionalSupportedImageTypes which will
1278         allow transferring it from the UI process to the web process.
1279
1280         * UIProcess/API/APIPageConfiguration.h:
1281         (API::PageConfiguration::additionalSupportedImageTypes const):
1282         (API::PageConfiguration::setAdditionalSupportedImageTypes):
1283         Store the AdditionalSupportedImageTypes in the APIPageConfiguration
1284         which is used when creating the WebPageProxy in the UIPorcess.
1285
1286         * UIProcess/API/Cocoa/WKWebView.mm:
1287         (-[WKWebView _initializeWithConfiguration:]):
1288         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1289         (-[WKWebViewConfiguration copyWithZone:]):
1290         (-[WKWebViewConfiguration _additionalSupportedImageTypes]):
1291         (-[WKWebViewConfiguration _setAdditionalSupportedImageTypes:]):
1292         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1293         Setter/Getter for the AdditionalSupportedImageTypes.
1294
1295         * UIProcess/WebPageProxy.cpp:
1296         (WebKit::WebPageProxy::creationParameters):
1297         Copy the AdditionalSupportedImageTypes from APIPageConfiguration to 
1298         WebPageCreationParameters.
1299
1300         * UIProcess/WebPageProxy.h:
1301         Delete unimplemented function.
1302
1303         * WebProcess/WebPage/WebPage.cpp:
1304         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1305         Copy the AdditionalSupportedImageTypes from WebPageCreationParameters to
1306         WebCore.
1307
1308 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
1309
1310         Adopt Reveal Framework to replace Lookup
1311         https://bugs.webkit.org/show_bug.cgi?id=191097
1312         <rdar://problem/45924508>
1313
1314         Reviewed by Tim Horton.
1315
1316         Pass in what it needed to clear the textIndicators. This is better than
1317         the current notification structure.
1318
1319         * UIProcess/Cocoa/WebViewImpl.mm:
1320         (-[WKWindowVisibilityObserver dealloc]):
1321         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
1322         * UIProcess/mac/PageClientImplMac.mm:
1323         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1324         * UIProcess/mac/WKImmediateActionController.mm:
1325         (-[WKImmediateActionController _animationControllerForText]):
1326         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1327         (WebKit::PDFPlugin::showDefinitionForAttributedString):
1328
1329         Generate and pass in the text indicator information, as this is needed now.
1330
1331         * WebProcess/WebPage/mac/WebPageMac.mm:
1332         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin):
1333
1334 2018-11-08  Keith Rollin  <krollin@apple.com>
1335
1336         Create .xcfilelist files
1337         https://bugs.webkit.org/show_bug.cgi?id=191324
1338         <rdar://problem/45852819>
1339
1340         Reviewed by Alex Christensen.
1341
1342         As part of preparing for enabling XCBuild, create and use .xcfilelist
1343         files. These files are using during Run Script build phases in an
1344         Xcode project. If a Run Script build phase produces new files that are
1345         used later as inputs to subsequent build phases, XCBuild needs to know
1346         about these files. These files can be either specified in an "output
1347         files" section of the Run Script phase editor, or in .xcfilelist files
1348         that are associated with the Run Script build phase.
1349
1350         This patch takes the second approach. It consists of three sets of changes:
1351
1352         - Modify the DerivedSources.make files to have a
1353           'print_all_generated_files" target that produces a list of the files
1354           they create.
1355
1356         - Create a shell script that produces .xcfilelist files from the
1357           output of the previous step, as well as for the files created in the
1358           Generate Unified Sources build steps.
1359
1360         - Add the new .xcfilelist files to the associated projects.
1361
1362         Note that, with these changes, the Xcode workspace and projects can no
1363         longer be fully loaded into Xcode 9. Xcode will attempt to load the
1364         projects that have .xcfilelist files associated with them, but will
1365         fail and display a placeholder for those projects instead. It's
1366         expected that all developers are using Xcode 10 by now and that not
1367         being able to load into Xcode 9 is not a practical issue. Keep in mind
1368         that this is strictly an IDE issue, and that the projects can still be
1369         built with `xcodebuild`.
1370
1371         Also note that the shell script that creates the .xcfilelist files can
1372         also be used to verify that the set of files that's currently checked
1373         in is up-to-date. This checking can be used as part of a check-in hook
1374         or part of check-webkit-style to sooner catch cases where the
1375         .xcfilelist files need to be regenerated.
1376
1377         * DerivedSources.make:
1378         * DerivedSources.xcfilelist: Added.
1379         * UnifiedSources.xcfilelist: Added.
1380         * WebKit.xcodeproj/project.pbxproj:
1381
1382 2018-11-08  Timothy Hatcher  <timothy@apple.com>
1383
1384         Add experimental support for a `supported-color-schemes` CSS property.
1385         https://bugs.webkit.org/show_bug.cgi?id=191319
1386         rdar://problem/45852261
1387
1388         Reviewed by Dean Jackson.
1389
1390         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1391         (WebKit::InjectedBundleRangeHandle::renderedImage):
1392         * WebProcess/WebPage/WebPage.cpp:
1393         (WebKit::WebPage::drawRect):
1394
1395 2018-11-08  Eric Carlson  <eric.carlson@apple.com>
1396
1397         [MediaStream] Use DeviceIdHashSaltStorage to generate device ID hash salt
1398         https://bugs.webkit.org/show_bug.cgi?id=190825
1399         <rdar://problem/45486085>
1400
1401         Reviewed by Youenn Fablet.
1402
1403         * UIProcess/API/C/WKUserMediaPermissionCheck.cpp:
1404         (WKUserMediaPermissionCheckSetUserMediaAccessInfo):
1405         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
1406         (webkitDeviceInfoPermissionRequestAllow):
1407         (webkitDeviceInfoPermissionRequestDeny):
1408         * UIProcess/Cocoa/UIDelegate.mm:
1409         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
1410         * UIProcess/DeviceIdHashSaltStorage.cpp:
1411         (WebKit::DeviceIdHashSaltStorage::regenerateDeviceIdHashSaltForOrigin):
1412         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigin):
1413         * UIProcess/DeviceIdHashSaltStorage.h:
1414         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1415         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
1416         * UIProcess/UserMediaPermissionCheckProxy.h:
1417         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1418         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest):
1419         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1420         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1421         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
1422         (WebKit::UserMediaPermissionRequestManagerProxy::updateDeviceIDHashSalt):
1423         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1424         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1425         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1426         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
1427         * UIProcess/UserMediaPermissionRequestProxy.h:
1428         (WebKit::UserMediaPermissionRequestProxy::create):
1429         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const): Deleted.
1430
1431 2018-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1432
1433         [GTK] Crash when running with sandbox enabled
1434         https://bugs.webkit.org/show_bug.cgi?id=191353
1435
1436         Reviewed by Michael Catanzaro.
1437
1438         g_key_file_set_string_list() expects a null-terminated array as parameter.
1439
1440         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1441         (WebKit::createFlatpakInfo): Append nullptr to sharedPermissions array.
1442
1443 2018-11-07  Chris Dumez  <cdumez@apple.com>
1444
1445         Unreviewed, fix iOS build with recent SDKs.
1446
1447         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1448         (-[WKFullScreenWindowController _EVOrganizationName]):
1449
1450 2018-11-07  John Wilander  <wilander@apple.com>
1451
1452         Resource Load Statistics: Enable cap on partitioned cache max age
1453         https://bugs.webkit.org/show_bug.cgi?id=191395
1454         <rdar://problem/45885977>
1455
1456         Reviewed by Chris Dumez.
1457
1458         This change does not bump the network cache revision number.
1459         It's not needed since it was done just a week ago.
1460
1461         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1462         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap):
1463         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap):
1464         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
1465         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1466         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
1467
1468 2018-11-07  Daniel Bates  <dabates@apple.com>
1469
1470         [iOS] Support deleting to the start of the line and to the end of the line
1471         https://bugs.webkit.org/show_bug.cgi?id=191389
1472         <rdar://problem/45883972>
1473
1474         Reviewed by Wenson Hsieh.
1475
1476         Add support for the key commands Command + Delete and Control + K to delete to the start
1477         of the line and to delete to the end of the line, respectively.
1478
1479         * UIProcess/ios/WKContentViewInteraction.mm:
1480         (-[WKContentView _deleteToStartOfLine]): Added.
1481         (-[WKContentView _deleteToEndOfLine]): Added.
1482
1483 2018-11-07  Daniel Bates  <dabates@apple.com>
1484
1485         [iOS] Option + Delete should delete previous word
1486         https://bugs.webkit.org/show_bug.cgi?id=191381
1487         <rdar://problem/23681351>
1488
1489         Reviewed by Wenson Hsieh.
1490
1491         Implement support for pressing Option + Delete to delete the previous word. This makes text editing
1492         in WebKit more closely match the platform conventions.
1493
1494         * UIProcess/ios/WKContentViewInteraction.mm:
1495         (-[WKContentView _deleteByWord]):
1496
1497 2018-11-07  Daniel Bates  <dabates@apple.com>
1498
1499         Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
1500         https://bugs.webkit.org/show_bug.cgi?id=190141
1501
1502         Reviewed by Darin Adler.
1503
1504         Directly use +[UIKeyboard isInHardwareKeyboardMode]. We will override this class method
1505         in DumpRenderTree and WebKitTestRunner to always return NO so as to make test runs
1506         deterministic regardless of whether a hardware keyboard is attached.
1507
1508         * Shared/NativeWebKeyboardEvent.h:
1509         * Shared/ios/NativeWebKeyboardEventIOS.mm:
1510         (WebKit::isInHardwareKeyboardMode): Deleted.
1511         * UIProcess/ios/WKContentViewInteraction.mm:
1512         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1513         * WebProcess/WebPage/ios/WebPageIOS.mm:
1514         (WebKit::WebPage::platformEditorState const):
1515
1516 2018-11-07  Zamiul Haque  <zhaque@apple.com>
1517
1518         Force a gregorian calendar to show for credit card expiration date inputs
1519         (autocomplete='cc-exp'*) regardless of default system settings.
1520         https://bugs.webkit.org/show_bug.cgi?id=191096
1521         rdar://problem/42640256
1522
1523         Reviewed by Tim Horton.
1524
1525         Added some plumbing code to expose the calendar identifier of the calendar used by a
1526         presented date picker. Added shouldPresentGregorianCalendar:, to be used for
1527         determining what property values a date input control must present a Gregorian
1528         calendar for.
1529
1530         * UIProcess/ios/WKContentViewInteraction.mm:
1531         (-[WKContentView formInputPeripheral]):
1532         * UIProcess/ios/forms/WKFormInputControl.mm:
1533
1534 2018-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1535
1536         Unreviewed. Fix GTK/WPE build when memfd is not available after r237922.
1537
1538         * Platform/unix/SharedMemoryUnix.cpp:
1539         (WebKit::createSharedMemory):
1540
1541 2018-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1542
1543         [Linux] Use memfd_create when available in SharedMemory implementation
1544         https://bugs.webkit.org/show_bug.cgi?id=189741
1545
1546         Reviewed by Michael Catanzaro.
1547
1548         If memfd is available, use it instead of shm_open.
1549
1550         * Platform/unix/SharedMemoryUnix.cpp:
1551         (WebKit::createSharedMemory): Helper to create the shared memory, trying first with memfd and falling back to
1552         shm if it's not available.
1553         (WebKit::SharedMemory::create): Use createSharedMemory() helper.
1554
1555 2018-11-06  Justin Fan  <justin_fan@apple.com>
1556
1557         [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
1558         https://bugs.webkit.org/show_bug.cgi?id=191291
1559
1560         Reviewed by Myles Maxfield.
1561
1562         Properly disable WEBGPU on all non-Metal platforms for now.
1563
1564         * Configurations/FeatureDefines.xcconfig:
1565
1566 2018-11-06  Youenn Fablet  <youenn@apple.com>
1567
1568         Make mDNS ICE Candidate an experimental flag again
1569         https://bugs.webkit.org/show_bug.cgi?id=191262
1570
1571         Reviewed by Dean Jackson.
1572
1573         * Shared/WebPreferences.yaml:
1574         * UIProcess/API/C/WKPreferences.cpp:
1575         (WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
1576         (WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
1577         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1578         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1579
1580 2018-11-06  Suresh Koppisetty  <skoppisetty@apple.com>
1581
1582         Don’t use the main queue to create an XPC connection.
1583         https://bugs.webkit.org/show_bug.cgi?id=191160
1584         <rdar://problem/45736262>
1585
1586         Reviewed by Geoffrey Garen.
1587
1588         Don't use the main queue to create an XPC connection. xpc_connection_set_bootstrap does
1589         dispatch_mach_send_barrier_f on this queue which delays the sending of the subsequent
1590         bootstrap message (sent to launchd for launching a new target process) when the main queue is busy.
1591
1592         Now that the XPC connection runs on the default concurrent queue, errorHandler could be invoked
1593         by any thread. The job of errorHandler is to dispatch errorHandlerImpl to the main thread,
1594         where errorHandlerImpl is responsible for the actual handling of errors if any.
1595
1596         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1597         (WebKit::ProcessLauncher::launchProcess):
1598
1599 2018-11-06  Brian Burg  <bburg@apple.com>
1600
1601         Add missing iOS availability macro to _WKAutomationSessionConfiguration
1602         https://bugs.webkit.org/show_bug.cgi?id=191320
1603
1604         Reviewed by Tim Horton.
1605
1606         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
1607
1608 2018-11-06  John Wilander  <wilander@apple.com>
1609
1610         Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
1611         https://bugs.webkit.org/show_bug.cgi?id=189760
1612         <rdar://problem/44612242>
1613
1614         Reviewed by Youenn Fablet and Antti Koivisto.
1615
1616         When a redirect cache entry for a prevalent resource reaches its max
1617         age cap, it is loaded again from the network and the network response
1618         is compared with what's in the cache. If it's a match, the cache entry
1619         is fully accepted. If not, a new capped cache entry is created.
1620
1621         This feature is still off by default.
1622
1623         * NetworkProcess/NetworkResourceLoader.cpp:
1624         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
1625             Now checks the new member m_cacheEntryForMaxAgeCapValidation.
1626         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1627             New case handled for entry->hasReachedPrevalentResourceAgeCap().
1628         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
1629             This is where the new logic compares the incoming redirect with the
1630             cached one. If they match, an uncapped entry is allowed to be stored.
1631             If they don't match, a new capped entry will be stored.
1632         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1633             Now calls the new
1634             NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation()
1635             function.
1636         * NetworkProcess/NetworkResourceLoader.h:
1637             Added the m_cacheEntryForMaxAgeCapValidation member.
1638         * NetworkProcess/cache/NetworkCache.cpp:
1639         (WebKit::NetworkCache::makeUseDecision):
1640             Restored to previous behavior which means
1641             UseDecision::NoDueToPrevalentResourceAgeCap was removed.
1642         (WebKit::NetworkCache::Cache::retrieve):
1643             Restored to previous behavior.
1644         (WebKit::NetworkCache::Cache::storeRedirect):
1645             Now takes the optional maxAgeCap and caps the entry's max age if it's set.
1646         (WebKit::NetworkCache::hasReachedPrevalentResourceAgeCap): Deleted.
1647         * NetworkProcess/cache/NetworkCache.h:
1648         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1649         (WebKit::NetworkCache::Entry::encodeAsStorageRecord const):
1650             Now encodes m_maxAgeCap.
1651         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1652             Now decodes m_maxAgeCap.
1653         (WebKit::NetworkCache::Entry::hasReachedPrevalentResourceAgeCap const):
1654             Added.
1655         (WebKit::NetworkCache::Entry::capMaxAge):
1656             Added.
1657         * NetworkProcess/cache/NetworkCacheEntry.h:
1658             Added the optional m_maxAgeCap.
1659         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1660         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
1661             Now gets the optional max age cap from the NetworkStorageSession and sends it
1662             to Cache::storeRedirect().
1663         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1664         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
1665             Removed handling of UseDecision::NoDueToPrevalentResourceAgeCap.
1666
1667 2018-11-06  Per Arne Vollan  <pvollan@apple.com>
1668
1669         REGRESSION (r230523): Caps lock indicator not shown in password field
1670         https://bugs.webkit.org/show_bug.cgi?id=190056
1671
1672         Reviewed by Ryosuke Niwa.
1673
1674         Update cached modifier state in the WebProcess when WebKit::WebPage::keyEvent is called, and
1675         when the window becomes active.
1676
1677         * UIProcess/WebPageProxy.cpp:
1678         (WebKit::WebPageProxy::dispatchActivityStateChange):
1679         (WebKit::WebPageProxy::updateCurrentModifierState):
1680         * UIProcess/WebPageProxy.h:
1681         * WebProcess/WebPage/WebPage.cpp:
1682         (WebKit::WebPage::keyEvent):
1683         (WebKit::WebPage::updateCurrentModifierState):
1684         * WebProcess/WebPage/WebPage.h:
1685         * WebProcess/WebPage/WebPage.messages.in:
1686
1687 2018-11-06  Alex Christensen  <achristensen@webkit.org>
1688
1689         Add ObjC SPI equivalent of WKContextHandlesSafeBrowsing
1690         https://bugs.webkit.org/show_bug.cgi?id=191329
1691
1692         Reviewed by Tim Horton.
1693
1694         Like WKContextHandlesSafeBrowsing, this is so I can make one change in WebKit and enable safe browsing
1695         in WKWebView and disable it in Safari at the same time without broken revisions between landing two changes
1696         in two repositories.
1697
1698         * UIProcess/API/Cocoa/WKWebView.mm:
1699         (+[WKWebView handlesSafeBrowsing]):
1700         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1701
1702 2018-11-06  Eric Carlson  <eric.carlson@apple.com>
1703
1704         [MediaStream] User should not be prompted again after denying getDisplayMedia request
1705         https://bugs.webkit.org/show_bug.cgi?id=191227
1706         <rdar://problem/45784512>
1707
1708         Reviewed by Youenn Fablet.
1709
1710         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1711         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
1712         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
1713         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1714         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1715
1716 2018-11-06  Fujii Hironori  <Hironori.Fujii@sony.com>
1717
1718         [MediaStream] User should not be prompted again after denying getDisplayMedia request
1719         https://bugs.webkit.org/show_bug.cgi?id=191227
1720         <rdar://problem/45784512>
1721
1722         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
1723
1724         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
1725         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
1726
1727 2018-11-03  Alex Christensen  <achristensen@webkit.org>
1728
1729         [Mac] Implement safe browsing in WebKit
1730         https://bugs.webkit.org/show_bug.cgi?id=188871
1731
1732         Reviewed by Tim Horton.
1733
1734         * Platform/spi/Cocoa/SafeBrowsingSPI.h:
1735         * Resources/SafeBrowsing.xcassets: Added.
1736         * Resources/SafeBrowsing.xcassets/Contents.json: Added.
1737         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset: Added.
1738         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset/Contents.json: Added.
1739         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset: Added.
1740         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset/Contents.json: Added.
1741         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset: Added.
1742         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset/Contents.json: Added.
1743         * Shared/WebPreferences.yaml:
1744         * Shared/WebPreferencesDefaultValues.h:
1745         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1746         (WKContextHandlesSafeBrowsing):
1747         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm:
1748         (WebKit::malwareDetailsBase):
1749         (WebKit::learnMore):
1750         (WebKit::reportAnErrorBase):
1751         (WebKit::localizedProvider):
1752         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
1753         * UIProcess/Cocoa/WKSafeBrowsingWarning.h: Added.
1754         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: Added.
1755         (confirmMalwareSentinel):
1756         (visitUnsafeWebsiteSentinel):
1757         (colorNamed):
1758         (replace):
1759         (addLinkAndReplace):
1760         (-[WKSafeBrowsingExclamationPoint drawRect:]):
1761         (-[WKSafeBrowsingExclamationPoint intrinsicContentSize]):
1762         (reportAnErrorURL):
1763         (malwareDetailsURL):
1764         (titleText):
1765         (warningText):
1766         (detailsText):
1767         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
1768         (-[WKSafeBrowsingWarning dealloc]):
1769         (-[WKSafeBrowsingWarning goBackClicked]):
1770         (-[WKSafeBrowsingWarning clickedOnLink:]):
1771         (-[WKSafeBrowsingWarning showDetailsClicked]):
1772         (+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]):
1773         (+[WKSafeBrowsingTextView viewWithString:]):
1774         (-[WKSafeBrowsingTextView intrinsicContentSize]):
1775         (-[WKSafeBrowsingTextView clickedOnLink:atIndex:]):
1776         * UIProcess/Cocoa/WebViewImpl.h:
1777         * UIProcess/Cocoa/WebViewImpl.mm:
1778         (WebKit::WebViewImpl::showSafeBrowsingWarning):
1779         (WebKit::WebViewImpl::clearSafeBrowsingWarning):
1780         (WebKit::WebViewImpl::setFrameSize):
1781         * UIProcess/PageClient.h:
1782         (WebKit::PageClient::showSafeBrowsingWarning):
1783         (WebKit::PageClient::clearSafeBrowsingWarning):
1784         * UIProcess/SafeBrowsingResult.h:
1785         (WebKit::SafeBrowsingResult::url const):
1786         (WebKit::SafeBrowsingResult::provider const):
1787         (WebKit::SafeBrowsingResult::localizedProviderName const):
1788         (WebKit::SafeBrowsingResult::malwareDetailsURLBase const):
1789         (WebKit::SafeBrowsingResult::reportAnErrorURLBase const):
1790         (WebKit::SafeBrowsingResult::learnMoreURL const):
1791         (WebKit::SafeBrowsingResult::needsSafeBrowsingWarning const):
1792         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const): Deleted.
1793         * UIProcess/WebPageProxy.cpp:
1794         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1795         * UIProcess/ios/PageClientImplIOS.h:
1796         * UIProcess/ios/PageClientImplIOS.mm:
1797         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1798         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
1799         * UIProcess/mac/PageClientImplMac.h:
1800         * UIProcess/mac/PageClientImplMac.mm:
1801         (WebKit::PageClientImpl::setImpl):
1802         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1803         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
1804         * WebKit.xcodeproj/project.pbxproj:
1805
1806 2018-11-05  Zan Dobersek  <zdobersek@igalia.com>
1807
1808         [WPE] Remove BackingStore, BackingStoreCairo implementation files from build
1809         https://bugs.webkit.org/show_bug.cgi?id=191269
1810
1811         Reviewed by Michael Catanzaro.
1812
1813         * SourcesWPE.txt: Drop the BackingStore.cpp and BackingStoreCairo.cpp
1814         files from the WPE build. These are not used at all in WPE configuration
1815         as they are only used by the GTK+ port for non-AC functionality.
1816
1817 2018-11-05  Chris Dumez  <cdumez@apple.com>
1818
1819         Use same limit for page cache and suspended pages
1820         https://bugs.webkit.org/show_bug.cgi?id=191266
1821
1822         Reviewed by Geoffrey Garen.
1823
1824         Use same limit for page cache and suspended pages as they serve the same purpose.
1825
1826         * UIProcess/API/Cocoa/WKProcessPool.mm:
1827         (-[WKProcessPool _maximumSuspendedPageCount]):
1828         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1829         * UIProcess/WebProcessPool.cpp:
1830         (WebKit::WebProcessPool::updateMaxSuspendedPageCount):
1831         (WebKit::WebProcessPool::setCacheModel):
1832         (WebKit::WebProcessPool::addSuspendedPageProxy):
1833         * UIProcess/WebProcessPool.h:
1834
1835 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1836
1837         [iOS] Allow WKWebView clients to customize bar button item groups in the accessory view when editing
1838         https://bugs.webkit.org/show_bug.cgi?id=191240
1839         <rdar://problem/44872806>
1840
1841         Reviewed by Tim Horton.
1842
1843         Allow WKWebView clients to override WKContentView's default input assistant item by plumbing the call to
1844         `-inputAssistantItem` through `-[WKWebView inputAssistantItem]`, such that if a client asks WKWebView for its
1845         input assistant item and changes its leading or trailing bar button groups, the changes will be reflected by
1846         WKContentView; additionally, this allows clients to achieve the same effect by overriding `-inputAssistantItem`
1847         on WKWebView.
1848
1849         Test:   KeyboardInputTests.ModifyInputAssistantItemBarButtonGroups
1850                 KeyboardInputTests.OverrideInputAssistantItemBarButtonGroups
1851
1852         * UIProcess/API/Cocoa/WKWebView.mm:
1853         (-[WKWebView inputAssistantItem]):
1854         * UIProcess/ios/WKContentViewInteraction.h:
1855         * UIProcess/ios/WKContentViewInteraction.mm:
1856         (-[WKContentView inputAssistantItem]):
1857
1858         Route the call to `[super inputAssistantItem]` through `-[WKWebView inputAssistantItem]`, so that the input
1859         assistant item may be overridden via WKWebView.
1860
1861         (-[WKContentView inputAssistantItemForWebView]):
1862
1863 2018-11-05  Ryan Haddad  <ryanhaddad@apple.com>
1864
1865         Unreviewed, rolling out r237785.
1866
1867         Introduced layout test and API test failures on macOS and iOS.
1868
1869         Reverted changeset:
1870
1871         "[iOS] Issue initial paint soon after the visuallyNonEmpty
1872         milestone is fired."
1873         https://bugs.webkit.org/show_bug.cgi?id=191078
1874         https://trac.webkit.org/changeset/237785
1875
1876 2018-11-05  Commit Queue  <commit-queue@webkit.org>
1877
1878         Unreviewed, rolling out r237784 and r237788.
1879         https://bugs.webkit.org/show_bug.cgi?id=191270
1880
1881         Caused mediastream layout test failures (Requested by
1882         ryanhaddad on #webkit).
1883
1884         Reverted changesets:
1885
1886         "[MediaStream] User should not be prompted again after denying
1887         getDisplayMedia request"
1888         https://bugs.webkit.org/show_bug.cgi?id=191227
1889         https://trac.webkit.org/changeset/237784
1890
1891         "[MediaStream] User should not be prompted again after denying
1892         getDisplayMedia request"
1893         https://bugs.webkit.org/show_bug.cgi?id=191227
1894         https://trac.webkit.org/changeset/237788
1895
1896 2018-11-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1897
1898         [MediaStream] User should not be prompted again after denying getDisplayMedia request
1899         https://bugs.webkit.org/show_bug.cgi?id=191227
1900         <rdar://problem/45784512>
1901
1902         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
1903
1904         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
1905         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
1906
1907 2018-11-04  Zalan Bujtas  <zalan@apple.com>
1908
1909         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
1910         https://bugs.webkit.org/show_bug.cgi?id=191078
1911         <rdar://problem/45736178>
1912
1913         Reviewed by Antti Koivisto.
1914
1915         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1916         (WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
1917         * WebProcess/WebCoreSupport/WebChromeClient.h:
1918         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1919         (WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
1920         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1921         * WebProcess/WebPage/DrawingArea.h:
1922         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
1923         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1924         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1925         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1926         (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
1927         (WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
1928         (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
1929         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
1930         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1931         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1932         (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
1933
1934 2018-11-04  Eric Carlson  <eric.carlson@apple.com>
1935
1936         [MediaStream] User should not be prompted again after denying getDisplayMedia request
1937         https://bugs.webkit.org/show_bug.cgi?id=191227
1938         <rdar://problem/45784512>
1939
1940         Reviewed by Youenn Fablet.
1941
1942         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1943         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
1944         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
1945         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1946         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1947
1948 2018-11-03  Alex Christensen  <achristensen@webkit.org>
1949
1950         Mac production builds should sign the network process xpc service with entitlements
1951         https://bugs.webkit.org/show_bug.cgi?id=191209
1952         <rdar://problem/45377609>
1953
1954         Reviewed by Geoff Garen.
1955
1956         * Configurations/Network-OSX.entitlements: Copied from Configurations/Network-OSX-sandbox.entitlements.
1957         * Configurations/NetworkService.xcconfig:
1958         Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
1959         except with the corresponoding network process entitlements file.
1960         * UIProcess/API/Cocoa/WKProcessPool.mm:
1961         (-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
1962         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1963         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1964         (WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
1965         * UIProcess/WebProcessPool.h:
1966         * WebKit.xcodeproj/project.pbxproj:
1967         Add infrastructure to test that the network process actually has an entitlement.
1968
1969 2018-11-03  Philippe Normand  <pnormand@igalia.com>
1970
1971         [WPE] Add the WebKitVersion.h header
1972         https://bugs.webkit.org/show_bug.cgi?id=191015
1973         <rdar://problem/45647211>
1974
1975         Reviewed by Michael Catanzaro.
1976
1977         * PlatformWPE.cmake: Install the generated header as well.
1978
1979 2018-11-02  Alex Christensen  <achristensen@webkit.org>
1980
1981         Unreviewed, rolling out r237761.
1982
1983         Makes most API tests timeout and WK2 tests crash
1984
1985         Reverted changeset:
1986
1987         "Mac production builds should sign the network process xpc
1988         service with entitlements"
1989         https://bugs.webkit.org/show_bug.cgi?id=191209
1990         https://trac.webkit.org/changeset/237761
1991
1992 2018-11-02  Ryan Haddad  <ryanhaddad@apple.com>
1993
1994         Unreviewed, attempt to fix the build with recent SDKs.
1995
1996         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1997         (WebKit::XPCServiceExit):
1998
1999 2018-11-02  Alex Christensen  <achristensen@webkit.org>
2000
2001         Mac production builds should sign the network process xpc service with entitlements
2002         https://bugs.webkit.org/show_bug.cgi?id=191209
2003         <rdar://problem/45377609>
2004
2005         Reviewed by Geoff Garen.
2006
2007         * Configurations/NetworkService.xcconfig:
2008         Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
2009         except with the corresponoding network process entitlements file.
2010         * UIProcess/API/Cocoa/WKProcessPool.mm:
2011         (-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
2012         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2013         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2014         (WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
2015         * UIProcess/WebProcessPool.h:
2016         Add infrastructure to test that the network process actually has an entitlement.
2017
2018 2018-11-02  Daniel Bates  <dabates@apple.com>
2019
2020         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
2021         https://bugs.webkit.org/show_bug.cgi?id=190487
2022
2023         Reviewed by Tim Horton.
2024
2025         Add support for modifier flags change events dispatched by UIKit.
2026
2027         * Shared/ios/WebIOSEventFactory.mm:
2028         (modifiersForEvent): Update for renamed enumerations.
2029         (WebIOSEventFactory::createWebKeyboardEvent): Modifier keys do not have an associated
2030         character and do not participate in key repeat.
2031         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
2032         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Update for renamed enumerations.
2033         * UIProcess/ios/WKContentViewInteraction.mm:
2034         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Return NO if the event represents a
2035         modifier flags change to allow the default handling.
2036         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2037         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]): Update for renamed enumerations.
2038
2039 2018-11-02  Chris Dumez  <cdumez@apple.com>
2040
2041         [PSON] Reuse SuspendedPages' process when possible, for performance
2042         https://bugs.webkit.org/show_bug.cgi?id=191166
2043
2044         Reviewed by Geoffrey Garen.
2045
2046         When process-swapping check if there is an existing SuspendedPage for the domain we're going to.
2047         If there is, use this SuspendedPage's process for the navigation instead of a fresh new process.
2048         This change should be beneficial for performance as it:
2049         - Avoids spinning up a new process (CPU & memory cost)
2050         - Likely better leverages caches since this process already loaded this domain in the past
2051
2052         Due to current limitations, using a SuspendedPage's proxy may consume the SuspendedPage, which
2053         means that it can no longer be used for PageCache on history navigations. We need to do this when
2054         the SuspendedPageProxy in question was created for the current WebPageProxy because:
2055         - This SuspendedPageProxy's process already has a suspended WebPage with this WebPageProxy's pageID
2056         and
2057         - We do not currently support having more than one WebPage with a given pageID within a single
2058           WebProcess.
2059
2060         * UIProcess/SuspendedPageProxy.cpp:
2061         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2062         * UIProcess/SuspendedPageProxy.h:
2063         * UIProcess/WebProcessPool.cpp:
2064         (WebKit::WebProcessPool::processForNavigationInternal):
2065
2066 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
2067
2068         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
2069         https://bugs.webkit.org/show_bug.cgi?id=189693
2070
2071         Reviewed by Yusuke Suzuki.
2072
2073         * Shared/API/APIString.h: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
2074
2075 2018-11-01  Daniel Bates  <dabates@apple.com>
2076
2077         Cleanup: Extraneous platform guarding of -_setUpSQLiteDatabaseTrackerClient
2078         https://bugs.webkit.org/show_bug.cgi?id=191124
2079
2080         Reviewed by Tim Horton.
2081
2082         Remove the platform guard around the call to -_setUpSQLiteDatabaseTrackerClient as the
2083         implementation of that message is already guarded.
2084
2085         * UIProcess/API/Cocoa/WKWebView.mm:
2086         (-[WKWebView _initializeWithConfiguration:]):
2087
2088 2018-11-01  Ryan Haddad  <ryanhaddad@apple.com>
2089
2090         Unreviewed, attempt to fix the build with recent SDKs.
2091
2092         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2093         (WebKit::XPCServiceInitializer):
2094
2095 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
2096
2097         Add a storage limit for IndexedDB
2098         https://bugs.webkit.org/show_bug.cgi?id=190598
2099         <rdar://problem/44654715>
2100
2101         Reviewed by Chris Dumez.
2102
2103         Add SPI for testing.
2104
2105         * NetworkProcess/NetworkProcess.cpp:
2106         (WebKit::NetworkProcess::NetworkProcess):
2107         (WebKit::NetworkProcess::idbServer):
2108         (WebKit::NetworkProcess::setIDBPerOriginQuota):
2109         * NetworkProcess/NetworkProcess.h:
2110         * NetworkProcess/NetworkProcess.messages.in:
2111         * UIProcess/API/C/WKContext.cpp:
2112         (WKContextSetIDBPerOriginQuota):
2113         * UIProcess/API/C/WKContextPrivate.h:
2114         * UIProcess/WebProcessPool.cpp:
2115         (WebKit::WebProcessPool::setIDBPerOriginQuota):
2116         * UIProcess/WebProcessPool.h:
2117
2118 2018-11-01  Chris Dumez  <cdumez@apple.com>
2119
2120         [PSON] WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping
2121         https://bugs.webkit.org/show_bug.cgi?id=191076
2122
2123         Reviewed by Geoffrey Garen.
2124
2125         WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping.
2126         The client can request a new load synchronously after answering the policy decision, in which case we'd end up loading
2127         the wrong URL.
2128
2129         * UIProcess/WebPageProxy.cpp:
2130         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2131         * UIProcess/WebProcessPool.cpp:
2132         (WebKit::WebProcessPool::processForNavigation):
2133         (WebKit::WebProcessPool::processForNavigationInternal):
2134         * UIProcess/WebProcessPool.h:
2135
2136 2018-11-01  Chris Dumez  <cdumez@apple.com>
2137
2138         [PSON] Unable to submit a file in FormData cross-site
2139         https://bugs.webkit.org/show_bug.cgi?id=191138
2140
2141         Reviewed by Alex Christensen.
2142
2143         When PSON is enabled, we are unable to submit a file in FormData cross-site. Although we encode the
2144         request body over IPC since r237639, we're missing the right sandbox extensions for its to work for
2145         files.
2146
2147         Update FormDataReference encoder to pass along the necessary sandbox extensions for files in the
2148         FormData, and have its decoder consume those extensions so that the recipient has access to those
2149         files. Also update LoadParameters's IPC encoder / decoder to encoder an IPC::FormDataReference
2150         (which encodes both FormData and sandbox extensions) instead of a FormData.
2151
2152         * Platform/IPC/FormDataReference.h:
2153         (IPC::FormDataReference::encode const):
2154         (IPC::FormDataReference::decode):
2155         * Shared/LoadParameters.cpp:
2156         (WebKit::LoadParameters::encode const):
2157         (WebKit::LoadParameters::decode):
2158
2159 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
2160
2161         ERROR: ResourceLoadStatisticsPersistentStorage: Unable to delete statistics file
2162         https://bugs.webkit.org/show_bug.cgi?id=191152
2163
2164         Reviewed by Chris Dumez.
2165
2166         The statistics file is not created unconditionally, so
2167         make sure it exists before logging an error.
2168
2169         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2170         (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
2171         Check that the file exists before logging an error.
2172
2173 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
2174
2175         [GLIB] Silent a build warning when not using Wayland
2176
2177         Unreviewed.
2178
2179         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2180
2181 2018-11-01  Frederic Wang  <fwang@igalia.com>
2182
2183         [WebAuthN] Make AuthenticatorManager
2184         https://bugs.webkit.org/show_bug.cgi?id=189279
2185
2186         Unreviewed build fix.
2187
2188         * UIProcess/WebAuthentication/Cocoa/LocalConnection.h: Add missing headers.
2189
2190 2018-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2191
2192         API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
2193         https://bugs.webkit.org/show_bug.cgi?id=191114
2194         <rdar://problem/45700410>
2195
2196         Reviewed by Dean Jackson.
2197
2198         Followup to r237648: also make sure that we insecurely unarchive NSFileWrapper on platforms that don't support
2199         secure archiving of file wrappers.
2200
2201         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
2202         (API::Attachment::updateFromSerializedRepresentation):
2203
2204 2018-10-31  Dean Jackson  <dino@apple.com>
2205
2206         Forward original fragment identifier into System Preview
2207         https://bugs.webkit.org/show_bug.cgi?id=191141
2208         <rdar://problem/45717542>
2209
2210         Reviewed by Wenson Hsieh.
2211
2212         If the URL used by the page includes a fragment identifier, use
2213         it when telling QuickLook to open a local file.
2214
2215         * UIProcess/Cocoa/DownloadClient.mm:
2216         (WebKit::DownloadClient::didFinish): Append original fragment identifier
2217         to the destination URL.
2218
2219 2018-10-31  Zalan Bujtas  <zalan@apple.com>
2220
2221         [iOS] Do not paint tap highlight unless it is above a certain threshold
2222         https://bugs.webkit.org/show_bug.cgi?id=191134
2223         <rdar://problem/43615142>
2224
2225         Flashing a large portion of the screen on every tap looks unpleasant.
2226         This patch impoves the existing heuristic by adding area check and a % threshold.  
2227
2228         Reviewed by Tim Horton.
2229
2230         * UIProcess/ios/WKContentViewInteraction.mm:
2231         (-[WKContentView _showTapHighlight]):
2232         (highlightedQuadsAreSmallerThanRect): Deleted.
2233
2234 2018-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2235
2236         API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
2237         https://bugs.webkit.org/show_bug.cgi?id=191114
2238         <rdar://problem/45700410>
2239
2240         Reviewed by Dean Jackson.
2241
2242         On macOS 10.12, we don't attempt secure archival at all because SECURE_ARCHIVER_API is turned off, and on macOS
2243         10.14, NSFileWrapper supports secure coding. However, on macOS 10.13, SECURE_ARCHIVER_API is on despite
2244         NSFileWrapper not being securely codable, so we're unable to serialize attachment data.
2245
2246         To fix this, we only use the secure archiver on ≥ macOS 10.14 and ≥ iOS 12.
2247
2248         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
2249         (API::Attachment::createSerializedRepresentation const):
2250
2251 2018-10-31  Zach Li  <zacharyli323@gmail.com>
2252
2253         Add credit card autofill button
2254         https://bugs.webkit.org/show_bug.cgi?id=191051
2255         <rdar://problem/45657011>
2256
2257         Reviewed by Wenson Hsieh.
2258
2259         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2260         (toAutoFillButtonType):
2261         (toWKAutoFillButtonType):
2262         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
2263         Introduce a new button type for credit card autofill.
2264         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2265         (toAutoFillButtonType):
2266         (toWKAutoFillButtonType):
2267         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2268
2269 2018-10-31  Chris Dumez  <cdumez@apple.com>
2270
2271         [PSON] When process-swapping for a POST request the HTTP body gets dropped
2272         https://bugs.webkit.org/show_bug.cgi?id=191046
2273         <rdar://problem/45229732>
2274
2275         Reviewed by Alex Christensen.
2276
2277         For performance reasons, the ResourceRequest IPC encoder does not encode the request's HTTP body (aka form data).
2278         When we decide to process-swap for a POST request in WebPageProxy::decidePolicyForNavigationAction(), the request
2279         we pass the new WebProcess thus no longer has a HTTP body and the load will likely fail in the new process.
2280
2281         To address the issue, we now pass the request body along with the request when sending the DecidePolicyForNavigationActionAsync
2282         / DecidePolicyForNavigationActionSync IPC from the WebProcess to the UIProcess. No action is needed for the
2283         LoadRequest IPC to the new WebProcess since the LoadParameters' IPC encoder takes care of encoding the request's
2284         body already.
2285
2286         * UIProcess/WebPageProxy.cpp:
2287         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2288         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2289         * UIProcess/WebPageProxy.h:
2290         * UIProcess/WebPageProxy.messages.in:
2291         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2292         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2293
2294 2018-10-31  Antti Koivisto  <antti@apple.com>
2295
2296         Stop using LayerFlushScheduler in WK2
2297         https://bugs.webkit.org/show_bug.cgi?id=191065
2298
2299         Reviewed by Tim Horton.
2300
2301         Code gets more understandable when TiledCoreAnimationDrawingArea simply uses RunLoopObserver
2302         directly for flush scheduling. LayerFlushScheduler can be later moved to WK1.
2303
2304         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2305         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2306         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2307         (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
2308         (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
2309         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
2310         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
2311         (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
2312         (WebKit::TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver):
2313         (WebKit::TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver):
2314
2315 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
2316
2317         [WPE][GTK] Certificates loaded from the cache don't include the certificate chain
2318         https://bugs.webkit.org/show_bug.cgi?id=190956
2319
2320         Reviewed by Youenn Fablet.
2321
2322         Similarly to what was done for the IPC coders, serialize
2323         the entire certificate chain in the cache coder. Bump
2324         the cache version due to the caching format changes.
2325
2326         * NetworkProcess/cache/NetworkCacheCoders.h: Add GRefPtr<GByteArray> coders.
2327         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
2328         (WTF::Persistence::certificatesDataListFromCertificateInfo):
2329         (WTF::Persistence::certificateFromCertificatesDataList): Helpers.
2330         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
2331         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2332         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode):
2333         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode):
2334         * NetworkProcess/cache/NetworkCacheStorage.h: Bump the cache version.
2335
2336 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2337
2338         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
2339         https://bugs.webkit.org/show_bug.cgi?id=190530
2340         <rdar://problem/45232149>
2341
2342         Reviewed by Tim Horton.
2343
2344         See WebCore ChangeLog for more details.
2345
2346         * Shared/WebCoreArgumentCoders.cpp:
2347         (IPC::ArgumentCoder<SerializedAttachmentData>::encode):
2348         (IPC::ArgumentCoder<SerializedAttachmentData>::decode):
2349         * Shared/WebCoreArgumentCoders.h:
2350
2351         Add IPC encoding/decoding support for SerializedAttachmentData.
2352
2353         * UIProcess/API/APIAttachment.cpp:
2354         (API::Attachment::createSerializedRepresentation const):
2355         (API::Attachment::updateFromSerializedRepresentation):
2356         * UIProcess/API/APIAttachment.h:
2357         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
2358         (API::Attachment::createSerializedRepresentation const):
2359
2360         Add a method to serialize and return attachment info as a blob of data.
2361
2362         (API::Attachment::updateFromSerializedRepresentation):
2363
2364         Add a method to update the attachment, given a serialized blob of data. On Cocoa platforms, this fails
2365         gracefully if the serialized data cannot be decoded.
2366
2367         * UIProcess/Cocoa/PageClientImplCocoa.h:
2368         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2369         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
2370         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
2371         (WebKit::PageClientImplCocoa::allocFileWrapperInstance): Deleted.
2372
2373         Add an additional hook to return the list of NSFileWrapper subclasses suitable for deserialization. This
2374         array contains (at minimum) NSFileWrapper, but may additionally include a custom NSFileWrapper subclass, if
2375         configured.
2376
2377         * UIProcess/PageClient.h:
2378         (WebKit::PageClient::allocFileWrapperInstance const):
2379         (WebKit::PageClient::serializableFileWrapperClasses const):
2380         (WebKit::PageClient::allocFileWrapperInstance): Deleted.
2381         * UIProcess/WebPageProxy.cpp:
2382         (WebKit::WebPageProxy::registerAttachmentsFromSerializedData):
2383
2384         Registers the given serialized attachment data, creating new _WKAttachment instances if necessary. Currently,
2385         this does not update the file wrappers of existing _WKAttachments; we should revisit this in the future to see
2386         if we can additionally update file wrappers for existing attachments, without breaking the case where the user
2387         copies and pastes or drags and drops attachments within a single web view and the client expects _WKAttachment
2388         instances to be reused.
2389
2390         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
2391         * UIProcess/WebPageProxy.h:
2392         * UIProcess/WebPageProxy.messages.in:
2393         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2394         (WebKit::WebEditorClient::registerAttachments):
2395         (WebKit::WebEditorClient::serializedAttachmentDataForIdentifiers):
2396
2397         Implement a new IPC hook to fetch an array of serialized attachment data blobs, given a list of attachment
2398         identifiers.
2399
2400         * WebProcess/WebCoreSupport/WebEditorClient.h:
2401
2402 2018-10-30  Chris Dumez  <cdumez@apple.com>
2403
2404         [PSON] View gesture snapshot gets taken down early when process-swapping
2405         https://bugs.webkit.org/show_bug.cgi?id=191083
2406         <rdar://problem/45058738>
2407
2408         Reviewed by Alex Christensen.
2409
2410         When process-swapping, we would call WebViewImpl::processDidExit(), which would destroy
2411         the ViewGestureController and thus take down the swipe navigation snapshot before it
2412         should. We now call WebViewImpl::processDidSwap() instead, which does the same thing,
2413         except for destroying the ViewGestureController. As a result, the view snapshot stays
2414         visible as long as it is needed, even in case of process swap.
2415
2416         * UIProcess/Cocoa/WebViewImpl.h:
2417         * UIProcess/Cocoa/WebViewImpl.mm:
2418         (WebKit::WebViewImpl::handleProcessSwapOrExit):
2419         (WebKit::WebViewImpl::processWillSwap):
2420         (WebKit::WebViewImpl::processDidExit):
2421         * UIProcess/mac/PageClientImplMac.mm:
2422         (WebKit::PageClientImpl::processWillSwap):
2423
2424 2018-10-30  Chris Dumez  <cdumez@apple.com>
2425
2426         [PSON] WebView renders with incorrect dimensions after back or forward
2427         https://bugs.webkit.org/show_bug.cgi?id=191071
2428         <rdar://problem/45058950>
2429
2430         Reviewed by Alex Christensen.
2431
2432         Make sure WebPage::reinitializeWebPage() updates the page's dimensions if needed using the
2433         WebPageCreationParameters it is provided.
2434
2435         * WebProcess/WebPage/WebPage.cpp:
2436         (WebKit::WebPage::reinitializeWebPage):
2437
2438 2018-10-30  Dewei Zhu  <dewei_zhu@apple.com>
2439
2440         Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
2441         https://bugs.webkit.org/show_bug.cgi?id=191049
2442
2443         Reviewed by Dean Jackson.
2444
2445         Move the feature flag to experimental feature section.
2446
2447         * Shared/WebPreferences.yaml:
2448
2449 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2450
2451         Enable InstallAPI for iOS unconditionally
2452         https://bugs.webkit.org/show_bug.cgi?id=191043
2453         rdar://problem/32728423
2454
2455         Reviewed by Dan Bernstein.
2456
2457         * Configurations/Base.xcconfig: Enabled it. Added NSURLDownloadSPI.h as an
2458         excluded header - WebKit doesn't export NSURLDownload, so the definition
2459         shouldn't be processed by InstallAPI.
2460
2461 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2462
2463         Clean up some obsolete MAX_ALLOWED macros
2464         https://bugs.webkit.org/show_bug.cgi?id=190916
2465
2466         Reviewed by Tim Horton.
2467
2468         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2469         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
2470         * Platform/spi/Cocoa/DeviceIdentitySPI.h:
2471         * Platform/spi/ios/UIKitSPI.h:
2472         * Shared/WebPreferencesDefaultValues.cpp:
2473         (defaultCustomPasteboardDataEnabled):
2474         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2475         (WebKit::toPKPaymentRequest):
2476         * UIProcess/ios/WKContentViewInteraction.mm:
2477         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
2478
2479 2018-10-30  Commit Queue  <commit-queue@webkit.org>
2480
2481         Unreviewed, rolling out r237600 and r237604.
2482         https://bugs.webkit.org/show_bug.cgi?id=191086
2483
2484         Breaks internal iOS builds (Requested by ryanhadd_ on
2485         #webkit).
2486
2487         Reverted changesets:
2488
2489         "Enable InstallAPI for iOS unconditionally"
2490         https://bugs.webkit.org/show_bug.cgi?id=191043
2491         https://trac.webkit.org/changeset/237600
2492
2493         "Build fix attempt after enabling InstallAPI for iOS."
2494         https://bugs.webkit.org/show_bug.cgi?id=191043
2495         https://trac.webkit.org/changeset/237604
2496
2497 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2498
2499         Build fix attempt after enabling InstallAPI for iOS.
2500         https://bugs.webkit.org/show_bug.cgi?id=191043
2501         rdar://problem/32728423
2502
2503         * Configurations/WebKit.xcconfig: Skip NSURLDownloadSPI.h here too.
2504
2505 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2506
2507         Enable InstallAPI for iOS unconditionally
2508         https://bugs.webkit.org/show_bug.cgi?id=191043
2509         rdar://problem/32728423
2510
2511         Reviewed by Dan Bernstein.
2512
2513         * Configurations/Base.xcconfig: Enabled it.
2514
2515 2018-10-30  Zan Dobersek  <zdobersek@igalia.com>
2516
2517         [CoordGraphics] CoordinatedLayerTreeHost::flushLayersAndForceRepaint() should schedule the flush
2518         https://bugs.webkit.org/show_bug.cgi?id=191066
2519
2520         Reviewed by Michael Catanzaro.
2521
2522         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2523         (WebKit::CoordinatedLayerTreeHost::flushLayersAndForceRepaint):
2524         Only schedule the layer flush in this call, don't perform it on the
2525         spot. This avoids re-entry of the layer flushing process in cases when
2526         the associated display refresh monitor is requested a callback during
2527         the layout phase that's executed under the initial layer flush.
2528
2529 2018-10-29  Dewei Zhu  <dewei_zhu@apple.com>
2530
2531         Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
2532         https://bugs.webkit.org/show_bug.cgi?id=191049
2533
2534         Reviewed by Chris Dumez.
2535
2536         Move 'ProcessSwapOnCrossSiteNavigationEnabled' from 'internal' to 'experimental' category.
2537
2538         * Shared/WebPreferences.yaml:
2539
2540 2018-10-29  Youenn Fablet  <youenn@apple.com>
2541
2542         Handle MDNS resolution of candidates through libwebrtc directly
2543         https://bugs.webkit.org/show_bug.cgi?id=190681
2544
2545         Reviewed by Eric Carlson.
2546
2547         Add support for AsyncResolver to resolve MDNS.
2548         This basically reuse the code path used to resolve STUN server addresses.
2549         Removed MDNS specific resolution.
2550         Use existing CFHost resolution mechanism to do the actual resolution.
2551
2552         Make sure that a resolver is kept alive while iterating through its clients when signaling done.
2553         Some of its clients may indeed call Destroy() on the resolver during that iteration.
2554
2555         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
2556         (WebKit::NetworkMDNSRegister::registerMDNSName):
2557         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
2558         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2559         (WebKit::LibWebRTCResolver::Destroy):
2560         (WebKit::LibWebRTCResolver::doDestroy):
2561         (WebKit::LibWebRTCResolver::setResolvedAddress):
2562         (WebKit::LibWebRTCResolver::setError):
2563         (WebKit::LibWebRTCProvider::createPeerConnection):
2564         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
2565         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
2566         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
2567         * WebProcess/Network/webrtc/WebMDNSRegister.h:
2568         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
2569
2570 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2571
2572         Modernize WebKit nibs and lprojs for localization's sake
2573         https://bugs.webkit.org/show_bug.cgi?id=190911
2574         <rdar://problem/45349466>
2575
2576         Reviewed by Dan Bernstein.
2577
2578         * Resources/WebContentProcess.xib:
2579         * WebKit.xcodeproj/project.pbxproj:
2580         * en.lproj/InfoPlist.strings: Renamed from Source/WebKit/English.lproj/InfoPlist.strings.
2581         English->en
2582
2583 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2584
2585         Make FindOptionsShowOverlay work on iOS
2586         https://bugs.webkit.org/show_bug.cgi?id=190551
2587
2588         Reviewed by Andy Estes.
2589
2590         * WebProcess/WebPage/FindController.cpp:
2591         (WebKit::FindController::updateFindUIAfterPageScroll):
2592         Update the find indicator after installing the page overlay for the find holes.
2593         This ensures that if the find indicator mechanism also uses page overlays,
2594         as it does on iOS, that they are installed in the correct order (because
2595         order of installation directly affects z-order).
2596
2597         (WebKit::FindController::findIndicatorRadius const):
2598         (WebKit::FindController::shouldHideFindIndicatorOnScroll const):
2599         Add two getters for design differences between find-in-page on iOS vs. other platforms.
2600
2601         (WebKit::FindController::rectsForTextMatchesInRect):
2602         Return FloatRects instead of IntRects for ease of use in the caller.
2603         Don't clip rects for matches that intersect the current tile. We still
2604         drop ones that don't intersect at all, but if they do intersect, we
2605         provide the full rect (which may overlap a different tile), so that
2606         e.g. border drawing will work correctly.
2607
2608         (WebKit::FindController::drawRect):
2609         Adopt shrink-wrapping for find holes. This has minimal impact on macOS,
2610         where the holes don't have rounded corners, but on iOS this makes
2611         overlapping or adjacent holes look great. We already do this for the indicator,
2612         so it only makes sense to do the same for the holes.
2613
2614         In order to support shrink-wrapping here, switch to using a Clear operator
2615         with a path-fill instead of clearRect to clear out the holes.
2616
2617         Avoid hiding the find indicator on scroll if the platform says not to.
2618
2619         * WebProcess/WebPage/FindController.h:
2620         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2621         (WebKit::FindController::findIndicatorRadius const):
2622         (WebKit::FindController::shouldHideFindIndicatorOnScroll const):
2623         Slightly adjust the find indicator's parameters to be compatible with having holes.
2624         Reduce the horizontal margin by half a point so that it fits precisely in the hole.
2625         Drop the "TightlyFitContent" text indicator parameter, because we want 
2626         rects that match the holes, and they do not tightly fit the content's height.
2627         This matches macOS's behavior.
2628
2629 2018-10-29  Jer Noble  <jer.noble@apple.com>
2630
2631         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
2632         https://bugs.webkit.org/show_bug.cgi?id=190954
2633
2634         Reviewed by Simon Fraser.
2635
2636         * Shared/cg/ShareableBitmapCG.cpp:
2637         (WebKit::ShareableBitmap::makeCGImage):
2638
2639 2018-10-29  Youenn Fablet  <youenn@apple.com>
2640
2641         Guard H264 simulcast with a runtime flag
2642         https://bugs.webkit.org/show_bug.cgi?id=191025
2643
2644         Reviewed by Eric Carlson.
2645
2646         * Shared/WebPreferences.yaml:
2647
2648 2018-10-29  Chris Dumez  <cdumez@apple.com>
2649
2650         [PSON] When Safari restores session state after launching, going back and forward does not swap processes
2651         https://bugs.webkit.org/show_bug.cgi?id=190975
2652         <rdar://problem/45059256>
2653
2654         Reviewed by Antti Koivisto.
2655
2656         When deciding to process-swap or not on a history navigation, we normally check the BackForwardListItems'
2657         process identifiers do check if they come from different WebProcesses or not. However, the check was invalid
2658         in the case where the BackForwardListItems were restored by the client. After a session restore, the
2659         items' process identifier is the UIProcess one. Therefore, we need to disable the BackForwardListItems'
2660         process identifiers check if if the process identifier is the one of the UIProcess.
2661
2662         * UIProcess/WebProcessPool.cpp:
2663         (WebKit::WebProcessPool::processForNavigationInternal):
2664
2665 2018-10-29  Youenn Fablet  <youenn@apple.com>
2666
2667         [WebRTC] Enable VP8 by default
2668         https://bugs.webkit.org/show_bug.cgi?id=190672
2669
2670         Reviewed by Eric Carlson.
2671
2672         * Shared/WebPreferences.yaml:
2673
2674 2018-10-28  Zan Dobersek  <zdobersek@igalia.com>
2675
2676         [WPE] Add the WebKitVersion.h header
2677         https://bugs.webkit.org/show_bug.cgi?id=191015
2678
2679         Reviewed by Michael Catanzaro.
2680
2681         Add the WebKitVersion.h API header for the WPE port. As with other
2682         headers providing the GLib API, we have to provide a WPE-specific
2683         version, but the implementation file can be shared with the GTK port,
2684         and is moved under the UIProcess/API/glib/ directory accordingly.
2685
2686         * PlatformWPE.cmake:
2687         * SourcesWPE.txt:
2688         * UIProcess/API/glib/WebKitVersion.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/WebKitVersion.cpp.
2689         * UIProcess/API/wpe/WebKitVersion.h.in: Added.
2690         * UIProcess/API/wpe/webkit.h:
2691
2692 2018-10-26  Megan Gardner  <megan_gardner@apple.com>
2693
2694         Remove Unused WebSelectionAssistant
2695         https://bugs.webkit.org/show_bug.cgi?id=190939
2696
2697         Reviewed by Tim Horton.
2698
2699         We made webSelectionAssistant alwasys nil last year when we moved to using
2700         the textSelectionAssistant for all text selection on the web. This patch merely 
2701         goes through and cleans out all the references to this object that is always nil.
2702         No functionality should change.
2703
2704         * UIProcess/ios/WKContentView.mm:
2705         (-[WKContentView _didExitStableState]):
2706         * UIProcess/ios/WKContentViewInteraction.h:
2707         * UIProcess/ios/WKContentViewInteraction.mm:
2708         (-[WKContentView cleanupInteraction]):
2709         (-[WKContentView resignFirstResponderForWebView]):
2710         (-[WKContentView _scrollingNodeScrollingWillBegin]):
2711         (-[WKContentView _scrollingNodeScrollingDidEnd]):
2712         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
2713         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2714         (-[WKContentView _uiTextSelectionRects]):
2715         (-[WKContentView _singleTapCommited:]):
2716         (-[WKContentView _willStartScrollingOrZooming]):
2717         (-[WKContentView _didEndScrollingOrZooming]):
2718         (-[WKContentView _lookupForWebView:]):
2719         (-[WKContentView _shareForWebView:]):
2720         (-[WKContentView _addShortcutForWebView:]):
2721         (-[WKContentView _showDictionary:]):
2722         (selectionChangedWithGesture):
2723         (selectionChangedWithTouch):
2724         (-[WKContentView selectionInteractionAssistant]):
2725         (-[WKContentView _stopAssistingNode]):
2726         (-[WKContentView _updateChangedSelection:]):
2727         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
2728         (-[WKContentView _restoreCalloutBarIfNeeded]):
2729         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2730         (-[WKContentView webSelectionAssistant]): Deleted.
2731
2732 2018-10-26  Commit Queue  <commit-queue@webkit.org>
2733
2734         Unreviewed, rolling out r237458.
2735         https://bugs.webkit.org/show_bug.cgi?id=190973
2736
2737         broke internal iOS builds (Requested by zalan on #webkit).
2738
2739         Reverted changeset:
2740
2741         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
2742         https://bugs.webkit.org/show_bug.cgi?id=190951
2743         https://trac.webkit.org/changeset/237458
2744
2745 2018-10-26  Chris Dumez  <cdumez@apple.com>
2746
2747         [PSON] Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake
2748         https://bugs.webkit.org/show_bug.cgi?id=190971
2749
2750         Reviewed by Geoffrey Garen.
2751
2752         Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake.
2753
2754         Since r236257, the WebProcess would always delay attaching the drawing area when a new WebPage is created. The
2755         WebProcess would send a DidCompletePageTransition IPC to the UIProcess when the page transition is complete and
2756         the UIProcess would then send an IPC back to attach the drawing area.
2757
2758         In the new design, WebPageCreationParameters contains a flag indicating if the WebPage should delay attaching
2759         the drawing area or not. We only delay attaching in case of process swap and we've successfuly suspended the
2760         previous page. Then when WebPage::didCompletePageTransition(), we stop sending the DidCompletePageTransition
2761         IPC to the UIProcess and instead have the WebProcess attach the drawing area right away if we've delayed
2762         attaching until then.
2763
2764         * Shared/WebPageCreationParameters.cpp:
2765         (WebKit::WebPageCreationParameters::encode const):
2766         (WebKit::WebPageCreationParameters::decode):
2767         * Shared/WebPageCreationParameters.h:
2768         * UIProcess/DrawingAreaProxy.h:
2769         * UIProcess/WebPageProxy.cpp:
2770         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2771         (WebKit::WebPageProxy::swapToWebProcess):
2772         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2773         (WebKit::WebPageProxy::initializeWebPage):
2774         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2775         * UIProcess/WebPageProxy.h:
2776         * UIProcess/WebPageProxy.messages.in:
2777         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2778         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2779         * WebProcess/WebPage/DrawingArea.messages.in:
2780         * WebProcess/WebPage/WebPage.cpp:
2781         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2782         (WebKit::WebPage::reinitializeWebPage):
2783         (WebKit::WebPage::didCompletePageTransition):
2784         * WebProcess/WebPage/WebPage.h:
2785         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2786         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2787
2788 2018-10-26  Chris Dumez  <cdumez@apple.com>
2789
2790         [PSON] Avoid tearing down the drawing area when suspending a WebPage due to process-swap
2791         https://bugs.webkit.org/show_bug.cgi?id=190879
2792
2793         Reviewed by Antti Koivisto.
2794
2795         Avoid tearing down the drawing area when suspending a WebPage due to process-swap. We really only need to reset
2796         the drawing area upon resuming the WebPage. There is no strict need to destroy the drawing area on suspension
2797         and this has caused various crashes because code usually assumes we always have a drawing area.
2798
2799         This patch also drops various drawing area null checks that were added to address PSON crashes.
2800
2801         * UIProcess/SuspendedPageProxy.cpp:
2802         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess): Deleted.
2803         * UIProcess/SuspendedPageProxy.h:
2804         * UIProcess/WebPageProxy.cpp:
2805         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2806         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2807         (WebKit::WebPageProxy::didCompletePageTransition):
2808         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2809         * UIProcess/WebPageProxy.h:
2810         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2811         (WebKit::WebChromeClient::invalidateContentsAndRootView):
2812         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
2813         (WebKit::WebChromeClient::contentsSizeChanged const):
2814         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2815         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2816         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
2817         (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
2818         * WebProcess/WebPage/WebPage.cpp:
2819         (WebKit::WebPage::reinitializeWebPage):
2820         (WebKit::WebPage::exitAcceleratedCompositingMode):
2821         (WebKit::WebPage::setIsSuspended):
2822         (WebKit::WebPage::tearDownDrawingAreaForSuspend): Deleted.
2823         * WebProcess/WebPage/WebPage.h:
2824         * WebProcess/WebPage/WebPage.messages.in:
2825
2826 2018-10-26  Antti Koivisto  <antti@apple.com>
2827
2828         Use random() instead of begin() to limit cache sizes
2829         https://bugs.webkit.org/show_bug.cgi?id=190957
2830
2831         Reviewed by Chris Dumez.
2832
2833         * UIProcess/WebProcessPool.cpp:
2834         (WebKit::WebProcessPool::didCollectPrewarmInformation):
2835
2836 2018-10-26  Chris Dumez  <cdumez@apple.com>
2837
2838         Modernize / Simplify IPC::Connection::sendOutgoingMessage()
2839         https://bugs.webkit.org/show_bug.cgi?id=190931
2840
2841         Reviewed by Alex Christensen.
2842
2843         * Platform/IPC/mac/ConnectionMac.mm:
2844         (IPC::Connection::sendOutgoingMessage):
2845
2846 2018-10-26  Jer Noble  <jer.noble@apple.com>
2847
2848         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
2849         https://bugs.webkit.org/show_bug.cgi?id=190951
2850         <rdar://problem/45213065>
2851
2852         Reviewed by Alex Christensen.
2853
2854         Add an asyncronous reply request to VideoFullscreenManager.
2855
2856         Drive-by fix: messages.py generates "WTFMove(*arg1, *arg2)" instead of "WTFMove(*arg1), WTFMove(*arg2)"
2857         in its reply handler generation.
2858
2859         * Platform/IPC/MessageSender.h:
2860         (IPC::MessageSender::sendWithAsyncReply):
2861         * Scripts/webkit/messages.py:
2862         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2863         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2864         (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
2865         * WebProcess/cocoa/VideoFullscreenManager.h:
2866         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
2867         * WebProcess/cocoa/VideoFullscreenManager.mm:
2868         (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
2869
2870 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2871
2872         Unreviewed, another try at fixing the GTK build with sandbox enabled
2873
2874         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2875         (WebKit::memfd_create): Deleted.
2876
2877 2018-10-25  Antoine Quint  <graouts@apple.com>
2878
2879         [Web Animations] Turn Web Animations CSS Integration off by default
2880         https://bugs.webkit.org/show_bug.cgi?id=190901
2881
2882         Reviewed by Dean Jackson.
2883
2884         * Shared/WebPreferences.yaml:
2885
2886 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2887
2888         Unreviewed, try to fix GTK build with sandbox enabled
2889
2890         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2891
2892 2018-10-25  Claudio Saavedra  <csaavedra@igalia.com>
2893
2894         [WPE][GTK] Follow-up fixes to the certificate coders
2895         https://bugs.webkit.org/show_bug.cgi?id=190900
2896
2897         Reviewed by Michael Catanzaro.
2898
2899         Cleanup the GRefPtr mess I created earlier. Also we now bail out
2900         if any certificate in the chain has no data instead of returning a
2901         cropped chain.
2902
2903         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2904         (IPC::ArgumentCoder<CertificateInfo>::encode):
2905         (IPC::ArgumentCoder<CertificateInfo>::decode):
2906
2907 2018-10-25  Zan Dobersek  <zdobersek@igalia.com>
2908
2909         [GTK][AC] Resizing the window doesn't always update the visible rect
2910         https://bugs.webkit.org/show_bug.cgi?id=189743
2911
2912         Reviewed by Michael Catanzaro.
2913
2914         Disassociate resizing that can be done on an AcceleratedSurface object
2915         between "host resizes" and "client resizes".
2916
2917         The former is done from ThreadedCoordinatedLayerTreeHost directly, and
2918         is currently used only for GTK on X11, where a new pixmap object is
2919         created on each resize, which affects the context ID that is based on
2920         that pixmap object's address.
2921
2922         The latter is done from the composition thread. It's used for GTK on
2923         Wayland and WPE. In both cases, the underlying window object does not
2924         change on each resize, but it's necessary to perform the actual resize
2925         on the composition thread.
2926
2927         So far it hasn't been performed there, which ended up pushing sizes of
2928         the WebKit view and the underlying window object out of sync during
2929         resizing, leaving parts of window unrendered.
2930
2931         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2932         (WebKit::ThreadedCompositor::renderLayerTree):
2933         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2934         * WebProcess/WebPage/AcceleratedSurface.cpp:
2935         (WebKit::AcceleratedSurface::hostResize):
2936         (WebKit::AcceleratedSurface::resize): Deleted.
2937         * WebProcess/WebPage/AcceleratedSurface.h:
2938         (WebKit::AcceleratedSurface::clientResize):
2939         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2940         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
2941         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
2942         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2943         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
2944         (WebKit::AcceleratedSurfaceWayland::clientResize):
2945         (WebKit::AcceleratedSurfaceWayland::resize): Deleted.
2946         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
2947         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
2948         (WebKit::AcceleratedSurfaceX11::hostResize):
2949         (WebKit::AcceleratedSurfaceX11::resize): Deleted.
2950         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
2951         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
2952         (WebKit::AcceleratedSurfaceWPE::clientResize):
2953         (WebKit::AcceleratedSurfaceWPE::resize): Deleted.
2954         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
2955
2956 2018-10-24  Alexey Proskuryakov  <ap@apple.com>
2957
2958         Clean up some obsolete macOS version guards
2959         https://bugs.webkit.org/show_bug.cgi?id=190887
2960
2961         Reviewed by Dan Bernstein.
2962
2963         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2964         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2965         (WebKit::WebProcessPool::platformInitializeWebProcess):
2966
2967 2018-10-24  Megan Gardner  <megan_gardner@apple.com>
2968
2969         Turn on Conic Gradients
2970         https://bugs.webkit.org/show_bug.cgi?id=190810
2971
2972         Reviewed by Tim Horton.
2973
2974         Remove conic gradients from experimental features and turn it on always.
2975
2976         * Configurations/FeatureDefines.xcconfig:
2977         * Shared/WebPreferences.yaml:
2978
2979 2018-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
2980
2981         Cleanup: MIMETypeRegistry functions
2982         https://bugs.webkit.org/show_bug.cgi?id=190838
2983
2984         Reviewed by Simon Fraser.
2985
2986         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2987         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
2988
2989 2018-10-24  Chris Dumez  <cdumez@apple.com>
2990
2991         REGRESSION (r237257): [iOS] Crashes in com.apple.WebKit: WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit
2992         https://bugs.webkit.org/show_bug.cgi?id=190804
2993
2994         Reviewed by Alex Christensen.
2995
2996         Fix null-dereference of the drawing area in RemoteScrollingCoordinator::scheduleTreeStateCommit.
2997         With process-swap-on-navigation enabled, suspended pages' drawing area gets torn down.
2998
2999         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
3000         (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
3001
3002 2018-10-24  Claudio Saavedra  <csaavedra@igalia.com>
3003
3004         [WPE][GTK] Cleanups to the certificate decoder
3005         https://bugs.webkit.org/show_bug.cgi?id=190867
3006
3007         Reviewed by Žan Doberšek.
3008
3009         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3010         (IPC::ArgumentCoder<CertificateInfo>::decode):
3011
3012 2018-10-24  Claudio Saavedra  <csaavedra@igalia.com>
3013
3014         [WPE][GTK] Cleanups to the certificate encoder
3015         https://bugs.webkit.org/show_bug.cgi?id=190865
3016
3017         Reviewed by Žan Doberšek.
3018
3019         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3020         (IPC::ArgumentCoder<CertificateInfo>::encode):
3021
3022 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
3023
3024         Unreviewed, rolling out r237261.
3025
3026         The layout test for this change crashes under GuardMalloc.
3027
3028         Reverted changeset:
3029
3030         "Handle MDNS resolution of candidates through libwebrtc
3031         directly"
3032         https://bugs.webkit.org/show_bug.cgi?id=190681
3033         https://trac.webkit.org/changeset/237261
3034
3035 2018-10-23  David Kilzer  <ddkilzer@apple.com>
3036
3037         Fix false positive leaks when using custom -init methods that don't start with -init
3038         <https://webkit.org/b/190818>
3039         <rdar://problem/45476042>
3040
3041         Reviewed by Dan Bernstein.
3042
3043         * UIProcess/Cocoa/WKWebViewContentProvider.h:
3044         (-[WKWebViewContentProvider web_initWithFrame:webView:mimeType:]):
3045         Add attribute to make this behave like an -init method.
3046
3047 2018-10-23  Chris Dumez  <cdumez@apple.com>
3048
3049         [PSON] Add support for cross-site client-side redirects
3050         https://bugs.webkit.org/show_bug.cgi?id=190806
3051         <rdar://problem/45047344>
3052
3053         Reviewed by Geoffrey Garen.
3054
3055         * Shared/LoadParameters.cpp:
3056         (WebKit::LoadParameters::encode const):
3057         (WebKit::LoadParameters::decode):
3058         * Shared/LoadParameters.h:
3059         * Shared/NavigationActionData.cpp:
3060         (WebKit::NavigationActionData::encode const):
3061         (WebKit::NavigationActionData::decode):
3062         * Shared/NavigationActionData.h:
3063         * Shared/WebBackForwardListItem.cpp:
3064         (WebKit::WebBackForwardListItem::setSuspendedPage):
3065         * UIProcess/API/APINavigation.h:
3066         (API::Navigation::setLockHistory):
3067         (API::Navigation::lockHistory const):
3068         (API::Navigation::setLockBackForwardList):
3069         (API::Navigation::lockBackForwardList const):
3070         (API::Navigation::setClientRedirectSourceForHistory):
3071         (API::Navigation::clientRedirectSourceForHistory const):
3072         * UIProcess/API/APINavigationClient.h:
3073         (API::NavigationClient::willPerformClientRedirect):
3074         (API::NavigationClient::didPerformClientRedirect):
3075         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3076         * UIProcess/Cocoa/NavigationState.h:
3077         * UIProcess/Cocoa/NavigationState.mm:
3078         (WebKit::NavigationState::setNavigationDelegate):
3079         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
3080         * UIProcess/FrameLoadState.h:
3081         (WebKit::FrameLoadState::setURL):
3082         * UIProcess/WebPageProxy.cpp:
3083         (WebKit::WebPageProxy::loadRequestWithNavigation):
3084         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3085         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3086         (WebKit::WebPageProxy::didPerformClientRedirect):
3087         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3088         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3089         * WebProcess/WebPage/WebPage.cpp:
3090         (WebKit::WebPage::loadRequest):
3091         (WebKit::WebPage::setCurrentHistoryItemForReattach):
3092         * WebProcess/WebPage/WebPage.h:
3093         * WebProcess/WebPage/WebPage.messages.in:
3094
3095 2018-10-23  Claudio Saavedra  <csaavedra@igalia.com>
3096
3097         [WPE][GTK] Pass full certificate chain in CertificateInfo coder
3098         https://bugs.webkit.org/show_bug.cgi?id=190789
3099
3100         Reviewed by Michael Catanzaro.
3101
3102         When the network process serializes certificate data to other
3103         processes through the argument coders, the certificate chain, if
3104         present, is lost. In practice this means that applications using
3105         the public API to process certificate info have no details on the
3106         certificate chain, other than the very basics included in the
3107         certificate. Serialize the entire chain if available in the
3108         certificate.
3109
3110         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3111         (IPC::ArgumentCoder<CertificateInfo>::encode): Encode the
3112         certificate chain if present.
3113         (IPC::ArgumentCoder<CertificateInfo>::decode): Decode the
3114         entire certificate chain and rebuild it.
3115
3116 2018-10-22  Keith Rollin  <krollin@apple.com>
3117
3118         Use Location = "Relative to Build Products" rather than "Relative to Group"
3119         https://bugs.webkit.org/show_bug.cgi?id=190781
3120
3121         Reviewed by Alexey Proskuryakov.
3122
3123         Almost all Derived Files are included in Xcode projects with the
3124         Location attribute set to "Relative to Group". While this currently
3125         works, the Derived Files can no longer be found when enabling XCBuild
3126         (which has stricter requirements). Fix this by setting the Location
3127         attribute to "Relative to Build Products".
3128
3129         * WebKit.xcodeproj/project.pbxproj:
3130
3131 2018-10-22  Tim Horton  <timothy_horton@apple.com>
3132
3133         Don't waste time under -setupInteraction under -initWithFrame for unparented WKWebViews
3134         https://bugs.webkit.org/show_bug.cgi?id=190801
3135         <rdar://problem/43674361>
3136
3137         Reviewed by Megan Gardner.
3138
3139         * UIProcess/ios/WKContentView.mm:
3140         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
3141         (-[WKContentView didMoveToWindow]):
3142         Defer the first call to WKContentViewInteraction's -setupInteraction
3143         until the view is parented. This avoids a few milliseconds of unnecessary
3144         work for views that are never parented.
3145
3146         * UIProcess/ios/WKContentViewInteraction.h:
3147         * UIProcess/ios/WKContentViewInteraction.mm:
3148         (-[WKContentView setupInteraction]):
3149         (-[WKContentView cleanupInteraction]):
3150         Keep track of the current state of WKContentViewInteraction's gestures.
3151         Use this to make it OK to call -setupInteraction multiple times.
3152
3153 2018-10-22  Chris Dumez  <cdumez@apple.com>
3154
3155         Deque's contains() and findIf() should be const
3156         https://bugs.webkit.org/show_bug.cgi?id=190796
3157
3158         Reviewed by Antti Koivisto.
3159
3160         Mark method as const now that Deque's implementation allows it to be.
3161
3162         * UIProcess/WebProcessPool.cpp:
3163         (WebKit::WebProcessPool::hasSuspendedPageProxyFor const):
3164         (WebKit::WebProcessPool::hasSuspendedPageProxyFor): Deleted.
3165         * UIProcess/WebProcessPool.h:
3166
3167 2018-10-19  Brent Fulgham  <bfulgham@apple.com>
3168
3169         Allow WebContent process to check some file system features
3170         https://bugs.webkit.org/show_bug.cgi?id=190768
3171         <rdar://problem/45377609>
3172
3173         Reviewed by Alexey Proskuryakov.
3174
3175         This patch unblocks some IOKit properties that are needed by lower level frameworks to make decisions
3176         about how to efficiently use the file system.
3177
3178         * WebProcess/com.apple.WebProcess.sb.in:
3179
3180 2018-10-19  Stephan Szabo  <stephan.szabo@sony.com>
3181
3182         [WinCairo] Search terms are not saved for <input type="search">
3183         https://bugs.webkit.org/show_bug.cgi?id=188174
3184
3185         Reviewed by Fujii Hironori.
3186
3187         Add support for saving the search terms for <input
3188         type="search"> to a SQLite database, replacing the
3189         CF-based implementation for Windows and adding support
3190         for non-legacy WebKit.
3191
3192         * UIProcess/win/WebPageProxyWin.cpp:
3193         (WebKit::WebPageProxy::saveRecentSearches): Use SQLite database
3194         implementation in WebCore::SearchPopupMenuDB to save search
3195         terms
3196         (WebKit::WebPageProxy::loadRecentSearches): Use SQLite database
3197         implementation in WebCore::SearchPopupMenuDB to load search
3198         terms
3199
3200 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3201
3202         WebDataListSuggestionsDropdown should use a WeakPtr
3203         https://bugs.webkit.org/show_bug.cgi?id=190763
3204         <rdar://problem/45417449>
3205
3206         Reviewed by Tim Horton.
3207
3208         Nothing suspicious here. It's just good practice to not keep raw pointers that aren't reset when the object they point to are destroyed.
3209
3210         * UIProcess/WebDataListSuggestionsDropdown.cpp:
3211         (WebKit::WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown):
3212         (WebKit::WebDataListSuggestionsDropdown::close):
3213         * UIProcess/WebDataListSuggestionsDropdown.h:
3214         (WebKit::WebDataListSuggestionsDropdown::Client::~Client): Deleted.
3215         * UIProcess/WebPageProxy.h:
3216         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
3217         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
3218         (WebKit::WebDataListSuggestionsDropdownIOS::create):
3219         (WebKit::WebDataListSuggestionsDropdownIOS::WebDataListSuggestionsDropdownIOS):
3220         (WebKit::WebDataListSuggestionsDropdownIOS::close):
3221         (WebKit::WebDataListSuggestionsDropdownIOS::didSelectOption):
3222         * UIProcess/mac/WebDataListSuggestionsDropdownMac.h:
3223         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
3224         (WebKit::WebDataListSuggestionsDropdownMac::create):
3225         (WebKit::WebDataListSuggestionsDropdownMac::WebDataListSuggestionsDropdownMac):
3226         (WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
3227         (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
3228
3229 2018-10-19  Wenson Hsieh  <wenson_hsieh@apple.com>
3230
3231         [iOS] [Datalist] Can't pick datalist suggestions in a stock WKWebView
3232         https://bugs.webkit.org/show_bug.cgi?id=190621
3233         <rdar://problem/45310649>
3234
3235         Reviewed by Tim Horton.
3236
3237         Fixes the bug by refactoring datalist suggestion information on iOS; currently, we override text suggestions on
3238         _WKFormInputSession. This only works for a few internal clients (including Safari) that set a _WKInputDelegate
3239         and also implement either -_webView:willStartInputSession: or -_webView:didStartInputSession:, which is
3240         necessary in order to ensure that WebKit creates and maintains a form input session.
3241
3242         The two pieces of information that datalist code needs to vend to WKContentView are a list of UITextSuggestions
3243         and a custom input view, which are both currently properties of _WKFormInputSession. This patch lifts these out
3244         of the input session and makes them properties of WKContentView, which are used in
3245         WebDataListSuggestionsDropdownIOS.
3246
3247         Test: fast/forms/datalist/datalist-textinput-suggestions-order.html
3248
3249         * UIProcess/ios/WKContentViewInteraction.h:
3250         * UIProcess/ios/WKContentViewInteraction.mm:
3251
3252         Add new properties to WKContentView: an input view for datalist suggestions, and a list of text suggestions.
3253
3254         (-[WKFormInputSession setSuggestions:]):
3255         (-[WKContentView setupInteraction]):
3256         (-[WKContentView cleanupInteraction]):
3257         (-[WKContentView _endEditing]):
3258
3259         Pull out common logic when resigning first responder or tabbing to the next or previous text field into a new
3260         helper. This helper notifies `_inputPeripheral`, `_formInputSession`, and `_dataListTextSuggestionsInputView`
3261         when editing has ended; the input peripheral and suggestions input view use this chance to send the value of the
3262         form control to the web process.
3263
3264         (-[WKContentView resignFirstResponderForWebView]):
3265         (-[WKContentView inputView]):
3266
3267         If a custom input view is not set but we have an input view for a datalist's text suggestions, use the datalist
3268         input view.
3269
3270         (-[WKContentView accessoryTab:]):
3271         (-[WKContentView _stopAssistingNode]):
3272
3273         Clear datalist state on WKContentView.
3274
3275         (-[WKContentView dataListTextSuggestionsInputView]):
3276         (-[WKContentView dataListTextSuggestions]):
3277         (-[WKContentView setDataListTextSuggestionsInputView:]):
3278         (-[WKContentView setDataListTextSuggestions:]):
3279         (-[WKContentView updateTextSuggestionsForInputDelegate]):
3280
3281         Pull out logic for setting suggestions on UIKit's `inputDelegate` (i.e. UIKeyboardImpl). We now first consult
3282         internally-vended text suggestions from _WKFormInputSession; if an internal client has not overridden our text
3283         suggestions, then we simply use suggestions from the current datalist (if present).
3284
3285         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
3286         (-[WKDataListSuggestionsPicker updateWithInformation:]):
3287         (-[WKDataListSuggestionsPicker showSuggestionsDropdown:activationType:]):
3288         (-[WKDataListSuggestionsPicker invalidate]):
3289         (-[WKDataListSuggestionsPopover updateWithInformation:]):
3290         (-[WKDataListSuggestionsPopover showSuggestionsDropdown:activationType:]):
3291         (-[WKDataListSuggestionsPopover didSelectOptionAtIndex:]):
3292
3293         Change all the places that currently manipulate WKContentView's form input session to directly set text
3294         suggestions and the text suggestion input view on the content view instead.
3295
3296 2018-10-19  John Wilander  <wilander@apple.com>
3297
3298         Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
3299         https://bugs.webkit.org/show_bug.cgi?id=190687
3300         <rdar://problem/45349024>
3301
3302         Reviewed by Alex Christensen.
3303
3304         This patch adds the following:
3305         - The WebProcessPool now tells the WebsiteDataStore when a network process has
3306             been created.
3307         - The WebsiteDataStore in turn tells the WebResourceLoadStatisticsStore when
3308             a network process has been created.
3309         - The WebResourceLoadStatisticsStore makes sure to update the network processes
3310             with its cookie policy when it's notified that a network process has been
3311             created.
3312
3313         In addition, this patch changes the following:
3314         - The ResourceLoadStatisticsMemoryStore no longer keeps track of which domains
3315             it has told the network process to block cookies for. The reason is that
3316             we cannot assume that there is only one network process so we should
3317             always send complete blocking data.
3318         - The ResourceLoadStatisticsMemoryStore's functions for communicating cookie
3319             blocking state to the network process no longer take and forward the
3320             "clear first" parameter. This is because complete data is sent every time
3321             and thus the network process' set is always cleared on an update.
3322         - Removes WebsiteDataStore::networkProcessDidCrash() and
3323             WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset() since
3324             the call site---WebProcessPool::ensureNetworkProcess()---now calls
3325             WebsiteDataStore::didCreateNetworkProcess() after a network process
3326             crash and the state sync for cookie blocking is triggered.
3327
3328         * NetworkProcess/NetworkProcess.cpp:
3329         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
3330         (WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies):
3331         * NetworkProcess/NetworkProcess.h:
3332         * NetworkProcess/NetworkProcess.messages.in:
3333         * UIProcess/Network/NetworkProcessProxy.cpp:
3334         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3335         (WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies):
3336         (WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies):
3337         * UIProcess/Network/NetworkProcessProxy.h:
3338         * UIProcess/Network/NetworkProcessProxy.messages.in:
3339         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
3340         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
3341         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
3342         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
3343         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
3344         (WebKit::ResourceLoadStatisticsMemoryStore::resetCookieBlockingState): Deleted.
3345         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
3346         * UIProcess/WebProcessPool.cpp:
3347         (WebKit::WebProcessPool::ensureNetworkProcess):
3348         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3349         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
3350         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
3351         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3352         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
3353         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset): Deleted.
3354         * UIProcess/WebResourceLoadStatisticsStore.h:
3355         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3356         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
3357         (WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies):
3358         (WebKit::WebsiteDataStore::didCreateNetworkProcess):
3359         (WebKit::WebsiteDataStore::networkProcessDidCrash): Deleted.
3360         * UIProcess/WebsiteData/WebsiteDataStore.h:
3361
3362 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3363
3364         Rebase python tests.
3365
3366         * Scripts/webkit/messages_unittest.py:
3367
3368 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3369
3370         Rebase python tests.
3371
3372         * Scripts/Makefile:
3373         * Scripts/webkit/MessageReceiver-expected.cpp:
3374         * Scripts/webkit/Messages-expected.h:
3375
3376 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3377
3378         Mark LegacySync IPC messages
3379         https://bugs.webkit.org/show_bug.cgi?id=190759
3380
3381         Reviewed by Tim Horton.
3382
3383         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3384         * NetworkProcess/NetworkProcess.messages.in:
3385         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
3386         * Platform/IPC/HandleMessage.h:
3387         (IPC::handleMessageLegacySync):
3388         * PluginProcess/PluginControllerProxy.messages.in:
3389         * Scripts/webkit/messages.py:
3390         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
3391         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
3392         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3393         * UIProcess/Plugins/PluginProcessProxy.messages.in:
3394         * UIProcess/WebFullScreenManagerProxy.messages.in:
3395         * UIProcess/WebPageProxy.messages.in:
3396         * UIProcess/WebPasteboardProxy.messages.in:
3397         * UIProcess/WebProcessPool.messages.in:
3398         * UIProcess/WebProcessProxy.messages.in:
3399         * UIProcess/WebStorage/StorageManager.messages.in:
3400         * UIProcess/mac/SecItemShimProxy.messages.in:
3401         * WebProcess/Plugins/PluginProcessConnection.messages.in:
3402         * WebProcess/Plugins/PluginProxy.messages.in:
3403         * WebProcess/WebPage/WebPage.messages.in:
3404         * WebProcess/WebProcess.messages.in:
3405
3406 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3407
3408         Update and add python tests after r237294
3409         https://bugs.webkit.org/show_bug.cgi?id=190746
3410
3411         * Scripts/Makefile: Added to help updating expectations.
3412         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
3413         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
3414         (Messages::WebPage::TestAsyncMessage::callReply):
3415         (Messages::WebPage::TestAsyncMessage::cancelReply):
3416         (Messages::WebPage::TestAsyncMessage::send):
3417         (WebKit::WebPage::didReceiveMessage):
3418         * Scripts/webkit/MessagesSuperclass-expected.h:
3419         (Messages::WebPage::TestAsyncMessage::receiverName):
3420         (Messages::WebPage::TestAsyncMessage::name):
3421         (Messages::WebPage::TestAsyncMessage::asyncMessageReplyName):
3422         (Messages::WebPage::TestAsyncMessage::TestAsyncMessage):
3423         (Messages::WebPage::TestAsyncMessage::arguments const):
3424         * Scripts/webkit/test-superclass-messages.in:
3425         Adding the extra newline made python tests fail.
3426         I also added more tests for the new functionality introduced in r237924.
3427
3428 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3429
3430         Introduce CompletionHandler-based Async IPC messages with replies
3431         https://bugs.webkit.org/show_bug.cgi?id=190746
3432