[Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
4         https://bugs.webkit.org/show_bug.cgi?id=182472
5         <rdar://problem/35143057>
6
7         Reviewed by Tim Horton.
8
9         Allows the user to edit numeric input types using a number pad. See below comments for more detail.
10
11         * UIProcess/ios/WKContentViewInteraction.h:
12         * UIProcess/ios/WKContentViewInteraction.mm:
13         (-[WKContentView _startAssistingKeyboard]):
14         (-[WKContentView _stopAssistingNode]):
15
16         Dismiss the number pad, if it is present.
17
18         (-[WKContentView dismissNumberPadViewController:]):
19         (-[WKContentView presentNumberPadViewController:]):
20
21         Add new helpers for showing and hiding the number pad view controller.
22
23         (-[WKContentView presentViewControllerForAssistedNode:]):
24         (-[WKContentView textInputController:didRequestDismissalWithAction:]):
25
26         Dismiss the number pad, if it is present.
27
28         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
29         (-[WKContentView shouldPresentTextInputViewController:]): Deleted.
30
31         Remove -shouldPresentTextInputViewController and replace it with -presentViewControllerForAssistedNode:, which
32         presents the appropriate view controller given "assisted" node information.
33
34         * UIProcess/ios/forms/WKNumberPadView.h: Added.
35         * UIProcess/ios/forms/WKNumberPadView.mm: Added.
36         * UIProcess/ios/forms/WKNumberPadViewController.h: Added.
37         * UIProcess/ios/forms/WKNumberPadViewController.mm: Added.
38
39         Add "WebKitAdditions harness" files for the new number pad view and view controller classes.
40
41         * WebKit.xcodeproj/project.pbxproj:
42
43 2018-02-05  Youenn Fablet  <youenn@apple.com>
44
45         Add logging to CacheStorageEngineConnection
46         https://bugs.webkit.org/show_bug.cgi?id=182456
47
48         Reviewed by Chris Dumez.
49
50         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
51         (WebKit::CacheStorageEngineConnection::open):
52         (WebKit::CacheStorageEngineConnection::remove):
53         (WebKit::CacheStorageEngineConnection::caches):
54         (WebKit::CacheStorageEngineConnection::retrieveRecords):
55         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
56         (WebKit::CacheStorageEngineConnection::putRecords):
57         (WebKit::CacheStorageEngineConnection::reference):
58         (WebKit::CacheStorageEngineConnection::dereference):
59         * Platform/Logging.h:
60
61 2018-02-05  Daniel Bates  <dabates@apple.com>
62
63         REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart
64         https://bugs.webkit.org/show_bug.cgi?id=182491
65         <rdar://problem/36533447>
66
67         Reviewed by Brent Fulgham.
68
69         Exempt Nike from the XHR header restrictions in r222795.
70
71         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
72         However Nike also depends on such functionality.
73
74         * UIProcess/API/Cocoa/WKWebView.mm:
75         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
76
77 2018-02-02  Brent Fulgham  <bfulgham@apple.com>
78
79         Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
80         https://bugs.webkit.org/show_bug.cgi?id=182455
81         <rdar://problem/36626601>
82
83         Reviewed by Chris Dumez.
84
85         Refactor "logCookieInformation" so that it can be used for resource loads and DOM cookie
86         manipulation. Place the generally useful logic in a static method that can be invoked
87         from other places in the NetworkProcess.
88
89         Call the new refactored method from NetworkConnectionToWebProcess::setCookiesFromDOM so
90         we can perform logging there as well.
91
92         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
93         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Call the new logging method
94         (when enabled).
95         * NetworkProcess/NetworkResourceLoader.cpp:
96         (WebKit::NetworkResourceLoader::shouldLogCookieInformation): Changed to static method.
97         (WebKit::escapeForJSON): Made a static function so it could be shared between multiple
98         methods.
99         (WebKit::NetworkResourceLoader::logCookieInformation const): Refactor into two methods.
100         (WebKit::NetworkResourceLoader::logCookieInformation): Ditto.
101         (WebKit::NetworkResourceLoader::shouldLogCookieInformation const): Deleted.
102         * NetworkProcess/NetworkResourceLoader.h:
103         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
104         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Switch to user-enabled release logging
105         to track partitioning and blocking behavior.
106
107 2018-02-05  John Wilander  <wilander@apple.com>
108
109         Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
110         https://bugs.webkit.org/show_bug.cgi?id=181601
111         <rdar://problem/36475837>
112
113         Reviewed by Alex Christensen.
114
115         http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
116         was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
117         it's possible to check access even if a frame doesn't respond timely to
118         postMessage after detach and attach.
119
120         * NetworkProcess/NetworkProcess.cpp:
121         (WebKit::NetworkProcess::getAllStorageAccessEntries):
122         * NetworkProcess/NetworkProcess.h:
123         * NetworkProcess/NetworkProcess.messages.in:
124         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
125         (-[WKWebsiteDataStore _getAllStorageAccessEntries:]):
126         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
127         * UIProcess/Network/NetworkProcessProxy.cpp:
128         (WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
129         (WebKit::NetworkProcessProxy::allStorageAccessEntriesResult):
130         * UIProcess/Network/NetworkProcessProxy.h:
131         * UIProcess/Network/NetworkProcessProxy.messages.in:
132         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
133         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
134         * UIProcess/WebsiteData/WebsiteDataStore.h:
135
136 2018-02-05  Daniel Bates  <dabates@apple.com>
137
138         Disallow evaluating JavaScript from NPP_Destroy() in WebKit
139         https://bugs.webkit.org/show_bug.cgi?id=181889
140         <rdar://problem/36674701>
141
142         Reviewed by Brent Fulgham.
143
144         Make the behavior of WebKit match the behavior of WebKitLegacy on Mac.
145
146         * Shared/Plugins/NPObjectMessageReceiver.cpp:
147         (WebKit::NPObjectMessageReceiver::hasMethod):
148         (WebKit::NPObjectMessageReceiver::invoke):
149         (WebKit::NPObjectMessageReceiver::invokeDefault):
150         (WebKit::NPObjectMessageReceiver::hasProperty):
151         (WebKit::NPObjectMessageReceiver::getProperty):
152         (WebKit::NPObjectMessageReceiver::setProperty):
153         (WebKit::NPObjectMessageReceiver::removeProperty):
154         (WebKit::NPObjectMessageReceiver::enumerate):
155         (WebKit::NPObjectMessageReceiver::construct):
156         Bail out if the plugin is executing NPP_Destroy().
157
158         * WebProcess/Plugins/Plugin.cpp:
159         (WebKit::Plugin::destroyPlugin):
160         * WebProcess/Plugins/Plugin.h:
161         (WebKit::Plugin::isBeingDestroyed const):
162         Move bookkeeping of whether the plugin is being destroyed from PluginView
163         to here. This makes it straightforward for NPObjectMessageReceiver to query
164         this information.
165
166         * WebProcess/Plugins/PluginView.cpp:
167         (WebKit::PluginView::~PluginView):
168         (WebKit::PluginView::destroyPluginAndReset):
169         (WebKit::PluginView::recreateAndInitialize):
170         (WebKit::PluginView::protectPluginFromDestruction):
171         (WebKit::PluginView::unprotectPluginFromDestruction):
172         Move bookkeeping of whether the plugin is being destroyed from here
173         to Plugin.
174
175         * WebProcess/Plugins/PluginView.h:
176         (WebKit::PluginView::isBeingDestroyed const): Turn around and ask the plugin if it
177         is being destroyed, if we have one.
178
179 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
180
181         WebDriver: addCookie command should prepend a dot to domain if missing
182         https://bugs.webkit.org/show_bug.cgi?id=182328
183         <rdar://problem/37116398>
184
185         Reviewed by Michael Catanzaro.
186
187         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
188
189         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
190
191         * UIProcess/Automation/WebAutomationSession.cpp:
192         (WebKit::WebAutomationSession::addSingleCookie):
193
194 2018-02-03  Tim Horton  <timothy_horton@apple.com>
195
196         UI process sometimes crashes under -[WKContentView _lookupForWebView:]
197         https://bugs.webkit.org/show_bug.cgi?id=182460
198         <rdar://problem/33260602>
199
200         Reviewed by Wenson Hsieh.
201
202         * UIProcess/ios/WKContentViewInteraction.mm:
203         (-[WKContentView _lookupForWebView:]):
204         If you have a range selection, but no rects for the selection, retrieving
205         the 0th element of selectionRects will crash the UI process. To fix, in
206         this case, use the rect for the starting caret instead.
207
208         It doesn't seem like the presentationRect is actually currently used for
209         the Lookup service, so the only impact is that we shouldn't crash anymore.
210
211 2018-02-02  Michael Catanzaro  <mcatanzaro@igalia.com>
212
213         Remove remaining dead !USE(NETWORK_SESSION) code
214         https://bugs.webkit.org/show_bug.cgi?id=182451
215
216         Reviewed by Alex Christensen.
217
218         DownloadCurl.cpp and AuthenticationManagerSoup.cpp have been dead code since NETWORK_SESSION
219         became mandatory.
220
221         * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Removed.
222         * PlatformGTK.cmake:
223         * PlatformWPE.cmake:
224         * PlatformWin.cmake:
225         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Removed.
226
227 2018-02-02  Youenn Fablet  <youenn@apple.com>
228
229         CacheStorage should check for origin file presence when computing the origin of a folder
230         https://bugs.webkit.org/show_bug.cgi?id=182454
231
232         Reviewed by Chris Dumez.
233
234         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.
235         We should be checking the origin filename anyway since we will be reading it afterwards.
236
237         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
238         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
239
240 2018-02-02  Youenn Fablet  <youenn@apple.com>
241
242         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
243         https://bugs.webkit.org/show_bug.cgi?id=182403
244         <rdar://problem/36673358>
245
246         Reviewed by Alex Christensen.
247
248         * UIProcess/WebProcessPool.cpp:
249         (WebKit::legacyWebsiteDataStoreConfiguration): Setting serviceWorkerRegistrationDirectory for legacy stores.
250
251 2018-02-02  Youenn Fablet  <youenn@apple.com>
252
253         Clearing all service worker registrations should wait for importing service worker registration to finish
254         https://bugs.webkit.org/show_bug.cgi?id=182407
255
256         Reviewed by Chris Dumez.
257
258         Updating API to take a completion handler.
259
260         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
261         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
262         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
263
264 2018-02-02  Fujii Hironori  <Hironori.Fujii@sony.com>
265
266         [Win] MSVC doesn't seem to like "friend class NeverDestroyed<Foo>"
267         https://bugs.webkit.org/show_bug.cgi?id=182081
268
269         Reviewed by Yusuke Suzuki.
270
271         The template friend class, which belongs to a different namespace,
272         can't access private member if its friend declaration is specified
273         without the namespace and with class keyword.
274
275         Replaced "friend class NeverDestroyed<Foo>" with "friend NeverDestroyed<Foo>".
276
277         * NetworkProcess/NetworkProcess.h:
278         * NetworkProcess/capture/NetworkCaptureManager.h:
279         * PluginProcess/PluginProcess.h:
280         * Shared/CallbackID.h:
281         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
282         * StorageProcess/StorageProcess.h:
283         * UIProcess/Plugins/PluginProcessManager.h:
284         * UIProcess/Plugins/gtk/PluginInfoCache.h:
285         * UIProcess/WebPageProxy.cpp:
286         * UIProcess/WebPasteboardProxy.h:
287         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
288         * UIProcess/gtk/HardwareAccelerationManager.h:
289         * UIProcess/gtk/WaylandCompositor.h:
290         * UIProcess/linux/MemoryPressureMonitor.h:
291         * UIProcess/mac/ServicesController.h:
292         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
293         * WebProcess/Plugins/WebPluginInfoProvider.h:
294         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h:
295         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
296
297 2018-02-02  Youenn Fablet  <youenn@apple.com>
298
299         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
300         https://bugs.webkit.org/show_bug.cgi?id=182403
301
302         Reviewed by Alex Christensen.
303
304         WebsiteDataStore is the place to set configuration information such as service worker registration path.
305         This patch updates WebKit code accordingly.
306         By default, the service worker registration path is in a Caches subfolder, similarly to cache API path.
307
308         * UIProcess/API/APIProcessPoolConfiguration.cpp:
309         (API::ProcessPoolConfiguration::createWithLegacyOptions):
310         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
311         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
312         (API::ProcessPoolConfiguration::copy):
313         * UIProcess/API/APIProcessPoolConfiguration.h:
314         * UIProcess/API/C/WKContextConfigurationRef.cpp:
315         (WKContextConfigurationCopyServiceWorkerDatabaseDirectory): Deleted.
316         (WKContextConfigurationSetServiceWorkerDatabaseDirectory): Deleted.
317         * UIProcess/API/C/WKContextConfigurationRef.h:
318         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
319         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
320         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
321         (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
322         (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
323         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
324         * UIProcess/WebProcessPool.cpp:
325         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
326         (WebKit::WebProcessPool::initializeNewWebProcess):
327         * UIProcess/WebsiteData/WebsiteDataStore.h:
328         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
329         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
330         * UIProcess/gtk/WebProcessPoolGtk.cpp:
331         * UIProcess/gtk/WebProcessPoolWPE.cpp:
332
333 2018-02-02  Wenson Hsieh  <wenson_hsieh@apple.com>
334
335         [Extra Zoom Mode] Implement support for indirect mainframe scrolling
336         https://bugs.webkit.org/show_bug.cgi?id=182421
337         <rdar://problem/35142694>
338
339         Reviewed by Tim Horton.
340
341         Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for
342         zooming. See below for more details.
343
344         * UIProcess/API/Cocoa/WKWebView.mm:
345
346         Remove a now-unneeded WebKitAdditions import.
347
348         * UIProcess/ios/WKScrollView.mm:
349         (-[WKScrollView initWithFrame:]):
350
351         Add imports for -Before and -After versions of WKScrollViewAdditions.
352
353         (-[WKScrollView addGestureRecognizer:]):
354
355         Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized.
356         I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture
357         recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in
358         -initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths.
359
360 2018-02-01  Tim Horton  <timothy_horton@apple.com>
361
362         WebKit fails to build (_startAssistingNode has conflicting parameters)
363         https://bugs.webkit.org/show_bug.cgi?id=182417
364         <rdar://problem/36965318>
365
366         Reviewed by Dan Bernstein.
367
368         * UIProcess/ios/WKContentViewInteraction.h:
369         Use Big BOOL like in the implementation.
370
371 2018-02-01  Brent Fulgham  <bfulgham@apple.com>
372
373         Improve NetworkResourceLogger to report blocked (versus non-partitioned) cookies
374         https://bugs.webkit.org/show_bug.cgi?id=182408
375         <rdar://problem/36918028>
376
377         Reviewed by Chris Dumez.
378
379         Update the logging method to report blocked origins, rather than logging them as non-partitioned
380         loads that have no cookies or other content.
381
382         * NetworkProcess/NetworkResourceLoader.cpp:
383         (WebKit::NetworkResourceLoader::logCookieInformation const):
384
385 2018-02-01  David Kilzer  <ddkilzer@apple.com>
386
387         REGRESSION (r222824): UI process crashes in WebKit::WebBackForwardList::backItem const
388         <https://webkit.org/b/182409>
389         <rdar://problem/35495094>
390
391         Reviewed by Alex Christensen.
392
393         * UIProcess/WebBackForwardList.cpp:
394         (WebKit::WebBackForwardList::goToItem): Fix typo so the for loop
395         actually checks each value in m_entries.
396
397 2018-02-01  Youenn Fablet  <youenn@apple.com>
398
399         Delay service worker process creation until actually needed by SWServer
400         https://bugs.webkit.org/show_bug.cgi?id=182301
401
402         Reviewed by Chris Dumez.
403
404         Do not create a service worker process at creation of the first SWServerConnection.
405         Wait for a WebProcess message that needs it:
406         - postMessage message
407         - fetchEvent message
408         - job scheduling.
409
410         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
411         (WebKit::WebSWServerConnection::startFetch):
412         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
413         (WebKit::WebSWServerConnection::scheduleJobInServer):
414         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
415         * StorageProcess/StorageToWebProcessConnection.cpp:
416         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
417
418 2018-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
419
420         [Extra zoom mode] Implement basic support for interacting with text form controls
421         https://bugs.webkit.org/show_bug.cgi?id=182401
422         <rdar://problem/35143035>
423
424         Reviewed by Tim Horton.
425
426         Add UI support for interacting with and editing text form controls when extra zoom mode is enabled. See below
427         for more details.
428
429         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
430         (-[WKWebViewConfiguration init]):
431         (-[WKWebViewConfiguration encodeWithCoder:]):
432         (-[WKWebViewConfiguration initWithCoder:]):
433         (-[WKWebViewConfiguration copyWithZone:]):
434         (-[WKWebViewConfiguration _textInteractionGesturesEnabled]):
435         (-[WKWebViewConfiguration _setTextInteractionGesturesEnabled:]):
436         (-[WKWebViewConfiguration _longPressActionsEnabled]):
437         (-[WKWebViewConfiguration _setLongPressActionsEnabled:]):
438
439         Introduce two new web view configuration flags: `textInteractionGesturesEnabled` and `longPressActionsEnabled`.
440         The former determines whether text interaction gestures (i.e. text selection, moving the caret, showing UI for
441         IME, etc.) are enabled. The latter determines whether or not long press actions (i.e. touch callout, share
442         sheet, etc.) are enabled. These are disabled by default only in extra zoom mode.
443
444         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
445         * UIProcess/WebPageProxy.cpp:
446         (WebKit::WebPageProxy::setTextAsync):
447
448         Add a way to set the text value of a currently edited text form control. This will either set the text value of
449         an input, a. la. autofill, or overwrite the contents of a contenteditable area by selecting everything and
450         inserting the given text.
451
452         * UIProcess/WebPageProxy.h:
453         (WebKit::WebPageProxy::focusNextAssistedNode):
454
455         Add a default argument for the completion callback.
456
457         * UIProcess/ios/WKContentViewInteraction.h:
458         * UIProcess/ios/WKContentViewInteraction.mm:
459         (-[WKContentView setupInteraction]):
460         (-[WKContentView _displayFormNodeInputView]):
461         (-[WKContentView _actionForLongPressFromPositionInformation:]):
462         (-[WKContentView hasSelectablePositionAtPoint:]):
463         (-[WKContentView pointIsNearMarkedText:]):
464         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
465         (-[WKContentView insertionPointColor]):
466
467         Respect the web view configuration flags above by bailing early from text interaction and long press action
468         sheet methods.
469
470         (-[WKContentView _startAssistingKeyboard]):
471         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
472
473         Add a flag indicating whether we are in the process of changing focus from one node to another. We use this to
474         decide whether or not we want to present the text input view controller right away, or just reload the focused
475         form control overlay. When we stop "assisting" a node, we also keep the focused form control overlay up if we're
476         only changing focus to another form control.
477
478         (-[WKContentView _stopAssistingNode]):
479         (-[WKContentView presentFocusedFormControlViewController:]):
480         (-[WKContentView dismissFocusedFormControlViewController:]):
481         (-[WKContentView shouldPresentTextInputViewController:]):
482         (-[WKContentView presentTextInputViewController:]):
483         (-[WKContentView dismissTextInputViewController:]):
484
485         Introduce helpers for managing presentation of the focused form control overlay and text input view controller.
486         All -present and -dismiss helpers here are idempotent. These view controllers are presented from the content
487         view's view controller for fullscreen presentation.
488
489         (-[WKContentView textInputController:didCommitText:]):
490         (-[WKContentView textInputController:didRequestDismissalWithAction:]):
491         (-[WKContentView focusedFormControlControllerDidSubmit:]):
492         (-[WKContentView focusedFormControlControllerDidCancel:]):
493         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
494         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]):
495         (-[WKContentView actionNameForFocusedFormControlController:]):
496         (-[WKContentView focusedFormControlControllerDidRequestNextNode:]):
497         (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]):
498         (-[WKContentView hasNextNodeForFocusedFormControlController:]):
499         (-[WKContentView hasPreviousNodeForFocusedFormControlController:]):
500
501         Implement delegate methods for the focused form control and text input view controllers. This mainly involves
502         straightforward plumbing of pieces of AssistedNodeInformation on the content view.
503
504         (-[WKContentView pointIsInAssistedNode:]): Deleted.
505
506         Remove a method that was still implemented only for binary compatibility with iOS 10.
507
508         * WebProcess/WebPage/WebPage.cpp:
509         (WebKit::WebPage::setTextAsync):
510         * WebProcess/WebPage/WebPage.h:
511         * WebProcess/WebPage/WebPage.messages.in:
512
513 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
514
515         [GTK] Shift + mouse scroll should scroll horizontally
516         https://bugs.webkit.org/show_bug.cgi?id=181629
517
518         Reviewed by Michael Catanzaro.
519
520         Swap scroll direction when Shift is pressed for consistency with GtkScrolledWindow.
521
522         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
523         (webkitWebViewBaseScrollEvent):
524
525 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
526
527         REGRESSION(r227893): fast/events/touch/touch-stale-node-crash.html and other tests crash
528         https://bugs.webkit.org/show_bug.cgi?id=182350
529
530         Reviewed by Carlos Alberto Lopez Perez.
531
532         Ensure events synthesized from touch gestures have a valid window, screen and device.
533
534         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
535         * UIProcess/gtk/GestureController.h: Add virtual destructor to GestureControllerclient.
536
537 2018-01-31  Simon Fraser  <simon.fraser@apple.com>
538
539         Use different debug red colors for different contexts
540         https://bugs.webkit.org/show_bug.cgi?id=182362
541
542         Reviewed by Tim Horton.
543         
544         Pure red is used elsehwere in the system as a debug color indicator, so use different
545         shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
546         so they are identifiable.
547
548         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
549         (WebKit::RemoteLayerBackingStore::drawInContext):
550
551 2018-01-31  Don Olmstead  <don.olmstead@sony.com>
552
553         [CMake] Make JavaScriptCore headers copies
554         https://bugs.webkit.org/show_bug.cgi?id=182303
555
556         Reviewed by Alex Christensen.
557
558         * CMakeLists.txt:
559         * Scripts/generate-forwarding-headers.pl:
560
561 2018-01-31  Alex Christensen  <achristensen@webkit.org>
562
563         Unreviewed, rolling out r227942.
564
565         r227875 should not have been rolled out.
566
567         Reverted changeset:
568
569         "Unreviewed, rolling out r227875."
570         https://bugs.webkit.org/show_bug.cgi?id=182357
571         https://trac.webkit.org/changeset/227942
572
573 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
574
575         Unreviewed, rolling out r227875.
576         https://bugs.webkit.org/show_bug.cgi?id=182357
577
578         Missing cross-platform TestController implementation
579
580         Reverted changeset:
581
582         "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
583         https://bugs.webkit.org/show_bug.cgi?id=181958
584         https://trac.webkit.org/changeset/227875
585
586         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
587         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
588         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
589         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
590         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
591         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
592         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
593         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
594         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
595         * UIProcess/WebResourceLoadStatisticsStore.cpp:
596         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
597         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
598         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
599         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
600         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
601         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
602         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
603         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
604         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
605         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
606         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
607         * UIProcess/WebResourceLoadStatisticsStore.h:
608
609 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
610
611         Follow-up to r227939.
612         https://bugs.webkit.org/show_bug.cgi?id=182354
613         <rdar://problem/37046844>
614
615         Make sure the correct sandbox is used on iOS as well.
616
617         * StorageProcess/ios/StorageProcessIOS.mm:
618         (WebKit::StorageProcess::initializeSandbox):
619
620 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
621
622         REGRESSION(r220094): com.apple.WebKit.Storage lost its sandbox
623         https://bugs.webkit.org/show_bug.cgi?id=182354
624         <rdar://problem/37046844>
625
626         Reviewed by Ryosuke Niwa.
627
628         The Database process was renamed to Storage, but it's sandbox was not updated.
629
630         * Configurations/WebKit.xcconfig: Update for sandbox rename.
631         * DerivedSources.make: Ditto.
632         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Removed.
633         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Copied from Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.
634         * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Removed.
635         * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Copied from StorageProcess/mac/com.apple.WebKit.Databases.sb.in.
636         * WebKit.xcodeproj/project.pbxproj: Update for sandbox rename.
637
638 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
639
640         REGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html, http/tests/resourceLoadStatistics/grandfathering.html timing out on GTK, WPE
641         https://bugs.webkit.org/show_bug.cgi?id=182222
642
643         Reviewed by Alex Christensen.
644
645         Add callbacks to notify when resource load statistics deletion is complete.
646
647         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
648         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
649         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
650         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
651
652 2018-01-31  Tim Horton  <timothy_horton@apple.com>
653
654         Occasional null deref under WebPageProxy::updateBackingStoreDiscardableState()
655         https://bugs.webkit.org/show_bug.cgi?id=182349
656         <rdar://problem/27822258>
657
658         Reviewed by Simon Fraser.
659
660         * UIProcess/WebPageProxy.cpp:
661         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
662         m_drawingArea can be null during process launch and relaunch.
663
664         Cocoa ports don't use the result of setBackingStoreIsDiscardable(),
665         but they do run this code to keep it up to date.
666
667 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
668
669         [GTK] Move gir and typelib generation into ENABLE_INTROSPECTION conditional
670         https://bugs.webkit.org/show_bug.cgi?id=182308
671
672         Reviewed by Carlos Garcia Campos.
673
674         * PlatformGTK.cmake:
675
676 2018-01-31  Youenn Fablet  <youenn@apple.com>
677
678         Remove StorageToWebProcessConnection::removeSWServerConnection
679         https://bugs.webkit.org/show_bug.cgi?id=182305
680
681         Reviewed by Chris Dumez.
682
683         * StorageProcess/StorageToWebProcessConnection.cpp:
684         (WebKit::StorageToWebProcessConnection::removeSWServerConnection): Deleted.
685         * StorageProcess/StorageToWebProcessConnection.h:
686         * StorageProcess/StorageToWebProcessConnection.messages.in:
687
688 2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
689
690         REGRESSION(r227544): [GTK] contextMenuEvent is NULL on CONTEXT_MENU call
691         https://bugs.webkit.org/show_bug.cgi?id=182224
692
693         Reviewed by Michael Catanzaro.
694
695         Move the gestures handling to WebKitWebViewBase. This patch adds GestureControllerClient class, created and
696         implemented by WebKitWebViewBase and used by GestureController instead of the WebPageProxy. This way we ensure
697         events are handled consistently.
698
699         * UIProcess/API/gtk/PageClientImpl.cpp:
700         (WebKit::PageClientImpl::doneWithTouchEvent): Cast the GdkEvent since GestureController no longer works wirth
701         const GdkEvents.
702         (WebKit::PageClientImpl::zoom): Use webkit_web_view_set_zoom_level() in case of WebKitWebView or
703         WebPageProxy::setPageZoomFactor() otherwise.
704         * UIProcess/API/gtk/PageClientImpl.h:
705         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
706         (ClickCounter::currentClickCountForGdkButtonEvent): Receive a GdkEvent to avoid casts.
707         (webkitWebViewBaseHandleMouseEvent): Helper function to handle mouse events.
708         (webkitWebViewBaseButtonPressEvent): Use webkitWebViewBaseHandleMouseEvent.
709         (webkitWebViewBaseButtonReleaseEvent): Ditto.
710         (webkitWebViewBaseHandleWheelEvent): Helper function to handle wheel events.
711         (webkitWebViewBaseScrollEvent): Use webkitWebViewBaseHandleWheelEvent.
712         (webkitWebViewBaseMotionNotifyEvent): Use webkitWebViewBaseHandleMouseEvent.
713         (webkitWebViewBaseCrossingNotifyEvent): Ditto.
714         (webkitWebViewBaseGestureController): Pass the widget and client to GestureController.
715         * UIProcess/gtk/GestureController.cpp:
716         (WebKit::GestureController::GestureController): Receives a widget and client now.
717         (WebKit::GestureController::handleEvent): Remove the const.
718         (WebKit::GestureController::Gesture::Gesture): Initialize client.
719         (WebKit::GestureController::Gesture::handleEvent): Remove the const.
720         (WebKit::GestureController::DragGesture::startDrag): Use the client instead of WebPageProxy.
721         (WebKit::GestureController::DragGesture::handleDrag): Ditto.
722         (WebKit::GestureController::DragGesture::handleTap): Ditto.
723         (WebKit::GestureController::DragGesture::begin): Ignore the const returned by gtk_gesture_get_last_event().
724         (WebKit::GestureController::DragGesture::update): Ditto.
725         (WebKit::GestureController::DragGesture::end): Ditto.
726         (WebKit::GestureController::DragGesture::DragGesture): Receives a widget and client now.
727         (WebKit::GestureController::SwipeGesture::startMomentumScroll): Use the client instead of WebPageProxy.
728         (WebKit::GestureController::SwipeGesture::swipe): Ignore the const returned by gtk_gesture_get_last_event().
729         (WebKit::GestureController::SwipeGesture::SwipeGesture): Receives a widget and client now.
730         (WebKit::GestureController::ZoomGesture::begin): Start the zoom.
731         (WebKit::GestureController::ZoomGesture::startZoom): Use the client instead of WebPageProxy.
732         (WebKit::GestureController::ZoomGesture::handleZoom): Ditto.
733         (WebKit::GestureController::ZoomGesture::ZoomGesture): Receives a widget and client now.
734         (WebKit::GestureController::LongPressGesture::longPressed): Use the client instead of WebKitWebView.
735         (WebKit::GestureController::LongPressGesture::pressed): Ignore the const returned by gtk_gesture_get_last_event().
736         (WebKit::GestureController::LongPressGesture::LongPressGesture): Receives a widget and client now.
737         (WebKit::GestureController::Gesture::simulateMouseClick): Deleted.
738         (WebKit::createScrollEvent): Deleted.
739         * UIProcess/gtk/GestureController.h:
740
741 2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
742
743         Web Automation: cookies returned by automation should have expiry time in seconds
744         https://bugs.webkit.org/show_bug.cgi?id=182293
745
746         Reviewed by Brian Burg.
747
748         When creating a WebCore::Cookie from a WebDriver object we convert the given expiry time to milliseconds, but
749         when creating a WebDriver object from a WebCore::Cookie we are keeping the milliseconds. We should convert to
750         seconds for consistency, so that the WebDriver always handles seconds.
751
752         Fixes: imported/w3c/webdriver/tests/cookies/get_named_cookie.py::test_get_named_cookie
753
754         * UIProcess/Automation/WebAutomationSession.cpp:
755         (WebKit::buildObjectForCookie): Convert expiry to seconds.
756
757 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
758
759         Unreviewed iOS build fix.
760
761         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
762
763 2018-01-30  John Wilander  <wilander@apple.com>
764
765         Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()
766         https://bugs.webkit.org/show_bug.cgi?id=181958
767         https://bugs.webkit.org/show_bug.cgi?id=182072
768         <rdar://problem/36801804>
769         <rdar://problem/36845795>
770
771         Reviewed by Brent Fulgham.
772
773         Because of the asynchronous nature of XPC and cookies,
774         we need callbacks in these TestRunner functions so that
775         the layout tests can wait for state changes to finish
776         before checking test conditions.
777
778         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
779         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
780         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
781         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
782         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
783         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]):
784         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
785         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]):
786         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
787         * UIProcess/WebResourceLoadStatisticsStore.cpp:
788         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
789         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
790         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
791         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
792         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
793         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
794         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
795         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
796         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
797         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
798         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
799         * UIProcess/WebResourceLoadStatisticsStore.h:
800
801 2018-01-30  Ryosuke Niwa  <rniwa@webkit.org>
802
803         REGRESSION(r227550): Resource timing API is disabled on macOS
804         https://bugs.webkit.org/show_bug.cgi?id=182318
805
806         Reviewed by Chris Dumez.
807
808         Resource timing API should be enabled by default all versions of macOS we support now.
809
810         * Shared/WebPreferences.yaml:
811         * Shared/WebPreferencesDefaultValues.h:
812
813 2018-01-30  Tim Horton  <timothy_horton@apple.com>
814
815         WKWebView layout is sometimes wrong after rotation on iPhone X
816         https://bugs.webkit.org/show_bug.cgi?id=182304
817         <rdar://problem/34158671>
818
819         Reviewed by Simon Fraser.
820
821         * Platform/spi/ios/UIKitSPI.h:
822         * UIProcess/API/Cocoa/WKWebView.mm:
823         (-[WKWebView _computedContentInset]):
824         (-[WKWebView _scrollViewSystemContentInset]):
825         (activeMinimumLayoutSize):
826         It turns out that it is not always safe to look at the safe area insets of
827         children from inside layoutSubviews, even after the call to super.
828
829         Instead, make use of the fact that WKScrollView and WKWebView have identical
830         coordinate spaces, and map WKWebView's safe area insets into the WKScrollView.
831         It's safe to use the scroll view's affected-edges and contentScrollInset,
832         because those aren't updated at the same outside-of-layout time that
833         safe area insets are.
834
835         We could alternatively move all calls to activeMinimumLayoutSize outside
836         of layoutSubviews, but that seems like a larger and riskier change.
837
838         All attempts to write a test have failed; this depends heavily on use of
839         autolayout and the mechanism by which the system updates system-owned
840         safe area insets during device rotation.
841
842 2018-01-30  Don Olmstead  <don.olmstead@sony.com>
843
844         JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
845         https://bugs.webkit.org/show_bug.cgi?id=182312
846
847         Reviewed by Michael Catanzaro.
848
849         * config.h:
850
851 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
852
853         Add telemetry to track storage access API adoption
854         https://bugs.webkit.org/show_bug.cgi?id=182197
855         <rdar://problem/35803309>
856
857         Reviewed by Chris Dumez.
858
859         Part 2: Add telemetry for the Storage Access API case
860
861         This change increments a counter when an origin is loaded in a first part context because
862         it was granted Storage Access API permissions.
863
864         * NetworkProcess/NetworkResourceLoader.cpp:
865         (WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate
866         loads that happened with the Storage Access API enabled.
867         * UIProcess/WebResourceLoadStatisticsStore.cpp:
868         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for
869         loads using the new API.
870
871 2018-01-30  Megan Gardner  <megan_gardner@apple.com>
872
873         Make preserve and restore focus more likely to be symmetrical
874         https://bugs.webkit.org/show_bug.cgi?id=182264
875         <rdar://problem/36948473>
876         
877         Reviewed by Tim Horton.
878
879         Keep a stack of if we actually increment the focusState, so that
880         changes to the web content do not result in asymmetric decrements to the focus state. 
881         To work around problems associated with <rdar://problem/37000122>.
882
883         * UIProcess/ios/WKContentViewInteraction.h:
884         * UIProcess/ios/WKContentViewInteraction.mm:
885         (-[WKContentView _restoreFocusWithToken:]):
886         (-[WKContentView _preserveFocusWithToken:destructively:]):
887
888 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
889
890         Add telemetry to track storage access API adoption
891         https://bugs.webkit.org/show_bug.cgi?id=182197
892         <rdar://problem/35803309>
893
894         Reviewed by Chris Dumez.
895         
896         This patch also handled aggregating the counts in the UIProcess, which has access to
897         the right data.
898
899         The original patch assumed the WebContent process kept track of user interaction. This is
900         only tracked in the UIProcess, so we can get rid of some of the logging code adding in
901         r227755.
902
903         * Shared/WebProcessCreationParameters.cpp:
904         (WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not
905         needed to track the statistics.
906         (WebKit::WebProcessCreationParameters::decode): Ditto.
907         * Shared/WebProcessCreationParameters.h:
908         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
909         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
910         * UIProcess/WebResourceLoadStatisticsStore.cpp:
911         (WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from
912         the WebContent process, which does not keep track of user interaction.
913         (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing
914         the statistics.
915         * UIProcess/WebResourceLoadStatisticsStore.h:
916         * WebProcess/WebProcess.cpp:
917         (WebKit::WebProcess::initializeWebProcess):
918
919 2018-01-30  Chris Dumez  <cdumez@apple.com>
920
921         Make sure we never create a WebSWClientConnection with an invalid sessionID
922         https://bugs.webkit.org/show_bug.cgi?id=182276
923         <rdar://problem/36582633>
924
925         Reviewed by Alex Christensen.
926
927         Make sure we never create a WebSWClientConnection with an invalid sessionID as this
928         could corrupt our hash tables.
929
930         * StorageProcess/StorageProcess.cpp:
931         (WebKit::StorageProcess::swServerForSession):
932         * UIProcess/WebProcessPool.cpp:
933         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
934         * WebProcess/Storage/WebSWClientConnection.cpp:
935         (WebKit::WebSWClientConnection::WebSWClientConnection):
936         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
937         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
938         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
939         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
940         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
941
942 2018-01-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>
943
944         [WinCairo] Fix forwarding header conflict of WebKit on WinCairo
945         https://bugs.webkit.org/show_bug.cgi?id=177202
946
947         Reviewed by Alex Christensen.
948
949         * PlatformWin.cmake:
950
951 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
952
953         WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
954         https://bugs.webkit.org/show_bug.cgi?id=180350
955
956         Reviewed by Carlos Alberto Lopez Perez.
957
958         undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
959         case to return an empty string. We currently handle this case for execute script commands, but not in all other
960         cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
961         because in that case we wouldn't need to handle it as a special case.
962
963         15.2 Executing Script
964         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone
965
966         Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent
967
968         * WebProcess/Automation/WebAutomationSessionProxy.js:
969         (let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.
970
971 2018-01-29  Ryosuke Niwa  <rniwa@webkit.org>
972
973         Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent
974         https://bugs.webkit.org/show_bug.cgi?id=182273
975
976         Reviewed by Chris Dumez.
977
978         The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for
979         the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame,
980         it's not safe to execute arbitrary code.
981
982         Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566.
983
984         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
985         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
986
987 2018-01-29  Wenson Hsieh  <wenson_hsieh@apple.com>
988
989         Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit
990         https://bugs.webkit.org/show_bug.cgi?id=182268
991         <rdar://problem/37003784>
992
993         Reviewed by Tim Horton and Dan Bernstein.
994
995         Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from
996         usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the
997         unlocalized resources directory. If the AdditionalResources directory does not exist in the build
998         directory, we fall back to searching the SDK.
999
1000         * WebKit.xcodeproj/project.pbxproj:
1001
1002 2018-01-29  Youenn Fablet  <youenn@apple.com>
1003
1004         ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses
1005         https://bugs.webkit.org/show_bug.cgi?id=182134
1006
1007         Reviewed by Chris Dumez.
1008
1009         As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection.
1010         This is also consistent with SubresourceLoader::didReceiveResponse.
1011
1012         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1013         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1014
1015 2018-01-29  Youenn Fablet  <youenn@apple.com>
1016
1017         Cache API should make sure to resolve caches.open promises in the same order as called
1018         https://bugs.webkit.org/show_bug.cgi?id=182193
1019         <rdar://problem/36930363>
1020
1021         Reviewed by Chris Dumez.
1022
1023         Covered by added test.
1024         Whenever opening/removing a cache requires writing to disk, wait to finish the task
1025         until any disk writing task is done.
1026         Applying this strategy when clearing data so that we also clear data that is pending to be written.
1027         For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier.
1028         WebCore uses that information to return true/false as promise resolution value.
1029
1030         * NetworkProcess/cache/CacheStorageEngine.cpp:
1031         (WebKit::CacheStorage::Engine::retrieveCaches):
1032         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1033         (WebKit::CacheStorage::Caches::clear):
1034         (WebKit::CacheStorage::Caches::open):
1035         (WebKit::CacheStorage::Caches::remove):
1036         (WebKit::CacheStorage::Caches::writeCachesToDisk):
1037         (WebKit::CacheStorage::Caches::cacheInfos):
1038         (WebKit::CacheStorage::Caches::cacheInfos const): Deleted.
1039         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1040         (WebKit::CacheStorage::Caches::createWeakPtr):
1041
1042 2018-01-29  Alex Christensen  <achristensen@webkit.org>
1043
1044         Clean up API after bugs 178240 and 176474
1045         https://bugs.webkit.org/show_bug.cgi?id=182259
1046
1047         Reviewed by Dan Bernstein.
1048
1049         NS_OPTIONS should be NSUInteger, not NSInteger.  This is how all other NS_OPTIONS in WebKit are,
1050         and it's necessary if we get really big numbers as options.  Changing them won't cause binary
1051         incompatibility unless someone does signed integer comparison with currently invalid values.
1052
1053         Added availability macros I forgot to add earlier.
1054
1055         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1056         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1057
1058 2018-01-29  Jiewen Tan  <jiewen_tan@apple.com>
1059
1060         [WebAuthN] Add a compile-time feature flag
1061         https://bugs.webkit.org/show_bug.cgi?id=182211
1062         <rdar://problem/36936365>
1063
1064         Reviewed by Brent Fulgham.
1065
1066         * Configurations/FeatureDefines.xcconfig:
1067
1068 2018-01-29  John Wilander  <wilander@apple.com>
1069
1070         Resource Load Statistics: Introduce debug mode as experimental feature
1071         https://bugs.webkit.org/show_bug.cgi?id=182199
1072         <rdar://problem/36930364>
1073
1074         Reviewed by Alex Christensen.
1075
1076         The only changes to default behavior are:
1077         - Increased resolution on timestamps which is needed to be able to set shorter
1078           timeouts in debug mode.
1079         - Only update partitioning and blocking table when needed. This is an optimization
1080           which pays off in less XPC with shorter timeouts.
1081
1082         * Shared/WebPreferences.yaml:
1083         * UIProcess/API/APIWebsiteDataStore.cpp:
1084         (API::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
1085         (API::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1086         * UIProcess/API/APIWebsiteDataStore.h:
1087         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1088         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode):
1089         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1090         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1091         (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
1092         (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
1093         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1094         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1095         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
1096         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1097         * UIProcess/WebResourceLoadStatisticsStore.h:
1098         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1099         (WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
1100         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1101         * UIProcess/WebsiteData/WebsiteDataStore.h:
1102
1103 2018-01-29  Andy Estes  <aestes@apple.com>
1104
1105         [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
1106         https://bugs.webkit.org/show_bug.cgi?id=182252
1107         <rdar://problem/21555881>
1108
1109         Reviewed by Tim Horton.
1110
1111         * WebProcess/WebPage/WebPage.cpp:
1112         (WebKit::WebPage::dispatchTouchEvent):
1113         (WebKit::WebPage::updatePotentialTapSecurityOrigin):
1114
1115         Record the target frame origin of touch events that are potential taps, are
1116         TouchStart events, are targeted in frames that have touch event listeners, and are not
1117         handled by those listeners.
1118
1119         * WebProcess/WebPage/WebPage.h:
1120         * WebProcess/WebPage/ios/WebPageIOS.mm:
1121         (WebKit::WebPage::potentialTapAtPosition):
1122         (WebKit::WebPage::commitPotentialTap):
1123         (WebKit::WebPage::cancelPotentialTapInFrame):
1124
1125         Passed the target frame origin to Frame::nodeRespondingToClickEvents() then cleared it.
1126
1127 2018-01-29  Alex Christensen  <achristensen@webkit.org>
1128
1129         Make policy checks more robust against null pointer dereferencing
1130         https://bugs.webkit.org/show_bug.cgi?id=182263
1131         <rdar://problem/34895714>
1132
1133         Reviewed by Tim Horton.
1134
1135         We're still dereferencing null.  Check everything.
1136
1137         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1138         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1139
1140 2018-01-29  Brent Fulgham  <bfulgham@apple.com>
1141
1142         Add telemetry to track storage access API adoption
1143         https://bugs.webkit.org/show_bug.cgi?id=182197
1144         <rdar://problem/35803309>
1145
1146         Reviewed by Chris Dumez.
1147
1148         Part 1: Add telemetry for the user interaction case
1149         
1150         This patch adds telemetry to track how frequently third-party cookies are
1151         used in a first party context due to user interaction. This will help
1152         understand cases where the new Storage Access API can help, and to help
1153         us understand if we have considered relevant use cases in its design.
1154
1155         * Shared/WebProcessCreationParameters.cpp:
1156         (WebKit::WebProcessCreationParameters::encode const):
1157         (WebKit::WebProcessCreationParameters::decode):
1158         * Shared/WebProcessCreationParameters.h:
1159         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1160         (WebKit::WebProcessPool::platformInitializeWebProcess):
1161         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1162         (WebKit::sortedPrevalentResourceTelemetry): Update for new telemetry.
1163         (WebKit::submitTopList): Update for new data types.
1164         * WebProcess/WebProcess.cpp:
1165         (WebKit::WebProcess::initializeWebProcess): Handle the partitioning time
1166         passed from the UIProcess.
1167
1168 2018-01-29  Alex Christensen  <achristensen@webkit.org>
1169
1170         Fix crash when during canAuthenticateAgainstProtectionSpace
1171         https://bugs.webkit.org/show_bug.cgi?id=182260
1172         <rdar://problem/34911343>
1173
1174         Reviewed by Chris Dumez.
1175
1176         If we have a valid network load with no challenge completion handler and we are
1177         telling it to continue with the challenge handling, something has gone wrong.
1178         Maybe we've just recovered from a crashed network process.  If this happens, do nothing.
1179
1180         * NetworkProcess/NetworkLoad.cpp:
1181         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1182
1183 2018-01-29  Zach Li  <zacharyli323@gmail.com>
1184
1185         Warning in 32-bit WebKit build when trying to link to SafariSafeBrowsing
1186         https://bugs.webkit.org/show_bug.cgi?id=182251
1187         rdar://problem/36964995
1188
1189         Reviewed by Alex Christensen.
1190
1191         * Configurations/WebKit.xcconfig:
1192         Only link against SafariSafeBrowsing framework in 64-bit architecture.
1193
1194         * Platform/spi/Cocoa/SafeBrowsingSPI.h:
1195         Guard the Safe Browsing code with WK_API_ENABLED.
1196
1197 2018-01-29  Chris Dumez  <cdumez@apple.com>
1198
1199         Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC
1200         https://bugs.webkit.org/show_bug.cgi?id=182256
1201         <rdar://problem/36689233>
1202
1203         Reviewed by Simon Fraser.
1204
1205         Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC as
1206         this can lead to crashes such as the one in <rdar://problem/36689233>.
1207
1208         * WebProcess/Storage/WebSWClientConnection.cpp:
1209         (WebKit::WebSWClientConnection::WebSWClientConnection):
1210
1211 2018-01-29  Jan-Michael Brummer  <jan.brummer@tabos.org>
1212
1213         [GTK] Zooming gesture incorrectly uses scale instead of zoom 
1214         https://bugs.webkit.org/show_bug.cgi?id=182174
1215
1216         Reviewed by Michael Catanzaro.
1217
1218         Switch zooming gesture to use zoom instead of scale function.
1219
1220         * UIProcess/gtk/GestureController.cpp:
1221         (WebKit::GestureController::ZoomGesture::begin):
1222         (WebKit::GestureController::ZoomGesture::handleZoom):
1223
1224 2018-01-29  Brady Eidson  <beidson@apple.com>
1225
1226         Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
1227         https://bugs.webkit.org/show_bug.cgi?id=182229
1228
1229         Reviewed by Chris Dumez.
1230
1231         * UIProcess/UIMessagePortChannelProvider.cpp:
1232         (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
1233
1234         * UIProcess/WebPageProxy.cpp:
1235         (WebKit::m_configurationPreferenceValues): The UI process does not need to override the 
1236           global singleton provider. It can remain the default ProviderImpl to allow WK1 views 
1237           to work fine, too.
1238
1239 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1240
1241         WebDriver: ASSERTION FAILED: !m_loadTimer.isActive()
1242         https://bugs.webkit.org/show_bug.cgi?id=182237
1243
1244         Reviewed by Carlos Alberto Lopez Perez.
1245
1246         We should stop the load timer when we dispatch the pending navigation callbacks due to an alert open.
1247
1248         * UIProcess/Automation/WebAutomationSession.cpp:
1249         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
1250
1251 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1252
1253         [Cairo] Add GraphicsContextImplCairo::createFactory() helpers
1254         https://bugs.webkit.org/show_bug.cgi?id=182238
1255
1256         Reviewed by Carlos Garcia Campos.
1257
1258         Use GraphicsContextImplCairo::createFactory() helpers throughout the
1259         Cairo-specific GraphicsContext constructors in the WebKit layer.
1260
1261         * Shared/cairo/ShareableBitmapCairo.cpp:
1262         (WebKit::ShareableBitmap::createGraphicsContext):
1263         * UIProcess/cairo/BackingStoreCairo.cpp:
1264         (WebKit::BackingStore::incorporateUpdate):
1265         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1266         (WebKit::WebPrintOperationGtk::renderPage):
1267
1268 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1269
1270         [Cairo] Remove the GraphicsContext(cairo_t*) constructor
1271         https://bugs.webkit.org/show_bug.cgi?id=182234
1272
1273         Reviewed by Carlos Garcia Campos.
1274
1275         Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
1276         instead provide a factory function that returns a fresh
1277         GraphicsContextImplCairo object, passing that cairo_t object to its
1278         constructor.
1279
1280         * Shared/cairo/ShareableBitmapCairo.cpp:
1281         (WebKit::ShareableBitmap::createGraphicsContext):
1282         * UIProcess/cairo/BackingStoreCairo.cpp:
1283         (WebKit::BackingStore::incorporateUpdate):
1284         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1285         (WebKit::WebPrintOperationGtk::renderPage):
1286
1287 2018-01-26  Megan Gardner  <megan_gardner@apple.com>
1288
1289         Don't retain focus for input peripheral views
1290         https://bugs.webkit.org/show_bug.cgi?id=182204
1291
1292         Reviewed by Tim Horton.
1293
1294         Retaining focus on input peripheral views makes it so they cannot dismiss themselves with
1295         the current architecture. This should probably be fixed in UIKit, as there is no reason for
1296         focus to be retained on these views anyways, as they don't have keyboard input, but this
1297         guards against over-aggressive retain requests.
1298
1299         * UIProcess/ios/WKContentViewInteraction.mm:
1300         (-[WKContentView _restoreFocusWithToken:]):
1301         (-[WKContentView _preserveFocusWithToken:destructively:]):
1302
1303 2018-01-26  Chris Dumez  <cdumez@apple.com>
1304
1305         Make sure service worker code does not launch a StorageProcess unnecessarily
1306         https://bugs.webkit.org/show_bug.cgi?id=182192
1307         <rdar://problem/36927427>
1308
1309         Reviewed by Geoffrey Garen.
1310
1311         When calling WebProcess::existingWebToStorageProcessConnection(), make sure we do not
1312         force the creation of a WebProcess connection to the StorageProcess. If there is
1313         no WebProcess, just return false right away.
1314
1315         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1316         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
1317         * WebProcess/WebProcess.h:
1318
1319 2018-01-26  Alex Christensen  <achristensen@webkit.org>
1320
1321         Allow cellular access for default-created ephemeral sessions
1322         https://bugs.webkit.org/show_bug.cgi?id=182179
1323         <rdar://problem/36572023>
1324
1325         Reviewed by Andy Estes.
1326
1327         This makes it so when we recover from a NetworkProcess crash (see r227590) on iOS, we will
1328         be able to continue browsing using cell data.
1329
1330         * Shared/WebsiteDataStoreParameters.cpp:
1331         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1332         * UIProcess/WebProcessPool.cpp:
1333         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1334         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1335         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
1336
1337 2018-01-26  Alex Christensen  <achristensen@webkit.org>
1338
1339         Clean up more networking code
1340         https://bugs.webkit.org/show_bug.cgi?id=182161
1341
1342         Reviewed by Anders Carlsson.
1343
1344         Two cleanups:
1345         1. The WebProcess doesn't need to initialize NetworkSessions.
1346         2. WebFrameNetworkingContext doesn't need to have the NetworkingContext functions to support ResourceHandles in WebKit any more.
1347
1348         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1349         * NetworkProcess/NetworkLoad.h:
1350         * NetworkProcess/RemoteNetworkingContext.h:
1351         (): Deleted.
1352         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1353         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
1354         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
1355         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
1356         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
1357         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1358         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
1359         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
1360         (WebKit::RemoteNetworkingContext::localFileContentSniffingEnabled const): Deleted.
1361         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
1362         (WebKit::RemoteNetworkingContext::sourceApplicationAuditData const): Deleted.
1363         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier const): Deleted.
1364         (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
1365         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
1366         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
1367         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
1368         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
1369         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1370         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1371         * WebProcess/WebProcess.cpp:
1372         (WebKit::WebProcess::initializeWebProcess):
1373         (WebKit::WebProcess::clearCachedCredentials):
1374
1375 2018-01-26  Jan-Michael Brummer  <jan.brummer@tabos.org>
1376
1377         [GTK] Support using long-tap gesture to open context menu
1378         https://bugs.webkit.org/show_bug.cgi?id=140747
1379
1380         Reviewed by Carlos Garcia Campos.
1381
1382         Add long press gesture which simulates a secondary mouse press to open context menu.
1383
1384         * UIProcess/gtk/GestureController.cpp:
1385         (WebKit::GestureController::GestureController):
1386         (WebKit::GestureController::handleEvent):
1387         (WebKit::GestureController::isProcessingGestures const):
1388         (WebKit::GestureController::Gesture::simulateMousePress):
1389         (WebKit::GestureController::DragGesture::handleTap):
1390         (WebKit::GestureController::LongPressGesture::longPressed):
1391         (WebKit::GestureController::LongPressGesture::pressed):
1392         (WebKit::GestureController::LongPressGesture::LongPressGesture):
1393         * UIProcess/gtk/GestureController.h:
1394         (WebKit::GestureController::reset):
1395
1396 2018-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1397
1398         Unreviewed. REGRESSION(r227647): window.open() is broken in GTK and WPE after r227647.
1399
1400         In r227647, API::UIClient::createNewPage() was changed to use CompletionHandler instead of Function. All
1401         implementations were updated expect the GLib one, and we didn't notice it because the method doesn't have the
1402         final/override mark.
1403
1404         * UIProcess/API/glib/WebKitUIClient.cpp:
1405         (UIClient::createNewPage):
1406
1407 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
1408
1409         [WebVR] Make WebVR available by default for developer builds
1410         https://bugs.webkit.org/show_bug.cgi?id=182101
1411
1412         Reviewed by Michael Catanzaro.
1413
1414         Moved WebVR setting to the experimental features section and make it
1415         available by default for developer builds for GTK and WPE.
1416
1417         * Shared/WebPreferences.yaml:
1418
1419 2018-01-25  Alex Christensen  <achristensen@webkit.org>
1420
1421         REGRESSION (r221899): Web Content process hangs when webpage tries to make a new window if the WKWebView doesn’t have a UI delegate
1422         https://bugs.webkit.org/show_bug.cgi?id=182152
1423
1424         Reviewed by Joseph Pecoraro.
1425
1426         Call the completion handler of the default API::UIClient::createNewPage.
1427
1428         * UIProcess/API/APIUIClient.h:
1429         (API::UIClient::createNewPage):
1430         * UIProcess/API/C/WKPage.cpp:
1431         (WKPageSetPageUIClient):
1432         * UIProcess/Cocoa/UIDelegate.h:
1433         * UIProcess/Cocoa/UIDelegate.mm:
1434         (WebKit::UIDelegate::UIClient::createNewPage):
1435
1436 2018-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1437
1438         [iOS] [WK2] Introduce new views and view controllers to support extra-zoomed text form controls
1439         https://bugs.webkit.org/show_bug.cgi?id=182000
1440         <rdar://problem/35143035>
1441
1442         Reviewed by Tim Horton.
1443
1444         Add new files to support text form control editing while extra-zoomed.
1445
1446         * UIProcess/ios/forms/WKFocusedFormControlView.h: Added.
1447         * UIProcess/ios/forms/WKFocusedFormControlView.mm: Added.
1448         * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Added.
1449         * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Added.
1450         * UIProcess/ios/forms/WKTextFormControlViewController.h: Added.
1451         * UIProcess/ios/forms/WKTextFormControlViewController.mm: Added.
1452         * UIProcess/ios/forms/WKTextInputViewController.h: Added.
1453         * UIProcess/ios/forms/WKTextInputViewController.mm: Added.
1454         * UIProcess/ios/forms/WKTextSuggestionButton.h: Added.
1455         * UIProcess/ios/forms/WKTextSuggestionButton.mm: Added.
1456         * WebKit.xcodeproj/project.pbxproj:
1457
1458 2018-01-25  Chris Dumez  <cdumez@apple.com>
1459
1460         Clients.get(id) should only returns clients in the service worker's origin
1461         https://bugs.webkit.org/show_bug.cgi?id=182149
1462         <rdar://problem/36882310>
1463
1464         Reviewed by Youenn Fablet.
1465
1466         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1467         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
1468
1469 2018-01-25  Youenn Fablet  <youenn@apple.com>
1470
1471         WebPluginInfoProvider should handle null host queries
1472         https://bugs.webkit.org/show_bug.cgi?id=182112
1473
1474         Reviewed by Chris Dumez.
1475
1476         Return early if host is null.
1477
1478         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1479         (WebKit::WebPluginInfoProvider::populatePluginCache):
1480
1481 2018-01-25  Simon Fraser  <simon.fraser@apple.com>
1482
1483         ASSERT(CGSizeEqualToSize(m_resizeScrollOffset, CGSizeZero)) in WebViewImpl::setFrameAndScrollBy()
1484         https://bugs.webkit.org/show_bug.cgi?id=182082
1485         rdar://problem/13971838
1486
1487         Reviewed by Tim Horton.
1488
1489         Safari could call WebViewImpl::setFrameAndScrollBy() multiple times with different scroll offsets,
1490         triggering this assertion.
1491
1492         Rename to m_resizeScrollOffset to m_scrollOffsetAdjustment to reduce confusion with actual scroll offsets.
1493         This parameter has no effect on macOS, but is used by the -[WKWebView setFrame:andScrollBy:] so at some point
1494         needs to be hooked up to allow synchronous view resize and scroll adjustment (e.g. for the Find bar animation).
1495         
1496         Remove DrawingAreaProxy's m_layerPosition which was unused, and remove the parameters from the UpdateGeometry message.
1497
1498         * UIProcess/API/Cocoa/WKWebView.mm:
1499         (-[WKWebView _frameOrBoundsChanged]):
1500         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1501         * UIProcess/Cocoa/WebViewImpl.h:
1502         * UIProcess/Cocoa/WebViewImpl.mm:
1503         (WebKit::WebViewImpl::setFrameAndScrollBy):
1504         (WebKit::WebViewImpl::setDrawingAreaSize):
1505         * UIProcess/DrawingAreaProxy.cpp:
1506         (WebKit::DrawingAreaProxy::setSize):
1507         * UIProcess/DrawingAreaProxy.h:
1508         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1509         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
1510         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1511         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
1512         * WebProcess/WebPage/DrawingArea.h:
1513         (WebKit::DrawingArea::updateGeometry):
1514         * WebProcess/WebPage/DrawingArea.messages.in:
1515         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1516         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1517         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
1518         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1519         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1520         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
1521
1522 2018-01-25  Keith Rollin  <krollin@apple.com>
1523
1524         Add logging to facilitate binding of WebContent and Network processes to UI process
1525         https://bugs.webkit.org/show_bug.cgi?id=182066
1526
1527         Reviewed by Brent Fulgham.
1528
1529         When examining sysdiagnose logs and tracing events from one process to
1530         another, it would be helpful to know which WebKit processes were
1531         related to each other. When Safari, Mail, Messages, etc. are all
1532         running at the same time, it may otherwise be difficult to know if a
1533         particular Network process, for example was associated with Safari or
1534         some other application. Add some logging to the creation of WebContent
1535         and Network processes to identify their "presenting process" (parent
1536         application).
1537
1538         * NetworkProcess/NetworkProcess.cpp:
1539         (WebKit::NetworkProcess::initializeNetworkProcess):
1540         * Platform/Logging.h:
1541         * WebProcess/WebProcess.cpp:
1542         (WebKit::WebProcess::initializeWebProcess):
1543
1544 2018-01-25  Youenn Fablet  <youenn@apple.com>
1545
1546         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
1547         https://bugs.webkit.org/show_bug.cgi?id=182115
1548
1549         Reviewed by Alex Christensen.
1550
1551         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1552         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1553
1554 2018-01-25  Alex Christensen  <achristensen@webkit.org>
1555
1556         Fix crash when preconnecting while closing private browsing
1557         https://bugs.webkit.org/show_bug.cgi?id=182114
1558         <rdar://problem/35637284>
1559
1560         Reviewed by Joseph Pecoraro.
1561
1562         * NetworkProcess/PreconnectTask.cpp:
1563         There is a race condition when destroying a session while a page is initiating a preconnect.
1564         If this happens, fail gracefully instead of trying to preconnect with a null session.
1565
1566 2018-01-25  Dan Bernstein  <mitz@apple.com>
1567
1568         [Mac] Enable library validation for Networking & Storage XPC services
1569         https://bugs.webkit.org/show_bug.cgi?id=173424
1570         <rdar://problem/32386565>
1571
1572         Reviewed by Joseph Pecoraro.
1573
1574         * Configurations/BaseXPCService.xcconfig: Moved the definitions of
1575           WK_LIBRARY_VALIDATION_ENABLED and WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS from
1576           WebContentService.xcconfig to here and made them Mac-only at this level.
1577         * Configurations/NetworkService.xcconfig: Also set OTHER_CODE_SIGN_FLAGS to
1578           WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS.
1579         * Configurations/StorageService.xcconfig: Ditto.
1580         * Configurations/WebContentService.xcconfig: Moved definitions from here to
1581           BaseXPCService.xcconfig.
1582
1583 2018-01-25  David Hyatt  <hyatt@apple.com>
1584
1585         Enable lines clamp support for Apple Mail by default
1586         https://bugs.webkit.org/show_bug.cgi?id=182113
1587
1588         Reviewed by Dean Jackson.
1589
1590         * Shared/WebPageCreationParameters.cpp:
1591         (WebKit::WebPageCreationParameters::encode const):
1592         (WebKit::WebPageCreationParameters::decode):
1593         * Shared/WebPageCreationParameters.h:
1594         * UIProcess/WebPageProxy.cpp:
1595         (WebKit::WebPageProxy::creationParameters):
1596         * UIProcess/WebPageProxy.h:
1597         * UIProcess/mac/WebPageProxyMac.mm:
1598         (WebKit::WebPageProxy::appleMailLinesClampEnabled):
1599         * WebProcess/WebPage/WebPage.cpp:
1600         (WebKit::m_cpuLimit):
1601
1602 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
1603
1604         [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
1605         https://bugs.webkit.org/show_bug.cgi?id=182102
1606
1607         Reviewed by Carlos Garcia Campos.
1608
1609         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1610
1611 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
1612
1613         [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
1614         https://bugs.webkit.org/show_bug.cgi?id=182102
1615
1616         Reviewed by Carlos Garcia Campos.
1617
1618         This new public API was not supposed to be included in the patch
1619         that added OpenVR to the tree and to the build.
1620
1621         * UIProcess/API/glib/WebKitSettings.cpp:
1622         (webKitSettingsSetProperty):
1623         (webKitSettingsGetProperty):
1624         (webkit_settings_class_init):
1625         (webkit_settings_get_enable_webvr): Deleted.
1626         (webkit_settings_set_enable_webvr): Deleted.
1627         * UIProcess/API/gtk/WebKitSettings.h:
1628         * UIProcess/API/wpe/WebKitSettings.h:
1629
1630 2018-01-25  Claudio Saavedra  <csaavedra@igalia.com>
1631
1632         [GTK] Fix build with touch events disabled
1633
1634         Unreviewed build fix.
1635
1636         Explicitly include gtk.h in files that were indirectly getting it
1637         only when touch events were enabled.
1638         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1639         * UIProcess/gtk/WaylandCompositor.h:
1640
1641 2018-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1642
1643         WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug
1644         https://bugs.webkit.org/show_bug.cgi?id=182096
1645
1646         Reviewed by Carlos Alberto Lopez Perez.
1647
1648         It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values
1649         and the map is modified inside the loop. We need to use copyToVector to copy the keys.
1650
1651         * UIProcess/Automation/WebAutomationSession.cpp:
1652         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
1653         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
1654         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
1655
1656 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1657
1658         Gracefully recover from NetworkProcess crashes in private browsing
1659         https://bugs.webkit.org/show_bug.cgi?id=182073
1660         <rdar://problem/36572023>
1661
1662         Reviewed by Geoff Garen.
1663
1664         If we're using a non-persistent WKWebsiteDataStore and the NetworkProcess crashes and we try to do a load,
1665         then the WebProcess restarts the NetworkProcess but doesn't recreate the ephemeral session in the NetworkProcess.
1666         When this happens, we've already lost the browsing state in memory in the NetworkProcess, but we don't want to hang.
1667         If this is the problem, then just recreate the ephemeral session and continue loading.
1668
1669         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1670         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
1671         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
1672         * NetworkProcess/NetworkResourceLoader.cpp:
1673         (WebKit::NetworkResourceLoader::startNetworkLoad):
1674         * Shared/WebsiteDataStoreParameters.cpp:
1675         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1676         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted.
1677         * Shared/WebsiteDataStoreParameters.h:
1678         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
1679
1680 2018-01-24  Dan Bernstein  <mitz@apple.com>
1681
1682         Enable library validation on the Web Content service
1683         Part 1 of https://bugs.webkit.org/show_bug.cgi?id=172365
1684         <rdar://problem/26470661>
1685
1686         Reviewed by David Kilzer.
1687
1688         This makes the Web Content process signed with the Library Validation flag in production
1689         builds. Because doing so would prevent engineering builds of Apple apps that use an
1690         injected bundle from working, this also adds a Development version of the service, which
1691         does not enforce Library Validation. The UI process chooses to use the Development service
1692         iff it would need to load an injected bundle that is not part of the OS.
1693
1694         * Configurations/DebugRelease.xcconfig: Disable Library Validation in engineering builds.
1695
1696         * Configurations/WebContentService.Development.xcconfig: Added. Like the normal service, but
1697           only installed when WebKit is installed in the OS, and uses a Development variant.
1698
1699         * Configurations/WebContentService.xcconfig: For the Development variant, append
1700           ".Development" to the product name, which is also the service identifier. Enable Library
1701           Validation for the Normal variant of the service when WK_LIBRARY_VALIDATION_ENABLED allows
1702           it.
1703
1704         * UIProcess/Launcher/ProcessLauncher.h: Add nonValidInjectedCodeAllowed member to
1705           LaunchOptions, false by default.
1706
1707         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1708         (WebKit::serviceName): Use the Development variant if nonValidInjectedCodeAllowed is true.
1709
1710         * UIProcess/WebProcessProxy.cpp:
1711         (WebKit::WebProcessProxy::getLaunchOptions): Initialize nonValidInjectedCodeAllowed using
1712            the new shouldAllowNonValidInjectedCode().
1713         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Generic implementation
1714           that returns false.
1715         * UIProcess/WebProcessProxy.h: Declared shouldAllowNonValidInjectedCode.
1716         * UIProcess/mac/WebProcessProxyMac.mm:
1717         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return true if this is
1718           system WebKit with a non-system injected bundle.
1719
1720         * WebKit.xcodeproj/project.pbxproj: Added new service target.
1721
1722 2018-01-24  Chris Dumez  <cdumez@apple.com>
1723
1724         Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
1725         https://bugs.webkit.org/show_bug.cgi?id=182021
1726         <rdar://problem/21629943>
1727
1728         Reviewed by Ryosuke Niwa.
1729
1730         Add a new DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption that the caller can
1731         set when calling sendSync(). This indicates that the sendSync() should return only when we receive
1732         the response to our sync IPC message, and that we should not process ANY incoming IPC in the meantime.
1733
1734         This patch also starts using this flag in 3 places where we know processing incoming IPC is an issue
1735         and is causing crashes.
1736
1737         * Platform/IPC/Connection.cpp:
1738         (IPC::Connection::sendSyncMessage):
1739         When DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, make sure
1740         we set the ShouldDispatchMessageWhenWaitingForSyncReply flag on the encoder. If we did not set this
1741         flag then it could cause deadlocks when the destination process is also waiting on a synchronous
1742         IPC from us. Normally, this flag already gets set for sync messages because sendSyncMessage() calls
1743         sendMessage() with DispatchMessageEvenWhenWaitingForSyncReply SyncOption. However, sendMessage()
1744         ignores the DispatchMessageEvenWhenWaitingForSyncReply flag if the
1745         m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage flag is set on the
1746         connection. Note that this flag is set on the connection from the WebProcess to the UIProcess at
1747         the moment, which is why we saw deadlocks on the previous iteration of this patch.
1748
1749         (IPC::Connection::waitForSyncReply):
1750         If DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, do not
1751         process incoming IPC messages while waiting for our sync IPC reply.
1752
1753         * Platform/IPC/Connection.h:
1754         Add new SendSyncOption.
1755
1756         * UIProcess/WebProcessProxy.cpp:
1757         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
1758         * UIProcess/WebProcessProxy.h:
1759         * UIProcess/WebProcessProxy.messages.in:
1760         Testing infrastructure.
1761
1762         * WebProcess/Network/WebLoaderStrategy.cpp:
1763         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1764         Use new flag.
1765
1766         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1767         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
1768         * WebProcess/WebCoreSupport/WebChromeClient.h:
1769         Testing infrastructure.
1770
1771         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1772         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
1773         Use new flag.
1774
1775         * WebProcess/WebProcess.cpp:
1776         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
1777         Testing infrastructure.
1778
1779         (WebKit::WebProcess::ensureNetworkProcessConnection):
1780         Use new flag.
1781
1782         * WebProcess/WebProcess.h:
1783         * WebProcess/WebProcess.messages.in:
1784         Testing infrastructure.
1785
1786 2018-01-24  Joseph Pecoraro  <pecoraro@apple.com>
1787
1788         Web Inspector: Remove duplicate preference update for WebAuthentication value
1789         https://bugs.webkit.org/show_bug.cgi?id=182058
1790
1791         Reviewed by Brian Burg.
1792
1793         * WebProcess/WebPage/WebPage.cpp:
1794         (WebKit::WebPage::updatePreferences):
1795         An identical update already happens in generated code.
1796
1797 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1798
1799         Remove WebProcess access to QTKit
1800         https://bugs.webkit.org/show_bug.cgi?id=182035
1801
1802         Reviewed by Alexey Proskuryakov.
1803
1804         * WebProcess/com.apple.WebProcess.sb.in:
1805         This isn't needed any more.  We only have a little bit of code that uses QTKit which we should remove,
1806         and it's only used for fullscreen controls in WebKitLegacy.  Let's tighten up the sandbox!
1807
1808 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1809
1810         Remove pre-Sierra-OS-specific code in WebKit
1811         https://bugs.webkit.org/show_bug.cgi?id=182024
1812
1813         Reviewed by Tim Horton.
1814
1815         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1816         * Shared/Cocoa/DataDetectionResult.mm:
1817         (WebKit::DataDetectionResult::encode const):
1818         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1819         (IPC::ArgumentCoder<WebCore::Payment>::encode):
1820         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
1821         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
1822         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
1823         * Shared/WebPreferencesDefaultValues.h:
1824         * Shared/cg/ShareableBitmapCG.cpp:
1825         (WebKit::wantsExtendedRange):
1826         * Shared/ios/InteractionInformationAtPosition.mm:
1827         (WebKit::InteractionInformationAtPosition::encode const):
1828         * Shared/mac/CodeSigning.mm:
1829         (WebKit::codeSigningIdentifier):
1830         (WebKit::codeSigningIdentifierForCurrentProcess):
1831         * Shared/mac/ColorSpaceData.mm:
1832         (WebKit::ColorSpaceData::encode const):
1833         * Shared/mac/PasteboardTypes.mm:
1834         (WebKit::PasteboardTypes::forURL):
1835         * Shared/mac/WebCoreArgumentCodersMac.mm:
1836         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1837         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1838         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
1839         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
1840         * Shared/mac/WebHitTestResultData.mm:
1841         (WebKit::WebHitTestResultData::platformEncode const):
1842         * UIProcess/API/Cocoa/WKProcessPool.mm:
1843         (-[WKProcessPool _setObject:forBundleParameter:]):
1844         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
1845         * UIProcess/API/Cocoa/WKWebView.mm:
1846         (-[WKWebView _handleAcceptedCandidate:]):
1847         * UIProcess/Cocoa/WebViewImpl.h:
1848         * UIProcess/Cocoa/WebViewImpl.mm:
1849         (WebKit::WebViewImpl::handleAcceptedCandidate):
1850         (WebKit::WebViewImpl::performDragOperation):
1851         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1852         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1853         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1854         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
1855         * WebProcess/com.apple.WebProcess.sb.in:
1856
1857 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1858
1859         Stop using AuthenticationClient in WebKit
1860         https://bugs.webkit.org/show_bug.cgi?id=182016
1861
1862         Reviewed by Brady Eidson.
1863
1864         It was necessary to support ResourceHandle use in WebKit, but now we're using NetworkSession everywhere in WebKit.
1865
1866         * Shared/Authentication/AuthenticationManager.cpp:
1867         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1868         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
1869         (WebKit::AuthenticationManager::cancelSingleChallenge):
1870         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
1871         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
1872
1873 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1874
1875         Remove WebProcess authentication code
1876         https://bugs.webkit.org/show_bug.cgi?id=182020
1877
1878         Reviewed by Brady Eidson.
1879
1880         * Shared/Authentication/AuthenticationManager.cpp:
1881         * Shared/Authentication/AuthenticationManager.h:
1882         * UIProcess/WebPageProxy.cpp:
1883         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Deleted.
1884         * UIProcess/WebPageProxy.h:
1885         * UIProcess/WebPageProxy.messages.in:
1886         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1887         (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
1888         * WebProcess/WebProcess.cpp:
1889         (WebKit::m_webSQLiteDatabaseTracker):
1890
1891 2018-01-24  Jan-Michael Brummer  <jan.brummer@tabos.org>
1892
1893         [GTK] Page crash after swipe gesture running GNOME3 under wayland
1894         https://bugs.webkit.org/show_bug.cgi?id=181996
1895
1896         Reviewed by Michael Catanzaro.
1897
1898         Add missing GDK_TOUCH_CANCEL support which fixes page crashes due to cancelled gestures.
1899         * Shared/gtk/WebEventFactory.cpp:
1900         (WebKit::WebEventFactory::createWebTouchEvent):
1901         * UIProcess/API/gtk/PageClientImpl.cpp:
1902         (WebKit::PageClientImpl::doneWithTouchEvent):
1903         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1904         (touchPointStateForEvents):
1905         (webkitWebViewBaseGetTouchPointsForEvent):
1906         (webkitWebViewBaseTouchEvent):
1907         * UIProcess/gtk/GestureController.cpp:
1908         (WebKit::GestureController::handleEvent):
1909
1910 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1911
1912         Remove unused QTKit preference
1913         https://bugs.webkit.org/show_bug.cgi?id=181968
1914
1915         Reviewed by Alexey Proskuryakov.
1916
1917         * Shared/API/c/WKDeprecatedFunctions.cpp:
1918         (WKPreferencesSetQTKitEnabled):
1919         (WKPreferencesGetQTKitEnabled):
1920         * Shared/WebPreferences.yaml:
1921         * UIProcess/API/C/WKPreferences.cpp:
1922         (WKPreferencesSetQTKitEnabled): Deleted.
1923         (WKPreferencesGetQTKitEnabled): Deleted.
1924         * UIProcess/API/Cocoa/WKPreferences.mm:
1925         (-[WKPreferences _setQTKitEnabled:]): Deleted.
1926         (-[WKPreferences _qtKitEnabled]): Deleted.
1927         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1928
1929 2018-01-24  Youenn Fablet  <youenn@apple.com>
1930
1931         Fetch response should copy its url from the request if null
1932         https://bugs.webkit.org/show_bug.cgi?id=182048
1933
1934         Reviewed by Chris Dumez.
1935
1936         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1937         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1938
1939 2018-01-24  Sergio Villar Senin  <svillar@igalia.com>
1940
1941         Unreviewed build fix after r227518. I forgot to add the function declarations to the WPE
1942         header.
1943
1944         * UIProcess/API/wpe/WebKitSettings.h: Added webkit_settings_get/set_enable_webvr.
1945
1946 2018-01-24  Youenn Fablet  <youenn@apple.com>
1947
1948         Add Cache Storage engine assertion following on bug 181887
1949         https://bugs.webkit.org/show_bug.cgi?id=181925
1950
1951         Reviewed by Alex Christensen.
1952
1953         In a normal environment, the folderPath should be the same as the path computed from the ClientOrigin.
1954         Add assertion to verify this.
1955
1956         * NetworkProcess/cache/CacheStorageEngine.cpp:
1957         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
1958
1959 2018-01-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1960
1961         [GTK] Use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP in WebKitWebViewBase.cpp
1962         https://bugs.webkit.org/show_bug.cgi?id=182031
1963
1964         Reviewed by Carlos Garcia Campos.
1965
1966         No functional changes, this just replaces TRUE with GDK_EVENT_STOP and FALSE with
1967         GDK_EVENT_PROPAGATE, to improve readability.
1968
1969         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1970         (webkitWebViewBaseKeyPressEvent):
1971         (webkitWebViewBaseKeyReleaseEvent):
1972         (webkitWebViewBaseButtonPressEvent):
1973         (webkitWebViewBaseButtonReleaseEvent):
1974         (webkitWebViewBaseScrollEvent):
1975         (webkitWebViewBaseMotionNotifyEvent):
1976         (webkitWebViewBaseCrossingNotifyEvent):
1977         (webkitWebViewBaseTouchEvent):
1978
1979 2018-01-23  Eric Carlson  <eric.carlson@apple.com>
1980
1981         Resign NowPlaying status when no media element is eligible
1982         https://bugs.webkit.org/show_bug.cgi?id=181914
1983         <rdar://problem/35294116>
1984
1985         Reviewed by Jer Noble.
1986
1987         * UIProcess/API/Cocoa/WKWebView.mm:
1988         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
1989         status.
1990         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1991
1992         * UIProcess/WebPageProxy.cpp:
1993         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
1994         * UIProcess/WebPageProxy.h:
1995         * UIProcess/WebPageProxy.messages.in:
1996         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1997         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
1998
1999 2018-01-23  Alex Christensen  <achristensen@webkit.org>
2000
2001         Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync
2002         https://bugs.webkit.org/show_bug.cgi?id=181961
2003
2004         Reviewed by Michael Catanzaro.
2005
2006         * NetworkProcess/Downloads/Download.h:
2007         * NetworkProcess/NetworkLoad.cpp:
2008         * NetworkProcess/NetworkLoad.h:
2009         * NetworkProcess/NetworkResourceLoadParameters.h:
2010         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2011         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2012         * WebProcess/WebPage/mac/WebPageMac.mm:
2013         * WebProcess/WebProcess.cpp:
2014
2015 2018-01-23  Chris Dumez  <cdumez@apple.com>
2016
2017         Unreviewed, rollout r227216 as it seems to be causing deadlocks
2018         https://bugs.webkit.org/show_bug.cgi?id=182013
2019
2020         * Platform/IPC/Connection.cpp:
2021         (IPC::Connection::waitForSyncReply):
2022         * Platform/IPC/Connection.h:
2023         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply): Deleted.
2024         * UIProcess/WebProcessProxy.cpp:
2025         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
2026         * UIProcess/WebProcessProxy.h:
2027         * UIProcess/WebProcessProxy.messages.in:
2028         * WebProcess/Network/NetworkProcessConnection.cpp:
2029         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
2030         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2031         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
2032         * WebProcess/WebConnectionToUIProcess.cpp:
2033         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
2034         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2035         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
2036         * WebProcess/WebCoreSupport/WebChromeClient.h:
2037         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2038         (WebKit::WebEditorClient::undo):
2039         (WebKit::WebEditorClient::redo):
2040         * WebProcess/WebProcess.cpp:
2041         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting): Deleted.
2042         * WebProcess/WebProcess.h:
2043         * WebProcess/WebProcess.messages.in:
2044
2045 2018-01-23  Commit Queue  <commit-queue@webkit.org>
2046
2047         Unreviewed, rolling out r227437.
2048         https://bugs.webkit.org/show_bug.cgi?id=182011
2049
2050         broke build (Requested by alexchristensen on #webkit).
2051
2052         Reverted changeset:
2053
2054         "Remove unused QTKit preference"
2055         https://bugs.webkit.org/show_bug.cgi?id=181968
2056         https://trac.webkit.org/changeset/227437
2057
2058 2018-01-23  Alex Christensen  <achristensen@webkit.org>
2059
2060         Remove compile guard around beacon API
2061         https://bugs.webkit.org/show_bug.cgi?id=182002
2062
2063         Reviewed by Sam Weinig.
2064
2065         It's enabled everywhere now.
2066
2067         * Shared/WebPreferences.yaml:
2068         * UIProcess/API/C/WKPreferences.cpp:
2069         (WKPreferencesSetBeaconAPIEnabled):
2070         (WKPreferencesGetBeaconAPIEnabled):
2071         * config.h:
2072
2073 2018-01-23  Alex Christensen  <achristensen@webkit.org>
2074
2075         Remove unused QTKit preference
2076         https://bugs.webkit.org/show_bug.cgi?id=181968
2077
2078         Reviewed by Alexey Proskuryakov.
2079
2080         * Shared/API/c/WKDeprecatedFunctions.cpp:
2081         (WKPreferencesSetQTKitEnabled):
2082         (WKPreferencesGetQTKitEnabled):
2083         * Shared/WebPreferences.yaml:
2084         * UIProcess/API/C/WKPreferences.cpp:
2085         (WKPreferencesSetQTKitEnabled): Deleted.
2086         (WKPreferencesGetQTKitEnabled): Deleted.
2087         * UIProcess/API/Cocoa/WKPreferences.mm:
2088         (-[WKPreferences _setQTKitEnabled:]): Deleted.
2089         (-[WKPreferences _qtKitEnabled]): Deleted.
2090         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2091
2092 2018-01-23  Brent Fulgham  <bfulgham@apple.com>
2093
2094         [macOS] WebProcess needs TCC entitlements for media capture
2095         https://bugs.webkit.org/show_bug.cgi?id=181995
2096         <rdar://problem/36674649>
2097
2098         Reviewed by Eric Carlson.
2099
2100         * Configurations/WebContent-OSX.entitlements: Add delegated services needed to support media
2101         capture features.
2102
2103 2018-01-23  Dan Bernstein  <mitz@apple.com>
2104
2105         [Cocoa] Disable header postprocessing when building for macOS High Sierra
2106         https://bugs.webkit.org/show_bug.cgi?id=181972
2107
2108         Reviewed by Anders Carlsson.
2109
2110         * Configurations/WebKit.xcconfig: Adopt macOSTargetConditionals.xcconfig helpers and disable postprocessing
2111           when building for macOS 10.13.
2112
2113 2018-01-23  Joseph Pecoraro  <pecoraro@apple.com>
2114
2115         Web Inspector: Window resizing is broken after detaching to separate window
2116         https://bugs.webkit.org/show_bug.cgi?id=181992
2117         <rdar://problem/36714840>
2118
2119         Reviewed by Brian Burg.
2120
2121         * UIProcess/mac/WebInspectorProxyMac.mm:
2122         (WebKit::WebInspectorProxy::platformDetach):
2123         Restore the inspector view's autoresizingMask to the initial value
2124         that works with a detached window. This gets changed when the view
2125         gets attached to bottom/side, so we need to revert it on detaching.
2126
2127 2018-01-23  Brady Eidson  <beidson@apple.com>
2128
2129         Allow passing MessagePorts across processes (e.g. ServiceWorkers).
2130         https://bugs.webkit.org/show_bug.cgi?id=181178
2131
2132         Reviewed by Andy Estes.
2133
2134         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2135         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2136         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
2137         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2138         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2139
2140         * StorageProcess/StorageProcess.cpp:
2141         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
2142         * StorageProcess/StorageProcess.h:
2143         * StorageProcess/StorageProcess.messages.in:
2144
2145         * UIProcess/WebProcessProxy.cpp:
2146         (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
2147         (WebKit::WebProcessProxy::postMessageToRemote):
2148
2149         * WebProcess/Storage/WebSWClientConnection.cpp:
2150         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
2151         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
2152         * WebProcess/Storage/WebSWClientConnection.h:
2153         * WebProcess/Storage/WebSWClientConnection.messages.in:
2154
2155         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2156         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker):
2157         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
2158         * WebProcess/Storage/WebSWContextManagerConnection.h:
2159         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2160
2161 2018-01-23  Commit Queue  <commit-queue@webkit.org>
2162
2163         Unreviewed, rolling out r227279 and r227373.
2164         https://bugs.webkit.org/show_bug.cgi?id=181988
2165
2166         The LayoutTest crash fix introduced an API test failure.
2167         (Requested by ryanhaddad on #webkit).
2168
2169         Reverted changesets:
2170
2171         "Resign NowPlaying status when no media element is eligible"
2172         https://bugs.webkit.org/show_bug.cgi?id=181914
2173         https://trac.webkit.org/changeset/227279
2174
2175         "Resign NowPlaying status when no media element is eligible"
2176         https://bugs.webkit.org/show_bug.cgi?id=181914
2177         https://trac.webkit.org/changeset/227373
2178
2179 2018-01-23  Youenn Fablet  <youenn@apple.com>
2180
2181         REGRESSION (r227348): ASSERT_NOT_REACHED in WebKit::ServiceWorkerClientFetch::didFinish()
2182         https://bugs.webkit.org/show_bug.cgi?id=181956
2183         <rdar://problem/36755492>
2184
2185         Reviewed by Chris Dumez.
2186
2187         Covered by test no longer crashing in Debug builds.
2188         Reset m_redirectionStatus to None when starting an SW fetch.
2189
2190         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2191         (WebKit::ServiceWorkerClientFetch::start):
2192         (WebKit::ServiceWorkerClientFetch::didFinish):
2193
2194 2018-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2195
2196         [WPE] TestWebKitFindController asserts
2197         https://bugs.webkit.org/show_bug.cgi?id=181472
2198
2199         Reviewed by Carlos Garcia Campos.
2200
2201         Let's fix this in two independent ways.
2202
2203         First, use a GRefPtr to hold ownership of the WebKitWebViewBackend. This way, we don't need
2204         to change the order in which WebKitWebView destroys its priv struct members from what is
2205         used in WebKitGTK+, which can lead to odd bugs.
2206
2207         Additionally, just for good measure, stop resetting the find client when disposing
2208         WebKitFindController. This is unnecessary because it will never be destroyed before the
2209         WebKitWebView.
2210
2211         * UIProcess/API/glib/WebKitFindController.cpp:
2212         (webkit_find_controller_class_init):
2213         (webkitFindControllerDispose): Deleted.
2214         * UIProcess/API/glib/WebKitWebView.cpp:
2215         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
2216         (webkitWebViewSetProperty):
2217         (webkitWebViewGetProperty):
2218         (webkitWebViewCreatePage):
2219         (webkit_web_view_get_backend):
2220         * UIProcess/API/wpe/WebKitWebViewBackend.cpp:
2221         (webkitWebViewBackendCreateDefault):
2222         (WTF::refGPtr):
2223         (WTF::derefGPtr):
2224         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h:
2225
2226 2018-01-22  Jon Lee  <jonlee@apple.com>
2227
2228         Update title label size
2229         https://bugs.webkit.org/show_bug.cgi?id=181962
2230         rdar://problem/36754744
2231
2232         Reviewed by Simon Fraser.
2233
2234         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
2235         (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): Move titleLabel properties into
2236         createSubviews.
2237         (-[_WKFullScreenViewController createSubviews]): Set the title label for both the cancel and location buttons.
2238         Refer to a const CGFloat for the font size.
2239
2240 2018-01-22  Megan Gardner  <megan_gardner@apple.com>
2241
2242         Temporarily restore block selection code conditionally
2243         https://bugs.webkit.org/show_bug.cgi?id=181895
2244         <rdar://problem/36567325>
2245
2246         Reviewed by Tim Horton.
2247
2248         We need to restore this code temporarily to avoid a crash.
2249
2250         * Platform/spi/ios/UIKitSPI.h:
2251         * UIProcess/ios/WKContentViewInteraction.mm:
2252         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
2253
2254 2018-01-22  Zach Li  <zacharyli323@gmail.com>
2255
2256         We should not try to link against the Safe Browsing framework on watchOS and tvOS.
2257         https://bugs.webkit.org/show_bug.cgi?id=181965.
2258
2259         Reviewed by Tim Horton.
2260
2261         * Configurations/WebKit.xcconfig:
2262
2263 2018-01-22  Alex Christensen  <achristensen@webkit.org>
2264
2265         Remove pre-NetworkSession loading code
2266         https://bugs.webkit.org/show_bug.cgi?id=181944
2267
2268         Reviewed by Tim Horton.
2269
2270         We were keeping it around for El Capitan.
2271
2272         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
2273         (WebKit::LegacyCustomProtocolManager::registerProtocolClass):
2274         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
2275         (WebKit::LegacyCustomProtocolManager::initialize):
2276         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
2277         * NetworkProcess/Downloads/BlobDownloadClient.cpp: Removed.
2278         * NetworkProcess/Downloads/BlobDownloadClient.h: Removed.
2279         * NetworkProcess/Downloads/Download.cpp:
2280         (WebKit::Download::~Download):
2281         (WebKit::Download::cancel):
2282         (WebKit::Download::didReceiveChallenge):
2283         (WebKit::Download::didFinish):
2284         (WebKit::Download::isAlwaysOnLoggingAllowed const):
2285         (WebKit::Download::start): Deleted.
2286         (WebKit::Download::startWithHandle): Deleted.
2287         (WebKit::Download::didStart): Deleted.
2288         (WebKit::Download::willSendRedirectedRequest): Deleted.
2289         (WebKit::Download::didReceiveAuthenticationChallenge): Deleted.
2290         (WebKit::Download::didReceiveResponse): Deleted.
2291         (WebKit::Download::shouldDecodeSourceDataOfMIMEType): Deleted.
2292         (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted.
2293         (WebKit::Download::decideDestinationWithSuggestedFilenameAsync): Deleted.
2294         (WebKit::Download::didDecideDownloadDestination): Deleted.
2295         (WebKit::Download::continueDidReceiveResponse): Deleted.
2296         * NetworkProcess/Downloads/Download.h:
2297         (WebKit::Download::setBlobFileReferences): Deleted.
2298         (WebKit::Download::request const): Deleted.
2299         * NetworkProcess/Downloads/DownloadManager.cpp:
2300         (WebKit::DownloadManager::startDownload):
2301         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
2302         (WebKit::DownloadManager::convertNetworkLoadToDownload):
2303         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2304         (WebKit::DownloadManager::resumeDownload):
2305         (WebKit::DownloadManager::cancelDownload):
2306         * NetworkProcess/Downloads/DownloadManager.h:
2307         (WebKit::DownloadManager::startDownload):
2308         * NetworkProcess/Downloads/PendingDownload.cpp:
2309         * NetworkProcess/Downloads/PendingDownload.h:
2310         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2311         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
2312         * NetworkProcess/Downloads/mac/DownloadMac.mm: Removed.
2313         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2314         * NetworkProcess/NetworkCORSPreflightChecker.h:
2315         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2316         (WebKit::NetworkConnectionToWebProcess::loadPing):
2317         * NetworkProcess/NetworkDataTask.cpp:
2318         * NetworkProcess/NetworkDataTask.h:
2319         * NetworkProcess/NetworkDataTaskBlob.cpp:
2320         * NetworkProcess/NetworkDataTaskBlob.h:
2321         * NetworkProcess/NetworkLoad.cpp:
2322         (WebKit::NetworkLoad::~NetworkLoad):
2323         (WebKit::NetworkLoad::setDefersLoading):
2324         (WebKit::NetworkLoad::cancel):
2325         (WebKit::NetworkLoad::continueWillSendRequest):
2326         (WebKit::NetworkLoad::continueDidReceiveResponse):
2327         (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics const):
2328         (WebKit::NetworkLoad::didReceiveResponseAsync): Deleted.
2329         (WebKit::NetworkLoad::didReceiveBuffer): Deleted.
2330         (WebKit::NetworkLoad::didFinishLoading): Deleted.
2331         (WebKit::NetworkLoad::didFail): Deleted.
2332         (WebKit::NetworkLoad::willSendRequestAsync): Deleted.
2333         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
2334         (WebKit::NetworkLoad::shouldUseCredentialStorage): Deleted.
2335         (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Deleted.
2336         (WebKit::NetworkLoad::receivedCancellation): Deleted.
2337         * NetworkProcess/NetworkLoad.h:
2338         * NetworkProcess/NetworkLoadParameters.h:
2339         * NetworkProcess/NetworkProcess.cpp:
2340         (WebKit::NetworkProcess::initializeNetworkProcess):
2341         (WebKit::NetworkProcess::clearCachedCredentials):
2342         (WebKit::NetworkProcess::findPendingDownloadLocation):
2343         * NetworkProcess/NetworkProcess.h:
2344         * NetworkProcess/NetworkProcess.messages.in:
2345         * NetworkProcess/NetworkResourceLoader.cpp:
2346         (WebKit::NetworkResourceLoader::startNetworkLoad):
2347         * NetworkProcess/NetworkSession.cpp:
2348         * NetworkProcess/NetworkSession.h:
2349         * NetworkProcess/PingLoad.cpp:
2350         * NetworkProcess/PingLoad.h:
2351         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2352         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2353         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2354         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2355         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2356         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2357         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2358         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2359         * NetworkProcess/mac/NetworkLoadMac.mm: Removed.
2360         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2361         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2362         * Shared/Authentication/AuthenticationManager.cpp:
2363         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2364         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2365         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
2366         (WebKit::AuthenticationManager::cancelSingleChallenge):
2367         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
2368         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
2369         * Shared/Authentication/AuthenticationManager.h:
2370         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Removed.
2371         * Shared/SessionTracker.cpp:
2372         (WebKit::SessionTracker::setSession):
2373         (WebKit::SessionTracker::destroySession):
2374         * Shared/SessionTracker.h:
2375         * Shared/mac/CookieStorageShim.h: Removed.
2376         * Shared/mac/CookieStorageShim.mm: Removed.
2377         * UIProcess/API/APIDownloadClient.h:
2378         (API::DownloadClient::didReceiveData):
2379         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
2380         * UIProcess/API/C/WKContext.cpp:
2381         (WKContextSetDownloadClient):
2382         * UIProcess/Cocoa/DownloadClient.h:
2383         * UIProcess/Cocoa/DownloadClient.mm:
2384         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
2385         * UIProcess/Downloads/DownloadProxy.cpp:
2386         (WebKit::DownloadProxy::willSendRequest):
2387         (WebKit::DownloadProxy::didReceiveResponse):
2388         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): Deleted.
2389         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Deleted.
2390         * UIProcess/Downloads/DownloadProxy.h:
2391         * UIProcess/Downloads/DownloadProxy.messages.in:
2392         * WebKit.xcodeproj/project.pbxproj:
2393         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2394         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2395         * WebProcess/WebProcess.cpp:
2396         (WebKit::WebProcess::initializeWebProcess):
2397         (WebKit::WebProcess::clearCachedCredentials):
2398         * config.h:
2399
2400 2018-01-22  Youenn Fablet  <youenn@apple.com>
2401
2402         SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP
2403         https://bugs.webkit.org/show_bug.cgi?id=181942
2404         <rdar://problem/35132091>
2405
2406         Reviewed by Chris Dumez.
2407
2408         Add ServiceWorkerRegistrations and DOMCache as persistent data to be cleared according ITP decisions.
2409
2410         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2411         (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
2412
2413 2018-01-22  Chris Dumez  <cdumez@apple.com>
2414
2415         Add release logging to help debug issues related to service workers
2416         https://bugs.webkit.org/show_bug.cgi?id=181935
2417         <rdar://problem/36735900>
2418
2419         Reviewed by Brady Eidson.
2420
2421         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2422         (WebKit::WebSWServerConnection::startFetch):
2423         (WebKit::WebSWServerConnection::didFinishFetch):
2424         (WebKit::WebSWServerConnection::didFailFetch):
2425         (WebKit::WebSWServerConnection::didNotHandleFetch):
2426
2427 2018-01-22  Brent Fulgham  <bfulgham@apple.com>
2428
2429         [iOS] REGRESSION (r225763): Allow access to power logging features
2430         https://bugs.webkit.org/show_bug.cgi?id=181938
2431         <rdar://problem/36442803>
2432
2433         Reviewed by Eric Carlson.
2434
2435         I denied access to the powerlog facility in r225763, not realizing that it
2436         gets activated in certain logging scenarios. This patch reverts this change.
2437
2438         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2439
2440 2018-01-22  Brent Fulgham  <bfulgham@apple.com>
2441
2442         [macOS, iOS] Allow accss to AVFoundation preference
2443         https://bugs.webkit.org/show_bug.cgi?id=181937
2444         <rdar://problem/33137029>
2445
2446         Reviewed by Eric Carlson.
2447
2448         Grant access to the 'com.apple.avfoundation.frecents' preference.
2449
2450         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2451         * WebProcess/com.apple.WebProcess.sb.in:
2452
2453 2018-01-22  Brady Eidson  <beidson@apple.com>
2454
2455         In WebKit2, make the MessagePortChannelRegistry live in the UI process.
2456         https://bugs.webkit.org/show_bug.cgi?id=181922
2457
2458         Reviewed by Andy Estes.
2459
2460         With all of the work that went into making MessagePorts be fully asynchronous
2461         and to be process-aware, formally moving them out-of-process is just a matter
2462         of adding WebKit IPC layers.
2463         
2464         The basic unit of asynchronicity is "MessagePortChannelProvider", and this patch
2465         adds both a WebMessagePortChannelProvider and UIMessagePortChannelProvider for
2466         each side of the process divide.
2467         
2468         * UIProcess/UIMessagePortChannelProvider.cpp: Added.
2469         (WebKit::UIMessagePortChannelProvider::singleton):
2470         (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
2471         (WebKit::UIMessagePortChannelProvider::~UIMessagePortChannelProvider):
2472         (WebKit::UIMessagePortChannelProvider::createNewMessagePortChannel):
2473         (WebKit::UIMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
2474         (WebKit::UIMessagePortChannelProvider::messagePortDisentangled):
2475         (WebKit::UIMessagePortChannelProvider::messagePortClosed):
2476         (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
2477         (WebKit::UIMessagePortChannelProvider::postMessageToRemote):
2478         (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
2479         (WebKit::UIMessagePortChannelProvider::checkProcessLocalPortForActivity):
2480         * UIProcess/UIMessagePortChannelProvider.h: Added.
2481         (WebKit::UIMessagePortChannelProvider::registry):
2482
2483         * UIProcess/WebPageProxy.cpp:
2484         (WebKit::m_configurationPreferenceValues):
2485
2486         * UIProcess/WebProcessProxy.cpp:
2487         (WebKit::WebProcessProxy::processForIdentifier):
2488         (WebKit::m_userMediaCaptureManagerProxy):
2489         (WebKit::WebProcessProxy::~WebProcessProxy):
2490         (WebKit::WebProcessProxy::shutDown):
2491         (WebKit::WebProcessProxy::createNewMessagePortChannel):
2492         (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
2493         (WebKit::WebProcessProxy::messagePortDisentangled):
2494         (WebKit::WebProcessProxy::messagePortClosed):
2495         (WebKit::WebProcessProxy::takeAllMessagesForPort):
2496         (WebKit::WebProcessProxy::didDeliverMessagePortMessages):
2497         (WebKit::WebProcessProxy::postMessageToRemote):
2498         (WebKit::WebProcessProxy::checkRemotePortForActivity):
2499         (WebKit::WebProcessProxy::checkProcessLocalPortForActivity):
2500         (WebKit::WebProcessProxy::didCheckProcessLocalPortForActivity):
2501         * UIProcess/WebProcessProxy.h:
2502         * UIProcess/WebProcessProxy.messages.in:
2503
2504         * WebKit.xcodeproj/project.pbxproj:
2505
2506         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: Added.
2507         (WebKit::WebMessagePortChannelProvider::singleton):
2508         (WebKit::WebMessagePortChannelProvider::WebMessagePortChannelProvider):
2509         (WebKit::WebMessagePortChannelProvider::~WebMessagePortChannelProvider):
2510         (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
2511         (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
2512         (WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
2513         (WebKit::WebMessagePortChannelProvider::messagePortClosed):
2514         (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
2515         (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
2516         (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
2517         (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
2518         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
2519         (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
2520         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: Added.
2521
2522         * WebProcess/WebProcess.cpp:
2523         (WebKit::WebProcess::initializeProcess):
2524         (WebKit::WebProcess::didTakeAllMessagesForPort):
2525         (WebKit::WebProcess::checkProcessLocalPortForActivity):
2526         (WebKit::WebProcess::didCheckRemotePortForActivity):
2527         (WebKit::WebProcess::messagesAvailableForPort):
2528         * WebProcess/WebProcess.h:
2529         * WebProcess/WebProcess.messages.in:
2530
2531 2018-01-22  Youenn Fablet  <youenn@apple.com>
2532
2533         Bump default cache storage quota to 50MB
2534         https://bugs.webkit.org/show_bug.cgi?id=181924
2535
2536         Reviewed by Chris Dumez.
2537
2538         Existing web sites use more than 20 MB.
2539
2540         * UIProcess/WebsiteData/WebsiteDataStore.h:
2541
2542 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
2543
2544         Unreviewed build fix after r227292. Fixing a bad copy-paste that broke
2545         the GTK+ debug builds.
2546
2547         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2548         (WebKit::convertCairoSurfaceToShareableBitmap):
2549
2550 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
2551
2552         [Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
2553         https://bugs.webkit.org/show_bug.cgi?id=181930
2554
2555         Reviewed by Carlos Garcia Campos.
2556
2557         Call sites of the PlatformContextCairo::drawSurfaceToContext() method
2558         are adjusted to now call Cairo::drawSurface() and properly pass the
2559         PlatformContextCairo object to the function.
2560
2561         * Shared/cairo/ShareableBitmapCairo.cpp:
2562         (WebKit::ShareableBitmap::paint):
2563         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2564         (WebKit::convertCairoSurfaceToShareableBitmap):
2565
2566 2018-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2567
2568         Unreviewed. Fix compile warning.
2569
2570         Use #include instead of #import in cross-platform code.
2571
2572         * Shared/WebPreferencesDefaultValues.cpp:
2573
2574 2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
2575
2576         Turning off custom pasteboard data doesn't actually turn it off in WK2
2577         https://bugs.webkit.org/show_bug.cgi?id=181920
2578         <rdar://problem/36686429>
2579
2580         Reviewed by Wenson Hsieh.
2581
2582         Moved the code to decide when to enable custom pasteboard data from WebCore
2583         since we never enable this feature in WebKit1.
2584
2585         * Shared/WebPreferences.yaml:
2586         * Shared/WebPreferencesDefaultValues.cpp:
2587         (defaultCustomPasteboardDataEnabled): Added.
2588         * Shared/WebPreferencesDefaultValues.h:
2589
2590 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2591
2592         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
2593         https://bugs.webkit.org/show_bug.cgi?id=181918
2594
2595         Reviewed by Tim Horton.
2596
2597         Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).
2598
2599         * Configurations/FeatureDefines.xcconfig:
2600
2601 2018-01-21  Eric Carlson  <eric.carlson@apple.com>
2602
2603         Resign NowPlaying status when no media element is eligible
2604         https://bugs.webkit.org/show_bug.cgi?id=181914
2605         <rdar://problem/35294116>
2606
2607         Reviewed by Jer Noble.
2608
2609         * UIProcess/API/Cocoa/WKWebView.mm:
2610         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
2611         status.
2612         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2613
2614         * UIProcess/WebPageProxy.cpp:
2615         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
2616         * UIProcess/WebPageProxy.h:
2617         * UIProcess/WebPageProxy.messages.in:
2618         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2619         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
2620
2621 2018-01-20  Andy Estes  <aestes@apple.com>
2622
2623         [Apple Pay] Stop eagerly loading PassKit.framework
2624         https://bugs.webkit.org/show_bug.cgi?id=181911
2625         <rdar://problem/36555369>
2626
2627         Reviewed by Tim Horton.
2628
2629         * Shared/WebPageCreationParameters.cpp:
2630         (WebKit::WebPageCreationParameters::encode const):
2631         (WebKit::WebPageCreationParameters::decode):
2632         * Shared/WebPageCreationParameters.h:
2633
2634         Removed availablePaymentNetworks from WebPageCreationParameters.
2635
2636         * UIProcess/API/C/WKPreferences.cpp:
2637         (WKPreferencesSetApplePayEnabled):
2638         * UIProcess/API/Cocoa/WKWebView.mm:
2639         (-[WKWebView _initializeWithConfiguration:]):
2640
2641         Stopped calling WebPaymentCoordinatorProxy::platformSupportsPayments().
2642
2643         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2644         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
2645         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2646         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2647
2648         Added message AvailablePaymentNetworks, which synchronously returns a Vector of payment
2649         networks.
2650
2651         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2652         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2653
2654         Returned false if PassKitLibrary() fails.
2655
2656         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2657         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
2658
2659         Called completionHandler with false if PassKitLibrary() fails.
2660
2661         (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
2662         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
2663
2664         Renamed availablePaymentNetworks to platformAvailablePaymentNetworks
2665
2666         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): Deleted.
2667
2668         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2669         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2670
2671         Called completionHandler with false if PassKitLibrary() fails.
2672
2673         * UIProcess/WebPageProxy.cpp:
2674         (WebKit::WebPageProxy::creationParameters):
2675
2676         Stopped calling WebPaymentCoordinatorProxy::availablePaymentNetworks().
2677
2678         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2679         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
2680         (WebKit::WebPaymentCoordinator::validatedPaymentNetwork):
2681         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2682
2683         Implemented PaymentCoordinatorClient::validatedPaymentNetwork(). m_availablePaymentNetworks
2684         starts off as std::nullopt, but is initialized by sending the AvailablePaymentNetworks sync
2685         message the first time it's accessed.
2686
2687         * WebProcess/WebPage/WebPage.cpp:
2688         (WebKit::WebPage::WebPage):
2689
2690         Stopped setting PageConfiguration::availablePaymentNetworks.
2691
2692 2018-01-20  Jer Noble  <jer.noble@apple.com>
2693
2694         Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
2695         https://bugs.webkit.org/show_bug.cgi?id=181840
2696         <rdar://problem/36186214>
2697
2698         Reviewed by Simon Fraser.
2699
2700         Updating layout while the document is suspended or stopped is unsafe.
2701
2702         * WebProcess/cocoa/VideoFullscreenManager.mm:
2703         (WebKit::inlineVideoFrame):
2704
2705 2018-01-20  Chris Dumez  <cdumez@apple.com>
2706
2707         DOMCache data sometimes not properly removed when clearing data for a given origin
2708         https://bugs.webkit.org/show_bug.cgi?id=181887
2709         <rdar://problem/36671239>
2710
2711         Reviewed by Youenn Fablet.
2712
2713         * NetworkProcess/cache/CacheStorageEngine.cpp:
2714         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
2715         This code was iterating through folders on disk, then reading the folder's origin
2716         from the origin file on disk. Then, if the origin would match the one we want to
2717         delete, it would regenerate the folder path using cachesRootPath(*folderOrigin).
2718         I don't know how but on my machine, I was ended up in a state where the path
2719         generated by cachesRootPath(*folderOrigin) differed from the actual folder path
2720         we read the origin from (Likely a different salt?). To make the code more robust,
2721         I updated the code to delete "folderPath", which is the path we read the origin
2722         from.
2723
2724 2018-01-19  Zach Li  <zacharyli323@gmail.com>
2725
2726         Expose Safe Browsing SPI
2727         https://bugs.webkit.org/show_bug.cgi?id=181804
2728         <rdar://problem/36626946>
2729
2730         Reviewed by Dan Bernstein.
2731
2732         If client is using Apple internal SDK, then we can just import the header; if not,
2733         then we declare necessary symbols that client will need.
2734
2735         * Configurations/WebKit.xcconfig:
2736         Only link against SafariSafeBrowsing framework on macOS High Sierra
2737         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
2738         because it is not present on the Base system.
2739
2740         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
2741
2742         * WebKit.xcodeproj/project.pbxproj:
2743         Added SafeBrowsingSPI.h.
2744
2745         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
2746         Added.
2747
2748 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
2749
2750         Unreviewed build fix, removed unused lambda capture.
2751
2752         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2753         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2754
2755 2018-01-19  John Wilander  <wilander@apple.com>
2756
2757         Resource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTestingEvent() to fix API test
2758         https://bugs.webkit.org/show_bug.cgi?id=181890
2759         <rdar://problem/36674772>
2760
2761         Unreviewed API test fix.
2762
2763         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2764         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2765
2766 2018-01-19  Youenn Fablet  <youenn@apple.com>
2767
2768         Do not go to the storage process when registering a service worker client if there is no service worker registered
2769         https://bugs.webkit.org/show_bug.cgi?id=181740
2770         <rdar://problem/36650400>
2771
2772         Reviewed by Chris Dumez.
2773
2774         UIProcess notifies all web processes to register their service worker clients when spinning the service worker process.
2775         Add private API to set the number of web processes for testing purposes.
2776
2777         * UIProcess/API/Cocoa/WKProcessPool.mm:
2778         (-[WKProcessPool _setMaximumNumberOfProcesses:]):
2779         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2780         * UIProcess/WebProcessPool.cpp:
2781         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2782         * WebProcess/WebProcess.cpp:
2783         (WebKit::WebProcess::registerServiceWorkerClients):
2784         * WebProcess/WebProcess.h:
2785         * WebProcess/WebProcess.messages.in:
2786
2787 2018-01-19  Dean Jackson  <dino@apple.com>
2788
2789         REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
2790         https://bugs.webkit.org/show_bug.cgi?id=181817
2791         <rdar://problem/35274055>
2792
2793         Reviewed by Simon Fraser.
2794
2795         Add a linked-on-or-after check to set passive touch listeners on document in WebCore.
2796
2797         * CMakeLists.txt:
2798         * Shared/WebPreferences.yaml:
2799         * Shared/WebPreferencesDefaultValues.cpp: Copied from Source/WebKit/UIProcess/Cocoa/VersionChecks.h.
2800         (defaultPassiveTouchListenersAsDefaultOnDocument):
2801         * Shared/WebPreferencesDefaultValues.h:
2802         * UIProcess/Cocoa/VersionChecks.h:
2803         * WebKit.xcodeproj/project.pbxproj:
2804
2805 2018-01-19  Joseph Pecoraro  <pecoraro@apple.com>
2806
2807         [Cocoa] _WKNSWindowExtras.h: Add missing availability annotation
2808         https://bugs.webkit.org/show_bug.cgi?id=181868
2809
2810         Reviewed by Dan Bernstein.
2811
2812         * Shared/API/Cocoa/_WKNSWindowExtras.h:
2813
2814 2018-01-19  John Wilander  <wilander@apple.com>
2815
2816         Resource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes
2817         https://bugs.webkit.org/show_bug.cgi?id=181870
2818         <rdar://problem/36666750>
2819
2820         Unreviewed build fix.
2821
2822         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2823
2824 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
2825
2826         Unreviewed, rolling out r227211.
2827
2828         Breaks iOS Simulator tests.
2829
2830         Reverted changeset:
2831
2832         "Expose Safe Browsing SPI"
2833         https://bugs.webkit.org/show_bug.cgi?id=181804
2834         https://trac.webkit.org/changeset/227211
2835
2836 2018-01-19  John Wilander  <wilander@apple.com>
2837
2838         Resource Load Statistics: Implement callback support for removal of WebsiteDataType::ResourceLoadStatistics
2839         https://bugs.webkit.org/show_bug.cgi?id=181822
2840         https://bugs.webkit.org/show_bug.cgi?id=175263
2841         https://bugs.webkit.org/show_bug.cgi?id=178536
2842         https://bugs.webkit.org/show_bug.cgi?id=181223
2843         https://bugs.webkit.org/show_bug.cgi?id=181482
2844         <rdar://problem/33491222>
2845         <rdar://problem/33805293>
2846         <rdar://problem/36332683>
2847         <rdar://problem/36549026>
2848
2849         Reviewed by Alex Christensen.
2850
2851         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2852         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2853         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2854         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2855         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
2856             Calls the new API with no-op completion handler.
2857         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]):
2858             New API with completion handler.
2859         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
2860             Calls the new API with no-op completion handler.
2861         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]):
2862             New API with completion handler.
2863         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2864         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2865         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
2866         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2867         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2868         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2869         * UIProcess/WebResourceLoadStatisticsStore.h:
2870         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2871         (WebKit::WebsiteDataStore::removeData):
2872         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
2873         * UIProcess/WebsiteData/WebsiteDataStore.h:
2874
2875 2018-01-19  Daniel Bates  <dabates@apple.com>
2876
2877         REGRESSION (r223149): Ref WebPageProxy objects before calling their functionality
2878         https://bugs.webkit.org/show_bug.cgi?id=181863
2879         <rdar://problem/36662452>
2880
2881         Reviewed by Chris Dumez.
2882
2883         More fix ups following r223149. When notifying all pages of a process state change we need to
2884         take care to ref all the pages before iterating over them and notifying them of the change.
2885         Notifying a page of such a state change may ultimately delegate to the embedding client. And
2886         the embedding client can do anything, including deallocating one or more pages.
2887
2888         * UIProcess/WebProcessProxy.cpp:
2889         (WebKit::WebProcessProxy::didBecomeUnresponsive):
2890         (WebKit::WebProcessProxy::didBecomeResponsive):
2891         (WebKit::WebProcessProxy::willChangeIsResponsive):
2892         (WebKit::WebProcessProxy::didChangeIsResponsive):
2893         (WebKit::WebProcessProxy::requestTermination):
2894
2895 2018-01-19  Chris Dumez  <cdumez@apple.com>
2896
2897         The WebContent process should not process incoming IPC while waiting for a sync IPC reply
2898         https://bugs.webkit.org/show_bug.cgi?id=181560
2899
2900         Reviewed by Ryosuke Niwa.
2901
2902         The WebContent process should not process incoming IPC while waiting for a sync IPC reply.
2903         This is causing hard-to-debug crashes because developers often assume the state does not
2904         change during a sendSync() call.
2905
2906         * Platform/IPC/Connection.cpp:
2907         (IPC::Connection::waitForSyncReply):
2908         * Platform/IPC/Connection.h:
2909         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply):
2910         * UIProcess/WebProcessProxy.cpp:
2911         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
2912         * UIProcess/WebProcessProxy.h:
2913         * UIProcess/WebProcessProxy.messages.in:
2914         * WebProcess/Network/NetworkProcessConnection.cpp:
2915         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
2916         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2917         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
2918         * WebProcess/WebConnectionToUIProcess.cpp:
2919         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
2920         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2921         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
2922         * WebProcess/WebCoreSupport/WebChromeClient.h:
2923         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2924         (WebKit::WebEditorClient::undo):
2925         (WebKit::WebEditorClient::redo):
2926         * WebProcess/WebProcess.cpp:
2927         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
2928         * WebProcess/WebProcess.h:
2929         * WebProcess/WebProcess.messages.in:
2930
2931 2018-01-19  Keith Miller  <keith_miller@apple.com>
2932
2933         HaveInternalSDK includes should be "#include?"
2934         https://bugs.webkit.org/show_bug.cgi?id=179670
2935
2936         Reviewed by Dan Bernstein.
2937
2938         * Configurations/Base.xcconfig:
2939
2940 2018-01-19  Daniel Bates  <dabates@apple.com>
2941
2942         Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
2943
2944         * WebProcess/Plugins/PDF/PDFPlugin.h:
2945         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2946         (WebKit::PDFPlugin::willDetachRenderer):
2947         (WebKit::PDFPlugin::willDetatchRenderer): Deleted.
2948         * WebProcess/Plugins/Plugin.h:
2949         (WebKit::Plugin::willDetachRenderer):
2950         (WebKit::Plugin::willDetatchRenderer): Deleted.
2951         * WebProcess/Plugins/PluginView.cpp:
2952         (WebKit::PluginView::willDetachRenderer):
2953         (WebKit::PluginView::willDetatchRenderer): Deleted.
2954         * WebProcess/Plugins/PluginView.h:
2955
2956 2018-01-19  Zach Li  <zacharyli323@gmail.com>
2957
2958         Expose Safe Browsing SPI
2959         https://bugs.webkit.org/show_bug.cgi?id=181804
2960         <rdar://problem/36626946>
2961
2962         Reviewed by Alex Christensen.
2963
2964         If client is using Apple internal SDK, then we can just import the header; if not,
2965         then we declare necessary symbols that client will need.
2966
2967         * Configurations/WebKit.xcconfig:
2968         Only link against SafariSafeBrowsing framework on macOS High Sierra
2969         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
2970         because it is not present on the Base system.
2971
2972         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
2973
2974         * WebKit.xcodeproj/project.pbxproj:
2975         Added SafeBrowsingSPI.h.
2976
2977         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
2978         Added.
2979
2980 2018-01-18  Chris Dumez  <cdumez@apple.com>
2981
2982         We should be able to terminate service workers that are unresponsive
2983         https://bugs.webkit.org/show_bug.cgi?id=181563
2984         <rdar://problem/35280031>
2985
2986         Reviewed by Alex Christensen.
2987
2988         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2989         (WebKit::WebSWContextManagerConnection::terminateWorker):
2990         Use a 10 second timeout for forcefully exiting the service worker process when
2991         the service worker in question fails to terminate.
2992
2993         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
2994         Use a 100ms timeout for forcefully exiting the service worker process when
2995         the service worker in question fails to terminate. This method is only called
2996         from the layout tests, which is why we use a very short timeout.
2997
2998 2018-01-18  Ryan Haddad  <ryanhaddad@apple.com>
2999
3000         Unreviewed, suppress deprecation warnings to fix the build with a newer SDK.
3001
3002         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
3003         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
3004
3005 2018-01-18  Youenn Fablet  <youenn@apple.com>
3006
3007         Do not go to the storage process when loading a main resource if there is no service worker registered
3008         https://bugs.webkit.org/show_bug.cgi?id=181395
3009
3010         Reviewed by Chris Dumez.
3011
3012         Add a new web process creation parameter to know whether there is any service worker registered at web process creation time.
3013         If there is none, the web process will then start to load HTTP resources from the network.
3014         The connection to the storage process is then executed when receiving the first bytes of the main resource.
3015         This connection is needed as other web processes may create service workers at any given time.
3016         If there is one registered service worker, the web process will wait for its connection to the storage process to be active.
3017
3018         * Shared/WebProcessCreationParameters.cpp:
3019         (WebKit::WebProcessCreationParameters::encode const):
3020         (WebKit::WebProcessCreationParameters::decode):
3021         * Shared/WebProcessCreationParameters.h:
3022         * UIProcess/ServiceWorkerProcessProxy.cpp:
3023         (WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers):
3024         * UIProcess/ServiceWorkerProcessProxy.h:
3025         * UIProcess/WebProcessPool.cpp:
3026         (WebKit::WebProcessPool::initializeNewWebProcess):
3027         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3028         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
3029         * WebProcess/Storage/WebServiceWorkerProvider.h:
3030         * WebProcess/Storage/WebToStorageProcessConnection.h:
3031         (WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession):
3032         * WebProcess/WebProcess.cpp:
3033         (WebKit::WebProcess::initializeWebProcess):
3034
3035 2018-01-18  Chris Dumez  <cdumez@apple.com>
3036
3037         Regression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects
3038         https://bugs.webkit.org/show_bug.cgi?id=181771
3039         <rdar://problem/36566237>
3040
3041         Reviewed by Brady Eidson.
3042
3043         * UIProcess/WebProcessProxy.cpp:
3044         (WebKit::WebProcessProxy::didClose):
3045         Use copyToVectorOf<RefPtr<WebPageProxy>>() to maintain pre-r223149 behavior
3046         and ref the pages.
3047
3048 2018-01-18  Dan Bernstein  <mitz@apple.com>
3049
3050         [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
3051         https://bugs.webkit.org/show_bug.cgi?id=181803
3052
3053         Reviewed by Tim Horton.
3054
3055         * Configurations/Base.xcconfig: Updated.
3056         * Configurations/DebugRelease.xcconfig: Ditto.
3057         * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
3058         * Configurations/Version.xcconfig: Updated.
3059         * Configurations/macOSTargetConditionals.xcconfig: Added.  Defines helper build settings
3060           useful for defining settings that depend on the target macOS version.
3061
3062 2018-01-18  Chris Dumez  <cdumez@apple.com>
3063
3064         Service Workers restored from persistent storage have 'redundant' state
3065         https://bugs.webkit.org/show_bug.cgi?id=181749
3066         <rdar://problem/36556486>
3067
3068         Reviewed by Youenn Fablet.
3069
3070         Allow service workers to intercept custom protocol loads as this is useful for
3071         API testing.
3072
3073         * WebProcess/Network/WebLoaderStrategy.cpp:
3074         (WebKit::WebLoaderStrategy::scheduleLoad):
3075         (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
3076         * WebProcess/Network/WebLoaderStrategy.h:
3077
3078 2018-01-18  Brent Fulgham  <bfulgham@apple.com>
3079
3080         REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences
3081         https://bugs.webkit.org/show_bug.cgi?id=181797
3082         <rdar://problem/36546412>
3083
3084         Reviewed by Eric Carlson.
3085
3086         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for
3087         'com.apple.lookup.shared' to support DataDetectors.
3088
3089 2018-01-17  John Wilander  <wilander@apple.com>
3090
3091         Resource Load Statistics: Block cookies for prevalent resources without user interaction
3092         https://bugs.webkit.org/show_bug.cgi?id=177394
3093         <rdar://problem/34613960>
3094
3095         Reviewed by Alex Christensen.
3096
3097         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3098             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
3099             cookie blocking.
3100         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3101         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
3102             Returns singleton empty, deny-all cookie storage for cookie blocking.
3103             The ugly pragma instructions for clang are because the NSString
3104             parameter for _initWithIdentifier was not marked nullable pre-Sierra.
3105         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
3106             Instead of just decision making, this now applies the policy.
3107         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
3108             New method.
3109         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3110             Now blocks cookies for domains where cookies will be purged anyway.
3111         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3112             Now blocks cookies for domains where cookies will be purged anyway.
3113         (WebKit::shouldChangePartition): Deleted.
3114         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3115         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3116             Now downgrades for blocked cookies instead of partitioned cookies.
3117         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3118             Now downgrades for blocked cookies instead of partitioned cookies.
3119
3120
3121 2018-01-17  Stephan Szabo  <stephan.szabo@sony.com>
3122
3123         [Curl] Use ResourceRequest::encodeWithPlatformData()
3124         https://bugs.webkit.org/show_bug.cgi?id=181768
3125
3126         Reviewed by Alex Christensen.
3127
3128         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
3129         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3130         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3131
3132 2018-01-17  Matt Lewis  <jlewis3@apple.com>
3133
3134         Unreviewed, rolling out r227076.
3135
3136         This breaks internal builds
3137
3138         Reverted changeset:
3139
3140         "Resource Load Statistics: Block cookies for prevalent
3141         resources without user interaction"
3142         https://bugs.webkit.org/show_bug.cgi?id=177394
3143         https://trac.webkit.org/changeset/227076
3144
3145 2018-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3146
3147         WEBKIT_FRAMEWORK should not modify file-global include directories
3148         https://bugs.webkit.org/show_bug.cgi?id=181656
3149
3150         Reviewed by Konstantin Tokarev.
3151
3152         * PlatformGTK.cmake:
3153         * PlatformWPE.cmake:
3154
3155 2018-01-17  Youenn Fablet  <youenn@apple.com>
3156
3157         Put fetch request keepAlive behind a runtime flag
3158         https://bugs.webkit.org/show_bug.cgi?id=181592
3159
3160         Reviewed by Chris Dumez.
3161
3162         * Shared/WebPreferences.yaml:
3163         * UIProcess/API/C/WKPreferences.cpp:
3164         (WKPreferencesSetFetchAPIKeepAliveEnabled):
3165         (WKPreferencesGetFetchAPIKeepAliveEnabled):
3166         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3167
3168 2018-01-17  John Wilander  <wilander@apple.com>
3169
3170         Resource Load Statistics: Block cookies for prevalent resources without user interaction
3171         https://bugs.webkit.org/show_bug.cgi?id=177394
3172         <rdar://problem/34613960>
3173
3174         Reviewed by Alex Christensen.
3175
3176         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3177             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
3178             cookie blocking.
3179         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3180         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
3181             Returns singleton empty, deny-all cookie storage for cookie blocking.
3182         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
3183             Instead of just decision making, this now applies the policy.
3184         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
3185             New method.
3186         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3187             Now blocks cookies for domains where cookies will be purged anyway.
3188         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3189             Now blocks cookies for domains where cookies will be purged anyway.
3190         (WebKit::shouldChangePartition): Deleted.
3191         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3192         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3193             Now downgrades for blocked cookies instead of partitioned cookies.
3194         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3195             Now downgrades for blocked cookies instead of partitioned cookies.
3196
3197 2018-01-17  Daniel Bates  <dabates@apple.com>
3198
3199         REGRESSION (r222795): Cardiogram never signs in
3200         https://bugs.webkit.org/show_bug.cgi?id=181693
3201         <rdar://problem/36286293>
3202
3203         Reviewed by Ryosuke Niwa.
3204
3205         Exempt Cardiogram from the XHR header restrictions in r222795.
3206
3207         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
3208         However Cardiogram also depends on such functionality.
3209
3210         * Shared/WebPreferences.yaml:
3211         * UIProcess/API/Cocoa/WKWebView.mm:
3212         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
3213         (-[WKWebView _initializeWithConfiguration:]):
3214         * UIProcess/Cocoa/VersionChecks.h:
3215
3216 2018-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3217
3218         Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
3219         https://bugs.webkit.org/show_bug.cgi?id=181637
3220         <rdar://problem/36508471>
3221
3222         Reviewed by Tim Horton.
3223
3224         Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to
3225         represent an archive resource, given the resource's data and MIME type.
3226
3227         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
3228         (API::InjectedBundle::EditorClient::replacementURLForResource):
3229         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
3230         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
3231
3232         Add replacementURLForResource, and also bump the current injected bundle editor client version to 2.
3233
3234         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3235         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
3236         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
3237         (WebKit::InjectedBundlePageEditorClient::replacementURLForResource):
3238         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
3239         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3240         (WebKit::WebEditorClient::replacementURLForResource):
3241         * WebProcess/WebCoreSupport/WebEditorClient.h:
3242
3243 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
3244
3245         [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
3246         https://bugs.webkit.org/show_bug.cgi?id=181725
3247
3248         Reviewed by Carlos Garcia Campos.
3249
3250         * Shared/cairo/ShareableBitmapCairo.cpp:
3251         (WebKit::ShareableBitmap::paint):
3252         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
3253         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
3254         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
3255
3256 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3257
3258         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.
3259
3260         * gtk/NEWS: Add release notes for 2.19.6.
3261
3262 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3263
3264         [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
3265         https://bugs.webkit.org/show_bug.cgi?id=179914
3266
3267         Reviewed by Žan Doberšek.
3268
3269         Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script.
3270
3271         * webkitglib-symbols.map:
3272
3273 2018-01-17  Youenn Fablet  <youenn@apple.com>
3274
3275         Clear Caches volatile storage as a memory optimization.
3276         https://bugs.webkit.org/show_bug.cgi?id=181643
3277
3278         Reviewed by Chris Dumez.
3279
3280         clearMemoryRepresentation clears m_caches which exposes data potentially stored in m_volatileStorage.
3281         Clearing m_volatileStorage allows releasing some memory.
3282
3283         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3284         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3285
3286 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
3287
3288         [Cairo] Use one-time ShadowBlur objects when performing shadowing
3289         https://bugs.webkit.org/show_bug.cgi?id=181720
3290
3291         Reviewed by Carlos Garcia Campos.
3292
3293         * Shared/cairo/ShareableBitmapCairo.cpp:
3294         (WebKit::ShareableBitmap::paint):
3295         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
3296         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
3297         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
3298
3299 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
3300
3301         [CMake] Remove WebCoreDerivedSources library target
3302         https://bugs.webkit.org/show_bug.cgi?id=181664
3303
3304         Reviewed by Carlos Garcia Campos.
3305
3306         * CMakeLists.txt: Do not link WebCoreDerivedSources.
3307         * PlatformGTK.cmake: Appended WebCore after WebCorePlatformGTK in WebKit_LIBRARIES.
3308         * PlatformWin.cmake: Ditto.
3309
3310 2018-01-16  Alex Christensen  <achristensen@webkit.org>
3311
3312         Merge sync and async code paths for getting context menus
3313         https://bugs.webkit.org/show_bug.cgi?id=181423
3314
3315         Reviewed by Joseph Pecoraro.
3316
3317         What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
3318         This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
3319         There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
3320         case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!
3321
3322         * UIProcess/API/APIContextMenuClient.h:
3323         (API::ContextMenuClient::getContextMenuFromProposedMenu):
3324         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
3325         * UIProcess/API/C/WKPage.cpp:
3326         (WKPageSetPageContextMenuClient):
3327         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
3328         * UIProcess/WebContextMenuProxy.h:
3329         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3330         (WebKit::WebContextMenuProxyGtk::show):
3331         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
3332         * UIProcess/gtk/WebContextMenuProxyGtk.h:
3333         * UIProcess/mac/WebContextMenuProxyMac.h:
3334         * UIProcess/mac/WebContextMenuProxyMac.mm:
3335         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
3336         (WebKit::WebContextMenuProxyMac::showContextMenu):
3337         * UIProcess/wpe/WebContextMenuProxyWPE.h:
3338
3339 2018-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
3340
3341         Don't link WebKit target directly to JavaScriptCore
3342         https://bugs.webkit.org/show_bug.cgi?id=181688
3343
3344         Reviewed by Alex Christensen.
3345
3346         It's safer if we only link to the next lower-layered lib in the stack, so let's just link
3347         directly to WebCore instead.
3348
3349         And WPE doesn't need to specify it twice.
3350
3351         * CMakeLists.txt:
3352         * PlatformMac.cmake:
3353         * PlatformWPE.cmake:
3354
3355 2018-01-16  Eric Carlson  <eric.carlson@apple.com>
3356
3357         AVSampleBufferDisplayLayer should be flushed when application activates
3358         https://bugs.webkit.org/show_bug.cgi?id=181623
3359         <rdar://problem/36487738>
3360
3361         Reviewed by Darin Adler.
3362
3363         * WebProcess/WebPage/ios/WebPageIOS.mm:
3364         (WebKit::WebPage::applicationWillResignActive): Call page.
3365         (WebKit::WebPage::applicationDidEnterBackground): Ditto, let it call libWebRTCProvider.
3366         (WebKit::WebPage::applicationWillEnterForeground): Call page.
3367         (WebKit::WebPage::applicationDidBecomeActive): Ditto, let it call libWebRTCProvider.
3368
3369 2018-01-16  Zach Li  <zachli@apple.com>
3370
3371         Add pop-up policy support in website policies.
3372         https://bugs.webkit.org/show_bug.cgi?id=181544.
3373         rdar://problem/30521400.
3374
3375         Reviewed by Alex Christensen.
3376
3377         * Shared/WebsitePoliciesData.cpp: Encode and decode
3378         pop-up policy.
3379         (WebKit::WebsitePoliciesData::encode const):
3380         (WebKit::WebsitePoliciesData::decode):
3381         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
3382         Apply the pop-up policy from website policies to the
3383         document loader.
3384
3385         * Shared/WebsitePoliciesData.h:
3386
3387         * Shared/WebsitePopUpPolicy.h:
3388         Added for declaring enum WebsitePopUpPolicy.
3389
3390         * UIProcess/API/APIWforebsitePolicies.cpp:
3391         Include pop-up policy in website policies.
3392         (API::WebsitePolicies::WebsitePolicies):
3393         (API::WebsitePolicies::data):
3394         * UIProcess/API/APIWebsitePolicies.h:
3395
3396         * UIProcess/API/C/WKWebsitePolicies.cpp:
3397         Added C API to get and set pop-up policy on
3398         website policies.
3399         (WKWebsitePoliciesGetPopUpPolicy):
3400         (WKWebsitePoliciesSetPopUpPolicy):
3401         * UIProcess/API/C/WKWebsitePolicies.h:
3402
3403         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3404         Added Obj-C API to get and set pop-up policy
3405         on website policies.
3406         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3407         (-[_WKWebsitePolicies setPopUpPolicy:]):
3408         (-[_WKWebsitePolicies popUpPolicy]):
3409
3410         * WebKit.xcodeproj/project.pbxproj:
3411         Added WebsitePopUpPolicy.h.
3412
3413 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
3414
3415         [CMake][Mac] Fix the build errors
3416         https://bugs.webkit.org/show_bug.cgi?id=181665
3417
3418         Reviewed by Alex Christensen.
3419
3420         * CMakeLists.txt: Added TouchBarMenuData.cpp and TouchBarMenuItemData.cpp to compile.
3421         * PlatformMac.cmake: Added _WKApplicationManifest.mm, WKInspectorWKWebView.mm and WKInspectorWindow.mm to compile.
3422         * UIProcess/API/Cocoa/WKProcessPool.mm:
3423         (-[WKProcessPool _webPageContentProcessCount]): Call WebProcessPool::serviceWorkerProxy() only if ENABLE(SERVICE_WORKER).
3424
3425 2018-01-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3426
3427         [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
3428         https://bugs.webkit.org/show_bug.cgi?id=181638
3429         <rdar://problem/36508702>
3430
3431         Reviewed by Dan Bernstein.
3432
3433         Add a `source` parameter to the `didInsertAttachment` codepath for notifying WebKit2 clients when attachment
3434         elements are inserted into the document.
3435
3436         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3437         * UIProcess/API/Cocoa/WKWebView.mm:
3438         (-[WKWebView _didInsertAttachment:withSource:]):
3439         (-[WKWebView _didInsertAttachment:]): Deleted.
3440         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3441         * UIProcess/Cocoa/PageClientImplCocoa.h:
3442         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3443         (WebKit::PageClientImplCocoa::didInsertAttachment):
3444         * UIProcess/PageClient.h:
3445         (WebKit::PageClient::didInsertAttachment):
3446         * UIProcess/WebPageProxy.cpp:
3447         (WebKit::WebPageProxy::didInsertAttachment):
3448         * UIProcess/WebPageProxy.h:
3449         * UIProcess/WebPageProxy.messages.in:
3450         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3451         (WebKit::WebEditorClient::didInsertAttachment):
3452         * WebProcess/WebCoreSupport/WebEditorClient.h:
3453
3454 2018-01-15  Youenn Fablet  <youenn@apple.com>
3455
3456         ASSERTION FAILED: m_ptr under WebKit::CacheStorage::Caches::writeRecord
3457         https://bugs.webkit.org/show_bug.cgi?id=181401
3458         <rdar://problem/36379022>
3459
3460         Reviewed by Darin Adler.
3461
3462         m_isInitialized is true but m_storage is set to nullptr when calling writeRecord.
3463         The only case seems to be if:
3464         - We are doing persistent storage
3465         - We are traversing the storage to do the initialization. At that point m_storage is set to a correct value.
3466         - clearMemoryRepresentation is called, thus setting m_storage to nullptr and m_isInitialized to false.
3467         We fix this by making clearMemoryRepresentation a no-op if we are initializing the caches.
3468         clearMemoryRepresentation is about cleaning the in-memory information of the caches and the memory representation is empty at init time.
3469         Nullifying m_storage is a memory consumption optimization.
3470
3471         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3472         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3473
3474 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3475
3476         Unreviewed, speculative build fix after r226899.
3477
3478         Add an empty implementation for PageClient::startDrag.
3479
3480         * UIProcess/PageClient.h:
3481         (WebKit::PageClient::startDrag):
3482
3483 2018-01-12  Brent Fulgham  <bfulgham@apple.com>
3484
3485         [iOS] Remove unneeded accessibility-related sandbox rules
3486         https://bugs.webkit.org/show_bug.cgi?id=181619