Add WebProcessPool option for process swapping on navigation.
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-02-19  Brady Eidson  <beidson@apple.com>
2
3         Add WebProcessPool option for process swapping on navigation.
4         https://bugs.webkit.org/show_bug.cgi?id=182945
5
6         Reviewed by Alex Christensen.
7
8         Just the most basic groundwork for testing a new WK2 feature.
9
10         * UIProcess/API/APIProcessPoolConfiguration.h:
11
12         * UIProcess/API/C/WKContextConfigurationRef.cpp:
13         (WKContextConfigurationProcessSwapsOnNavigation):
14         (WKContextConfigurationSetProcessSwapsOnNavigation):
15         * UIProcess/API/C/WKContextConfigurationRef.h:
16
17         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
18         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
19         (-[_WKProcessPoolConfiguration setProcessSwapsOnNavigation:]):
20         (-[_WKProcessPoolConfiguration processSwapsOnNavigation]):
21
22 2018-02-19  Daniel Bates  <dabates@apple.com>
23
24         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
25         https://bugs.webkit.org/show_bug.cgi?id=182905
26         <rdar://problem/37676775>
27
28         Reviewed by Alex Christensen.
29
30         Return nullptr when querying for the scheme handler of the null string.
31
32         Before a navigation is performed WebKit checks if the destination URL is associated with an app
33         unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
34         If the URL is not associated with an app then WebKit may fall back to checking if the embedding
35         client registered a scheme handler for it. Currently we assume that the scheme is a non-null
36         string when checking the scheme handler registry. However the scheme can be a null string if
37         it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
38         for a scheme handler. Instead check that the scheme is a non-null string before checking to see
39         if it is in the scheme handler registry.
40
41         * UIProcess/WebPageProxy.cpp:
42         (WebKit::WebPageProxy::urlSchemeHandlerForScheme):
43
44 2018-02-19  Eric Carlson  <eric.carlson@apple.com>
45
46         [Extra zoom mode] Don't allow PiP media playback
47         https://bugs.webkit.org/show_bug.cgi?id=182930
48         <rdar://problem/37676259>
49
50         Reviewed by Andy Estes.
51
52         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
53         (-[WKWebViewConfiguration init]): Don't enable PiP mode. Require user interaction for
54         all media types.
55
56 2018-02-19  Ryan Haddad  <ryanhaddad@apple.com>
57
58         Unreviewed, rolling out r228696.
59
60         The API test added with this change is timing out on macOS.
61
62         Reverted changeset:
63
64         "Null pointer dereference in
65         WebPageProxy::urlSchemeHandlerForScheme()"
66         https://bugs.webkit.org/show_bug.cgi?id=182905
67         https://trac.webkit.org/changeset/228696
68
69 2018-02-19  Daniel Bates  <dabates@apple.com>
70
71         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
72         https://bugs.webkit.org/show_bug.cgi?id=182905
73
74         Reviewed by Alex Christensen.
75
76         Return nullptr when querying for the scheme handler of the null string.
77
78         Before a navigation is performed WebKit checks if the destination URL is associated with an app
79         unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
80         If the URL is not associated with an app then WebKit may fall back to checking if the embedding
81         client registered a scheme handler for it. Currently we assume that the scheme is a non-null
82         string when checking the scheme handler registry. However the scheme can be a null string if
83         it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
84         for a scheme handler. Instead check that the scheme is a non-null string before checking to see
85         if it is in the scheme handler registry.
86
87         * UIProcess/WebPageProxy.cpp:
88         (WebKit::WebPageProxy::urlSchemeHandlerForScheme):
89
90 2018-02-19  Ms2ger  <Ms2ger@igalia.com>
91
92         Explicitly qualify some method calls on this in lamdas in Service Worker code.
93         https://bugs.webkit.org/show_bug.cgi?id=182875
94
95         Reviewed by Chris Dumez.
96
97         This is necessary for the code to build with GCC 5. Other code already
98         appears to have been adapted similarly.
99
100         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
101         (WebKit::WebSWServerConnection::startFetch):
102
103 2018-02-18  Reza Abbasian  <rabbasian@apple.com>
104
105         Set the appropriate AutoFill context for suggested passwords.
106         https://bugs.webkit.org/show_bug.cgi?id=182718
107         <rdar://problem/36326863>
108
109         Reviewed by Wenson Hsieh and Tim Horton.
110
111         Before starting the input session, call the new delegate to query if AutoFill password suggestion assistance
112         is required for the focused element.
113
114         * UIProcess/API/Cocoa/_WKFormInputSession.h:
115         * UIProcess/API/Cocoa/_WKInputDelegate.h:
116         Introduce a new delegate to be called  before starting an input session to query if AutoFill password suggestion
117         assistance is required for the focused element.
118         * UIProcess/ios/WKContentViewInteraction.h:
119         * UIProcess/ios/WKContentViewInteraction.mm:
120         (-[WKFormInputSession initWithContentView:focusedElementInfo:requiresStrongPasswordAssistance:]):
121         (-[WKFormInputSession requiresStrongPasswordAssistance]):
122         (-[WKContentView cleanupInteraction]):
123         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
124         Call the delegate to find out if AutoFill suggested password assistance is required.
125         (-[WKContentView _stopAssistingNode]):
126         (-[WKContentView _autofillContext]): If the first responder is a password element and requires
127         assistance for AutoFill suggested password, set the appropriate AutoFill context.
128         (-[WKFormInputSession initWithContentView:focusedElementInfo:]): Deleted.
129
130 2018-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>
131
132         [Extra zoom mode] Form control values are stale after dismissing and representing input view controllers
133         https://bugs.webkit.org/show_bug.cgi?id=182877
134         <rdar://problem/37604395>
135
136         Reviewed by Tim Horton.
137
138         Currently, when presenting an input view controller for a focused element, we populate the initial form control
139         value using the WKContentView's assisted node information when it was last focused. However, if the user edits
140         the value of a form control, dismisses to the form control view controller (while the element is still focused)
141         and then begins editing the field again, the initial text will be the previous value of the input, since the
142         AssistedNodeInformation isn't up to date.
143
144         To fix this, we introduce a mechanism to update WKContentView's AssistedNodeInformation for the current assisted
145         node. This overwrites _assistedNodeInformation with new information computed from the web process, as long as
146         the assisted node before and after the request is made in the UI process has not changed. We accomplish this by
147         adding an identifier to AssistedNodeInformation, which is monotonically incremented when an element is focused
148         in the web process. The UI process may then use this identifier to determine whether AssistedNodeInformations
149         are describing the same focused element.
150
151         One interesting consideration here is that a normal AssistedNodeInformation update (propagated when focusing an
152         element) may be deferred in the UI process until the next layer tree commit. In the absence of the assisted node
153         identifier check, one could imagine a scenario in which the assisted node information in the UI process gets
154         "updated" from a new value to an old value:
155
156         1. The web process focuses an element and sends AssistedNodeInformation `A`.
157         2. WKContentView calls -updateCurrentAssistedNodeInformation.
158         3. The web process sends AssistedNodeInformation `B`.
159         4. `A` is received in the UI process, but deferred.
160         5. The UI process receives `B` and sets _assistedNodeInformation to `B`.
161         6. The UI process calls -_startAssistingNode: and sets _assistedNodeInformation to `A`.
162
163         This would mean that the _assistedNodeInformation is set to an earlier value, `A`, after being set to a later
164         value, `B`. However, because the AssistedNodeInformation identifier in step (2) refers to the assisted node
165         prior to step (1), the assisted node identifier in (5) would not match this identifier, and we would simply bail
166         instead of overwriting assisted node information.
167
168         We use this AssistedNodeInformation update mechanism after inserting text via input view controllers, and also
169         after reentering edit mode from the focused form control view controller. This fixes two issues where changing
170         the size of the focused element after editing it results in the focused form overlay highlighting a stale frame,
171         and also when setting the initial text when reentering edit mode for a form control that is already focused.
172
173         * Shared/AssistedNodeInformation.cpp:
174         (WebKit::AssistedNodeInformation::encode const):
175         (WebKit::AssistedNodeInformation::decode):
176         * Shared/AssistedNodeInformation.h:
177
178         Add a new monotonically increasing identifier (per WebPage) which associates a AssistedNodeInformation with a
179         focused element. In the event that the web process crashes and relaunches (thus resetting this identifier),
180         AssistedNodeInformation state in the UI process is now also reset (see -cleanupInteraction), so we won't end up
181         confusing AssistedNodeInformations computed by different WebPages between a web process crash.
182
183         * UIProcess/WebPageProxy.h:
184
185         A bit of related refactoring here to remove an unnecessary bool flag that indicates whether we have a deferred
186         assisted node information. Instead, just use the presence of m_deferredNodeAssistanceArguments.
187
188         * UIProcess/WebPageProxy.messages.in:
189
190         Add a AssistedNodeInformationCallback IPC message.
191
192         * UIProcess/ios/WKContentViewInteraction.mm:
193         (-[WKContentView cleanupInteraction]):
194
195         Clear out the previous AssistedNodeInformation. See above for details.
196
197         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
198         (-[WKContentView updateCurrentAssistedNodeInformation:]):
199
200         Tries to update AssistedNodeInformation for the current assisted node, invoking the completion callback when
201         finished. This may result in the assisted node information not being updated due to the current assisted node
202         changing in the time between the start of the request and the information being received in the UI process.
203
204         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
205
206         Refactored from -presentViewControllerForAssistedNode:, such that it no longer takes an AssistedNodeInformation
207         as an argument, but rather just uses WKContentView's current _assistedNodeInformation. This was just being
208         called with _assistedNodeInformation from all call sites anyways.
209
210         (-[WKContentView textInputController:didCommitText:]):
211
212         Request an AssistedNodeInformation update after setting the value of a form control; if the assisted node hasn't
213         changed, update the focused form control overlay. This is needed to handle cases where the focused element's
214         frame may have changed after inserting text (e.g. due to line wrapping), and the focused form control overlay
215         needs to be updated to reflect this change.
216
217         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
218
219         Request an AssistedNodeInformation update before reentering edit mode; if the assisted node hasn't changed since
220         the start of the request, present the appropriate input view controller.
221
222         (-[WKContentView presentViewControllerForAssistedNode:]): Deleted.
223         * UIProcess/ios/WebPageProxyIOS.mm:
224         (WebKit::WebPageProxy::assistedNodeInformationCallback):
225         (WebKit::WebPageProxy::requestAssistedNodeInformation):
226         (WebKit::WebPageProxy::didCommitLayerTree):
227         (WebKit::WebPageProxy::startAssistingNode):
228         (WebKit::WebPageProxy::stopAssistingNode):
229         * WebProcess/WebPage/WebPage.cpp:
230         (WebKit::WebPage::elementDidFocus):
231
232         Increment the assisted node identifier.
233
234         * WebProcess/WebPage/WebPage.h:
235         * WebProcess/WebPage/WebPage.messages.in:
236         * WebProcess/WebPage/ios/WebPageIOS.mm:
237         (WebKit::WebPage::requestAssistedNodeInformation):
238
239         Compute and return an AssistedNodeInformation.
240
241         (WebKit::WebPage::getAssistedNodeInformation):
242
243 2018-02-16  Dean Jackson  <dino@apple.com>
244
245         Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
246         https://bugs.webkit.org/show_bug.cgi?id=182894
247
248         Reviewed by Tim Horton.
249
250         Rename OPENGL_ES_2 to OPENGL_ES.
251
252         * CMakeLists.txt:
253         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
254         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
255         (WebKit::AcceleratedBackingStoreWayland::paint):
256         * UIProcess/gtk/WaylandCompositor.cpp:
257         (WebKit::WaylandCompositor::initializeEGL):
258
259 2018-02-16  Ryosuke Niwa  <rniwa@webkit.org>
260
261         Add an entitlement check for service worker on iOS
262         https://bugs.webkit.org/show_bug.cgi?id=182865
263         <rdar://problem/37505903>
264
265         Reviewed by Brady Eidson.
266
267         Added an entitlement check to enable service workers on iOS.
268
269         * Shared/mac/SandboxUtilities.h:
270         * Shared/mac/SandboxUtilities.mm:
271         (WebKit::connectedProcessHasEntitlement): Added.
272         * StorageProcess/StorageProcess.cpp:
273         (WebKit::StorageProcess::createStorageToWebProcessConnection): Enforce the entitlement check by crashing
274         when this code is executed without the parent process having the service worker entitlement. This should
275         never happen unless someone is trying to bypass the entitlement check in UI Process since we ordinarily
276         disable service worker gracefully in WKWebView _initializeWithConfiguration.
277         (WebKit::StorageProcess::swServerForSession): Ditto.
278         (WebKit::StorageProcess::registerSWServerConnection): Ditto.
279         * StorageProcess/StorageProcess.h:
280         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
281         * StorageProcess/ios/StorageProcessIOS.mm:
282         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
283         * UIProcess/API/Cocoa/WKWebView.mm:
284         (-[WKWebView _initializeWithConfiguration:]): Disable the service workers when the entitlement is
285         missing from the current process. The entitlement is enforced by WebContent and Storage process.
286         This check avoids crashing WebContent process and gracefully disabling the feature.
287         * WebProcess/WebPage/WebPage.cpp:
288         (WebKit::WebPage::updatePreferences): Enforce the entitlement check.
289         * WebProcess/WebPage/WebPage.h:
290         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
291         * WebProcess/WebPage/ios/WebPageIOS.mm:
292         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
293
294 2018-02-16  Youenn Fablet  <youenn@apple.com>
295
296         Allow specifying which plug-ins are supported
297         https://bugs.webkit.org/show_bug.cgi?id=182748
298
299         Reviewed by Chris Dumez.
300
301         Add a C and ObjC API to set which plug-ins are specified.
302         Plug-ins may be allowed by origin of the main page or for all origins.
303
304         If the API to set a supported plug-in is called, WebKit enters a mode
305         where it will block any plug-in that is not on the list.
306
307         The list of supported plug-ins is stored in UIProcess and sent to WebProcess.
308         This allows to compute the list of visible plug-ins according supported plugins.
309
310         PluginInfoStore is storing the list of supported plugins and can
311         answer whether a plug-in creation request is to be made unsupported or not.
312         It also creates the structure sent to WebProcess for computing plugin visibility.
313
314         Updated ArgumentCoders to accept modern HashSet decoders.
315
316         * Platform/IPC/ArgumentCoders.h:
317         * UIProcess/API/C/WKContext.cpp:
318         (WKContextAddSupportedPlugin):
319         (WKContextClearSupportedPlugins):
320         * UIProcess/API/C/WKContextPrivate.h:
321         * UIProcess/API/Cocoa/WKProcessPool.mm:
322         (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
323         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
324         * UIProcess/Plugins/PluginInfoStore.cpp:
325         (WebKit::PluginInfoStore::isSupportedPlugin):
326         (WebKit::PluginInfoStore::SupportedPlugins::isSupported):
327         (WebKit::PluginInfoStore::SupportedPlugin::isSupported):
328         (WebKit::PluginInfoStore::supportedPluginNames):
329         (WebKit::PluginInfoStore::addSupportedPlugin):
330         * UIProcess/Plugins/PluginInfoStore.h:
331         (WebKit::PluginInfoStore::clearSupportedPlugins):
332         * UIProcess/WebPageProxy.cpp:
333         (WebKit::WebPageProxy::findPlugin):
334         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
335         * UIProcess/WebPageProxy.h:
336         * UIProcess/WebPageProxy.messages.in:
337         * UIProcess/WebProcessPool.cpp:
338         (WebKit::WebProcessPool::addSupportedPlugin):
339         (WebKit::WebProcessPool::clearSupportedPlugins):
340         * UIProcess/WebProcessPool.h:
341         * UIProcess/WebProcessProxy.cpp:
342         (WebKit::WebProcessProxy::getPlugins):
343         * UIProcess/WebProcessProxy.h:
344         * UIProcess/WebProcessProxy.messages.in:
345         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
346         (WebKit::WebPluginInfoProvider::getPluginInfo):
347         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
348         (WebKit::WebPluginInfoProvider::populatePluginCache):
349         * WebProcess/Plugins/WebPluginInfoProvider.h:
350         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
351         (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const):
352         * WebProcess/WebPage/WebPage.cpp:
353         (WebKit::WebPage::createPlugin):
354         (WebKit::WebPage::canPluginHandleResponse):
355
356 2018-02-16  Jiewen Tan  <jiewen_tan@apple.com>
357
358         [WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
359         https://bugs.webkit.org/show_bug.cgi?id=182771
360         <rdar://problem/36459988>
361
362         Reviewed by Brent Fulgham.
363
364         This patch utilizes LocalAuthentication Framework to determine if biometrics
365         are enrolled on a device, which is the user verifying platform authenticator.
366         To do so, it links the framework to WebKit.
367
368         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
369         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
370         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailableReply):
371         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
372         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
373         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
374         (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
375         * WebKit.xcodeproj/project.pbxproj:
376         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
377         (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
378         (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
379         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
380         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
381
382 2018-02-16  Per Arne Vollan  <pvollan@apple.com>
383
384         Implement stopping of run loop in the WebContent process when using NSRunLoop.
385         https://bugs.webkit.org/show_bug.cgi?id=182499
386         <rdar://problem/37247424>
387
388         Reviewed by Brent Fulgham.
389
390         Add the method ChildProcess::stopNSRunLoop to end the WebContent process by executing a block
391         with 'exit(0)' on the main run loop. 
392
393         * Shared/ChildProcess.h:
394         * Shared/mac/ChildProcessMac.mm:
395         (WebKit::ChildProcess::stopNSRunLoop):
396         * WebProcess/cocoa/WebProcessCocoa.mm:
397         (WebKit::WebProcess::platformInitializeWebProcess):
398         (WebKit::WebProcess::stopRunLoop):
399
400 2018-02-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
401
402         [WinCario] Add NetworkSessionCurl
403         https://bugs.webkit.org/show_bug.cgi?id=182680
404
405         Reviewed by Konstantin Tokarev.
406
407         * NetworkProcess/NetworkSession.cpp:
408         (WebKit::NetworkSession::create):
409         * PlatformWin.cmake:
410
411 2018-02-16  Chris Dumez  <cdumez@apple.com>
412
413         ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel::entanglePortWithProcess()
414         https://bugs.webkit.org/show_bug.cgi?id=182054
415         <rdar://problem/36871207>
416
417         Reviewed by Brady Eidson.
418
419         Pipe postMessage messages to and from service workers via the UIProcess instead of going
420         directly to the StorageProcess. This is temporarily needed to avoid races due to the
421         MessagePort registry currently living in the UIProcess and postMessage messages potentially
422         sending MessagePort objects.
423
424         This change is covered by tests on the bots that currently flakily crash in debug.
425
426         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
427         * StorageProcess/StorageProcess.cpp:
428         (WebKit::StorageProcess::postMessageToServiceWorker):
429         * StorageProcess/StorageProcess.h:
430         * StorageProcess/StorageProcess.messages.in:
431         * UIProcess/WebProcessPool.cpp:
432         (WebKit::WebProcessPool::postMessageToServiceWorkerClient):
433         (WebKit::WebProcessPool::postMessageToServiceWorker):
434         * UIProcess/WebProcessPool.h:
435         * UIProcess/WebProcessPool.messages.in:
436         * WebProcess/Storage/WebSWClientConnection.cpp:
437         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
438         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
439         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
440
441 2018-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>
442
443         [Extra zoom mode] Add basic support for <input type='date'> using date picker UI
444         https://bugs.webkit.org/show_bug.cgi?id=182847
445         <rdar://problem/35143111>
446
447         Reviewed by Tim Horton.
448
449         Add support for presenting date pickers when focusing a date input.
450
451         * UIProcess/ios/WKContentViewInteraction.h:
452         * UIProcess/ios/WKContentViewInteraction.mm:
453         (-[WKContentView _stopAssistingNode]):
454         (-[WKContentView dismissAllInputViewControllers]):
455
456         Pull logic to dismiss input view controllers into a single helper.
457
458         (-[WKContentView presentDatePickerViewController:]):
459         (-[WKContentView dismissDatePickerViewController:]):
460         (-[WKContentView presentViewControllerForAssistedNode:]):
461         (-[WKContentView textInputController:didCommitText:]):
462         (-[WKContentView _wheelChangedWithEvent:]):
463
464         Delegate wheel events to the date picker.
465
466         * UIProcess/ios/forms/WKDatePickerViewController.h: Added.
467         * UIProcess/ios/forms/WKDatePickerViewController.mm: Added.
468
469         Add harness files for the WKDatePickerViewController implementation in WebKitAdditions.
470
471         * WebKit.xcodeproj/project.pbxproj:
472
473 2018-02-15  Youenn Fablet  <youenn@apple.com>
474
475         Resources loaded from service workers are not downloadable
476         https://bugs.webkit.org/show_bug.cgi?id=182848
477
478         Reviewed by Chris Dumez.
479
480         Downloads are not supporting resources loaded through service worker.
481         As a temporary solution, we will let network process handle it.
482         Note that this would not work if the URL can only be loaded through service worker.
483         Note also that for navigation loads, if the content type is the default one (application/octet-stream) we are overriding it to
484         text/html as we do not support mime sniffing yet from service worker responses.
485         This might interfere with automatic downloads from navigation.
486
487         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
488         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
489
490 2018-02-15  Megan Gardner  <megan_gardner@apple.com>
491
492         Support scrolling for non-editable web-selection and start autoscroll when near screen edges
493         https://bugs.webkit.org/show_bug.cgi?id=182815
494
495         Add support for autoscrolling during a selection. This also takes into account the edges of the screen
496         and starts autoscrolling when you get close, while still allowing autoscrolling when you are past the bounds
497         of the WebView.
498
499         Reviewed by Tim Horton.
500
501         * UIProcess/ios/WKContentViewInteraction.mm:
502         (-[WKContentView startAutoscroll:]):
503         (-[WKContentView resignFirstResponderForWebView]):
504         (-[WKContentView useSelectionAssistantWithGranularity:]):
505         (-[WKContentView selectedTextRange]):
506         * UIProcess/ios/WebPageProxyIOS.mm:
507         (WebKit::WebPageProxy::startAutoscrollAtPosition):
508         * WebProcess/WebPage/ios/WebPageIOS.mm:
509         (WebKit::WebPage::startAutoscrollAtPosition):
510         (WebKit::WebPage::cancelAutoscroll):
511
512 2018-02-15  John Wilander  <wilander@apple.com>
513
514         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
515         https://bugs.webkit.org/show_bug.cgi?id=182812
516         <rdar://problem/37511406>
517
518         Reviewed by Brent Fulgham.
519
520         * UIProcess/WebResourceLoadStatisticsStore.cpp:
521         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
522             Now does the following:
523             - Logs when there is a model version mismatch.
524             - Does not ingest statistics if the version on disk is newer than the supported one.
525             - Does ingest statistics if the version on disk is older than the supported one.
526             - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().
527
528 2018-02-15  Jiewen Tan  <jiewen_tan@apple.com>
529
530         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
531         https://bugs.webkit.org/show_bug.cgi?id=181946
532         <rdar://problem/37258262>
533
534         Reviewed by Chris Dumez.
535
536         Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
537         a message exchange channel between UIProcess and WebProcess.
538
539         * DerivedSources.make:
540         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
541         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
542         (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
543         (WebKit::WebCredentialsMessengerProxy::makeCredential):
544         (WebKit::WebCredentialsMessengerProxy::getAssertion):
545         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
546         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
547         * UIProcess/WebPageProxy.cpp:
548         (WebKit::m_configurationPreferenceValues):
549         (WebKit::WebPageProxy::reattachToWebProcess):
550         (WebKit::WebPageProxy::resetState):
551         * UIProcess/WebPageProxy.h:
552         * WebKit.xcodeproj/project.pbxproj:
553         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
554         (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
555         (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
556         (WebKit::WebCredentialsMessenger::makeCredential):
557         (WebKit::WebCredentialsMessenger::getAssertion):
558         (WebKit::WebCredentialsMessenger::makeCredentialReply):
559         (WebKit::WebCredentialsMessenger::getAssertionReply):
560         * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
561         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
562         * WebProcess/WebPage/WebPage.cpp:
563         (WebKit::m_credentialsMessenger):
564         (WebKit::m_cpuLimit): Deleted.
565         * WebProcess/WebPage/WebPage.h:
566
567 2018-02-15  Michael Catanzaro  <mcatanzaro@igalia.com>
568
569         [WPE] Unify build of platform-specific files in WebKit layer
570         https://bugs.webkit.org/show_bug.cgi?id=182696
571
572         Reviewed by Žan Doberšek.
573
574         This is easy, because all needed changes were made in the previously-landed patch.
575
576         * CMakeLists.txt:
577         * PlatformWPE.cmake:
578
579 2018-02-15  Don Olmstead  <don.olmstead@sony.com>
580
581         WebCore headers should not be included relatively within dependent projects
582         https://bugs.webkit.org/show_bug.cgi?id=182805
583
584         Reviewed by Chris Dumez.
585
586         * NetworkProcess/capture/NetworkCaptureManager.cpp:
587         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
588         * Shared/gtk/WebEventFactory.cpp:
589         * UIProcess/API/gtk/PageClientImpl.cpp:
590         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
591         * UIProcess/gtk/WebPageProxyGtk.cpp:
592         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
593         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
594         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
595         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
596         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
597
598 2018-02-15  Matt Lewis  <jlewis3@apple.com>
599
600         Unreviewed, rolling out r228495.
601
602         This caused mulitple perf tests to fail consistently.
603
604         Reverted changeset:
605
606         "Resource Load Statistics: Make sure
607         WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can
608         ingest older plist versions and not reset the database"
609         https://bugs.webkit.org/show_bug.cgi?id=182812
610         https://trac.webkit.org/changeset/228495
611
612 2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>
613
614         Default definition of InjectedBundle::PlatformBundle should not be Windows-specific.
615         https://bugs.webkit.org/show_bug.cgi?id=182810
616
617         Reviewed by Michael Catanzaro.
618
619         This branch was added in r228455, but should not be limited to OS(WINDOWS).
620
621         * WebProcess/InjectedBundle/InjectedBundle.h:
622
623 2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>
624
625         Default implementations of nativeEvent() should be platform-agnostic.
626         https://bugs.webkit.org/show_bug.cgi?id=182806
627
628         Reviewed by Darin Adler.
629
630         * Shared/NativeWebKeyboardEvent.h:
631         * Shared/NativeWebMouseEvent.h:
632         * Shared/NativeWebWheelEvent.h:
633
634 2018-02-14  John Wilander  <wilander@apple.com>
635
636         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
637         https://bugs.webkit.org/show_bug.cgi?id=182812
638         <rdar://problem/37511406>
639
640         Reviewed by Brent Fulgham.
641
642         * UIProcess/WebResourceLoadStatisticsStore.cpp:
643         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
644             Now does the following:
645             - Logs when there is a model version mismatch.
646             - Does not ingest statistics if the version on disk is newer than the supported one.
647             - Does ingest statistics if the version on disk is older than the supported one.
648             - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().
649
650 2018-02-14  Daniel Bates  <dabates@apple.com>
651
652         Disallow cross-origin subresources from asking for credentials
653         https://bugs.webkit.org/show_bug.cgi?id=182579
654         <rdar://problem/36162271>
655
656         Reviewed by Andy Estes.
657
658         Add a private preference to toggle allowing non-mixed content cross-origin subresources to load.
659         WebKitTestRunner toggles this preference when it sees the test option allowCrossOriginSubresourcesToAskForCredential.
660
661         * Shared/WebPreferences.yaml:
662         * UIProcess/API/C/WKPreferences.cpp:
663         (WKPreferencesSetAllowCrossOriginSubresourcesToAskForCredentials):
664         (WKPreferencesGetAllowCrossOriginSubresourcesToAskForCredentials):
665         * UIProcess/API/C/WKPreferencesRefPrivate.h:
666
667 2018-02-14  John Wilander  <wilander@apple.com>
668
669         Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCache::Storage::traverse()
670         https://bugs.webkit.org/show_bug.cgi?id=182797
671         <rdar://problem/37540594>
672
673         Reviewed by Tim Horton.
674
675         This capture was added in r228455 and causes a build failure when
676         run with -Wunused-lambda-capture. Xcode also warns about it.
677
678         * NetworkProcess/cache/NetworkCacheStorage.cpp:
679         (WebKit::NetworkCache::Storage::traverse):
680
681 2018-02-14  Ryosuke Niwa  <rniwa@webkit.org>
682
683         EventDispatcher::wheelEvent uses a wrong enum values in switch
684         https://bugs.webkit.org/show_bug.cgi?id=182796
685
686         Reviewed by Chris Dumez.
687
688         EventDispatcher::wheelEvent is using PlatformWheelEventPhaseBegan and PlatformWheelEventPhaseEnded
689         but the enum type of wheelEvent.phase() is WebWheelEvent::Phase.
690
691         The enum values are indentical for both so there is no behavioral change.
692
693         * WebProcess/WebPage/EventDispatcher.cpp:
694         (WebKit::EventDispatcher::wheelEvent):
695
696 2018-02-14  Maureen Daum  <mdaum@apple.com>
697
698         Add C SPI for support of Website Data Store in Website Policies
699         https://bugs.webkit.org/show_bug.cgi?id=182698
700         <rdar://problem/37412008>
701
702         Reviewed by Andy Estes.
703
704         Expand the API added for _WKWebsitePolicies.websiteDataStore in r225989 and r226325
705         to be available in the C API. In the ObjC API, we handle setting the website data
706         store in NavigationState::NavigationClient::decidePolicyForNavigationAction. There
707         we throw an exception if setting the website data store isn't supported, and then
708         change the website data store. The equivalent place to do this work in the C API is
709         in WKFramePolicyListenerUseWithPolicies. However, instead of throwing exceptions,
710         release asserts are used.
711
712         * UIProcess/API/C/WKFramePolicyListener.cpp:
713         (WKFramePolicyListenerUseWithPolicies):
714         If the website policies data contains a website data store, do the same checks that
715         are done in NavigationState::NavigationClient::decidePolicyForNavigationAction. Namely,
716         that it is a valid website data store and it is a policy decision for a main frame navigation.
717         If these checks are met, change the website data store.
718         * UIProcess/API/C/WKPage.cpp:
719         (WKPageUpdateWebsitePolicies):
720         * UIProcess/API/C/WKWebsitePolicies.cpp:
721         (WKWebsitePoliciesGetDataStore):
722         (WKWebsitePoliciesSetDataStore):
723         * UIProcess/API/C/WKWebsitePolicies.h:
724         * UIProcess/WebFrameListenerProxy.cpp:
725         (WebKit::WebFrameListenerProxy::changeWebsiteDataStore):
726         (WebKit::WebFrameListenerProxy::isMainFrame):
727         Expose whether the frame proxy is for a main frame, which is required to verify that
728         website policies only specify a website data store for main frame policy decisions.
729         * UIProcess/WebFrameListenerProxy.h:
730         * UIProcess/WebFramePolicyListenerProxy.cpp:
731         * UIProcess/WebFrameProxy.cpp:
732         (WebKit::WebFrameProxy::changeWebsiteDataStore):
733         * UIProcess/WebFrameProxy.h:
734
735 2018-02-14  Ryan Haddad  <ryanhaddad@apple.com>
736
737         Unreviewed, rolling out r228444.
738
739         Introduced API and Layout test failures.
740
741         Reverted changeset:
742
743         "[WebAuthN] Revisit the whole async model of task dispatching,
744         timeout and aborting"
745         https://bugs.webkit.org/show_bug.cgi?id=181946
746         https://trac.webkit.org/changeset/228444
747
748 2018-02-13  Yousuke Kimoto  <yousuke.kimoto@sony.com>
749
750         [WinCairo] Fix build errors which come from including headers and not suitable implementation for windows
751         https://bugs.webkit.org/show_bug.cgi?id=182679
752
753         Reviewed by Michael Catanzaro.
754
755         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
756         (WebKit::NetworkCache::BlobStorage::add):
757         * NetworkProcess/cache/NetworkCacheData.cpp:
758         (WebKit::NetworkCache::Data::mapToFile const):
759         (WebKit::NetworkCache::mapFile):
760         (WebKit::NetworkCache::adoptAndMapFile):
761         (WebKit::NetworkCache::readOrMakeSalt):
762         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
763         (WebKit::NetworkCache::directoryEntryType):
764         (WebKit::NetworkCache::traverseDirectory):
765         (WebKit::NetworkCache::fileTimes):
766         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
767         * NetworkProcess/cache/NetworkCacheStorage.cpp:
768         (WebKit::NetworkCache::Storage::traverse):
769         * NetworkProcess/win/SystemProxyWin.h:
770         * Platform/IPC/Attachment.h:
771         * Platform/Module.h:
772         * Platform/SharedMemory.h:
773         * PluginProcess/WebProcessConnection.cpp:
774         * Shared/API/c/WKBase.h:
775         * Shared/ChildProcess.cpp:
776         * Shared/WebCoreArgumentCoders.h:
777         * UIProcess/ProcessAssertion.h:
778         * WebProcess/InjectedBundle/InjectedBundle.h:
779         * WebProcess/WebProcess.cpp:
780
781 2018-02-13  Commit Queue  <commit-queue@webkit.org>
782
783         Unreviewed, rolling out r228431.
784         https://bugs.webkit.org/show_bug.cgi?id=182766
785
786         Regressed CMake build stability (Requested by dolmstead on
787         #webkit).
788
789         Reverted changeset:
790
791         "[CMake] Make WebCore headers copies"
792         https://bugs.webkit.org/show_bug.cgi?id=182512
793         https://trac.webkit.org/changeset/228431
794
795 2018-02-13  Jiewen Tan  <jiewen_tan@apple.com>
796
797         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
798         https://bugs.webkit.org/show_bug.cgi?id=181946
799         <rdar://problem/37258262>
800
801         Reviewed by Chris Dumez.
802
803         Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
804         a message exchange channel between UIProcess and WebProcess.
805
806         * DerivedSources.make:
807         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
808         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
809         (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
810         (WebKit::WebCredentialsMessengerProxy::makeCredential):
811         (WebKit::WebCredentialsMessengerProxy::getAssertion):
812         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
813         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
814         * UIProcess/WebPageProxy.cpp:
815         (WebKit::m_configurationPreferenceValues):
816         (WebKit::WebPageProxy::reattachToWebProcess):
817         * UIProcess/WebPageProxy.h:
818         * WebKit.xcodeproj/project.pbxproj:
819         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
820         (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
821         (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
822         (WebKit::WebCredentialsMessenger::makeCredential):
823         (WebKit::WebCredentialsMessenger::getAssertion):
824         (WebKit::WebCredentialsMessenger::makeCredentialReply):
825         (WebKit::WebCredentialsMessenger::getAssertionReply):
826         * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
827         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
828         * WebProcess/WebPage/WebPage.cpp:
829         (WebKit::m_credentialsMessenger):
830         (WebKit::m_cpuLimit): Deleted.
831         * WebProcess/WebPage/WebPage.h:
832
833 2018-02-13  Youenn Fablet  <youenn@apple.com>
834
835         Add support for configuring WebsiteDatastore service worker and cache storage path
836         https://bugs.webkit.org/show_bug.cgi?id=182674
837
838         Reviewed by Chris Dumez.
839
840         Beef up WKWebsiteDataStoreConfiguration to easily set the WebsiteDataStore
841         service worker registration and cache storage directory path.
842
843         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
844         (-[WKWebsiteDataStore _initWithConfiguration:]):
845         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
846         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
847         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
848         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
849         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
850         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
851
852 2018-02-13  Brian Burg  <bburg@apple.com>
853
854         Web Automation: don't return an error if resizing/moving a window has no effect
855         https://bugs.webkit.org/show_bug.cgi?id=182742
856
857         Reviewed by Tim Horton.
858
859         * UIProcess/Automation/WebAutomationSession.cpp:
860         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
861         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
862         Unify the behavior for all ports. Don't raise an error if the command was
863         idempotent (by mistake or not). It should not be an error to re-maximize a window.
864
865 2018-02-13  Don Olmstead  <don.olmstead@sony.com>
866
867         [CMake] Make WebCore headers copies
868         https://bugs.webkit.org/show_bug.cgi?id=182512
869
870         Reviewed by Keith Miller.
871
872         * CMakeLists.txt:
873         * NetworkProcess/capture/NetworkCaptureManager.cpp:
874         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
875         * PlatformWPE.cmake:
876         * Scripts/generate-forwarding-headers.pl:
877         * Shared/gtk/WebEventFactory.cpp:
878         * UIProcess/API/gtk/PageClientImpl.cpp:
879         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
880         * UIProcess/gtk/WebPageProxyGtk.cpp:
881         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
882         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
883         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
884         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
885         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
886
887 2018-02-13  Brent Fulgham  <bfulgham@apple.com>
888
889         [iOS] whitelist iokit-get-properties
890         https://bugs.webkit.org/show_bug.cgi?id=182722
891         <rdar://problem/30929165>
892
893         Reviewed by Eric Carlson.
894
895         Update the iOS sandbox to block access to IOKit properties that are not needed for
896         legitimate WebContent process use. This brings the iOS sandbox in line with the
897         work done under macOS.
898
899         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
900
901 2018-02-12  John Wilander  <wilander@apple.com>
902
903         Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources
904         https://bugs.webkit.org/show_bug.cgi?id=182664
905         <rdar://problem/37372572>
906
907         Reviewed by Brent Fulgham.
908
909         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
910         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics):
911             Unique top frame redirects now counts toward classification as prevalent.
912         * Shared/WebCoreArgumentCoders.cpp:
913         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
914         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
915         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
916         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
917         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
918         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
919             Test infrastructure.
920         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
921         * UIProcess/WebResourceLoadStatisticsStore.cpp:
922             Bumped the statistics model to 11 because of the added fields.
923         (WebKit::WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
924             This function back traces redirect chains to classify domains
925             that have redirected to a newly classified prevalent resource.
926         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
927             Now uses the new convenience function WebResourceLoadStatisticsStore::setPrevalentResource().
928         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
929             New convenience function to make sure we always call
930             WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain()
931             and capture redirect chains backward.
932         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
933         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
934         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
935         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
936         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
937         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
938             Test infrastructure.
939         * UIProcess/WebResourceLoadStatisticsStore.h:
940
941 2018-02-12  Antti Koivisto  <antti@apple.com>
942
943         Update NetworkCache::Storage::lastStableVersion after r226349
944         https://bugs.webkit.org/show_bug.cgi?id=182723
945         <rdar://problem/37469554>
946         
947         Reviewed by Ryosuke Niwa.
948
949         * NetworkProcess/cache/NetworkCacheStorage.h:
950
951         Allow deleting version 11 caches.
952
953 2018-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
954
955         [Extra zoom mode] Add support for <input type='time'> using time picker UI
956         https://bugs.webkit.org/show_bug.cgi?id=182683
957         <rdar://problem/35143162>
958
959         Reviewed by Tim Horton.
960
961         Adds support for showing a time picker when an input of type time is focused in extra zoomed mode.
962
963         * UIProcess/ios/WKContentViewInteraction.h:
964         * UIProcess/ios/WKContentViewInteraction.mm:
965         (-[WKContentView _stopAssistingNode]):
966         (-[WKContentView presentTimePickerViewController:]):
967         (-[WKContentView dismissTimePickerViewController:]):
968
969         Add helpers to dismiss and present the time picker view controller.
970
971         (-[WKContentView presentViewControllerForAssistedNode:]):
972
973         When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text
974         input view controller as a fallback when the other input view controllers (number pads, select menus and time
975         pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are
976         currently unsupported.
977
978         (-[WKContentView textInputController:didCommitText:]):
979         (-[WKContentView textInputControllerDidRequestDismissal:]):
980
981         Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate.
982
983         (-[WKContentView actionNameForFocusedFormControlController:]):
984
985         Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This
986         currently doesn't work for these form controls because it relies on implicit form submission; this should be
987         fixed by future changes, after which we should revert this adjustment.
988
989         (-[WKContentView _wheelChangedWithEvent:]):
990
991         Delegate wheel events to the time picker if needed.
992
993         (-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted.
994
995         Renamed to -textInputControllerDidRequestDismissal:.
996
997         * UIProcess/ios/forms/WKTimePickerViewController.h: Added.
998         * UIProcess/ios/forms/WKTimePickerViewController.mm: Added.
999         * WebKit.xcodeproj/project.pbxproj:
1000
1001 2018-02-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1002
1003         [GTK] Unify builds for platform-specific files in WebKit layer
1004         https://bugs.webkit.org/show_bug.cgi?id=182450
1005
1006         Reviewed by Carlos Garcia Campos.
1007
1008         Add most GTK-specific sources to unified build. API files are exempted, except for the DOM
1009         API. Files shared with PluginProcessGTK2 are also exempted. Finally, files with name
1010         conflicts in headers, which appears difficult to fix, are also exempted.
1011
1012         * CMakeLists.txt:
1013         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
1014         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1015         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1016         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1017         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
1018         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1019         * PlatformGTK.cmake:
1020         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
1021         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1022         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1023         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
1024         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1025         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
1026         * Shared/Plugins/unix/PluginSearchPath.cpp:
1027         * Shared/cairo/ShareableBitmapCairo.cpp:
1028         * Shared/glib/WebContextMenuItemGlib.cpp:
1029         * Shared/glib/WebErrorsGlib.cpp:
1030         * Shared/gtk/ArgumentCodersGtk.cpp:
1031         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
1032         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1033         * Shared/gtk/WebErrorsGtk.cpp:
1034         * Shared/gtk/WebEventFactory.cpp:
1035         * Shared/linux/WebMemorySamplerLinux.cpp:
1036         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1037         * Shared/soup/WebErrorsSoup.cpp:
1038         * SourcesGTK.txt: Added.
1039         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
1040         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
1041         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1042         * UIProcess/BackingStore.cpp:
1043         * UIProcess/DrawingAreaProxyImpl.cpp:
1044         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1045         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
1046         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1047         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1048         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1049         * UIProcess/WebStorage/StorageManager.cpp:
1050         * UIProcess/cairo/BackingStoreCairo.cpp:
1051         * UIProcess/gtk/AcceleratedBackingStore.cpp:
1052         * UIProcess/gtk/DragAndDropHandler.cpp:
1053         * UIProcess/gtk/GestureController.cpp:
1054         * UIProcess/gtk/HardwareAccelerationManager.cpp:
1055         * UIProcess/gtk/InputMethodFilter.cpp:
1056         * UIProcess/gtk/TextCheckerGtk.cpp:
1057         * UIProcess/gtk/WaylandCompositor.cpp:
1058         * UIProcess/gtk/WebColorPickerGtk.cpp:
1059         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1060         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
1061         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
1062         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1063         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
1064         (webkit_dom_attr_dom_event_target_init):
1065         (webkit_dom_attr_set_property):
1066         (webkit_dom_attr_get_property):
1067         (webkit_dom_attr_class_init):
1068         (webkit_dom_event_target_init): Deleted.
1069         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
1070         (webkit_dom_cdata_section_dom_event_target_init):
1071         (webkit_dom_event_target_init): Deleted.
1072         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
1073         (webkit_dom_css_rule_set_property):
1074         (webkit_dom_css_rule_get_property):
1075         (webkit_dom_css_rule_class_init):
1076         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
1077         (webkit_dom_css_rule_list_get_property):
1078         (webkit_dom_css_rule_list_class_init):
1079         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
1080         (webkit_dom_css_style_declaration_set_property):
1081         (webkit_dom_css_style_declaration_get_property):
1082         (webkit_dom_css_style_declaration_class_init):
1083         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
1084         (webkit_dom_css_style_sheet_get_property):
1085         (webkit_dom_css_style_sheet_class_init):
1086         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
1087         (webkit_dom_css_value_set_property):
1088         (webkit_dom_css_value_get_property):
1089         (webkit_dom_css_value_class_init):
1090         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1091         (webkit_dom_character_data_dom_event_target_init):
1092         (webkit_dom_character_data_set_property):
1093         (webkit_dom_character_data_get_property):
1094         (webkit_dom_character_data_class_init):
1095         (webkit_dom_event_target_init): Deleted.
1096         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
1097         (webkit_dom_client_rect_get_property):
1098         (webkit_dom_client_rect_class_init):
1099         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
1100         (webkit_dom_client_rect_list_get_property):
1101         (webkit_dom_client_rect_list_class_init):
1102         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
1103         (webkit_dom_comment_dom_event_target_init):
1104         (webkit_dom_event_target_init): Deleted.
1105         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
1106         (webkit_dom_dom_selection_get_property):
1107         (webkit_dom_dom_selection_class_init):
1108         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
1109         (webkit_dom_dom_token_list_set_property):
1110         (webkit_dom_dom_token_list_get_property):
1111         (webkit_dom_dom_token_list_class_init):
1112         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
1113         (webkit_dom_dom_window_dom_event_target_init):
1114         (webkit_dom_dom_window_set_property):
1115         (webkit_dom_dom_window_get_property):
1116         (webkit_dom_dom_window_class_init):
1117         (webkit_dom_event_target_init): Deleted.
1118         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1119         (webkit_dom_document_dom_event_target_init):
1120         (webkit_dom_document_set_property):
1121         (webkit_dom_document_get_property):
1122         (webkit_dom_document_class_init):
1123         (webkit_dom_event_target_init): Deleted.
1124         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1125         (webkit_dom_document_fragment_dom_event_target_init):
1126         (webkit_dom_document_fragment_get_property):
1127         (webkit_dom_document_fragment_class_init):
1128         (webkit_dom_event_target_init): Deleted.
1129         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
1130         (webkit_dom_document_type_dom_event_target_init):
1131         (webkit_dom_document_type_get_property):
1132         (webkit_dom_document_type_class_init):
1133         (webkit_dom_event_target_init): Deleted.
1134         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1135         (webkit_dom_element_dom_event_target_init):
1136         (webkit_dom_element_set_property):
1137         (webkit_dom_element_get_property):
1138         (webkit_dom_element_class_init):
1139         (webkit_dom_event_target_init): Deleted.
1140         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
1141         (webkit_dom_event_set_property):
1142         (webkit_dom_event_get_property):
1143         (webkit_dom_event_class_init):
1144         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
1145         (webkit_dom_file_get_property):
1146         (webkit_dom_file_class_init):
1147         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
1148         (webkit_dom_file_list_get_property):
1149         (webkit_dom_file_list_class_init):
1150         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
1151         (webkit_dom_html_anchor_element_dom_event_target_init):
1152         (webkit_dom_html_anchor_element_set_property):
1153         (webkit_dom_html_anchor_element_get_property):
1154         (webkit_dom_html_anchor_element_class_init):
1155         (webkit_dom_event_target_init): Deleted.
1156         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
1157         (webkit_dom_html_applet_element_dom_event_target_init):
1158         (webkit_dom_html_applet_element_set_property):
1159         (webkit_dom_html_applet_element_get_property):
1160         (webkit_dom_html_applet_element_class_init):
1161         (webkit_dom_event_target_init): Deleted.
1162         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
1163         (webkit_dom_html_area_element_dom_event_target_init):
1164         (webkit_dom_html_area_element_set_property):
1165         (webkit_dom_html_area_element_get_property):
1166         (webkit_dom_html_area_element_class_init):
1167         (webkit_dom_event_target_init): Deleted.
1168         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
1169         (webkit_dom_html_br_element_dom_event_target_init):
1170         (webkit_dom_html_br_element_set_property):
1171         (webkit_dom_html_br_element_get_property):
1172         (webkit_dom_html_br_element_class_init):
1173         (webkit_dom_event_target_init): Deleted.
1174         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
1175         (webkit_dom_html_base_element_dom_event_target_init):
1176         (webkit_dom_html_base_element_set_property):
1177         (webkit_dom_html_base_element_get_property):
1178         (webkit_dom_html_base_element_class_init):
1179         (webkit_dom_event_target_init): Deleted.
1180         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
1181         (webkit_dom_html_body_element_dom_event_target_init):
1182         (webkit_dom_html_body_element_set_property):
1183         (webkit_dom_html_body_element_get_property):
1184         (webkit_dom_html_body_element_class_init):
1185         (webkit_dom_event_target_init): Deleted.
1186         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
1187         (webkit_dom_html_button_element_dom_event_target_init):
1188         (webkit_dom_html_button_element_set_property):
1189         (webkit_dom_html_button_element_get_property):
1190         (webkit_dom_html_button_element_class_init):
1191         (webkit_dom_event_target_init): Deleted.
1192         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
1193         (webkit_dom_html_canvas_element_dom_event_target_init):
1194         (webkit_dom_html_canvas_element_set_property):
1195         (webkit_dom_html_canvas_element_get_property):
1196         (webkit_dom_html_canvas_element_class_init):
1197         (webkit_dom_event_target_init): Deleted.
1198         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
1199         (webkit_dom_html_collection_get_property):
1200         (webkit_dom_html_collection_class_init):
1201         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
1202         (webkit_dom_html_d_list_element_dom_event_target_init):
1203         (webkit_dom_html_d_list_element_set_property):
1204         (webkit_dom_html_d_list_element_get_property):
1205         (webkit_dom_html_d_list_element_class_init):
1206         (webkit_dom_event_target_init): Deleted.
1207         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
1208         (webkit_dom_html_directory_element_dom_event_target_init):
1209         (webkit_dom_html_directory_element_set_property):
1210         (webkit_dom_html_directory_element_get_property):
1211         (webkit_dom_html_directory_element_class_init):
1212         (webkit_dom_event_target_init): Deleted.
1213         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
1214         (webkit_dom_html_div_element_dom_event_target_init):
1215         (webkit_dom_html_div_element_set_property):
1216         (webkit_dom_html_div_element_get_property):
1217         (webkit_dom_html_div_element_class_init):
1218         (webkit_dom_event_target_init): Deleted.
1219         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
1220         (webkit_dom_html_document_dom_event_target_init):
1221         (webkit_dom_html_document_set_property):
1222         (webkit_dom_html_document_get_property):
1223         (webkit_dom_html_document_class_init):
1224         (webkit_dom_event_target_init): Deleted.
1225         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1226         (webkit_dom_html_element_dom_event_target_init):
1227         (webkit_dom_html_element_set_property):
1228         (webkit_dom_html_element_get_property):
1229         (webkit_dom_html_element_class_init):
1230         (webkit_dom_event_target_init): Deleted.
1231         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
1232         (webkit_dom_html_embed_element_dom_event_target_init):
1233         (webkit_dom_html_embed_element_set_property):
1234         (webkit_dom_html_embed_element_get_property):
1235         (webkit_dom_html_embed_element_class_init):
1236         (webkit_dom_event_target_init): Deleted.
1237         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
1238         (webkit_dom_html_field_set_element_dom_event_target_init):
1239         (webkit_dom_html_field_set_element_get_property):
1240         (webkit_dom_html_field_set_element_class_init):
1241         (webkit_dom_event_target_init): Deleted.
1242         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
1243         (webkit_dom_html_font_element_dom_event_target_init):
1244         (webkit_dom_html_font_element_set_property):
1245         (webkit_dom_html_font_element_get_property):
1246         (webkit_dom_html_font_element_class_init):
1247         (webkit_dom_event_target_init): Deleted.
1248         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
1249         (webkit_dom_html_form_element_dom_event_target_init):
1250         (webkit_dom_html_form_element_set_property):
1251         (webkit_dom_html_form_element_get_property):
1252         (webkit_dom_html_form_element_class_init):
1253         (webkit_dom_event_target_init): Deleted.
1254         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
1255         (webkit_dom_html_frame_element_dom_event_target_init):
1256         (webkit_dom_html_frame_element_set_property):
1257         (webkit_dom_html_frame_element_get_property):
1258         (webkit_dom_html_frame_element_class_init):
1259         (webkit_dom_event_target_init): Deleted.
1260         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
1261         (webkit_dom_html_frame_set_element_dom_event_target_init):
1262         (webkit_dom_html_frame_set_element_set_property):
1263         (webkit_dom_html_frame_set_element_get_property):
1264         (webkit_dom_html_frame_set_element_class_init):
1265         (webkit_dom_event_target_init): Deleted.
1266         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
1267         (webkit_dom_html_hr_element_dom_event_target_init):
1268         (webkit_dom_html_hr_element_set_property):
1269         (webkit_dom_html_hr_element_get_property):
1270         (webkit_dom_html_hr_element_class_init):
1271         (webkit_dom_event_target_init): Deleted.
1272         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
1273         (webkit_dom_html_head_element_dom_event_target_init):
1274         (webkit_dom_html_head_element_set_property):
1275         (webkit_dom_html_head_element_get_property):
1276         (webkit_dom_html_head_element_class_init):
1277         (webkit_dom_event_target_init): Deleted.
1278         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
1279         (webkit_dom_html_heading_element_dom_event_target_init):
1280         (webkit_dom_html_heading_element_set_property):
1281         (webkit_dom_html_heading_element_get_property):
1282         (webkit_dom_html_heading_element_class_init):
1283         (webkit_dom_event_target_init): Deleted.
1284         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
1285         (webkit_dom_html_html_element_dom_event_target_init):
1286         (webkit_dom_html_html_element_set_property):
1287         (webkit_dom_html_html_element_get_property):
1288         (webkit_dom_html_html_element_class_init):
1289         (webkit_dom_event_target_init): Deleted.
1290         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
1291         (webkit_dom_html_iframe_element_dom_event_target_init):
1292         (webkit_dom_html_iframe_element_set_property):
1293         (webkit_dom_html_iframe_element_get_property):
1294         (webkit_dom_html_iframe_element_class_init):
1295         (webkit_dom_event_target_init): Deleted.
1296         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
1297         (webkit_dom_html_image_element_dom_event_target_init):
1298         (webkit_dom_html_image_element_set_property):
1299         (webkit_dom_html_image_element_get_property):
1300         (webkit_dom_html_image_element_class_init):
1301         (webkit_dom_event_target_init): Deleted.
1302         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1303         (webkit_dom_html_input_element_dom_event_target_init):
1304         (webkit_dom_html_input_element_set_property):
1305         (webkit_dom_html_input_element_get_property):
1306         (webkit_dom_html_input_element_class_init):
1307         (webkit_dom_event_target_init): Deleted.
1308         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
1309         (webkit_dom_html_li_element_dom_event_target_init):
1310         (webkit_dom_html_li_element_set_property):
1311         (webkit_dom_html_li_element_get_property):
1312         (webkit_dom_html_li_element_class_init):
1313         (webkit_dom_event_target_init): Deleted.
1314         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
1315         (webkit_dom_html_label_element_dom_event_target_init):
1316         (webkit_dom_html_label_element_set_property):
1317         (webkit_dom_html_label_element_get_property):
1318         (webkit_dom_html_label_element_class_init):
1319         (webkit_dom_event_target_init): Deleted.
1320         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
1321         (webkit_dom_html_legend_element_dom_event_target_init):
1322         (webkit_dom_html_legend_element_set_property):
1323         (webkit_dom_html_legend_element_get_property):
1324         (webkit_dom_html_legend_element_class_init):
1325         (webkit_dom_event_target_init): Deleted.
1326         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
1327         (webkit_dom_html_link_element_dom_event_target_init):
1328         (webkit_dom_html_link_element_set_property):
1329         (webkit_dom_html_link_element_get_property):
1330         (webkit_dom_html_link_element_class_init):
1331         (webkit_dom_event_target_init): Deleted.
1332         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
1333         (webkit_dom_html_map_element_dom_event_target_init):
1334         (webkit_dom_html_map_element_set_property):
1335         (webkit_dom_html_map_element_get_property):
1336         (webkit_dom_html_map_element_class_init):
1337         (webkit_dom_event_target_init): Deleted.
1338         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
1339         (webkit_dom_html_marquee_element_dom_event_target_init):
1340         (webkit_dom_event_target_init): Deleted.
1341         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
1342         (webkit_dom_html_menu_element_dom_event_target_init):
1343         (webkit_dom_html_menu_element_set_property):
1344         (webkit_dom_html_menu_element_get_property):
1345         (webkit_dom_html_menu_element_class_init):
1346         (webkit_dom_event_target_init): Deleted.
1347         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
1348         (webkit_dom_html_meta_element_dom_event_target_init):
1349         (webkit_dom_html_meta_element_set_property):
1350         (webkit_dom_html_meta_element_get_property):
1351         (webkit_dom_html_meta_element_class_init):
1352         (webkit_dom_event_target_init): Deleted.
1353         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
1354         (webkit_dom_html_mod_element_dom_event_target_init):
1355         (webkit_dom_html_mod_element_set_property):
1356         (webkit_dom_html_mod_element_get_property):
1357         (webkit_dom_html_mod_element_class_init):
1358         (webkit_dom_event_target_init): Deleted.
1359         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
1360         (webkit_dom_html_o_list_element_dom_event_target_init):
1361         (webkit_dom_html_o_list_element_set_property):
1362         (webkit_dom_html_o_list_element_get_property):
1363         (webkit_dom_html_o_list_element_class_init):
1364         (webkit_dom_event_target_init): Deleted.
1365         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
1366         (webkit_dom_html_object_element_dom_event_target_init):
1367         (webkit_dom_html_object_element_set_property):
1368         (webkit_dom_html_object_element_get_property):
1369         (webkit_dom_html_object_element_class_init):
1370         (webkit_dom_event_target_init): Deleted.
1371         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
1372         (webkit_dom_html_opt_group_element_dom_event_target_init):
1373         (webkit_dom_html_opt_group_element_set_property):
1374         (webkit_dom_html_opt_group_element_get_property):
1375         (webkit_dom_html_opt_group_element_class_init):
1376         (webkit_dom_event_target_init): Deleted.
1377         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
1378         (webkit_dom_html_option_element_dom_event_target_init):
1379         (webkit_dom_html_option_element_set_property):
1380         (webkit_dom_html_option_element_get_property):
1381         (webkit_dom_html_option_element_class_init):
1382         (webkit_dom_event_target_init): Deleted.
1383         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
1384         (webkit_dom_html_options_collection_set_property):
1385         (webkit_dom_html_options_collection_get_property):
1386         (webkit_dom_html_options_collection_class_init):
1387         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
1388         (webkit_dom_html_paragraph_element_dom_event_target_init):
1389         (webkit_dom_html_paragraph_element_set_property):
1390         (webkit_dom_html_paragraph_element_get_property):
1391         (webkit_dom_html_paragraph_element_class_init):
1392         (webkit_dom_event_target_init): Deleted.
1393         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
1394         (webkit_dom_html_param_element_dom_event_target_init):
1395         (webkit_dom_html_param_element_set_property):
1396         (webkit_dom_html_param_element_get_property):
1397         (webkit_dom_html_param_element_class_init):
1398         (webkit_dom_event_target_init): Deleted.
1399         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
1400         (webkit_dom_html_pre_element_dom_event_target_init):
1401         (webkit_dom_html_pre_element_set_property):
1402         (webkit_dom_html_pre_element_get_property):
1403         (webkit_dom_html_pre_element_class_init):
1404         (webkit_dom_event_target_init): Deleted.
1405         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
1406         (webkit_dom_html_quote_element_dom_event_target_init):
1407         (webkit_dom_html_quote_element_set_property):
1408         (webkit_dom_html_quote_element_get_property):
1409         (webkit_dom_html_quote_element_class_init):
1410         (webkit_dom_event_target_init): Deleted.
1411         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
1412         (webkit_dom_html_script_element_dom_event_target_init):
1413         (webkit_dom_html_script_element_set_property):
1414         (webkit_dom_html_script_element_get_property):
1415         (webkit_dom_html_script_element_class_init):
1416         (webkit_dom_event_target_init): Deleted.
1417         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1418         (webkit_dom_html_select_element_dom_event_target_init):
1419         (webkit_dom_html_select_element_set_property):
1420         (webkit_dom_html_select_element_get_property):
1421         (webkit_dom_html_select_element_class_init):
1422         (webkit_dom_event_target_init): Deleted.
1423         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
1424         (webkit_dom_html_style_element_dom_event_target_init):
1425         (webkit_dom_html_style_element_set_property):
1426         (webkit_dom_html_style_element_get_property):
1427         (webkit_dom_html_style_element_class_init):
1428         (webkit_dom_event_target_init): Deleted.
1429         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
1430         (webkit_dom_html_table_caption_element_dom_event_target_init):
1431         (webkit_dom_html_table_caption_element_set_property):
1432         (webkit_dom_html_table_caption_element_get_property):
1433         (webkit_dom_html_table_caption_element_class_init):
1434         (webkit_dom_event_target_init): Deleted.
1435         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
1436         (webkit_dom_html_table_cell_element_dom_event_target_init):
1437         (webkit_dom_html_table_cell_element_set_property):
1438         (webkit_dom_html_table_cell_element_get_property):
1439         (webkit_dom_html_table_cell_element_class_init):
1440         (webkit_dom_event_target_init): Deleted.
1441         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
1442         (webkit_dom_html_table_col_element_dom_event_target_init):
1443         (webkit_dom_html_table_col_element_set_property):
1444         (webkit_dom_html_table_col_element_get_property):
1445         (webkit_dom_html_table_col_element_class_init):
1446         (webkit_dom_event_target_init): Deleted.
1447         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
1448         (webkit_dom_html_table_element_dom_event_target_init):
1449         (webkit_dom_html_table_element_set_property):
1450         (webkit_dom_html_table_element_get_property):
1451         (webkit_dom_html_table_element_class_init):
1452         (webkit_dom_event_target_init): Deleted.
1453         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
1454         (webkit_dom_html_table_row_element_dom_event_target_init):
1455         (webkit_dom_html_table_row_element_set_property):
1456         (webkit_dom_html_table_row_element_get_property):
1457         (webkit_dom_html_table_row_element_class_init):
1458         (webkit_dom_html_table_row_element_insert_cell):
1459         (webkit_dom_event_target_init): Deleted.
1460         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
1461         (webkit_dom_html_table_section_element_dom_event_target_init):
1462         (webkit_dom_html_table_section_element_set_property):
1463         (webkit_dom_html_table_section_element_get_property):
1464         (webkit_dom_html_table_section_element_class_init):
1465         (webkit_dom_event_target_init): Deleted.
1466         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
1467         (webkit_dom_html_text_area_element_dom_event_target_init):
1468         (webkit_dom_html_text_area_element_set_property):
1469         (webkit_dom_html_text_area_element_get_property):
1470         (webkit_dom_html_text_area_element_class_init):
1471         (webkit_dom_event_target_init): Deleted.
1472         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
1473         (webkit_dom_html_title_element_dom_event_target_init):
1474         (webkit_dom_html_title_element_set_property):
1475         (webkit_dom_html_title_element_get_property):
1476         (webkit_dom_html_title_element_class_init):
1477         (webkit_dom_event_target_init): Deleted.
1478         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
1479         (webkit_dom_html_u_list_element_dom_event_target_init):
1480         (webkit_dom_html_u_list_element_set_property):
1481         (webkit_dom_html_u_list_element_get_property):
1482         (webkit_dom_html_u_list_element_class_init):
1483         (webkit_dom_event_target_init): Deleted.
1484         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
1485         (webkit_dom_keyboard_event_get_property):
1486         (webkit_dom_keyboard_event_class_init):
1487         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
1488         (webkit_dom_media_list_set_property):
1489         (webkit_dom_media_list_get_property):
1490         (webkit_dom_media_list_class_init):
1491         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
1492         (webkit_dom_mouse_event_get_property):
1493         (webkit_dom_mouse_event_class_init):
1494         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
1495         (webkit_dom_named_node_map_get_property):
1496         (webkit_dom_named_node_map_class_init):
1497         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
1498         (webkit_dom_node_dom_event_target_init):
1499         (webkit_dom_node_set_property):
1500         (webkit_dom_node_get_property):
1501         (webkit_dom_node_class_init):
1502         (webkit_dom_event_target_init): Deleted.
1503         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
1504         (webkit_dom_node_iterator_get_property):
1505         (webkit_dom_node_iterator_class_init):
1506         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
1507         (webkit_dom_node_list_get_property):
1508         (webkit_dom_node_list_class_init):
1509         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp:
1510         (webkitDOMObjectSetProperty):
1511         (webkit_dom_object_class_init):
1512         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
1513         (webkit_dom_processing_instruction_dom_event_target_init):
1514         (webkit_dom_processing_instruction_get_property):
1515         (webkit_dom_processing_instruction_class_init):
1516         (webkit_dom_event_target_init): Deleted.
1517         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
1518         (webkit_dom_range_get_property):
1519         (webkit_dom_range_class_init):
1520         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
1521         (webkit_dom_style_sheet_set_property):
1522         (webkit_dom_style_sheet_get_property):
1523         (webkit_dom_style_sheet_class_init):
1524         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
1525         (webkit_dom_style_sheet_list_get_property):
1526         (webkit_dom_style_sheet_list_class_init):
1527         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
1528         (webkit_dom_text_dom_event_target_init):
1529         (webkit_dom_text_get_property):
1530         (webkit_dom_text_class_init):
1531         (webkit_dom_event_target_init): Deleted.
1532         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
1533         (webkit_dom_tree_walker_get_property):
1534         (webkit_dom_tree_walker_class_init):
1535         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
1536         (webkit_dom_ui_event_get_property):
1537         (webkit_dom_ui_event_class_init):
1538         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
1539         (webkit_dom_wheel_event_get_property):
1540         (webkit_dom_wheel_event_class_init):
1541         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
1542         (webkit_dom_xpath_result_get_property):
1543         (webkit_dom_xpath_result_class_init):
1544         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
1545         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1546         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
1547         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1548         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
1549         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
1550         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1551         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1552         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
1553         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1554         * WebProcess/WebPage/AcceleratedSurface.cpp:
1555         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1556         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1557         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1558         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1559         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
1560         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
1561         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1562         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
1563         * WebProcess/gtk/WebProcessMainGtk.cpp:
1564
1565 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1566
1567         WebDriver: addCookie command should prepend a dot to domain if missing
1568         https://bugs.webkit.org/show_bug.cgi?id=182328
1569         <rdar://problem/37116398>
1570
1571         Reviewed by Michael Catanzaro.
1572
1573         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
1574
1575         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
1576
1577         * UIProcess/Automation/WebAutomationSession.cpp:
1578         (WebKit::WebAutomationSession::addSingleCookie):
1579
1580 2018-02-11  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1581
1582         [WinCairo] Add WKBaseWin.h
1583         https://bugs.webkit.org/show_bug.cgi?id=182681
1584
1585         Reviewed by Yusuke Suzuki.
1586
1587         * PlatformWin.cmake:
1588         * Shared/API/c/win/WKBaseWin.h: Added.
1589
1590 2018-02-09  Ross Kirsling  <ross.kirsling@sony.com>
1591
1592         Remove invalidated WebPage::handleEditingKeyboardEvent default implementation after r228260.
1593         https://bugs.webkit.org/show_bug.cgi?id=182663
1594
1595         Reviewed by Chris Dumez.
1596
1597         This would need to be updated to turn `keyEvent` into `underlyingPlatformEvent`;
1598         instead, we can remove it, as it's only for Windows, which doesn't yet support WK2.
1599
1600         * WebProcess/WebPage/WebPage.cpp:
1601         (WebKit::WebPage::handleEditingKeyboardEvent): Deleted.
1602
1603 2018-02-09  Nan Wang  <n_wang@apple.com>
1604
1605         AX: Accessibility is not notified when a web process cancels the suspension
1606         https://bugs.webkit.org/show_bug.cgi?id=182659
1607
1608         Reviewed by Ryosuke Niwa.
1609
1610         We were notifying Accessibility with the web process suspended information in actualPrepareToSuspend
1611         and processDidResume. However, the suspension can be canceled during the prepare call. So that we
1612         should also post a notification in cancelPrepareToSuspend.
1613
1614         * WebProcess/WebProcess.cpp:
1615         (WebKit::WebProcess::cancelPrepareToSuspend):
1616
1617 2018-02-09  Brent Fulgham  <bfulgham@apple.com>
1618
1619         Sandbox violating attempting to read log formatting preference file
1620         https://bugs.webkit.org/show_bug.cgi?id=182648
1621         <rdar://problem/36629495>
1622
1623         Reviewed by Eric Carlson.
1624
1625         Various frameworks attempt to read logging format information from /usr/local/lib/log. The sandbox is blocking
1626         this, generating log spam and preventing some logging features from working properly. We should allow read
1627         access to this path.
1628
1629         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1630         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1631         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1632         * WebProcess/com.apple.WebProcess.sb.in:
1633
1634 2018-02-08  Chris Dumez  <cdumez@apple.com>
1635
1636         There should be a way to disable [OverrideBuiltins] behavior in a given DOMWrapperWorld
1637         https://bugs.webkit.org/show_bug.cgi?id=182524
1638         <rdar://problem/9057327>
1639
1640         Reviewed by Ryosuke Niwa.
1641
1642         Add C API on WKBundleScriptWorld and Cocoa API on WKWebProcessPlugInScriptWorld to
1643         disable the [OverrideBuiltins] behavior on a given script world.
1644
1645         The [OverrideBuiltins] behavior [1] is legacy behavior that is needed for Web compatibility
1646         but allowing the client to disable this behavior in a given world makes development easier
1647         and running injected script on uncontrolled content a lot more reliable.
1648
1649         [1] https://heycam.github.io/webidl/#OverrideBuiltins
1650
1651         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
1652         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
1653         (-[WKWebProcessPlugInScriptWorld disableOverrideBuiltinsBehavior]):
1654         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
1655         (WKBundleScriptWorldDisableOverrideBuiltinsBehavior):
1656         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
1657         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
1658         (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior):
1659         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
1660
1661 2018-02-08  Ross Kirsling  <ross.kirsling@sony.com>
1662
1663         Remove WebProcessPool::platformInitialize stub.
1664         https://bugs.webkit.org/show_bug.cgi?id=182621
1665
1666         Reviewed by Alex Christensen.
1667
1668         The #if here could be simplified to PLATFORM(WIN), but Windows too will need a proper implementation
1669         as part of WK2 support, so this stub shouldn't need to exist at all.
1670
1671         * UIProcess/WebProcessPool.cpp:
1672         (WebKit::WebProcessPool::platformInitialize): Deleted.
1673
1674 2018-02-08  Michael Catanzaro  <mcatanzaro@igalia.com>
1675
1676         TestController should not exercise cocoa-specific resource load statistics APIs
1677         https://bugs.webkit.org/show_bug.cgi?id=182355
1678
1679         Reviewed by Alex Christensen.
1680
1681         Remove the Cocoa testing SPI, since it's redundant with the C API. Also, add a couple
1682         missing cookie partitioning callbacks to the C API.
1683
1684         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1685         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
1686         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
1687         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1688         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1689         (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]): Deleted.
1690         (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsPrevalentResource:forHost:]): Deleted.
1691         (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]): Deleted.
1692         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]): Deleted.
1693         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]): Deleted.
1694         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHadUserInteraction:forHost:]): Deleted.
1695         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]): Deleted.
1696         (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]): Deleted.
1697         (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsGrandfathered:forHost:]): Deleted.
1698         (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]): Deleted.
1699         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubframeUnderTopFrameOrigin:forHost:]): Deleted.
1700         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUnderTopFrameOrigin:forHost:]): Deleted.
1701         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUniqueRedirectTo:forHost:]): Deleted.
1702         (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveUserInteraction:]): Deleted.
1703         (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveCookiePartitionFree:]): Deleted.
1704         (-[WKWebsiteDataStore _resourceLoadStatisticsSetMinimumTimeBetweenDataRecordsRemoval:]): Deleted.
1705         (-[WKWebsiteDataStore _resourceLoadStatisticsSetGrandfatheringTime:]): Deleted.
1706         (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]): Deleted.
1707         (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]): Deleted.
1708         (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]): Deleted.
1709         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): Deleted.
1710         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
1711         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): Deleted.
1712         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
1713         (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]): Deleted.
1714         (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenDataRecordsWereScanned:]): Deleted.
1715         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldClassifyResourcesBeforeDataRecordsRemoval:]): Deleted.
1716         (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenTelemetryWasCaptured:]): Deleted.
1717         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): Deleted.
1718         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]): Deleted.
1719         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Deleted.
1720         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]): Deleted.
1721         (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): Deleted.
1722         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1723
1724 2018-02-08  Don Olmstead  <don.olmstead@sony.com>
1725
1726         Remove JavaScriptCore/ForwardingHeaders directory
1727         https://bugs.webkit.org/show_bug.cgi?id=182594
1728
1729         Reviewed by Mark Lam.
1730
1731         * PlatformGTK.cmake:
1732
1733 2018-02-08  Tim Horton  <timothy_horton@apple.com>
1734
1735         Make WebKit public headers modules-safe
1736         https://bugs.webkit.org/show_bug.cgi?id=182611
1737         <rdar://problem/37160164>
1738
1739         Reviewed by Dan Bernstein.
1740
1741         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
1742         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
1743         Import headers without which these WebKit headers can not be used alone.
1744
1745         * WebKit.xcodeproj/project.pbxproj:
1746         Make WKWindowFeaturesPrivate a private header like it was supposed to be.
1747
1748 2018-02-08  Matt Lewis  <jlewis3@apple.com>
1749
1750         Unreviewed, rolling out r228262.
1751
1752         This broke an internal build alongside r228261.
1753
1754         Reverted changeset:
1755
1756         "WebDriver: addCookie command should prepend a dot to domain
1757         if missing"
1758         https://bugs.webkit.org/show_bug.cgi?id=182328
1759         https://trac.webkit.org/changeset/228262
1760
1761 2018-02-08  Miguel Gomez  <magomez@igalia.com>
1762
1763         [GTK] WaylandCompositor misusing eglGetProcAddress
1764         https://bugs.webkit.org/show_bug.cgi?id=182490
1765
1766         Reviewed by Michael Catanzaro.
1767
1768         Check that the appropriate extensions are available before calling eglGetProcAddress, as even
1769         getting a non null value from it, the functionality can be disabled at runtime.
1770
1771         * UIProcess/gtk/WaylandCompositor.cpp:
1772         (WebKit::WaylandCompositor::initializeEGL):
1773
1774 2018-02-08  Frederic Wang  <fwang@igalia.com>
1775
1776         Add scrolling node types to distinguish main frames and subframes.
1777         https://bugs.webkit.org/show_bug.cgi?id=182533
1778
1779         Reviewed by Simon Fraser.
1780
1781         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Replace the case of
1782         FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
1783         (WebKit::encodeNodeAndDescendants):
1784         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1785         (WebKit::dump):
1786         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Ditto.
1787         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1788         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Ditto and pass the node type to the
1789         constructor of the frame scrolling node.
1790         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
1791         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Replace the case of
1792         FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
1793         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1794         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: In order to
1795         determine whether the node is a main frame or subframe, use the node type instead of checking
1796         whether the node as a parent.
1797         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
1798
1799 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1800
1801         WebDriver: addCookie command should prepend a dot to domain if missing
1802         https://bugs.webkit.org/show_bug.cgi?id=182328
1803         <rdar://problem/37116398>
1804
1805         Reviewed by Michael Catanzaro.
1806
1807         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
1808
1809         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
1810
1811         * UIProcess/Automation/WebAutomationSession.cpp:
1812         (WebKit::WebAutomationSession::addSingleCookie):
1813
1814 2018-01-13  Darin Adler  <darin@apple.com>
1815
1816         Event improvements
1817         https://bugs.webkit.org/show_bug.cgi?id=179591
1818
1819         Reviewed by Chris Dumez.
1820
1821         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
1822         (webkit_dom_wheel_event_init_wheel_event): Updated to call initWebKitWheelEvent.
1823
1824         * WebProcess/Plugins/PluginView.cpp: Removed include of ScriptValue.h.
1825
1826         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1827         (WebKit::WebEditorClient::executePendingEditorCommands):
1828         Updated for name change from keyEvent to underlyingPlatformEvent.
1829         (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.
1830         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
1831         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
1832         (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.
1833
1834         * WebProcess/WebPage/WebPage.cpp: Removed include of ScriptValue.h.
1835
1836         * WebProcess/WebPage/ios/WebPageIOS.mm:
1837         (WebKit::WebPage::handleEditingKeyboardEvent): Updated for name change from
1838         keyEvent to underlyingPlatformEvent.
1839         * WebProcess/WebPage/mac/WebPageMac.mm:
1840         (WebKit::WebPage::executeKeypressCommandsInternal): Ditto.
1841         (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.
1842
1843 2018-02-07  Antti Koivisto  <antti@apple.com> and Youenn Fablet  <youenn@apple.com>
1844
1845         REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
1846         https://bugs.webkit.org/show_bug.cgi?id=182532
1847         <rdar://problem/36414017>
1848
1849         Reviewed by Chris Dumez.
1850
1851         No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
1852         We were calling a function that was WTFMoved away just a few lines above.
1853
1854         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1855         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1856
1857 2018-02-07  Tim Horton  <timothy_horton@apple.com>
1858
1859         Evernote device management web view sometimes displays at the wrong scale
1860         https://bugs.webkit.org/show_bug.cgi?id=182590
1861         <rdar://problem/36633687>
1862
1863         Reviewed by Simon Fraser.
1864
1865         Evernote implements the WKWebView's scroll view's delegate method
1866         viewForZoomingInScrollView: and returns nil. This results in
1867         WKScrollView's zoomScale always returning 1, no matter what the
1868         WKContentView's actual scale is. This will result in us never updating
1869         the WKContentView's scale to 1. When loading a page that has a few
1870         scale changes during load but ends up at scale 1, we get stuck at whatever
1871         intermediate scale immediately preceded settling on 1.
1872
1873         Fix this by not forwarding viewForZoomingInScrollView: to the external
1874         WKScrollView delegate; we are in charge of the contents of the scroll
1875         view (including which view scrollView's zoomScale should track), and
1876         overriding viewForZoomingInScrollView: is only ever going to lead to
1877         a broken WebKit.
1878
1879         * UIProcess/ios/WKScrollView.mm:
1880         (shouldForwardScrollViewDelegateMethodToExternalDelegate):
1881         (-[WKScrollViewDelegateForwarder forwardInvocation:]):
1882         (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):
1883
1884 2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1885
1886         [Extra zoom mode] Delegate scrolling from the content view to input view controllers
1887         https://bugs.webkit.org/show_bug.cgi?id=182534
1888         <rdar://problem/37276625>
1889
1890         Reviewed by Tim Horton.
1891
1892         Override -_wheelChangedWithEvent: on the content view, and give extra zoomed input view controllers a chance to
1893         handle the event.
1894
1895         * Platform/spi/ios/UIKitSPI.h:
1896         * UIProcess/ios/WKContentViewInteraction.mm:
1897         (-[WKContentView _wheelChangedWithEvent:]):
1898
1899 2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1900
1901         [Extra zoom mode] Implement multiple and single select menus
1902         https://bugs.webkit.org/show_bug.cgi?id=182525
1903         <rdar://problem/35143016>
1904
1905         Reviewed by Tim Horton.
1906
1907         Add support for presenting picker views when focusing single or multiple select elements. See changes below for
1908         additional detail.
1909
1910         * UIProcess/ios/WKContentViewInteraction.h:
1911         * UIProcess/ios/WKContentViewInteraction.mm:
1912         (-[WKContentView _startAssistingKeyboard]):
1913
1914         Move logic for presenting view controllers when focusing elements out of _startAssistingKeyboard, and into
1915         _startAssistingNode:(...). This is because _startAssistingKeyboard is only invoked for certain types of focused
1916         element types; importantly, this set excludes select elements. Putting the call to present the focused view
1917         controller there also didn't make much since, considering that these new view controllers are not tied to
1918         keyboards in any way.
1919
1920         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1921         (-[WKContentView _stopAssistingNode]):
1922
1923         Dismiss any select menu that is being presented.
1924
1925         (-[WKContentView presentSelectMenuViewController:]):
1926         (-[WKContentView dismissSelectMenuViewController:]):
1927
1928         Introduce idempotent helpers for presenting and dismissing the select menu view controller.
1929
1930         (-[WKContentView presentViewControllerForAssistedNode:]):
1931         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
1932
1933         For single select menus. Called when the user selects a row.
1934
1935         (-[WKContentView didCancelSelectionInSelectMenu:]):
1936         (-[WKContentView numberOfItemsInSelectMenu:]):
1937         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
1938
1939         Indicates the text value to show at a given index.
1940
1941         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
1942
1943         For multiple select menus, invoked when an item is checked. The `checked` parameter indicates whether or not the
1944         item is now checked.
1945
1946         (-[WKContentView selectMenuSupportsMultipleSelection:]):
1947
1948         Indicates whether this select menu is single-item-only, or allows multiple items to be selected (checked).
1949
1950         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]):
1951
1952         For multiple select menus. Determines whether an option at the given index is checked.
1953
1954         (-[WKContentView startingIndexForSelectMenu:]):
1955
1956         Determines the index to instantly scroll to when presenting the select menu.
1957
1958         * UIProcess/ios/forms/WKSelectMenuViewController.h: Added.
1959         * UIProcess/ios/forms/WKSelectMenuViewController.mm: Added.
1960
1961         Add new harness files for WKSelectMenuViewController's header and implementation (see WebKitAdditions).
1962
1963         * WebKit.xcodeproj/project.pbxproj:
1964
1965 2018-02-07  Brent Fulgham  <bfulgham@apple.com>
1966
1967         Improve NetworkResourceLoader logging to capture redirect cases
1968         https://bugs.webkit.org/show_bug.cgi?id=182573
1969         <rdar://problem/37316714>
1970
1971         Reviewed by Chris Dumez.
1972
1973         Add logging for cookie partitioning or blocking during redirects.
1974
1975         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1976         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1977
1978 2018-02-07  John Wilander  <wilander@apple.com>
1979
1980         Restrict Referer to just the origin for third parties in private mode and third parties ITP blocks cookies for in regular mode
1981         https://bugs.webkit.org/show_bug.cgi?id=182559
1982         <rdar://problem/36990337>
1983
1984         Reviewed by Andy Estes.
1985
1986         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1987         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1988         (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
1989             New convenience function. Checks whether the resource shares
1990             partition with the first party.
1991         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1992             Now strips the referrer to just the origin for:
1993             1. All third party requests in private mode.
1994             2. Third party requests to domains that ITP blocks cookies for.
1995         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1996             Now strips the referrer in redirects to just the origin for:
1997             1. All third party requests in private mode.
1998             2. Third party requests to domains that ITP blocks cookies for.
1999
2000 2018-02-07  Daniel Bates  <dabates@apple.com>
2001
2002         Log error when authentication challenge is blocked due to an insecure request
2003         https://bugs.webkit.org/show_bug.cgi?id=182358
2004
2005         Reviewed by Andy Estes.
2006
2007         Have network process notify the web process when it blocks an authentication challenge.
2008
2009         * NetworkProcess/NetworkLoad.cpp:
2010         (WebKit::NetworkLoad::completeAuthenticationChallenge):
2011         * NetworkProcess/NetworkLoadClient.h:
2012         (WebKit::NetworkLoadClient::didBlockAuthenticationChallenge):
2013         * NetworkProcess/NetworkResourceLoader.cpp:
2014         (WebKit::NetworkResourceLoader::didBlockAuthenticationChallenge):
2015         * NetworkProcess/NetworkResourceLoader.h:
2016         * WebProcess/Network/WebResourceLoader.cpp:
2017         (WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
2018         * WebProcess/Network/WebResourceLoader.h:
2019         * WebProcess/Network/WebResourceLoader.messages.in:
2020
2021 2018-02-07  Chris Dumez  <cdumez@apple.com>
2022
2023         IndexedDB in service workers is using a memory backed store
2024         https://bugs.webkit.org/show_bug.cgi?id=182574
2025         <rdar://problem/37316205>
2026
2027         Reviewed by Youenn Fablet.
2028
2029         Make sure we pass a proper WebDatabaseProvider to the ServiceWorkerProcess via
2030         PageConfiguration. Otherwise, we end up using the default EmptyDatabaseProvider
2031         which uses an InProcessIDBServer and a memory-backed store for IndexedDB.
2032
2033         * UIProcess/ServiceWorkerProcessProxy.cpp:
2034         (WebKit::ServiceWorkerProcessProxy::start):
2035         * UIProcess/WebProcessPool.h:
2036         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2037         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
2038         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2039         * WebProcess/Storage/WebSWContextManagerConnection.h:
2040         * WebProcess/WebProcess.cpp:
2041         (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
2042         * WebProcess/WebProcess.h:
2043         * WebProcess/WebProcess.messages.in:
2044
2045 2018-02-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2046
2047         [GTK] Typo in a translatable string
2048         https://bugs.webkit.org/show_bug.cgi?id=182570
2049
2050         Unreviewed. Fix a typo.
2051
2052         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2053         (webkit_website_data_manager_class_init):
2054
2055 2018-02-06  Don Olmstead  <don.olmstead@sony.com>
2056
2057         Remove WebCore/ForwardingHeaders directory
2058         https://bugs.webkit.org/show_bug.cgi?id=182347
2059
2060         Reviewed by Keith Miller.
2061
2062         * Platform/mac/StringUtilities.mm:
2063         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
2064         * Shared/WebKit2Initialize.cpp:
2065         * Shared/linux/WebMemorySamplerLinux.cpp:
2066         * Shared/mac/WebMemorySampler.mac.mm:
2067         * UIProcess/WebProcessPool.cpp:
2068         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2069         * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h:
2070         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
2071         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2072         * WebProcess/Plugins/PluginProcessConnection.cpp:
2073         * WebProcess/Plugins/PluginView.cpp:
2074         * WebProcess/WebPage/WebInspector.h:
2075         * WebProcess/WebPage/WebPage.cpp:
2076         * WebProcess/cocoa/WebProcessCocoa.mm:
2077
2078 2018-02-06  Chris Dumez  <cdumez@apple.com>
2079
2080         Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html is a flaky failure on macOS and iOS
2081         https://bugs.webkit.org/show_bug.cgi?id=181392
2082         <rdar://problem/36384136>
2083
2084         Reviewed by Youenn Fablet.
2085
2086         All tasks from the StorageProcess to the WebContent process to update registrations
2087         and service workers state are posted to the runloop. However, the fetch callbacks
2088         do not do so. This means that fetch results might come in out of order with regards
2089         to the registration / service worker state updates. The test was flaky because an
2090         intercepted load would sometimes finish before the task to update the service worker
2091         state to "activated" was processed by the runloop. We address the issue by having
2092         the ServiceWorkerClientFetch callbacks schedule tasks to the runloop too.
2093
2094         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2095         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2096         (WebKit::ServiceWorkerClientFetch::didReceiveData):
2097         (WebKit::ServiceWorkerClientFetch::didFinish):
2098         (WebKit::ServiceWorkerClientFetch::didFail):
2099         (WebKit::ServiceWorkerClientFetch::didNotHandle):
2100
2101 2018-02-06  Brent Fulgham  <bfulgham@apple.com>
2102
2103         [macOS] Correct sandbox violation triggered by Chase.com
2104         https://bugs.webkit.org/show_bug.cgi?id=182519
2105         <rdar://problem/37121757>
2106
2107         Reviewed by Eric Carlson.
2108
2109         Hitting a sandbox violation when attempting to check status of IOAV*En/Decode support.
2110
2111         * WebProcess/com.apple.WebProcess.sb.in:
2112
2113 2018-02-06  Jeff Miller  <jeffm@apple.com>
2114
2115         Add WKNavigationDelegate SPI to tell the client when an insecure plug-in is blocked
2116         https://bugs.webkit.org/show_bug.cgi?id=182540
2117
2118         Reviewed by Alex Christensen.
2119
2120         * UIProcess/API/APILoaderClient.h:
2121         (API::LoaderClient::didBlockInsecurePluginVersion):
2122         Changed to take a dictionary reference.
2123
2124         * UIProcess/API/APINavigationClient.h:
2125         (API::NavigationClient::didBlockInsecurePluginVersion):
2126         Added.
2127
2128         * UIProcess/API/C/WKPage.cpp:
2129         (WKPageSetPageLoaderClient):
2130         Changed didBlockInsecurePluginVersion() to take a dictionary reference.
2131
2132         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2133         Added -_webView:didBlockInsecurePluginVersionWithInfo:.
2134
2135         * UIProcess/Cocoa/NavigationState.h:
2136         * UIProcess/Cocoa/NavigationState.mm:
2137         (WebKit::NavigationState::setNavigationDelegate):
2138         Initialize webViewDidBlockInsecurePluginVersionWithInfo.
2139
2140         (WebKit::NavigationState::NavigationClient::didBlockInsecurePluginVersion):
2141         Added.
2142
2143         * UIProcess/WebPageProxy.cpp:
2144         (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
2145         Remove check for PLATFORM(COCOA) (we don't check for this in didFailToInitializePlugin() where we
2146         also use createPluginInformationDictionary()) and ENABLE(NETSCAPE_PLUGIN_API) (we're already inside
2147         an #if ENABLE(NETSCAPE_PLUGIN_API block) and use auto for pluginInformation. Attempt to use the
2148         navigation client before the loader client.
2149
2150 2018-02-06  Youenn Fablet  <youenn@apple.com>
2151
2152         HasServiceWorkerRegistration bit should be sent when creating a new page
2153         https://bugs.webkit.org/show_bug.cgi?id=182410
2154
2155         Reviewed by Chris Dumez.
2156
2157         Move the bit computation at page creation time.
2158         This allows computing the bit based on the web site data store and not only on the pool configuration.
2159         WebPage uses that bit to activate service worker registration matching for the whole process.
2160
2161         In case there is a service worker process proxy created, the bit is set to true by default.
2162
2163         Bit is computed by checking for database file presence.
2164         This information is cached in a map for efficiency reasons and cleared when a service worker process proxy is created.
2165
2166         * Shared/WebPageCreationParameters.cpp:
2167         (WebKit::WebPageCreationParameters::encode const):
2168         (WebKit::WebPageCreationParameters::decode):
2169         * Shared/WebPageCreationParameters.h:
2170         * Shared/WebProcessCreationParameters.cpp:
2171         (WebKit::WebProcessCreationParameters::encode const):
2172         (WebKit::WebProcessCreationParameters::decode):
2173         * Shared/WebProcessCreationParameters.h:
2174         * UIProcess/WebPageProxy.cpp:
2175         (WebKit::WebPageProxy::initializeWebPage):
2176         * UIProcess/WebProcessPool.cpp:
2177         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2178         (WebKit::WebProcessPool::initializeNewWebProcess):
2179         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
2180         * WebProcess/WebPage/WebPage.cpp:
2181         (WebKit::m_cpuLimit):
2182         * WebProcess/WebProcess.cpp:
2183         (WebKit::WebProcess::initializeWebProcess):
2184
2185 2018-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
2186
2187         Unreviewed, fix format specifiers added in r228116
2188         https://bugs.webkit.org/show_bug.cgi?id=182456
2189         <rdar://problem/37181006>
2190
2191         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2192         (WebKit::CacheStorageEngineConnection::open):
2193         (WebKit::CacheStorageEngineConnection::remove):
2194         (WebKit::CacheStorageEngineConnection::caches):
2195         (WebKit::CacheStorageEngineConnection::retrieveRecords):
2196         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
2197         (WebKit::CacheStorageEngineConnection::putRecords):
2198         (WebKit::CacheStorageEngineConnection::reference):
2199         (WebKit::CacheStorageEngineConnection::dereference):
2200
2201 2018-02-05  Chris Dumez  <cdumez@apple.com>
2202
2203         Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
2204         https://bugs.webkit.org/show_bug.cgi?id=182494
2205         <rdar://problem/37147632>
2206
2207         Reviewed by Ryosuke Niwa.
2208
2209         Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
2210         GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
2211         will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
2212         updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
2213         Connection::sendMessage(). This should mean the same thing since this code runs in
2214         WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
2215         without constructing a RunLoop.
2216
2217         * Platform/IPC/Connection.cpp:
2218         (IPC::Connection::sendMessage):
2219
2220 2018-02-05  Ryosuke Niwa  <rniwa@webkit.org>
2221
2222         Release assertion in inlineVideoFrame
2223         https://bugs.webkit.org/show_bug.cgi?id=182513
2224         <rdar://problem/37159363>
2225
2226         Reviewed by Zalan Bujtas.
2227
2228         Fixed the bug. Don't try to update the layout when there is no live render tree or active DOM objects
2229         had been stopped: i.e. during a document destruction.
2230
2231         * WebProcess/cocoa/VideoFullscreenManager.mm:
2232         (WebKit::inlineVideoFrame):
2233
2234 2018-02-05  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2235
2236         [WinCairo] Refine WebKitLegacy and WebKit build for wincairo
2237         https://bugs.webkit.org/show_bug.cgi?id=182478
2238
2239         Reviewed by Alex Christensen.
2240
2241         Fixed a typo of forwarding header path for InjectedBundle and copying header
2242         method, which should use FLATTENED.
2243
2244         * PlatformWin.cmake: Fix a typo of a forwarding header path for InjectedBundle and use FLATTENED.
2245
2246 2018-02-05  Youenn Fablet  <youenn@apple.com>
2247
2248         WebsiteDataStore::resolveDirectoriesIfNecessary() should not overwrite its resolved serviceWorkerRegistrationDirectory  if already set
2249         https://bugs.webkit.org/show_bug.cgi?id=182514
2250
2251         Reviewed by Chris Dumez.
2252
2253         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2254         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
2255
2256 2018-02-05  Brent Fulgham  <bfulgham@apple.com>
2257
2258         [iOS] Storage process is using the wrong sandbox profile filename
2259         https://bugs.webkit.org/show_bug.cgi?id=182500
2260         <rdar://problem/37232614>
2261
2262         Reviewed by David Kilzer.
2263
2264         The iOS entitlements file was still referencing the old Databases sandbox profile, even though the
2265         process has been renamed 'Storage'.
2266
2267         * Configurations/Databases-iOS.entitlements:
2268
2269 2018-02-05  Ryosuke Niwa  <rniwa@webkit.org>
2270
2271         Add DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen
2272         https://bugs.webkit.org/show_bug.cgi?id=182458
2273
2274         Reviewed by Chris Dumez.
2275
2276         Added DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen
2277         which are found to get sent from WebContent process while ScriptDisallowedScope is present
2278         by a work-in-progress patch on webkit.org/b/182449.
2279
2280         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2281         (WebKit::WebPluginInfoProvider::populatePluginCache):
2282         * WebProcess/WebPage/WebPage.cpp:
2283         (WebKit::WebPage::rootViewToScreen):
2284
2285 2018-02-05  Commit Queue  <commit-queue@webkit.org>
2286
2287         Unreviewed, rolling out r227964 and r228087.
2288         https://bugs.webkit.org/show_bug.cgi?id=182508
2289
2290         These introduced an API test  failure with
2291         URLTest.HostIsIPAddress alongside commit r228086 (Requested by
2292         mlewis13 on #webkit).
2293
2294         Reverted changesets:
2295
2296         "[SOUP] Ensure domain is valid when converting a WebCore
2297         Cookie to Soup"
2298         https://bugs.webkit.org/show_bug.cgi?id=182328
2299         https://trac.webkit.org/changeset/227964
2300
2301         "WebDriver: addCookie command should prepend a dot to domain
2302         if missing"
2303         https://bugs.webkit.org/show_bug.cgi?id=182328
2304         https://trac.webkit.org/changeset/228087
2305
2306 2018-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2307
2308         [Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
2309         https://bugs.webkit.org/show_bug.cgi?id=182472
2310         <rdar://problem/35143057>
2311
2312         Reviewed by Tim Horton.
2313
2314         Allows the user to edit numeric input types using a number pad. See below comments for more detail.
2315
2316         * UIProcess/ios/WKContentViewInteraction.h:
2317         * UIProcess/ios/WKContentViewInteraction.mm:
2318         (-[WKContentView _startAssistingKeyboard]):
2319         (-[WKContentView _stopAssistingNode]):
2320
2321         Dismiss the number pad, if it is present.
2322
2323         (-[WKContentView dismissNumberPadViewController:]):
2324         (-[WKContentView presentNumberPadViewController:]):
2325
2326         Add new helpers for showing and hiding the number pad view controller.
2327
2328         (-[WKContentView presentViewControllerForAssistedNode:]):
2329         (-[WKContentView textInputController:didRequestDismissalWithAction:]):
2330
2331         Dismiss the number pad, if it is present.
2332
2333         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
2334         (-[WKContentView shouldPresentTextInputViewController:]): Deleted.
2335
2336         Remove -shouldPresentTextInputViewController and replace it with -presentViewControllerForAssistedNode:, which
2337         presents the appropriate view controller given "assisted" node information.
2338
2339         * UIProcess/ios/forms/WKNumberPadView.h: Added.
2340         * UIProcess/ios/forms/WKNumberPadView.mm: Added.
2341         * UIProcess/ios/forms/WKNumberPadViewController.h: Added.
2342         * UIProcess/ios/forms/WKNumberPadViewController.mm: Added.
2343
2344         Add "WebKitAdditions harness" files for the new number pad view and view controller classes.
2345
2346         * WebKit.xcodeproj/project.pbxproj:
2347
2348 2018-02-05  Youenn Fablet  <youenn@apple.com>
2349
2350         Add logging to CacheStorageEngineConnection
2351         https://bugs.webkit.org/show_bug.cgi?id=182456
2352
2353         Reviewed by Chris Dumez.
2354
2355         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2356         (WebKit::CacheStorageEngineConnection::open):
2357         (WebKit::CacheStorageEngineConnection::remove):
2358         (WebKit::CacheStorageEngineConnection::caches):
2359         (WebKit::CacheStorageEngineConnection::retrieveRecords):
2360         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
2361         (WebKit::CacheStorageEngineConnection::putRecords):
2362         (WebKit::CacheStorageEngineConnection::reference):
2363         (WebKit::CacheStorageEngineConnection::dereference):
2364         * Platform/Logging.h:
2365
2366 2018-02-05  Daniel Bates  <dabates@apple.com>
2367
2368         REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart
2369         https://bugs.webkit.org/show_bug.cgi?id=182491
2370         <rdar://problem/36533447>
2371
2372         Reviewed by Brent Fulgham.
2373
2374         Exempt Nike from the XHR header restrictions in r222795.
2375
2376         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
2377         However Nike also depends on such functionality.
2378
2379         * UIProcess/API/Cocoa/WKWebView.mm:
2380         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
2381
2382 2018-02-02  Brent Fulgham  <bfulgham@apple.com>
2383
2384         Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
2385         https://bugs.webkit.org/show_bug.cgi?id=182455
2386         <rdar://problem/36626601>
2387
2388         Reviewed by Chris Dumez.
2389
2390         Refactor "logCookieInformation" so that it can be used for resource loads and DOM cookie
2391         manipulation. Place the generally useful logic in a static method that can be invoked
2392         from other places in the NetworkProcess.
2393
2394         Call the new refactored method from NetworkConnectionToWebProcess::setCookiesFromDOM so
2395         we can perform logging there as well.
2396
2397         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2398         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Call the new logging method
2399         (when enabled).
2400         * NetworkProcess/NetworkResourceLoader.cpp:
2401         (WebKit::NetworkResourceLoader::shouldLogCookieInformation): Changed to static method.
2402         (WebKit::escapeForJSON): Made a static function so it could be shared between multiple
2403         methods.
2404         (WebKit::NetworkResourceLoader::logCookieInformation const): Refactor into two methods.
2405         (WebKit::NetworkResourceLoader::logCookieInformation): Ditto.
2406         (WebKit::NetworkResourceLoader::shouldLogCookieInformation const): Deleted.
2407         * NetworkProcess/NetworkResourceLoader.h:
2408         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2409         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Switch to user-enabled release logging
2410         to track partitioning and blocking behavior.
2411
2412 2018-02-05  John Wilander  <wilander@apple.com>
2413
2414         Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
2415         https://bugs.webkit.org/show_bug.cgi?id=181601
2416         <rdar://problem/36475837>
2417
2418         Reviewed by Alex Christensen.
2419
2420         http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
2421         was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
2422         it's possible to check access even if a frame doesn't respond timely to
2423         postMessage after detach and attach.
2424
2425         * NetworkProcess/NetworkProcess.cpp:
2426         (WebKit::NetworkProcess::getAllStorageAccessEntries):
2427         * NetworkProcess/NetworkProcess.h:
2428         * NetworkProcess/NetworkProcess.messages.in:
2429         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2430         (-[WKWebsiteDataStore _getAllStorageAccessEntries:]):
2431         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2432         * UIProcess/Network/NetworkProcessProxy.cpp:
2433         (WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
2434         (WebKit::NetworkProcessProxy::allStorageAccessEntriesResult):
2435         * UIProcess/Network/NetworkProcessProxy.h:
2436         * UIProcess/Network/NetworkProcessProxy.messages.in:
2437         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2438         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
2439         * UIProcess/WebsiteData/WebsiteDataStore.h:
2440
2441 2018-02-05  Daniel Bates  <dabates@apple.com>
2442
2443         Disallow evaluating JavaScript from NPP_Destroy() in WebKit
2444         https://bugs.webkit.org/show_bug.cgi?id=181889
2445         <rdar://problem/36674701>
2446
2447         Reviewed by Brent Fulgham.
2448
2449         Make the behavior of WebKit match the behavior of WebKitLegacy on Mac.
2450
2451         * Shared/Plugins/NPObjectMessageReceiver.cpp:
2452         (WebKit::NPObjectMessageReceiver::hasMethod):
2453         (WebKit::NPObjectMessageReceiver::invoke):
2454         (WebKit::NPObjectMessageReceiver::invokeDefault):
2455         (WebKit::NPObjectMessageReceiver::hasProperty):
2456         (WebKit::NPObjectMessageReceiver::getProperty):
2457         (WebKit::NPObjectMessageReceiver::setProperty):
2458         (WebKit::NPObjectMessageReceiver::removeProperty):
2459         (WebKit::NPObjectMessageReceiver::enumerate):
2460         (WebKit::NPObjectMessageReceiver::construct):
2461         Bail out if the plugin is executing NPP_Destroy().
2462
2463         * WebProcess/Plugins/Plugin.cpp:
2464         (WebKit::Plugin::destroyPlugin):
2465         * WebProcess/Plugins/Plugin.h:
2466         (WebKit::Plugin::isBeingDestroyed const):
2467         Move bookkeeping of whether the plugin is being destroyed from PluginView
2468         to here. This makes it straightforward for NPObjectMessageReceiver to query
2469         this information.
2470
2471         * WebProcess/Plugins/PluginView.cpp:
2472         (WebKit::PluginView::~PluginView):
2473         (WebKit::PluginView::destroyPluginAndReset):
2474         (WebKit::PluginView::recreateAndInitialize):
2475         (WebKit::PluginView::protectPluginFromDestruction):
2476         (WebKit::PluginView::unprotectPluginFromDestruction):
2477         Move bookkeeping of whether the plugin is being destroyed from here
2478         to Plugin.
2479
2480         * WebProcess/Plugins/PluginView.h:
2481         (WebKit::PluginView::isBeingDestroyed const): Turn around and ask the plugin if it
2482         is being destroyed, if we have one.
2483
2484 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2485
2486         WebDriver: addCookie command should prepend a dot to domain if missing
2487         https://bugs.webkit.org/show_bug.cgi?id=182328
2488         <rdar://problem/37116398>
2489
2490         Reviewed by Michael Catanzaro.
2491
2492         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
2493
2494         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
2495
2496         * UIProcess/Automation/WebAutomationSession.cpp:
2497         (WebKit::WebAutomationSession::addSingleCookie):
2498
2499 2018-02-03  Tim Horton  <timothy_horton@apple.com>
2500
2501         UI process sometimes crashes under -[WKContentView _lookupForWebView:]
2502         https://bugs.webkit.org/show_bug.cgi?id=182460
2503         <rdar://problem/33260602>
2504
2505         Reviewed by Wenson Hsieh.
2506
2507         * UIProcess/ios/WKContentViewInteraction.mm:
2508         (-[WKContentView _lookupForWebView:]):
2509         If you have a range selection, but no rects for the selection, retrieving
2510         the 0th element of selectionRects will crash the UI process. To fix, in
2511         this case, use the rect for the starting caret instead.
2512
2513         It doesn't seem like the presentationRect is actually currently used for
2514         the Lookup service, so the only impact is that we shouldn't crash anymore.
2515
2516 2018-02-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2517
2518         Remove remaining dead !USE(NETWORK_SESSION) code
2519         https://bugs.webkit.org/show_bug.cgi?id=182451
2520
2521         Reviewed by Alex Christensen.
2522
2523         DownloadCurl.cpp and AuthenticationManagerSoup.cpp have been dead code since NETWORK_SESSION
2524         became mandatory.
2525
2526         * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Removed.
2527         * PlatformGTK.cmake:
2528         * PlatformWPE.cmake:
2529         * PlatformWin.cmake:
2530         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Removed.
2531
2532 2018-02-02  Youenn Fablet  <youenn@apple.com>
2533
2534         CacheStorage should check for origin file presence when computing the origin of a folder
2535         https://bugs.webkit.org/show_bug.cgi?id=182454
2536
2537         Reviewed by Chris Dumez.
2538
2539         In case caches is opened for an origin but no cache is added, we do not have a caches name file but we do have an origin filename.
2540         We should be checking the origin filename anyway since we will be reading it afterwards.
2541
2542         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2543         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
2544
2545 2018-02-02  Youenn Fablet  <youenn@apple.com>
2546
2547         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
2548         https://bugs.webkit.org/show_bug.cgi?id=182403
2549         <rdar://problem/36673358>
2550
2551         Reviewed by Alex Christensen.
2552
2553         * UIProcess/WebProcessPool.cpp:
2554         (WebKit::legacyWebsiteDataStoreConfiguration): Setting serviceWorkerRegistrationDirectory for legacy stores.
2555
2556 2018-02-02  Youenn Fablet  <youenn@apple.com>
2557
2558         Clearing all service worker registrations should wait for importing service worker registration to finish
2559         https://bugs.webkit.org/show_bug.cgi?id=182407
2560
2561         Reviewed by Chris Dumez.
2562
2563         Updating API to take a completion handler.
2564
2565         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2566         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
2567         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2568
2569 2018-02-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2570
2571         [Win] MSVC doesn't seem to like "friend class NeverDestroyed<Foo>"
2572         https://bugs.webkit.org/show_bug.cgi?id=182081
2573
2574         Reviewed by Yusuke Suzuki.
2575
2576         The template friend class, which belongs to a different namespace,
2577         can't access private member if its friend declaration is specified
2578         without the namespace and with class keyword.
2579
2580         Replaced "friend class NeverDestroyed<Foo>" with "friend NeverDestroyed<Foo>".
2581
2582         * NetworkProcess/NetworkProcess.h:
2583         * NetworkProcess/capture/NetworkCaptureManager.h:
2584         * PluginProcess/PluginProcess.h:
2585         * Shared/CallbackID.h:
2586         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2587         * StorageProcess/StorageProcess.h:
2588         * UIProcess/Plugins/PluginProcessManager.h:
2589         * UIProcess/Plugins/gtk/PluginInfoCache.h:
2590         * UIProcess/WebPageProxy.cpp:
2591         * UIProcess/WebPasteboardProxy.h:
2592         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2593         * UIProcess/gtk/HardwareAccelerationManager.h:
2594         * UIProcess/gtk/WaylandCompositor.h:
2595         * UIProcess/linux/MemoryPressureMonitor.h:
2596         * UIProcess/mac/ServicesController.h:
2597         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
2598         * WebProcess/Plugins/WebPluginInfoProvider.h:
2599         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h:
2600         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2601
2602 2018-02-02  Youenn Fablet  <youenn@apple.com>
2603
2604         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
2605         https://bugs.webkit.org/show_bug.cgi?id=182403
2606
2607         Reviewed by Alex Christensen.
2608
2609         WebsiteDataStore is the place to set configuration information such as service worker registration path.
2610         This patch updates WebKit code accordingly.
2611         By default, the service worker registration path is in a Caches subfolder, similarly to cache API path.
2612
2613         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2614         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2615         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2616         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2617         (API::ProcessPoolConfiguration::copy):
2618         * UIProcess/API/APIProcessPoolConfiguration.h:
2619         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2620         (WKContextConfigurationCopyServiceWorkerDatabaseDirectory): Deleted.
2621         (WKContextConfigurationSetServiceWorkerDatabaseDirectory): Deleted.
2622         * UIProcess/API/C/WKContextConfigurationRef.h:
2623         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2624         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
2625         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2626         (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
2627         (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
2628         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2629         * UIProcess/WebProcessPool.cpp:
2630         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
2631         (WebKit::WebProcessPool::initializeNewWebProcess):
2632         * UIProcess/WebsiteData/WebsiteDataStore.h:
2633         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
2634         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
2635         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2636         * UIProcess/gtk/WebProcessPoolWPE.cpp:
2637
2638 2018-02-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2639
2640         [Extra Zoom Mode] Implement support for indirect mainframe scrolling
2641         https://bugs.webkit.org/show_bug.cgi?id=182421
2642         <rdar://problem/35142694>
2643
2644         Reviewed by Tim Horton.
2645
2646         Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for
2647         zooming. See below for more details.
2648
2649         * UIProcess/API/Cocoa/WKWebView.mm:
2650
2651         Remove a now-unneeded WebKitAdditions import.
2652
2653         * UIProcess/ios/WKScrollView.mm:
2654         (-[WKScrollView initWithFrame:]):
2655
2656         Add imports for -Before and -After versions of WKScrollViewAdditions.
2657
2658         (-[WKScrollView addGestureRecognizer:]):
2659
2660         Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized.
2661         I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture
2662         recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in
2663         -initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths.
2664
2665 2018-02-01  Tim Horton  <timothy_horton@apple.com>
2666
2667         WebKit fails to build (_startAssistingNode has conflicting parameters)
2668         https://bugs.webkit.org/show_bug.cgi?id=182417
2669         <rdar://problem/36965318>
2670
2671         Reviewed by Dan Bernstein.
2672
2673         * UIProcess/ios/WKContentViewInteraction.h:
2674         Use Big BOOL like in the implementation.
2675
2676 2018-02-01  Brent Fulgham  <bfulgham@apple.com>
2677
2678         Improve NetworkResourceLogger to report blocked (versus non-partitioned) cookies
2679         https://bugs.webkit.org/show_bug.cgi?id=182408
2680         <rdar://problem/36918028>
2681
2682         Reviewed by Chris Dumez.
2683
2684         Update the logging method to report blocked origins, rather than logging them as non-partitioned
2685         loads that have no cookies or other content.
2686
2687         * NetworkProcess/NetworkResourceLoader.cpp:
2688         (WebKit::NetworkResourceLoader::logCookieInformation const):
2689
2690 2018-02-01  David Kilzer  <ddkilzer@apple.com>
2691
2692         REGRESSION (r222824): UI process crashes in WebKit::WebBackForwardList::backItem const
2693         <https://webkit.org/b/182409>
2694         <rdar://problem/35495094>
2695
2696         Reviewed by Alex Christensen.
2697
2698         * UIProcess/WebBackForwardList.cpp:
2699         (WebKit::WebBackForwardList::goToItem): Fix typo so the for loop
2700         actually checks each value in m_entries.
2701
2702 2018-02-01  Youenn Fablet  <youenn@apple.com>
2703
2704         Delay service worker process creation until actually needed by SWServer
2705         https://bugs.webkit.org/show_bug.cgi?id=182301
2706
2707         Reviewed by Chris Dumez.
2708
2709         Do not create a service worker process at creation of the first SWServerConnection.
2710         Wait for a WebProcess message that needs it:
2711         - postMessage message
2712         - fetchEvent message
2713         - job scheduling.
2714
2715         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2716         (WebKit::WebSWServerConnection::startFetch):
2717         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2718         (WebKit::WebSWServerConnection::scheduleJobInServer):
2719         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2720         * StorageProcess/StorageToWebProcessConnection.cpp:
2721         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2722
2723 2018-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2724
2725         [Extra zoom mode] Implement basic support for interacting with text form controls
2726         https://bugs.webkit.org/show_bug.cgi?id=182401
2727         <rdar://problem/35143035>
2728
2729         Reviewed by Tim Horton.
2730
2731         Add UI support for interacting with and editing text form controls when extra zoom mode is enabled. See below
2732         for more details.
2733
2734         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2735         (-[WKWebViewConfiguration init]):
2736         (-[WKWebViewConfiguration encodeWithCoder:]):
2737         (-[WKWebViewConfiguration initWithCoder:]):
2738         (-[WKWebViewConfiguration copyWithZone:]):
2739         (-[WKWebViewConfiguration _textInteractionGesturesEnabled]):
2740         (-[WKWebViewConfiguration _setTextInteractionGesturesEnabled:]):
2741         (-[WKWebViewConfiguration _longPressActionsEnabled]):
2742         (-[WKWebViewConfiguration _setLongPressActionsEnabled:]):
2743
2744         Introduce two new web view configuration flags: `textInteractionGesturesEnabled` and `longPressActionsEnabled`.
2745         The former determines whether text interaction gestures (i.e. text selection, moving the caret, showing UI for
2746         IME, etc.) are enabled. The latter determines whether or not long press actions (i.e. touch callout, share
2747         sheet, etc.) are enabled. These are disabled by default only in extra zoom mode.
2748
2749         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2750         * UIProcess/WebPageProxy.cpp:
2751         (WebKit::WebPageProxy::setTextAsync):
2752
2753         Add a way to set the text value of a currently edited text form control. This will either set the text value of
2754         an input, a. la. autofill, or overwrite the contents of a contenteditable area by selecting everything and
2755         inserting the given text.
2756
2757         * UIProcess/WebPageProxy.h:
2758         (WebKit::WebPageProxy::focusNextAssistedNode):
2759
2760         Add a default argument for the completion callback.
2761
2762         * UIProcess/ios/WKContentViewInteraction.h:
2763         * UIProcess/ios/WKContentViewInteraction.mm:
2764         (-[WKContentView setupInteraction]):
2765         (-[WKContentView _displayFormNodeInputView]):
2766         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2767         (-[WKContentView hasSelectablePositionAtPoint:]):
2768         (-[WKContentView pointIsNearMarkedText:]):
2769         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2770         (-[WKContentView insertionPointColor]):
2771
2772         Respect the web view configuration flags above by bailing early from text interaction and long press action
2773         sheet methods.
2774
2775         (-[WKContentView _startAssistingKeyboard]):
2776         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2777
2778         Add a flag indicating whether we are in the process of changing focus from one node to another. We use this to
2779         decide whether or not we want to present the text input view controller right away, or just reload the focused
2780         form control overlay. When we stop "assisting" a node, we also keep the focused form control overlay up if we're
2781         only changing focus to another form control.
2782
2783         (-[WKContentView _stopAssistingNode]):
2784         (-[WKContentView presentFocusedFormControlViewController:]):
2785         (-[WKContentView dismissFocusedFormControlViewController:]):
2786         (-[WKContentView shouldPresentTextInputViewController:]):
2787         (-[WKContentView presentTextInputViewController:]):
2788         (-[WKContentView dismissTextInputViewController:]):
2789
2790         Introduce helpers for managing presentation of the focused form control overlay and text input view controller.
2791         All -present and -dismiss helpers here are idempotent. These view controllers are presented from the content
2792         view's view controller for fullscreen presentation.
2793
2794         (-[WKContentView textInputController:didCommitText:]):
2795         (-[WKContentView textInputController:didRequestDismissalWithAction:]):
2796         (-[WKContentView focusedFormControlControllerDidSubmit:]):
2797         (-[WKContentView focusedFormControlControllerDidCancel:]):
2798         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
2799         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]):
2800         (-[WKContentView actionNameForFocusedFormControlController:]):
2801         (-[WKContentView focusedFormControlControllerDidRequestNextNode:]):
2802         (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]):
2803         (-[WKContentView hasNextNodeForFocusedFormControlController:]):
2804         (-[WKContentView hasPreviousNodeForFocusedFormControlController:]):
2805
2806         Implement delegate methods for the focused form control and text input view controllers. This mainly involves
2807         straightforward plumbing of pieces of AssistedNodeInformation on the content view.
2808
2809         (-[WKContentView pointIsInAssistedNode:]): Deleted.
2810
2811         Remove a method that was still implemented only for binary compatibility with iOS 10.
2812
2813         * WebProcess/WebPage/WebPage.cpp:
2814         (WebKit::WebPage::setTextAsync):
2815         * WebProcess/WebPage/WebPage.h:
2816         * WebProcess/WebPage/WebPage.messages.in:
2817
2818 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2819
2820         [GTK] Shift + mouse scroll should scroll horizontally
2821         https://bugs.webkit.org/show_bug.cgi?id=181629
2822
2823         Reviewed by Michael Catanzaro.
2824
2825         Swap scroll direction when Shift is pressed for consistency with GtkScrolledWindow.
2826
2827         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2828         (webkitWebViewBaseScrollEvent):
2829
2830 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2831
2832         REGRESSION(r227893): fast/events/touch/touch-stale-node-crash.html and other tests crash
2833         https://bugs.webkit.org/show_bug.cgi?id=182350
2834
2835         Reviewed by Carlos Alberto Lopez Perez.
2836
2837         Ensure events synthesized from touch gestures have a valid window, screen and device.
2838
2839         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2840         * UIProcess/gtk/GestureController.h: Add virtual destructor to GestureControllerclient.
2841
2842 2018-01-31  Simon Fraser  <simon.fraser@apple.com>
2843
2844         Use different debug red colors for different contexts
2845         https://bugs.webkit.org/show_bug.cgi?id=182362
2846
2847         Reviewed by Tim Horton.
2848         
2849         Pure red is used elsehwere in the system as a debug color indicator, so use different
2850         shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
2851         so they are identifiable.
2852
2853         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2854         (WebKit::RemoteLayerBackingStore::drawInContext):
2855
2856 2018-01-31  Don Olmstead  <don.olmstead@sony.com>
2857
2858         [CMake] Make JavaScriptCore headers copies
2859         https://bugs.webkit.org/show_bug.cgi?id=182303
2860
2861         Reviewed by Alex Christensen.
2862
2863         * CMakeLists.txt:
2864         * Scripts/generate-forwarding-headers.pl:
2865
2866 2018-01-31  Alex Christensen  <achristensen@webkit.org>
2867
2868         Unreviewed, rolling out r227942.
2869
2870         r227875 should not have been rolled out.
2871
2872         Reverted changeset:
2873
2874         "Unreviewed, rolling out r227875."
2875         https://bugs.webkit.org/show_bug.cgi?id=182357
2876         https://trac.webkit.org/changeset/227942
2877
2878 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2879
2880         Unreviewed, rolling out r227875.
2881         https://bugs.webkit.org/show_bug.cgi?id=182357
2882
2883         Missing cross-platform TestController implementation
2884
2885         Reverted changeset:
2886
2887         "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
2888         https://bugs.webkit.org/show_bug.cgi?id=181958
2889         https://trac.webkit.org/changeset/227875
2890
2891         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2892         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
2893         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
2894         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2895         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
2896         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
2897         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
2898         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
2899         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2900         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2901         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2902         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2903         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
2904         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
2905         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2906         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
2907         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
2908         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
2909         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2910         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2911         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
2912         * UIProcess/WebResourceLoadStatisticsStore.h:
2913
2914 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
2915
2916         Follow-up to r227939.
2917         https://bugs.webkit.org/show_bug.cgi?id=182354
2918         <rdar://problem/37046844>
2919
2920         Make sure the correct sandbox is used on iOS as well.
2921
2922         * StorageProcess/ios/StorageProcessIOS.mm:
2923         (WebKit::StorageProcess::initializeSandbox):
2924
2925 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
2926
2927         REGRESSION(r220094): com.apple.WebKit.Storage lost its sandbox
2928         https://bugs.webkit.org/show_bug.cgi?id=182354
2929         <rdar://problem/37046844>
2930
2931         Reviewed by Ryosuke Niwa.
2932
2933         The Database process was renamed to Storage, but it's sandbox was not updated.
2934
2935         * Configurations/WebKit.xcconfig: Update for sandbox rename.
2936         * DerivedSources.make: Ditto.
2937         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Removed.
2938         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Copied from Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.
2939         * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Removed.
2940         * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Copied from StorageProcess/mac/com.apple.WebKit.Databases.sb.in.
2941         * WebKit.xcodeproj/project.pbxproj: Update for sandbox rename.
2942
2943 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2944
2945         REGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html, http/tests/resourceLoadStatistics/grandfathering.html timing out on GTK, WPE
2946         https://bugs.webkit.org/show_bug.cgi?id=182222
2947
2948         Reviewed by Alex Christensen.
2949
2950         Add callbacks to notify when resource load statistics deletion is complete.
2951
2952         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2953         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2954         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2955         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2956
2957 2018-01-31  Tim Horton  <timothy_horton@apple.com>
2958
2959         Occasional null deref under WebPageProxy::updateBackingStoreDiscardableState()
2960         https://bugs.webkit.org/show_bug.cgi?id=182349
2961         <rdar://problem/27822258>
2962
2963         Reviewed by Simon Fraser.
2964
2965         * UIProcess/WebPageProxy.cpp:
2966         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
2967         m_drawingArea can be null during process launch and relaunch.
2968
2969         Cocoa ports don't use the result of setBackingStoreIsDiscardable(),
2970         but they do run this code to keep it up to date.
2971
2972 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2973
2974         [GTK] Move gir and typelib generation into ENABLE_INTROSPECTION conditional
2975         https://bugs.webkit.org/show_bug.cgi?id=182308
2976
2977         Reviewed by Carlos Garcia Campos.
2978
2979         * PlatformGTK.cmake:
2980
2981 2018-01-31  Youenn Fablet  <youenn@apple.com>
2982
2983         Remove StorageToWebProcessConnection::removeSWServerConnection
2984         https://bugs.webkit.org/show_bug.cgi?id=182305
2985
2986         Reviewed by Chris Dumez.
2987
2988         * StorageProcess/StorageToWebProcessConnection.cpp:
2989         (WebKit::StorageToWebProcessConnection::removeSWServerConnection): Deleted.
2990         * StorageProcess/StorageToWebProcessConnection.h:
2991         * StorageProcess/StorageToWebProcessConnection.messages.in:
2992
2993 2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2994
2995         REGRESSION(r227544): [GTK] contextMenuEvent is NULL on CONTEXT_MENU call
2996         https://bugs.webkit.org/show_bug.cgi?id=182224
2997
2998         Reviewed by Michael Catanzaro.
2999
3000         Move the gestures handling to WebKitWebViewBase. This patch adds GestureControllerClient class, created and
3001         implemented by WebKitWebViewBase and used by GestureController instead of the WebPageProxy. This way we ensure
3002         events are handled consistently.
3003
3004         * UIProcess/API/gtk/PageClientImpl.cpp:
3005         (WebKit::PageClientImpl::doneWithTouchEvent): Cast the GdkEvent since GestureController no longer works wirth
3006         const GdkEvents.
3007         (WebKit::PageClientImpl::zoom): Use webkit_web_view_set_zoom_level() in case of WebKitWebView or
3008         WebPageProxy::setPageZoomFactor() otherwise.
3009         * UIProcess/API/gtk/PageClientImpl.h:
3010         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3011         (ClickCounter::currentClickCountForGdkButtonEvent): Receive a GdkEvent to avoid casts.
3012         (webkitWebViewBaseHandleMouseEvent): Helper function to handle mouse events.
3013         (webkitWebViewBaseButtonPressEvent): Use webkitWebViewBaseHandleMouseEvent.
3014         (webkitWebViewBaseButtonReleaseEvent): Ditto.
3015         (webkitWebViewBaseHandleWheelEvent): Helper function to handle wheel events.
3016         (webkitWebViewBaseScrollEvent): Use webkitWebViewBaseHandleWheelEvent.
3017         (webkitWebViewBaseMotionNotifyEvent): Use webkitWebViewBaseHandleMouseEvent.
3018         (webkitWebViewBaseCrossingNotifyEvent): Ditto.
3019         (webkitWebViewBaseGestureController): Pass the widget and client to GestureController.
3020         * UIProcess/gtk/GestureController.cpp:
3021         (WebKit::GestureController::GestureController): Receives a widget and client now.
3022         (WebKit::GestureController::handleEvent): Remove the const.
3023         (WebKit::GestureController::Gesture::Gesture): Initialize client.
3024         (WebKit::GestureController::Gesture::handleEvent): Remove the const.
3025         (WebKit::GestureController::DragGesture::startDrag): Use the client instead of WebPageProxy.
3026         (WebKit::GestureController::DragGesture::handleDrag): Ditto.
3027         (WebKit::GestureController::DragGesture::handleTap): Ditto.
3028         (WebKit::GestureController::DragGesture::begin): Ignore the const returned by gtk_gesture_get_last_event().
3029         (WebKit::GestureController::DragGesture::update): Ditto.
3030         (WebKit::GestureController::DragGesture::end): Ditto.
3031         (WebKit::GestureController::DragGesture::DragGesture): Receives a widget and client now.
3032         (WebKit::GestureController::SwipeGesture::startMomentumScroll): Use the client instead of WebPageProxy.
3033         (WebKit::GestureController::SwipeGesture::swipe): Ignore the const returned by gtk_gesture_get_last_event().
3034         (WebKit::GestureController::SwipeGesture::SwipeGesture): Receives a widget and client now.
3035         (WebKit::GestureController::ZoomGesture::begin): Start the zoom.
3036         (WebKit::GestureController::ZoomGesture::startZoom): Use the client instead of WebPageProxy.
3037         (WebKit::GestureController::ZoomGesture::handleZoom): Ditto.
3038         (WebKit::GestureController::ZoomGesture::ZoomGesture): Receives a widget and client now.
3039         (WebKit::GestureController::LongPressGesture::longPressed): Use the client instead of WebKitWebView.
3040         (WebKit::GestureController::LongPressGesture::pressed): Ignore the const returned by gtk_gesture_get_last_event().
3041         (WebKit::GestureController::LongPressGesture::LongPressGesture): Receives a widget and client now.
3042         (WebKit::GestureController::Gesture::simulateMouseClick): Deleted.
3043         (WebKit::createScrollEvent): Deleted.
3044         * UIProcess/gtk/GestureController.h:
3045
3046 2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3047
3048         Web Automation: cookies returned by automation should have expiry time in seconds
3049         https://bugs.webkit.org/show_bug.cgi?id=182293
3050
3051         Reviewed by Brian Burg.
3052
3053         When creating a WebCore::Cookie from a WebDriver object we convert the given expiry time to milliseconds, but
3054         when creating a WebDriver object from a WebCore::Cookie we are keeping the milliseconds. We should convert to
3055         seconds for consistency, so that the WebDriver always handles seconds.
3056
3057         Fixes: imported/w3c/webdriver/tests/cookies/get_named_cookie.py::test_get_named_cookie
3058
3059         * UIProcess/Automation/WebAutomationSession.cpp:
3060         (WebKit::buildObjectForCookie): Convert expiry to seconds.
3061
3062 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
3063
3064         Unreviewed iOS build fix.
3065
3066         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3067
3068 2018-01-30  John Wilander  <wilander@apple.com>
3069
3070         Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()
3071         https://bugs.webkit.org/show_bug.cgi?id=181958
3072         https://bugs.webkit.org/show_bug.cgi?id=182072
3073         <rdar://problem/36801804>
3074         <rdar://problem/36845795>
3075
3076         Reviewed by Brent Fulgham.
3077
3078         Because of the asynchronous nature of XPC and cookies,
3079         we need callbacks in these TestRunner functions so that
3080         the layout tests can wait for state changes to finish
3081         before checking test conditions.
3082
3083         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3084         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
3085         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
3086         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3087         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
3088         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]):
3089         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
3090         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]):
3091         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3092         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3093         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3094         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3095         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
3096         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
3097         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
3098         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
3099         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
3100         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
3101         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3102         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
3103         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
3104         * UIProcess/WebResourceLoadStatisticsStore.h:
3105
3106 2018-01-30  Ryosuke Niwa  <rniwa@webkit.org>
3107
3108         REGRESSION(r227550): Resource timing API is disabled on macOS
3109         https://bugs.webkit.org/show_bug.cgi?id=182318
3110
3111         Reviewed by Chris Dumez.
3112
3113         Resource timing API should be enabled by default all versions of macOS we support now.
3114
3115         * Shared/WebPreferences.yaml:
3116         * Shared/WebPreferencesDefaultValues.h:
3117
3118 2018-01-30  Tim Horton  <timothy_horton@apple.com>
3119
3120         WKWebView layout is sometimes wrong after rotation on iPhone X
3121         https://bugs.webkit.org/show_bug.cgi?id=182304
3122         <rdar://problem/34158671>
3123
3124         Reviewed by Simon Fraser.
3125
3126         * Platform/spi/ios/UIKitSPI.h:
3127         * UIProcess/API/Cocoa/WKWebView.mm:
3128         (-[WKWebView _computedContentInset]):
3129         (-[WKWebView _scrollViewSystemContentInset]):
3130         (activeMinimumLayoutSize):
3131         It turns out that it is not always safe to look at the safe area insets of
3132         children from inside layoutSubviews, even after the call to super.
3133
3134         Instead, make use of the fact that WKScrollView and WKWebView have identical
3135         coordinate spaces, and map WKWebView's safe area insets into the WKScrollView.
3136         It's safe to use the scroll view's affected-edges and contentScrollInset,
3137         because those aren't updated at the same outside-of-layout time that
3138         safe area insets are.
3139
3140         We could alternatively move all calls to activeMinimumLayoutSize outside
3141         of layoutSubviews, but that seems like a larger and riskier change.
3142
3143         All attempts to write a test have failed; this depends heavily on use of
3144         autolayout and the mechanism by which the system updates system-owned
3145         safe area insets during device rotation.
3146
3147 2018-01-30  Don Olmstead  <don.olmstead@sony.com>
3148
3149         JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
3150         https://bugs.webkit.org/show_bug.cgi?id=182312
3151
3152         Reviewed by Michael Catanzaro.
3153
3154         * config.h:
3155
3156 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
3157
3158         Add telemetry to track storage access API adoption
3159         https://bugs.webkit.org/show_bug.cgi?id=182197
3160         <rdar://problem/35803309>
3161
3162         Reviewed by Chris Dumez.
3163
3164         Part 2: Add telemetry for the Storage Access API case
3165
3166         This change increments a counter when an origin is loaded in a first part context because
3167         it was granted Storage Access API permissions.
3168
3169         * NetworkProcess/NetworkResourceLoader.cpp:
3170         (WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate
3171         loads that happened with the Storage Access API enabled.
3172         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3173         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for
3174         loads using the new API.
3175
3176 2018-01-30  Megan Gardner  <megan_gardner@apple.com>
3177
3178         Make preserve and restore focus more likely to be symmetrical
3179         https://bugs.webkit.org/show_bug.cgi?id=182264
3180         <rdar://problem/36948473>
3181         
3182         Reviewed by Tim Horton.
3183
3184         Keep a stack of if we actually increment the focusState, so that
3185         changes to the web content do not result in asymmetric decrements to the focus state. 
3186         To work around problems associated with <rdar://problem/37000122>.
3187
3188         * UIProcess/ios/WKContentViewInteraction.h:
3189         * UIProcess/ios/WKContentViewInteraction.mm:
3190         (-[WKContentView _restoreFocusWithToken:]):
3191         (-[WKContentView _preserveFocusWithToken:destructively:]):
3192
3193 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
3194
3195         Add telemetry to track storage access API adoption
3196         https://bugs.webkit.org/show_bug.cgi?id=182197
3197         <rdar://problem/35803309>
3198
3199         Reviewed by Chris Dumez.
3200         
3201         This patch also handled aggregating the counts in the UIProcess, which has access to
3202         the right data.
3203
3204         The original patch assumed the WebContent process kept track of user interaction. This is
3205         only tracked in the UIProcess, so we can get rid of some of the logging code adding in
3206         r227755.
3207
3208         * Shared/WebProcessCreationParameters.cpp:
3209         (WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not
3210         needed to track the statistics.
3211         (WebKit::WebProcessCreationParameters::decode): Ditto.
3212         * Shared/WebProcessCreationParameters.h:
3213         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3214         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
3215         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3216         (WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from
3217         the WebContent process, which does not keep track of user interaction.
3218         (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing
3219         the statistics.
3220         * UIProcess/WebResourceLoadStatisticsStore.h:
3221         * WebProcess/WebProcess.cpp:
3222         (WebKit::WebProcess::initializeWebProcess):
3223
3224 2018-01-30  Chris Dumez  <cdumez@apple.com>
3225
3226         Make sure we never create a WebSWClientConnection with an invalid sessionID
3227         https://bugs.webkit.org/show_bug.cgi?id=182276
3228         <rdar://problem/36582633>
3229
3230         Reviewed by Alex Christensen.
3231
3232         Make sure we never create a WebSWClientConnection with an invalid sessionID as this
3233         could corrupt our hash tables.
3234
3235         * StorageProcess/StorageProcess.cpp:
3236         (WebKit::StorageProcess::swServerForSession):
3237         * UIProcess/WebProcessPool.cpp:
3238         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
3239         * WebProcess/Storage/WebSWClientConnection.cpp:
3240         (WebKit::WebSWClientConnection::WebSWClientConnection):
3241         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3242         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
3243         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
3244         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3245         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
3246
3247 2018-01-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3248
3249         [WinCairo] Fix forwarding header conflict of WebKit on WinCairo
3250         https://bugs.webkit.org/show_bug.cgi?id=177202
3251
3252         Reviewed by Alex Christensen.
3253
3254         * PlatformWin.cmake:
3255
3256 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3257
3258         WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
3259         https://bugs.webkit.org/show_bug.cgi?id=180350
3260
3261         Reviewed by Carlos Alberto Lopez Perez.
3262
3263         undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
3264         case to return an empty string. We currently handle this case for execute script commands, but not in all other
3265         cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
3266         because in that case we wouldn't need to handle it as a special case.
3267
3268         15.2 Executing Script
3269         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone
3270
3271         Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent
3272
3273         * WebProcess/Automation/WebAutomationSessionProxy.js:
3274         (let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.
3275
3276 2018-01-29  Ryosuke Niwa  <rniwa@webkit.org>
3277
3278         Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent
3279         https://bugs.webkit.org/show_bug.cgi?id=182273
3280
3281         Reviewed by Chris Dumez.
3282
3283         The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for
3284         the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame,
3285         it's not safe to execute arbitrary code.
3286
3287         Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566.
3288
3289         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3290         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
3291
3292 2018-01-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3293
3294         Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit
3295         https://bugs.webkit.org/show_bug.cgi?id=182268
3296         <rdar://problem/37003784>
3297
3298         Reviewed by Tim Horton and Dan Bernstein.
3299
3300         Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from
3301         usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the
3302         unlocalized resources directory. If the AdditionalResources directory does not exist in the build
3303         directory, we fall back to searching the SDK.
3304
3305         * WebKit.xcodeproj/project.pbxproj:
3306
3307 2018-01-29  Youenn Fablet  <youenn@apple.com>
3308
3309         ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses
3310         https://bugs.webkit.org/show_bug.cgi?id=182134
3311
3312         Reviewed by Chris Dumez.
3313
3314         As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection.
3315         This is also consistent with SubresourceLoader::didReceiveResponse.
3316
3317         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3318         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3319
3320 2018-01-29  Youenn Fablet  <youenn@apple.com>
3321
3322         Cache API should make sure to resolve caches.open promises in the same order as called
3323         https://bugs.webkit.org/show_bug.cgi?id=182193
3324         <rdar://problem/36930363>
3325
3326         Reviewed by Chris Dumez.
3327
3328         Covered by added test.
3329         Whenever opening/removing a cache requires writing to disk, wait to finish the task
3330         until any disk writing task is done.
3331         Applying this strategy when clearing data so that we also clear data that is pending to be written.
3332         For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier.
3333         WebCore uses that information to return true/false as promise resolution value.
3334
3335         * NetworkProcess/cache/CacheStorageEngine.cpp:
3336         (WebKit::CacheStorage::Engine::retrieveCaches):
3337         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3338         (WebKit::CacheStorage::Caches::clear):
3339         (WebKit::CacheStorage::Caches::open):
3340         (WebKit::CacheStorage::Caches::remove):
3341         (WebKit::CacheStorage::Caches::writeCachesToDisk):
3342         (WebKit::CacheStorage::Caches::cacheInfos):
3343         (WebKit::CacheStorage::Caches::cacheInfos const): Deleted.
3344         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3345         (WebKit::CacheStorage::Caches::createWeakPtr):
3346
3347 2018-01-29  Alex Christensen  <achristensen@webkit.org>
3348
3349         Clean up API after bugs 178240 and 176474
3350         https://bugs.webkit.org/show_bug.cgi?id=182259
3351
3352         Reviewed by Dan Bernstein.
3353
3354         NS_OPTIONS should be NSUInteger, not NSInteger.  This is how all other NS_OPTIONS in WebKit are,
3355         and it's necessary if we get really big numbers as options.  Changing them won't cause binary
3356         incompatibility unless someone does signed integer comparison with currently invalid values.
3357
3358         Added availability macros I forgot to add earlier.
3359
3360         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3361         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3362
3363 2018-01-29  Jiewen Tan  <jiewen_tan@apple.com>
3364
3365         [WebAuthN] Add a compile-time feature flag
3366         https://bugs.webkit.org/show_bug.cgi?id=182211
3367         <rdar://problem/36936365>
3368
3369         Reviewed by Brent Fulgham.
3370
3371         * Configurations/FeatureDefines.xcconfig:
3372
3373 2018-01-29  John Wilander  <wilander@apple.com>
3374
3375         Resource Load Statistics: Introduce debug mode as experimental feature
3376         https://bugs.webkit.org/show_bug.cgi?id=182199
3377         <rdar://problem/36930364>
3378
3379         Reviewed by Alex Christensen.
3380
3381         The only changes to default behavior are:
3382         - Increased resolution on timestamps which is needed to be able to set shorter
3383           timeouts in debug mode.
3384         - Only update partitioning and blocking table when needed. This is an optimization
3385           which pays off in less XPC with shorter timeouts.
3386
3387         * Shared/WebPreferences.yaml:
3388         * UIProcess/API/APIWebsiteDataStore.cpp:
3389         (API::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
3390         (API::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
3391         * UIProcess/API/APIWebsiteDataStore.h:
3392         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3393         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode):
3394         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3395         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3396         (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
3397         (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
3398         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3399         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3400         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
3401         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3402         * UIProcess/WebResourceLoadStatisticsStore.h:
3403         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3404         (WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
3405         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
3406         * UIProcess/WebsiteData/WebsiteDataStore.h:
3407
3408 2018-01-29  Andy Estes  <aestes@apple.com>
3409
3410         [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
3411         https://bugs.webkit.org/show_bug.cgi?id=182252
3412         <rdar://problem/21555881>
3413
3414         Reviewed by Tim Horton.
3415
3416         * WebProcess/WebPage/WebPage.