Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-10-13  Tim Horton  <timothy_horton@apple.com>
2
3         Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
4         https://bugs.webkit.org/show_bug.cgi?id=163364
5         <rdar://problem/28012494>
6
7         Reviewed by Geoff Garen.
8
9         Some clients may not want the default WKWebView behavior where we synchronously
10         block on the Web process after the first time a WKWebView is re-added to the window,
11         because they are e.g. parenting re-used WKWebViews while scrolling.
12
13         * UIProcess/API/APIPageConfiguration.h:
14         (API::PageConfiguration::shouldSynchronizeInitialPaintAfterMovingToWindow):
15         (API::PageConfiguration::setShouldSynchronizeInitialPaintAfterMovingToWindow):
16         * UIProcess/API/Cocoa/WKWebView.mm:
17         (-[WKWebView _initializeWithConfiguration:]):
18         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
19         (-[WKWebViewConfiguration init]):
20         (-[WKWebViewConfiguration copyWithZone:]):
21         (-[WKWebViewConfiguration _shouldSynchronizeInitialPaintAfterMovingToWindow]):
22         (-[WKWebViewConfiguration _setShouldSynchronizeInitialPaintAfterMovingToWindow:]):
23         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
24         * UIProcess/WebPageProxy.h:
25         * UIProcess/WebPageProxy.cpp:
26         (WebKit::WebPageProxy::WebPageProxy):
27         Add and plumb a new WKWebView configuration parameter.
28
29         (WebKit::WebPageProxy::dispatchViewStateChange):
30         If the new configuration parameter is set, don't block the main thread when
31         a view is reparented.
32
33 2016-10-12  Chris Dumez  <cdumez@apple.com>
34
35         [Web IDL] Drop support for legacy [ConstructorConditional=*]
36         https://bugs.webkit.org/show_bug.cgi?id=163368
37
38         Reviewed by Ryosuke Niwa.
39
40         Drop ENABLE_DOM4_EVENTS_CONSTRUCTOR compiler flag.
41
42         * Configurations/FeatureDefines.xcconfig:
43
44 2016-10-12  Alex Christensen  <achristensen@webkit.org>
45
46         Fix assertion after switching to URLParser
47         https://bugs.webkit.org/show_bug.cgi?id=163350
48         rdar://problem/28739938
49
50         Reviewed by Brady Eidson.
51         
52         Covered by a new API test.
53
54         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
55         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
56         The { } here is not understood by the compiler to mean WebCore::URL(), but rather the empty constructor for the enum ParsedURLStringTag.
57         We used to be unsafely trusting that the URL was valid and canonicalized, but with URLParser we are canonicalizing it,
58         and the assertion (url == m_string) in URL.cpp was failing.
59
60 2016-10-12  Anders Carlsson  <andersca@apple.com>
61
62         Remove an unused function
63         https://bugs.webkit.org/show_bug.cgi?id=163341
64
65         Reviewed by Dan Bernstein.
66
67         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
68         (WebKit::WebBackForwardListProxy::isActive): Deleted.
69         * WebProcess/WebPage/WebBackForwardListProxy.h:
70
71 2016-10-11  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
72
73         [EFL] Update API tests which are passed or failed
74         https://bugs.webkit.org/show_bug.cgi?id=163322
75
76         Unreviewed, simple on/off API test.
77
78         *ewk_favicon_database_clear* has been crashed for a long time, however
79         *ewk_cookie_manager_permanent_storage* is fine now. So the passing test
80         is enabled again, and disable the failure tests.
81
82         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
83         (TEST_F):
84         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
85         (TEST_F):
86
87 2016-10-11  Daniel Bates  <dabates@apple.com>
88
89         Attempt to fix the Apple Internal Mac build following r207159
90         (https://bugs.webkit.org/show_bug.cgi?id=163244)
91
92         * UIProcess/API/Cocoa/WKWebView.mm:
93         (shouldRequireUserGestureToLoadVideo):
94
95 2016-10-11  Anders Carlsson  <andersca@apple.com>
96
97         Clean up WebPageGroup somewhat
98         https://bugs.webkit.org/show_bug.cgi?id=163299
99
100         Reviewed by Tim Horton.
101
102         * Shared/API/c/WKDeprecatedFunctions.cpp:
103         (WKPageGroupCopyIdentifier):
104         Move this here from WKPageGroup.
105
106         (WKPageGroupAddUserContentFilter):
107         (WKPageGroupRemoveUserContentFilter):
108         (WKPageGroupRemoveAllUserContentFilters):
109         Just call directly into the user content controller.
110
111         * UIProcess/API/C/WKPageGroup.cpp:
112         (WKPageGroupAddUserStyleSheet):
113         (WKPageGroupRemoveAllUserStyleSheets):
114         (WKPageGroupAddUserScript):
115         (WKPageGroupRemoveAllUserScripts):
116         Just call directly into the user content controller.
117
118         * UIProcess/API/C/WKPageGroup.h:
119         * UIProcess/WebPageGroup.cpp:
120         (WebKit::WebPageGroup::addUserStyleSheet): Deleted.
121         (WebKit::WebPageGroup::addUserScript): Deleted.
122         (WebKit::WebPageGroup::removeAllUserStyleSheets): Deleted.
123         (WebKit::WebPageGroup::removeAllUserScripts): Deleted.
124         (WebKit::WebPageGroup::removeAllUserContent): Deleted.
125         (WebKit::WebPageGroup::addUserContentExtension): Deleted.
126         (WebKit::WebPageGroup::removeUserContentExtension): Deleted.
127         (WebKit::WebPageGroup::removeAllUserContentExtensions): Deleted.
128         Get rid of these, all their callers just call into the user content controller now.
129
130         * UIProcess/WebPageGroup.h:
131         (WebKit::WebPageGroup::identifier): Deleted.
132         (WebKit::WebPageGroup::sendToAllProcessesInGroup): Deleted.
133         Remove unused code.
134
135 2016-10-11  Daniel Bates  <dabates@apple.com>
136
137         [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
138         https://bugs.webkit.org/show_bug.cgi?id=163244
139         <rdar://problem/27250015>
140
141         Reviewed by Jer Noble.
142
143         Enable or disable the Setting::requiresUserGestureToLoadVideo() in WebKit depending on the
144         version of iOS SDK that the app was linked against. We require a user gesture to begin
145         loading a video as of iOS 10.
146
147         * Shared/WebPreferencesDefinitions.h:
148         * UIProcess/API/Cocoa/WKWebView.mm:
149         (shouldRequireUserGestureToLoadVideo): Added.
150         (-[WKWebView _initializeWithConfiguration:]): Set the requiresUserGestureToLoadVideo preference.
151         * WebProcess/WebPage/WebPage.cpp:
152         (WebKit::WebPage::updatePreferences): Modified to pass the WebKit requiresUserGestureToLoadVideo
153         preference to WebCore.
154
155 2016-10-11  Alex Christensen  <achristensen@webkit.org>
156
157         Remove dead networking code
158         https://bugs.webkit.org/show_bug.cgi?id=163263
159
160         Reviewed by Daniel Bates.
161
162         * NetworkProcess/Downloads/Download.h:
163         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
164         * NetworkProcess/Downloads/mac/DownloadMac.mm:
165         * NetworkProcess/NetworkLoad.h:
166         * NetworkProcess/mac/NetworkLoadMac.mm:
167         (WebKit::NetworkLoad::willCacheResponseAsync): Deleted.
168         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
169         (WebKit::AuthenticationManager::receivedCredential):
170         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
171         (WebKit::AuthenticationManager::receivedCancellation):
172         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
173         (WebKit::AuthenticationManager::receivedChallengeRejection):
174         * Shared/WebProcessCreationParameters.cpp:
175         (WebKit::WebProcessCreationParameters::encode):
176         (WebKit::WebProcessCreationParameters::decode):
177         * Shared/WebProcessCreationParameters.h:
178         * Shared/mac/WebCoreArgumentCodersMac.mm:
179         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
180         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
181         * WebKit2.xcodeproj/project.pbxproj:
182
183 2016-10-11  Anders Carlsson  <andersca@apple.com>
184
185         Move no longer used functions to WKDeprecatedFunctions.cpp
186         https://bugs.webkit.org/show_bug.cgi?id=163290
187
188         Reviewed by Dan Bernstein.
189
190         * Shared/API/c/WKDeprecatedFunctions.cpp:
191         (WKPageGroupAddUserContentFilter):
192         (WKPageGroupRemoveUserContentFilter):
193         (WKPageGroupRemoveAllUserContentFilters):
194         (WKContextSetProcessModel): Deleted.
195         * UIProcess/API/C/WKPageGroup.cpp:
196         (WKPageGroupRemoveAllUserScripts):
197         (WKPageGroupAddUserContentFilter): Deleted.
198         (WKPageGroupRemoveUserContentFilter): Deleted.
199         (WKPageGroupRemoveAllUserContentFilters): Deleted.
200         * UIProcess/API/C/WKPageGroup.h:
201
202 2016-10-11  Konstantin Tokarev  <annulen@yandex.ru>
203
204         Use modern for loops for iterating supplement maps
205         https://bugs.webkit.org/show_bug.cgi?id=163274
206
207         Reviewed by Alex Christensen.
208
209         * NetworkProcess/NetworkProcess.cpp:
210         (WebKit::NetworkProcess::initializeNetworkProcess):
211         (WebKit::NetworkProcess::initializeConnection):
212         * UIProcess/WebProcessPool.cpp:
213         (WebKit::WebProcessPool::~WebProcessPool):
214         (WebKit::WebProcessPool::networkProcessCrashed):
215         (WebKit::WebProcessPool::databaseProcessCrashed): Iterate by values()
216         like in other places.
217
218 2016-10-11  Wenson Hsieh  <wenson_hsieh@apple.com>
219
220         The "Input Events" experimental feature runtime flag should not be on by default
221         https://bugs.webkit.org/show_bug.cgi?id=163278
222
223         Reviewed by Zalan Bujtas.
224
225         This was intended to be off by default.
226
227         * Shared/WebPreferencesDefinitions.h:
228
229 2016-10-10  Zan Dobersek  <zdobersek@igalia.com>
230
231         Add ENABLE_ENCRYPTED_MEDIA configuration option
232         https://bugs.webkit.org/show_bug.cgi?id=163219
233
234         Reviewed by Darin Adler.
235
236         * Configurations/FeatureDefines.xcconfig:
237         Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
238         to enable or disable the new EME implementation at build-time.
239
240 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
241
242         NetworkSession: NetworkDataTask is leaked if download finishes in didReceiveResponse completion handler
243         https://bugs.webkit.org/show_bug.cgi?id=163204
244
245         Reviewed by Alex Christensen.
246
247         After the completion handler a reference of the NetworkDataTask is saved in m_downloadsAfterDestinationDecided.
248         If the download failed or was canceled DownloadManager::dataTaskBecameDownloadTask is never called and the data
249         task is kept in the download manager forever. This patch exposes NSURLSessionTask state property in
250         NetworkDataTask, so that the download manager can check the task state after the completion handler and return
251         early if the download finished or was cancelled.
252
253         * NetworkProcess/Downloads/DownloadManager.cpp:
254         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
255         * NetworkProcess/NetworkDataTask.h:
256         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
257         (WebKit::NetworkDataTask::state):
258
259 2016-10-10  Konstantin Tokarev  <annulen@yandex.ru>
260
261         Added final specifier to WebInspectorServer and to its overridden methods
262         https://bugs.webkit.org/show_bug.cgi?id=163228
263
264         Reviewed by Darin Adler.
265
266         * UIProcess/InspectorServer/WebInspectorServer.h:
267
268 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
269
270         [GTK] 2.14.0 Compile Errors: GTK 3.22.1
271         https://bugs.webkit.org/show_bug.cgi?id=163190
272
273         Reviewed by Alex Christensen.
274
275         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Include gtk.h since we are using gtk_widget_queue_draw().
276
277 2016-10-10  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
278
279         [EFL] ewk_context_preferred_languages has been failed since r206949
280         https://bugs.webkit.org/show_bug.cgi?id=163211
281
282         Reviewed by Chris Dumez.
283
284         r206949 changed to return value of navigator.language from en-us to en-US
285         in order to match other browsers and w3c spec. So ewk_context_preferred_languages
286         needs to change the expected result as well.
287
288         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
289         (TEST_F):
290
291 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
292
293         NetworkSession: downloads started by startDownload() can fail before starting from the API point of view
294         https://bugs.webkit.org/show_bug.cgi?id=163107
295
296         Reviewed by Alex Christensen.
297
298         In the network process we use a PendingDownload in this case, but in the UI process we always have a single
299         download proxy. If an error happens before the pending download is converted inot a real download, the DidFail
300         messages is received in the download proxy before the DidStart one. This is problematic at least for the GTK+
301         API, because it's common to connect to the started signal and connect to all other signals from there, but in
302         this case the started signal is never emitted, and then the failed one is not handled. This is not a problem for
303         downloads started by convertTaskToDownload, because in that case those loads are not considered a download by
304         the UI process when those early errors happen, and then the web page handles them.
305
306         * NetworkProcess/Downloads/PendingDownload.cpp:
307         (WebKit::PendingDownload::PendingDownload): Send DidStart message right after the network load starts like the
308         non network session code does.
309         * NetworkProcess/NetworkLoad.cpp:
310         (WebKit::NetworkLoad::convertTaskToDownload): Send DidStart message now that the normal load has been converted
311         into a download.
312         * NetworkProcess/NetworkProcess.cpp:
313         (WebKit::NetworkProcess::findPendingDownloadLocation): Do not send DidStart message here.
314
315 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
316
317         Network Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecameDownloadTask
318         https://bugs.webkit.org/show_bug.cgi?id=163006
319
320         Reviewed by Alex Christensen.
321
322         In DownloadManager::dataTaskBecameDownloadTask() we are supposed to have either a pending download, or a network
323         data task depending on whether the download was started by startDownload() or convertTaskToDownload. However, in
324         both cases we do have a data task and never a pending download. In the case of startDownload() the pending
325         download is removed from m_pendingDownloads in willDecidePendingDownloadDestination(). The task is always
326         added to m_downloadsWaitingForDestination in willDecidePendingDownloadDestination() and to
327         m_downloadsAfterDestinationDecided in continueDecidePendingDownloadDestination() in both cases.
328
329         * NetworkProcess/Downloads/DownloadManager.cpp:
330         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Add an ASSERT to ensure we don't have a pending download
331         at this point and that the download is not already in the map. Remove the download from the
332         m_downloadsAfterDestinationDecided map, but don't check its result because it might not bein that map if
333         dataTaskBecameDownloadTask is called synchronously from the didReceiveResponse completion handler.
334         (WebKit::DownloadManager::willDecidePendingDownloadDestination): Do not take the pending download here, wait
335         until didReceiveResponse completion handler is called.
336         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Take the pending download here ensuring
337         it's alive while the didReceiveResponse completion handler is called. Also remove invalid early return when
338         either networkDataTask or completionHandler are nullptr because we are using both unconditionally, we should
339         return early if both are nullptr to avoid crashes. However, we are checking that the download is in the
340         m_downloadsWaitingForDestination and in that case we should always have both, so better add asserts there. If
341         the download is already in the map after the completion handler it means that dataTaskBecameDownloadTask() has
342         alrady been called, so we can just return in that case.
343         * NetworkProcess/Downloads/DownloadManager.h:
344         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
345         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Protect the NetworkDataTask that can
346         be deleted by dataTaskBecameDownloadTask().
347
348 2016-10-10  Tim Horton  <timothy_horton@apple.com>
349
350         Share more code between iOS and macOS ViewGestureController
351         https://bugs.webkit.org/show_bug.cgi?id=163158
352
353         Reviewed by Simon Fraser.
354
355         Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
356         Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
357         because it shouldn't know anything about WKWebView.
358         Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
359
360         * UIProcess/API/Cocoa/WKWebView.mm:
361         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
362         * UIProcess/Cocoa/ViewGestureController.cpp:
363         (WebKit::ViewGestureController::ViewGestureController):
364         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
365         (WebKit::ViewGestureController::canSwipeInDirection):
366         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
367         * UIProcess/Cocoa/ViewGestureController.h:
368         * UIProcess/WebPageProxy.cpp:
369         (WebKit::WebPageProxy::WebPageProxy):
370         * UIProcess/WebPageProxy.h:
371         (WebKit::WebPageProxy::createWeakPtr):
372         * UIProcess/ios/ViewGestureControllerIOS.mm:
373         (WebKit::ViewGestureController::beginSwipeGesture):
374         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
375         (WebKit::ViewGestureController::canSwipeInDirection): Deleted.
376         * UIProcess/mac/ViewGestureControllerMac.mm:
377         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
378         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
379         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
380
381 2016-10-10  Tomas Popela  <tpopela@redhat.com>
382
383         [GTK] UIProcess crashes when using Japanese IM
384         https://bugs.webkit.org/show_bug.cgi?id=163011
385
386         We have to reference the current GdkEventKey before we try process it
387         as later when the lambda body is reached the event could be already
388         freed.
389
390         Reviewed by Carlos Garcia Campos.
391
392         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
393         (webkitWebViewBaseKeyPressEvent):
394         (webkitWebViewBaseKeyReleaseEvent):
395         * UIProcess/gtk/InputMethodFilter.h:
396         Use non-copyable Function so we can use WTFMove to pass the event to
397         lambda.
398
399 2016-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
400
401         Support InputEvent.inputType for the new InputEvent spec
402         https://bugs.webkit.org/show_bug.cgi?id=163025
403         <rdar://problem/28658092>
404
405         Reviewed by Darin Adler.
406
407         Accounts for some changes to the EditAction enum in nameForEditAction. Some former edit
408         actions, such as EditActionTyping, have been split out into its more specific subtypes,
409         so we preserve shipping behavior by treating all of the new subtypes the same way as the
410         original type.
411
412         * UIProcess/WebEditCommandProxy.cpp:
413         (WebKit::WebEditCommandProxy::nameForEditAction):
414
415 2016-10-08  Emanuele Aina  <emanuele.aina@collabora.com>
416
417         [GTK] Drop redundant wl_display_flush_clients() call
418         https://bugs.webkit.org/show_bug.cgi?id=161904
419
420         Reviewed by Michael Catanzaro.
421
422         The Wayland GSource::prepare() function already calls
423         wl_display_flush_clients() at every mainloop iteration, so there's no
424         need to further call it on Surface::commit().
425
426         * UIProcess/gtk/WaylandCompositor.cpp:
427         (WebKit::WaylandCompositor::Surface::commit):
428         * UIProcess/gtk/WaylandCompositor.h:
429
430 2016-10-06  Darin Adler  <darin@apple.com>
431
432         Next step on moving to modern way to return DOM exceptions
433         https://bugs.webkit.org/show_bug.cgi?id=163016
434
435         Reviewed by Ryosuke Niwa.
436
437         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
438         (webkit_dom_dom_implementation_create_document_type): Updated for name change
439         from takeReturnValue to releaseReturnValue.
440         (webkit_dom_dom_implementation_create_document): Ditto.
441         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
442         (webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode.
443         (webkit_dom_dom_selection_collapse_to_start): Ditto.
444         (webkit_dom_dom_selection_extend): Ditto.
445         (webkit_dom_dom_selection_get_range_at): Ditto.
446
447 2016-10-08  Commit Queue  <commit-queue@webkit.org>
448
449         Unreviewed, rolling out r206950.
450         https://bugs.webkit.org/show_bug.cgi?id=163169
451
452         broke an API test (Requested by thorton on #webkit).
453
454         Reverted changeset:
455
456         "Share more code between iOS and macOS ViewGestureController"
457         https://bugs.webkit.org/show_bug.cgi?id=163158
458         http://trac.webkit.org/changeset/206950
459
460 2016-10-08  Tim Horton  <timothy_horton@apple.com>
461
462         Share more code between iOS and macOS ViewGestureController
463         https://bugs.webkit.org/show_bug.cgi?id=163158
464
465         Reviewed by Simon Fraser.
466
467         Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
468         Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
469         because it shouldn't know anything about WKWebView.
470         Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
471
472         * UIProcess/API/Cocoa/WKWebView.mm:
473         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
474         * UIProcess/Cocoa/ViewGestureController.cpp:
475         (WebKit::ViewGestureController::ViewGestureController):
476         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
477         (WebKit::ViewGestureController::canSwipeInDirection):
478         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
479         * UIProcess/Cocoa/ViewGestureController.h:
480         * UIProcess/WebPageProxy.cpp:
481         (WebKit::WebPageProxy::WebPageProxy):
482         * UIProcess/WebPageProxy.h:
483         (WebKit::WebPageProxy::createWeakPtr):
484         * UIProcess/ios/ViewGestureControllerIOS.mm:
485         (WebKit::ViewGestureController::beginSwipeGesture):
486         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
487         (WebKit::ViewGestureController::canSwipeInDirection): Deleted.
488         * UIProcess/mac/ViewGestureControllerMac.mm:
489         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
490         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
491         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
492
493 2016-10-07  Anders Carlsson  <andersca@apple.com>
494
495         Get rid of API::Session and WKSessionRef
496         https://bugs.webkit.org/show_bug.cgi?id=163140
497
498         Reviewed by Tim Horton.
499
500         This API is no longer used.
501
502         * CMakeLists.txt:
503         * Shared/API/APIObject.h:
504         * Shared/API/c/WKSharedAPICast.h:
505         * UIProcess/API/APISession.cpp: Removed.
506         (API::generateID): Deleted.
507         (API::Session::defaultSession): Deleted.
508         (API::Session::Session): Deleted.
509         (API::Session::createEphemeral): Deleted.
510         (API::Session::isEphemeral): Deleted.
511         (API::Session::getID): Deleted.
512         (API::Session::~Session): Deleted.
513         * UIProcess/API/APISession.h: Removed.
514         * UIProcess/API/C/WKPage.h:
515         * UIProcess/API/C/WKSessionRef.cpp: Removed.
516         (WKSessionCreate): Deleted.
517         (WKSessionGetTypeID): Deleted.
518         (WKSessionIsEphemeral): Deleted.
519         * UIProcess/API/C/WKSessionRef.h: Removed.
520         * UIProcess/WebPageProxy.h:
521         * UIProcess/WebProcessProxy.h:
522         * WebKit2.xcodeproj/project.pbxproj:
523
524 2016-10-07  Tim Horton  <timothy_horton@apple.com>
525
526         Move ViewGestureController files to more accurate locations
527         https://bugs.webkit.org/show_bug.cgi?id=163141
528
529         Reviewed by Anders Carlsson.
530
531         * PlatformMac.cmake:
532         * UIProcess/Cocoa/ViewGestureController.cpp: Renamed from UIProcess/ViewGestureController.cpp.
533         * UIProcess/Cocoa/ViewGestureController.h: Renamed from UIProcess/mac/ViewGestureController.h.
534         * UIProcess/Cocoa/ViewGestureController.messages.in: Renamed from UIProcess/mac/ViewGestureController.messages.in.
535         * WebKit2.xcodeproj/project.pbxproj:
536
537 2016-10-07  Tim Horton  <timothy_horton@apple.com>
538
539         Adopt BlockPtr in ViewGestureController
540         https://bugs.webkit.org/show_bug.cgi?id=163132
541
542         Reviewed by Anders Carlsson.
543
544         * UIProcess/Cocoa/WebViewImpl.h:
545         * UIProcess/Cocoa/WebViewImpl.mm:
546         (WebKit::WebViewImpl::setDidMoveSwipeSnapshotCallback):
547         * UIProcess/ViewGestureController.cpp:
548         (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
549         * UIProcess/mac/ViewGestureController.h:
550         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
551         (WebKit::ViewGestureController::m_didMoveSwipeSnapshotCallback): Deleted.
552         * UIProcess/mac/ViewGestureControllerMac.mm:
553         (WebKit::ViewGestureController::platformTeardown):
554         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): Deleted.
555
556 2016-10-07  Anders Carlsson  <andersca@apple.com>
557
558         Get rid of WKPageSetSession
559         https://bugs.webkit.org/show_bug.cgi?id=163129
560
561         Reviewed by Tim Horton.
562
563         This function is no longer used.
564
565         * UIProcess/API/C/WKPage.cpp:
566         (WKPageSetSession): Deleted.
567         * UIProcess/API/C/WKPage.h:
568         * UIProcess/WebPageProxy.cpp:
569         (WebKit::WebPageProxy::setSessionID): Deleted.
570         * UIProcess/WebPageProxy.h:
571         (WebKit::WebPageProxy::sessionID):
572         * WebProcess/WebPage/WebPage.messages.in:
573
574 2016-10-07  Commit Queue  <commit-queue@webkit.org>
575
576         Unreviewed, rolling out r206909.
577         https://bugs.webkit.org/show_bug.cgi?id=163116
578
579         Caused most of  GTK layout tests to crash (Requested by KaL on
580         #webkit).
581
582         Reverted changeset:
583
584         "[GTK] UIProcess crashes when using Japanese IM"
585         https://bugs.webkit.org/show_bug.cgi?id=163011
586         http://trac.webkit.org/changeset/206909
587
588 2016-10-07  Carlos Garcia Campos  <cgarcia@igalia.com>
589
590         Network Session: Allow NetworkDataTask decide what to do when override is allowed for a download
591         https://bugs.webkit.org/show_bug.cgi?id=163010
592
593         Reviewed by Alex Christensen.
594
595         Current code always deletes the file before starting a download when allow override is True. In soup backend we
596         use glib API that takes care of it and tries to ensure that the original file is not deleted if the new file
597         creation fails for whatever reason.
598
599         * NetworkProcess/Downloads/DownloadManager.cpp:
600         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Pass allowOverride to setPendingDownloadLocation().
601         * NetworkProcess/NetworkDataTask.h:
602         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
603         (WebKit::NetworkDataTask::setPendingDownloadLocation): Delete the destination file if exists and allowOverride
604         is True.
605
606 2016-10-07  Tomas Popela  <tpopela@redhat.com>
607
608         [GTK] UIProcess crashes when using Japanese IM
609         https://bugs.webkit.org/show_bug.cgi?id=163011
610
611         We have to reference the current GdkEventKey before we try process it
612         as later when the lambda body is reached the event could be already
613         freed.
614
615         Reviewed by Carlos Garcia Campos.
616
617         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
618         (webkitWebViewBaseKeyPressEvent):
619         (webkitWebViewBaseKeyReleaseEvent):
620         * UIProcess/gtk/InputMethodFilter.h:
621         Use non-copyable Function so we can use WTFMove to pass the event to
622         lambda.
623
624 2016-10-06  Michael Catanzaro  <mcatanzaro@igalia.com>
625
626         [GTK] Expose WebKitDOMHTMLInputElement APIs for form autofill
627         https://bugs.webkit.org/show_bug.cgi?id=163082
628
629         Reviewed by Darin Adler.
630
631         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
632         (webkit_dom_html_input_element_get_auto_filled): Added.
633         (webkit_dom_html_input_element_set_auto_filled): Added.
634         (webkit_dom_html_input_element_set_editing_value): Added.
635         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
636         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
637
638 2016-10-06  John Wilander  <wilander@apple.com>
639
640         Update Resource Load Statistics
641         https://bugs.webkit.org/show_bug.cgi?id=162811
642
643         Reviewed by Alex Christensen.
644
645         * UIProcess/WebResourceLoadStatisticsStore.cpp:
646         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics):
647             Switched to vector-based classification.
648         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
649             Simplified logic and moved the split between has and has
650             no user interaction into ResourceLoadStatisticsStore.
651         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords):
652             Added.
653         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
654             Updated to make use of the new functions.
655         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
656             Removed stray whitespace.
657         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
658             Removed stray whitespace.
659         (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk):
660             Removed stray whitespace.
661         (WebKit::hasPrevalentResourceCharacteristics): Deleted.
662         (WebKit::classifyPrevalentResources): Deleted.
663         * UIProcess/WebResourceLoadStatisticsStore.h:
664             Added member variables for clearing of data records.
665
666 2016-10-06  Youenn Fablet  <youenn@apple.com>
667
668         [WK2] 304 revalidation on the network process does not update the validated response
669         https://bugs.webkit.org/show_bug.cgi?id=162973
670
671         Reviewed by Darin Adler.
672
673         * NetworkProcess/NetworkResourceLoader.cpp: Updating cache entry with the revalidated one.
674
675 2016-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
676
677         Introduce InputEvent bindings in preparation for the input events spec
678         https://bugs.webkit.org/show_bug.cgi?id=162954
679
680         Reviewed by Ryosuke Niwa.
681
682         Adds a new runtime switch for enabling InputEvents.
683
684         * Shared/WebPreferencesDefinitions.h:
685         * WebProcess/WebPage/WebPage.cpp:
686         (WebKit::WebPage::updatePreferences):
687
688 2016-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
689
690         Put variation fonts work behind a compile-time flag
691         https://bugs.webkit.org/show_bug.cgi?id=162949
692
693         Reviewed by Simon Fraser.
694
695         * Configurations/FeatureDefines.xcconfig:
696
697 2016-10-05  Tim Horton  <timothy_horton@apple.com>
698
699         Fix the build.
700
701         * UIProcess/Cocoa/WebViewImpl.mm:
702
703 2016-10-05  Tim Horton  <timothy_horton@apple.com>
704
705         Avoid automatically re-taking snapshots for back-forward items that were never loaded into the view
706         https://bugs.webkit.org/show_bug.cgi?id=162955
707         <rdar://problem/27659173>
708
709         Reviewed by Simon Fraser.
710
711         Make it possible for clients to control the snapshot for back-forward
712         items that are restored from session state without navigating to them,
713         by ensuring that we won't stomp on the snapshot that they explicitly take,
714         until a load occurs.
715
716         * UIProcess/WebBackForwardList.cpp:
717         (WebKit::WebBackForwardList::addItem):
718         (WebKit::WebBackForwardList::goToItem):
719         * UIProcess/ios/ViewGestureControllerIOS.mm:
720         (WebKit::ViewGestureController::beginSwipeGesture):
721         * UIProcess/mac/ViewGestureControllerMac.mm:
722         (WebKit::ViewGestureController::trackSwipeGesture):
723         Disambiguate explicit API-driven snapshot recording from automatic,
724         navigation-driven snapshot recording.
725
726         * UIProcess/Cocoa/WebViewImpl.mm:
727         (WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
728         Get rid of the version of recordNavigationSnapshot() that doesn't take a
729         back-forward list item, and grab the current item at the one remaining caller.
730         
731         * UIProcess/WebPageProxy.cpp:
732         (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
733         (WebKit::WebPageProxy::recordNavigationSnapshot):
734         (WebKit::WebPageProxy::restoreFromSessionState):
735         (WebKit::WebPageProxy::didCommitLoadForFrame):
736         * UIProcess/WebPageProxy.h:
737         Rename m_suppressNavigationSnapshotting to m_suppressAutomaticNavigationSnapshotting,
738         and make it be only about automatic (navigation-driven) snapshots; it won't have
739         any impact on explicit snapshots forced by clients.
740         
741         Set m_suppressAutomaticNavigationSnapshotting unconditionally when restoring
742         from session state, so that we won't start automatically snapshotting until
743         something has loaded in the view.
744
745 2016-10-05  Tim Horton  <timothy_horton@apple.com>
746
747         Make it possible to test ViewSnapshotStore behaviors
748         https://bugs.webkit.org/show_bug.cgi?id=162983
749
750         Reviewed by Simon Fraser.
751
752         Add two pieces of SPI to make it easier to test ViewSnapshotStore:
753
754         - [WKWebView _disableBackForwardSnapshotVolatilityForTesting]
755             This makes it so that we don't make snapshots volatile after we
756             take them, so that they won't get purged while the test is running
757             and cause the test to be flaky.
758
759         - [WKBackForwardListItem _copySnapshotForTesting]
760             This returns a CGImage with the content of the given back-forward
761             item's current snapshot, if there is one.
762
763         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
764         (-[WKBackForwardListItem _copySnapshotForTesting]):
765         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
766         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Added.
767         Add WKBackForwardListItem SPI to retrieve the snapshot for a given back-forward list item.
768
769         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
770         * UIProcess/API/Cocoa/WKWebView.mm:
771         (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]):
772         Add WKWebView SPI to disable volatility of snapshots, for testing purposes.
773         
774         * UIProcess/Cocoa/WebViewImpl.h:
775         * UIProcess/Cocoa/WebViewImpl.mm:
776         (WebKit::WebViewImpl::takeViewSnapshot):
777         Adopt ViewSnapshot::setVolatile instead of reaching into the surface.
778
779         * UIProcess/mac/ViewGestureControllerMac.mm:
780         (WebKit::ViewGestureController::removeSwipeSnapshot):
781         Adopt ViewSnapshot::setVolatile instead of reaching into the surface.
782
783         * UIProcess/mac/ViewSnapshotStore.h:
784         (WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
785         (WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting):
786         * UIProcess/mac/ViewSnapshotStore.mm:
787         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
788         (WebKit::ViewSnapshot::setVolatile):
789         (WebKit::ViewSnapshot::asLayerContents):
790         Move all touching of snapshot volatility into the new setVolatile,
791         and short-circuit if the testing-only m_disableSnapshotVolatility bit is set
792
793         (WebKit::ViewSnapshot::asImageForTesting):
794         Make a CGImageRef for the aforementioned WKBackForwardListItem SPI.
795         This is currently not implemented for the iOS Simulator, because we
796         don't have access to the bits of the image in that case.
797
798 2016-10-05  Chris Dumez  <cdumez@apple.com>
799
800         KeyboardEvent.getModifierState() should support "CapsLock" modifier
801         https://bugs.webkit.org/show_bug.cgi?id=162861
802
803         Reviewed by Darin Adler.
804
805         Add support for CapsLock modifier on events.
806
807         * Shared/API/c/WKEvent.h:
808         * Shared/API/c/WKSharedAPICast.h:
809         (WebKit::toAPI):
810         * Shared/WebEventConversion.cpp:
811         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
812         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
813         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
814         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
815         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
816         * Shared/efl/WebEventFactory.cpp:
817         (WebKit::toWebEventModifiers):
818         * Shared/ios/WebIOSEventFactory.mm:
819         (modifiersForEvent):
820         * Shared/mac/WebEventFactory.mm:
821         (WebKit::modifiersForEvent):
822         * UIProcess/API/Cocoa/WKNavigationAction.mm:
823         (toNSEventModifierFlags):
824         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
825         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
826
827 2016-10-05  Zan Dobersek  <zdobersek@igalia.com>
828
829         Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
830         https://bugs.webkit.org/show_bug.cgi?id=162903
831
832         Reviewed by Alex Christensen.
833
834         Rename build guards for the remaining implementation of the legacy EME API
835         to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
836         of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.
837
838         * Configurations/FeatureDefines.xcconfig:
839         * WebProcess/WebPage/WebPage.cpp:
840         (WebKit::m_userInterfaceLayoutDirection):
841         * WebProcess/WebProcess.cpp:
842         (WebKit::m_resourceLoadStatisticsStorage):
843
844 2016-10-05  Daniel Bates  <dabates@apple.com>
845
846         [WK2][NetworkSession] Ping requests should follow redirects if applicable
847         https://bugs.webkit.org/show_bug.cgi?id=162580
848         <rdar://problem/28631274>
849
850         Reviewed by Alex Christensen.
851
852         Implement support for following redirects, if applicable, of a ping request when using the
853         Network Session (ENABLE(NETWORK_SESSION)) code path in WebKit2. For ping requests that are
854         in response to hyperlink auditing (e.g. <a ping>) we should follow redirect responses.
855         For Content Security Policy and XSS Auditor violation reports we should not follow redirect
856         responses.
857
858         Currently we always ignore redirects for ping requests that are sent using the Network Session
859         code path in WebKit2. This behavior disagrees with the behavior described in section
860         "Hyperlink auditing" of the HTML standard, <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (27 September 2016),
861         as well as the behavior in Legacy WebKit and WebKit2 with Network Session disabled. We should
862         follow redirects for ping requests initiated as part of hyperlink auditing to more closely
863         conform to the HTML standard and match the behavior in Legacy WebKit and WebKit2 with Network
864         Session disabled.
865
866         * NetworkProcess/PingLoad.h:
867
868 2016-10-05  Daniel Bates  <dabates@apple.com>
869
870         Do not follow redirects when sending violation report
871         https://bugs.webkit.org/show_bug.cgi?id=162520
872         <rdar://problem/27957639>
873
874         Reviewed by Alex Christensen.
875
876         Update the non-Network Session WebKit2 implementation to follow redirect responses for a ping
877         request, if applicable. I did not update the Network Session implementation at this time. I
878         will fix it in <https://bugs.webkit.org/show_bug.cgi?id=162580>.
879
880         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
881         (WebKit::NetworkConnectionToWebProcess::loadPing): Tell PingHandle whether to follow redirects.
882         * NetworkProcess/NetworkLoadParameters.h:
883         * NetworkProcess/NetworkResourceLoadParameters.cpp:
884         (WebKit::NetworkResourceLoadParameters::encode): Encode NetworkResourceLoadParameters::shouldFollowRedirects.
885         (WebKit::NetworkResourceLoadParameters::decode): Decode NetworkResourceLoadParameters::shouldFollowRedirects.
886         * NetworkProcess/PingLoad.h: Added FIXME comment to implement support for following redirects,
887         if applicable (for hyperlink auditing). See <https://bugs.webkit.org/show_bug.cgi?id=162580>
888         for more details.
889         * WebProcess/Network/WebLoaderStrategy.cpp:
890         (WebKit::WebLoaderStrategy::createPingHandle): Modified to take a boolean whether to follow
891         redirects responses and set NetworkResourceLoadParameters::shouldFollowRedirects as appropriate.
892         * WebProcess/Network/WebLoaderStrategy.h:
893
894 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
895
896         [SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
897         https://bugs.webkit.org/show_bug.cgi?id=162910
898
899         Reviewed by Alex Christensen.
900
901         Use SoupNetworkSession instead of ResourceHandle.
902
903         * NetworkProcess/soup/NetworkProcessSoup.cpp:
904         (WebKit::NetworkProcess::setIgnoreTLSErrors):
905         (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost):
906
907 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
908
909         Unreviewed. Fix GTK+ build with USE_REDIRECTED_XCOMPOSITE_WINDOW disabled.
910
911         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
912         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
913
914 2016-10-04  Chris Dumez  <cdumez@apple.com>
915
916         Implement KeyboardEvent.code from the UI Event spec
917         https://bugs.webkit.org/show_bug.cgi?id=149584
918
919         Reviewed by Darin Adler.
920
921         Add support for Keyboard.code attribute:
922         - https://w3c.github.io/uievents/#dom-keyboardevent-code
923         - https://w3c.github.io/uievents-code/
924
925         * Shared/WebEvent.h:
926         (WebKit::WebKeyboardEvent::code):
927         * Shared/WebEventConversion.cpp:
928         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
929         * Shared/WebKeyboardEvent.cpp:
930         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
931         (WebKit::WebKeyboardEvent::encode):
932         (WebKit::WebKeyboardEvent::decode):
933         * Shared/mac/WebEventFactory.mm:
934         (WebKit::WebEventFactory::createWebKeyboardEvent):
935
936 2016-10-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
937
938         The dragged image should be the current frame only of the animated image
939         https://bugs.webkit.org/show_bug.cgi?id=162109
940
941         Reviewed by Tim Horton.
942
943         * UIProcess/Cocoa/WebViewImpl.mm:
944         (WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.
945
946 2016-10-04  Ryosuke Niwa  <rniwa@webkit.org>
947
948         Revert a change erroneously committed in r206795.
949
950         * WebProcess/WebPage/WebPage.cpp:
951         (WebKit::WebPage::updatePreferences):
952
953 2016-10-04  Anders Carlsson  <andersca@apple.com>
954
955         Properly kill web processes in the launching state
956         https://bugs.webkit.org/show_bug.cgi?id=162938
957
958         Reviewed by Tim Horton.
959
960         * UIProcess/Launcher/ProcessLauncher.h:
961         Add m_xpcConnection member.
962
963         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
964         (WebKit::ProcessLauncher::launchProcess):
965         Store the XPC connection in the m_xpcConnection member variable.
966         In the reply handler, handle m_xpcConnection being null.
967
968         (WebKit::ProcessLauncher::platformInvalidate):
969         Cancel and kill the connection.
970
971         * UIProcess/WebPageProxy.cpp:
972         (WebKit::WebPageProxy::terminateProcess):
973         Get rid of an assertion.
974
975         * UIProcess/WebProcessProxy.cpp:
976         (WebKit::WebProcessProxy::requestTermination):
977         Handle the launching state.
978
979 2016-10-04  Tim Horton  <timothy_horton@apple.com>
980
981         Fix the build.
982
983         * Shared/WebBackForwardListItem.cpp:
984         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
985         (WebKit::WebBackForwardListItem::highestUsedItemID):
986
987 2016-10-04  Tim Horton  <timothy_horton@apple.com>
988
989         Fix a typo in WebBackForwardListItem (highed->highest)
990         https://bugs.webkit.org/show_bug.cgi?id=162935
991
992         Reviewed by Anders Carlsson.
993
994         * Shared/WebBackForwardListItem.cpp:
995         (WebKit::WebBackForwardListItem::highestUsedItemID):
996         (WebKit::WebBackForwardListItem::highedUsedItemID): Deleted.
997         * Shared/WebBackForwardListItem.h:
998         * UIProcess/WebPageProxy.cpp:
999         (WebKit::WebPageProxy::creationParameters):
1000
1001 2016-10-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1002
1003         [DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information
1004         https://bugs.webkit.org/show_bug.cgi?id=162916
1005
1006         Reviewed by Filip Pizlo.
1007
1008         * CMakeLists.txt:
1009
1010 2016-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1011
1012         [SOUP] Remove SSLPolicyFlags from SoupNetworkSession
1013         https://bugs.webkit.org/show_bug.cgi?id=162906
1014
1015         Reviewed by Michael Catanzaro.
1016
1017         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
1018         (WebKit::NetworkProcessMainUnix):
1019
1020 2016-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1021
1022         Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
1023         https://bugs.webkit.org/show_bug.cgi?id=162766
1024         <rdar://problem/28533523>
1025
1026         Reviewed by Jer Noble.
1027
1028         Plumbs some more Now Playing information from the web process to the UI process for testing purposes. See
1029         WebCore ChangeLog for more details.
1030
1031         * UIProcess/API/Cocoa/WKWebView.mm:
1032         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
1033         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]): Deleted.
1034         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1035         * UIProcess/PageClient.h:
1036         * UIProcess/WebPageProxy.cpp:
1037         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
1038         * UIProcess/WebPageProxy.h:
1039         * UIProcess/WebPageProxy.messages.in:
1040         * UIProcess/mac/PageClientImpl.h:
1041         * UIProcess/mac/PageClientImpl.mm:
1042         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
1043         * WebProcess/WebPage/mac/WebPageMac.mm:
1044         (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
1045
1046 2016-10-04  Zan Dobersek  <zdobersek@igalia.com>
1047
1048         Unreviewed GTK+ build fix.
1049
1050         * UIProcess/API/C/WKPage.cpp:
1051         (WKPageSetPageNavigationClient): Guard the call to getDefaultWebCryptoMasterKey()
1052         with ENABLE(SUBTLE_CRYPTO), since the same guard is used for the definition. Fixes
1053         GTK+ production builds where the feature is disabled.
1054
1055 2016-10-03  Keith Rollin  <krollin@apple.com>
1056
1057         More logging to diagnose "WebKit encountered an internal error" messages
1058         https://bugs.webkit.org/show_bug.cgi?id=162754
1059
1060         Reviewed by Antti Koivisto.
1061
1062         Add more logging around calls to internalError, as well as some
1063         low-level logging around SharedMemory, and mach_vm_map in particular.
1064
1065         * NetworkProcess/NetworkResourceLoader.cpp:
1066         (WebKit::NetworkResourceLoader::startNetworkLoad):
1067         * Platform/Logging.h:
1068         * Platform/mac/SharedMemoryMac.cpp:
1069         (WebKit::SharedMemory::allocate):
1070         (WebKit::makeMemoryEntry):
1071         (WebKit::SharedMemory::map):
1072         (WebKit::SharedMemory::~SharedMemory):
1073         * WebProcess/Network/WebLoaderStrategy.cpp:
1074         (WebKit::WebLoaderStrategy::networkProcessCrashed):
1075         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1076         * WebProcess/Network/WebResourceLoader.cpp:
1077         (WebKit::WebResourceLoader::didReceiveResource):
1078
1079 2016-10-03  Ryan Haddad  <ryanhaddad@apple.com>
1080
1081         Unreviewed, rolling out r206754.
1082
1083         This change broke the El Capitan and Yosemite debug builds.
1084
1085         Reverted changeset:
1086
1087         "More logging to diagnose "WebKit encountered an internal
1088         error" messages"
1089         https://bugs.webkit.org/show_bug.cgi?id=162754
1090         http://trac.webkit.org/changeset/206754
1091
1092 2016-10-03  Keith Rollin  <krollin@apple.com>
1093
1094         More logging to diagnose "WebKit encountered an internal error" messages
1095         https://bugs.webkit.org/show_bug.cgi?id=162754
1096
1097         Reviewed by Antti Koivisto.
1098
1099         Add more logging around calls to internalError, as well as some
1100         low-level logging around SharedMemory, and mach_vm_map in particular.
1101
1102         * NetworkProcess/NetworkResourceLoader.cpp:
1103         (WebKit::NetworkResourceLoader::startNetworkLoad):
1104         * Platform/Logging.h:
1105         * Platform/mac/SharedMemoryMac.cpp:
1106         (WebKit::SharedMemory::allocate):
1107         (WebKit::makeMemoryEntry):
1108         (WebKit::SharedMemory::map):
1109         (WebKit::SharedMemory::~SharedMemory):
1110         * WebProcess/Network/WebLoaderStrategy.cpp:
1111         (WebKit::WebLoaderStrategy::networkProcessCrashed):
1112         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1113         * WebProcess/Network/WebResourceLoader.cpp:
1114         (WebKit::WebResourceLoader::didReceiveResource):
1115
1116 2016-10-03  Chris Dumez  <cdumez@apple.com>
1117
1118         Add support for KeyboardEvent.key attribute
1119         https://bugs.webkit.org/show_bug.cgi?id=36267
1120
1121         Reviewed by Darin Adler.
1122
1123         Add support for KeyboardEvent.key attribute.
1124
1125         * Shared/WebEvent.h:
1126         (WebKit::WebKeyboardEvent::key):
1127         (WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
1128         * Shared/WebEventConversion.cpp:
1129         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1130         * Shared/WebKeyboardEvent.cpp:
1131         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1132         (WebKit::WebKeyboardEvent::encode):
1133         (WebKit::WebKeyboardEvent::decode):
1134         * Shared/mac/WebEventFactory.mm:
1135         (WebKit::WebEventFactory::createWebKeyboardEvent):
1136
1137 2016-10-03  Chris Dumez  <cdumez@apple.com>
1138
1139         Add support for KeyboardEvent.key attribute
1140         https://bugs.webkit.org/show_bug.cgi?id=36267
1141
1142         Reviewed by Darin Adler.
1143
1144         Add support for KeyboardEvent.key attribute.
1145
1146         * Shared/WebEvent.h:
1147         (WebKit::WebKeyboardEvent::key):
1148         (WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
1149         * Shared/WebEventConversion.cpp:
1150         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1151         * Shared/WebKeyboardEvent.cpp:
1152         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1153         (WebKit::WebKeyboardEvent::encode):
1154         (WebKit::WebKeyboardEvent::decode):
1155         * Shared/mac/WebEventFactory.mm:
1156         (WebKit::WebEventFactory::createWebKeyboardEvent):
1157
1158 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1159
1160         [SOUP] Cleanup persistent credential storage code
1161         https://bugs.webkit.org/show_bug.cgi?id=162777
1162
1163         Reviewed by Alex Christensen.
1164
1165         Use USE(LIBSECRET) instead of ENABLE(CREDENTIAL_STORAGE).
1166
1167         * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
1168         (webkit_authentication_request_can_save_credentials):
1169
1170 2016-10-02  Ryan Haddad  <ryanhaddad@apple.com>
1171
1172         Unreviewed, rolling out r206683.
1173
1174         This change caused API test WebKit2.FindMatches to fail on
1175         Mac.
1176
1177         Reverted changeset:
1178
1179         "The dragged image should be the current frame only of the
1180         animated image"
1181         https://bugs.webkit.org/show_bug.cgi?id=162109
1182         http://trac.webkit.org/changeset/206683
1183
1184 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
1185
1186         Follow-up patch after r206701
1187         https://bugs.webkit.org/show_bug.cgi?id=162818
1188
1189         Unreviewed.
1190
1191         I missed one place required to enable an experimental feature by default.
1192
1193         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1194         (WebKit::registerUserDefaultsIfNeeded):
1195
1196 2016-09-30  Dan Bernstein  <mitz@apple.com>
1197
1198         [iOS] Editing menu omits the Share command if the selected text is longer than 200 characters
1199         https://bugs.webkit.org/show_bug.cgi?id=162821
1200         <rdar://problem/28409828>
1201
1202         Reviewed by Tim Horton.
1203
1204         * UIProcess/ios/WKContentViewInteraction.mm:
1205         (-[WKContentView canPerformAction:withSender:]): Changed to return YES for the _share:
1206           action even if the selection is longer than 200 characters. While Define should not have
1207           been available for longer selections, Share does not have such a limitation.
1208
1209 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
1210
1211         Turn variation fonts on by default
1212         https://bugs.webkit.org/show_bug.cgi?id=162818
1213
1214         Reviewed by Simon Fraser.
1215
1216         * Shared/WebPreferencesDefinitions.h:
1217
1218 2016-09-30  Brady Eidson  <beidson@apple.com>
1219
1220         REGRESSION (Safari 10 combined with WK changes): Unable to store WebCrypto keys in IndexedDB database.
1221         <rdar://problem/28334440> and https://bugs.webkit.org/show_bug.cgi?id=162554
1222
1223         Reviewed by Alexey Proskuryakov.
1224
1225         Safari 10 has a WKPageNavigation client but does not implement the "copyWebCryptoMasterKey" callback.
1226
1227         WebKit just fails in this case, instead of falling back to "getDefaultWebCryptoMasterKey".
1228         It should fall back.
1229
1230         Additionally there's a WKContextClient callback to get the crypto key, also, but it is completely unused.
1231         So it should be pulled.
1232
1233         * UIProcess/API/APILoaderClient.h:
1234         (API::LoaderClient::webCryptoMasterKey): Deleted.
1235         * UIProcess/API/C/WKContext.h:
1236
1237         * UIProcess/API/C/WKPage.cpp:
1238         (WKPageSetPageLoaderClient):
1239         (WKPageSetPageNavigationClient): If the client doesn't implement this method, fallback to getDefaultWebCryptoMasterKey.
1240
1241         * UIProcess/Cocoa/NavigationState.mm:
1242         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): If the client doesn't implement this method,
1243           fallback to getDefaultWebCryptoMasterKey.
1244
1245         * UIProcess/WebContextClient.cpp:
1246         (WebKit::WebContextClient::copyWebCryptoMasterKey): Deleted.
1247         * UIProcess/WebContextClient.h:
1248
1249         * UIProcess/WebPageProxy.cpp:
1250         (WebKit::WebPageProxy::wrapCryptoKey): Only ask the NavigationClient before falling back. Don't ask the loader client.
1251         (WebKit::WebPageProxy::unwrapCryptoKey): Ditto.
1252
1253 2016-09-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1254
1255         The dragged image should be the current frame only of the animated image
1256         https://bugs.webkit.org/show_bug.cgi?id=162109
1257
1258         Reviewed by Tim Horton.
1259
1260         * UIProcess/Cocoa/WebViewImpl.mm:
1261         (WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.
1262
1263 2016-09-30  Anders Carlsson  <andersca@apple.com>
1264
1265         Second time going into fullscreen using silverlight, will hide the menu bar and dock for Safari
1266         https://bugs.webkit.org/show_bug.cgi?id=162805
1267         rdar://problem/28208495
1268
1269         Reviewed by Dan Bernstein.
1270
1271         Turns out that the WindowRef wrappers for full screen NSWindows can end up in the m_windows HashSet,
1272         and never go away. 
1273         
1274         Fix this by storing the canonical CGWindowIDs in the hash map instead.
1275
1276         * PluginProcess/mac/PluginProcessMac.mm:
1277         (WebKit::cgWindowID):
1278         (WebKit::windowCoversAnyScreen):
1279         (WebKit::FullscreenWindowTracker::windowShown):
1280         (WebKit::FullscreenWindowTracker::windowHidden):
1281
1282 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
1283
1284         Create runtime flag for variation font work
1285         https://bugs.webkit.org/show_bug.cgi?id=162780
1286
1287         Reviewed by Alex Christensen.
1288
1289         * Shared/WebPreferencesDefinitions.h:
1290         * WebProcess/WebPage/WebPage.cpp:
1291         (WebKit::WebPage::updatePreferences):
1292
1293 2016-09-30  Chris Dumez  <cdumez@apple.com>
1294
1295         [WK2][iOS] Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint
1296         https://bugs.webkit.org/show_bug.cgi?id=162787
1297         <rdar://problem/28554292>
1298
1299         Reviewed by Benjamin Poulain.
1300
1301         Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint.
1302
1303         * Platform/spi/ios/UIKitSPI.h:
1304         * Shared/WebEvent.h:
1305         (WebKit::WebPlatformTouchPoint::setRadiusX):
1306         (WebKit::WebPlatformTouchPoint::radiusX):
1307         (WebKit::WebPlatformTouchPoint::setRadiusY):
1308         (WebKit::WebPlatformTouchPoint::radiusY):
1309         (WebKit::WebPlatformTouchPoint::setRotationAngle):
1310         (WebKit::WebPlatformTouchPoint::rotationAngle):
1311         * Shared/WebEventConversion.cpp:
1312         (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
1313         * Shared/ios/NativeWebTouchEventIOS.mm:
1314         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
1315         * Shared/ios/WebPlatformTouchPointIOS.cpp:
1316         (WebKit::WebPlatformTouchPoint::encode):
1317         (WebKit::WebPlatformTouchPoint::decode):
1318
1319 2016-09-30  Megan Gardner  <megan_gardner@apple.com>
1320
1321         Make it possible to test web-related user-interface features
1322         https://bugs.webkit.org/show_bug.cgi?id=162657
1323
1324         Reviewed by Simon Fraser.
1325
1326         Added the ability to pull the strings from an Action Sheet and pass them to
1327         test scripts to make sure we are giving the correct available actions for
1328         the item we are interacting with.
1329         Added a test for long press on an image, and used the sheet scraping functionality
1330         to make sure that the correct actions were being displayed.
1331         Test for previous patch, Changeset 205915; Bug 161761
1332
1333         * UIProcess/API/Cocoa/WKWebView.mm:
1334         (-[WKWebView _contentsOfUserInterfaceItem:]):
1335         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1336         * UIProcess/ios/WKActionSheetAssistant.h:
1337         * UIProcess/ios/WKActionSheetAssistant.mm:
1338         (-[WKActionSheetAssistant currentAvailableActionStrings]):
1339         * UIProcess/ios/WKContentViewInteraction.h:
1340         * UIProcess/ios/WKContentViewInteraction.mm:
1341         (-[WKContentView _contentsOfUserInterfaceItem:]):
1342
1343 2016-09-27  Anders Carlsson  <andersca@apple.com>
1344
1345         Remove a couple of unused members from PlatformKeyboardEvent
1346         https://bugs.webkit.org/show_bug.cgi?id=162641
1347
1348         Reviewed by Tim Horton.
1349
1350         * Shared/WebEventConversion.cpp:
1351         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1352
1353 2016-09-29  Nan Wang  <n_wang@apple.com>
1354
1355         AX: iOS: Tapping <input> in Safari zooms in a bit when page has max scale = 1
1356         https://bugs.webkit.org/show_bug.cgi?id=162471
1357
1358         Reviewed by Simon Fraser.
1359
1360         * Shared/AssistedNodeInformation.cpp:
1361         (WebKit::AssistedNodeInformation::encode):
1362         (WebKit::AssistedNodeInformation::decode):
1363         * Shared/AssistedNodeInformation.h:
1364         * UIProcess/ios/WKContentViewInteraction.mm:
1365         (-[WKContentView _displayFormNodeInputView]):
1366         * WebProcess/WebPage/WebPage.h:
1367         * WebProcess/WebPage/ios/WebPageIOS.mm:
1368         (WebKit::WebPage::maximumPageScaleFactorIgnoringAlwaysScalable):
1369         (WebKit::WebPage::getAssistedNodeInformation):
1370
1371 2016-09-29  Daniel Bates  <dabates@apple.com>
1372
1373         Mark NetworkLoad as final
1374         https://bugs.webkit.org/show_bug.cgi?id=162681
1375
1376         Reviewed by Alex Christensen.
1377
1378         Mark class NetworkLoad as final as we do not have any derived classes at the moment and it
1379         is unclear if it would make sense to subclass it. We can always unmark the class if it turns
1380         out that it makes sense to subclass it.
1381
1382         * NetworkProcess/NetworkLoad.h:
1383
1384 2016-09-29  Sam Weinig  <sam@webkit.org>
1385
1386         Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
1387         <rdar://problem/27648683>
1388         https://bugs.webkit.org/show_bug.cgi?id=162735
1389
1390         Reviewed by Dan Bernstein.
1391
1392         Add SPI for overriding the following NSURLSessionConfigurations properties:
1393             - _sourceApplicationBundleIdentifier
1394             - _sourceApplicationSecondaryIdentifier
1395             - _CTDataConnectionServiceType
1396
1397         * NetworkProcess/NetworkProcess.cpp:
1398         (WebKit::NetworkProcess::initializeNetworkProcess):
1399         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1400         (WebKit::NetworkProcessCreationParameters::encode):
1401         (WebKit::NetworkProcessCreationParameters::decode):
1402         * NetworkProcess/NetworkProcessCreationParameters.h:
1403         * NetworkProcess/NetworkSession.h:
1404         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1405         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1406         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1407         (WebKit::globalSourceApplicationBundleIdentifier):
1408         (WebKit::globalSourceApplicationSecondaryIdentifier):
1409         (WebKit::globalCTDataConnectionServiceType):
1410         (WebKit::NetworkSession::setCustomProtocolManager):
1411         (WebKit::NetworkSession::setSourceApplicationAuditTokenData):
1412         (WebKit::NetworkSession::setSourceApplicationBundleIdentifier):
1413         (WebKit::NetworkSession::setSourceApplicationSecondaryIdentifier):
1414         (WebKit::NetworkSession::setCTDataConnectionServiceType):
1415         (WebKit::NetworkSession::NetworkSession):
1416         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1417         (API::ProcessPoolConfiguration::copy):
1418         * UIProcess/API/APIProcessPoolConfiguration.h:
1419         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1420         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1421         (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
1422         (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
1423         (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
1424         (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
1425         (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]):
1426         (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]):
1427         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1428         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1429         * WebProcess/WebProcess.cpp:
1430         (WebKit::WebProcess::initializeWebProcess):
1431         * WebProcess/cocoa/WebProcessCocoa.mm:
1432         (WebKit::WebProcess::platformInitializeWebProcess):
1433
1434 2016-09-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1435
1436         NetworkSession: HTTP authentication doesn't work if PROTECTION_SPACE_AUTH_CALLBACK is not enabled
1437         https://bugs.webkit.org/show_bug.cgi?id=162724
1438
1439         Reviewed by Alex Christensen.
1440
1441         NetworkLoad always expects continueCanAuthenticateAgainstProtectionSpace() to be called to complete the
1442         authentication challenge, which is only defined when PROTECTION_SPACE_AUTH_CALLBACK is enabled.
1443         I've added missing #ifdefs for PROTECTION_SPACE_AUTH_CALLBACK.
1444
1445         * NetworkProcess/Downloads/DownloadManager.cpp:
1446         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
1447         * NetworkProcess/Downloads/DownloadManager.h:
1448         * NetworkProcess/Downloads/PendingDownload.cpp:
1449         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
1450         * NetworkProcess/Downloads/PendingDownload.h:
1451         * NetworkProcess/NetworkLoad.cpp:
1452         (WebKit::NetworkLoad::~NetworkLoad):
1453         (WebKit::NetworkLoad::didReceiveChallenge): Call completeAuthenticationChallenge() instead of
1454         canAuthenticateAgainstProtectionSpaceAsync() when PROTECTION_SPACE_AUTH_CALLBACK is not enabled.
1455         (WebKit::NetworkLoad::completeAuthenticationChallenge): Moved common code to complete the authentication
1456         challenge from continueCanAuthenticateAgainstProtectionSpace().
1457         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Call completeAuthenticationChallenge().
1458         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
1459         * NetworkProcess/NetworkLoad.h:
1460         * NetworkProcess/NetworkLoadClient.h:
1461         * NetworkProcess/NetworkProcess.cpp:
1462         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload):
1463         * NetworkProcess/NetworkProcess.h:
1464         * NetworkProcess/NetworkProcess.messages.in:
1465         * NetworkProcess/NetworkResourceLoader.cpp:
1466         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
1467         (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
1468         * NetworkProcess/NetworkResourceLoader.h:
1469         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1470         * Shared/Authentication/AuthenticationManager.h:
1471         * UIProcess/Downloads/DownloadProxy.cpp:
1472         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
1473         * UIProcess/Downloads/DownloadProxy.h:
1474         * UIProcess/Downloads/DownloadProxy.messages.in:
1475
1476 2016-09-28  Joseph Pecoraro  <pecoraro@apple.com>
1477
1478         WKSharedAPICast should not warn about acceptable custom context menu tag values
1479         https://bugs.webkit.org/show_bug.cgi?id=162597
1480         <rdar://problem/28487627>
1481
1482         Reviewed by Tim Horton.
1483
1484         * Shared/API/c/WKSharedAPICast.h:
1485         (WebKit::toAPI):
1486         (WebKit::toImpl):
1487         Don't log an error when casting ContextMenu types if it is within
1488         the Custom ContextMenu tag range.
1489
1490 2016-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1491
1492         Adopt MediaRemote SPI to achieve desired Now Playing behavior
1493         https://bugs.webkit.org/show_bug.cgi?id=162658
1494         <rdar://problem/28499358>
1495
1496         Reviewed by Jer Noble.
1497
1498         Plumbs Now Playing session information (for now, this is just a flag indicating whether or not there is an
1499         active session) across from the web process to the UI process for testing in the form of asynchronous request/
1500         handle-response messages on the WebPage and its proxy in the UI process.
1501
1502         * UIProcess/API/Cocoa/WKWebView.mm:
1503         (-[WKWebView _requestActiveNowPlayingSessionInfo]):
1504         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]):
1505         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1506         * UIProcess/PageClient.h:
1507         * UIProcess/WebPageProxy.cpp:
1508         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
1509         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
1510         * UIProcess/WebPageProxy.h:
1511         * UIProcess/WebPageProxy.messages.in:
1512         * UIProcess/mac/PageClientImpl.h:
1513         * UIProcess/mac/PageClientImpl.mm:
1514         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
1515         * WebProcess/WebPage/WebPage.h:
1516         * WebProcess/WebPage/WebPage.messages.in:
1517         * WebProcess/WebPage/mac/WebPageMac.mm:
1518         (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
1519
1520 2016-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1521
1522         [GTK] Switch to use GMenu internally in the context menu implementation
1523         https://bugs.webkit.org/show_bug.cgi?id=162603
1524
1525         Reviewed by Michael Catanzaro.
1526
1527         Switch to use GAction instead of GtkAction internally, but still keeping a GtkAction associated to the GAction,
1528         because our API depends on GtkAction.
1529
1530         * Shared/gtk/WebContextMenuItemGtk.cpp:
1531         (WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk):
1532         (WebKit::WebContextMenuItemGtk::createActionIfNeeded): Create the GAction and the associated GtkAction. Ensure a
1533         unique name for the GAction, since the name now matters.
1534         * Shared/gtk/WebContextMenuItemGtk.h:
1535         (WebKit::WebContextMenuItemGtk::gtkAction):
1536         (WebKit::WebContextMenuItemGtk::gAction):
1537         (WebKit::WebContextMenuItemGtk::submenuItems): Deleted.
1538         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1539         (WebKit::contextMenuItemActivatedCallback): Use the GAction.
1540         (WebKit::WebContextMenuProxyGtk::append): Create a new GMenuItem for the GAction.
1541         (WebKit::WebContextMenuProxyGtk::buildMenu): Build a GMenu for the given items.
1542         (WebKit::WebContextMenuProxyGtk::populate): Create a GMenu and bind it ot the GtkMenu.
1543         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): Create the GActionGroup for the menu.
1544         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Remove the action group from the GtkMenu.
1545         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1546
1547 2016-09-27  Daniel Bates  <dabates@apple.com>
1548
1549         NetworkLoad and PingLoad should use private inheritance
1550         https://bugs.webkit.org/show_bug.cgi?id=162649
1551
1552         Reviewed by Alex Christensen.
1553
1554         Make NetworkLoad privately inherit from NetworkDataTaskClient and ResourceHandleClient,
1555         and make the client callbacks from these interfaces private as this class implements
1556         these interfaces.
1557
1558         Similarly, make PingLoad privately inherit from ResourceHandleClient.
1559
1560         * NetworkProcess/NetworkLoad.h:
1561         * NetworkProcess/PingLoad.h:
1562
1563 2016-09-20  Anders Carlsson  <andersca@apple.com>
1564
1565         PlatformEvent::m_modifiers should be an OptionSet
1566         https://bugs.webkit.org/show_bug.cgi?id=162326
1567
1568         Reviewed by Daniel Bates.
1569
1570         * Shared/WebEventConversion.cpp:
1571         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1572         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
1573         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1574         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
1575
1576 2016-09-27  Dan Bernstein  <mitz@apple.com>
1577
1578         [iOS] REGRESSION (r182126): Selection highlight and handles aren’t visible with WKSelectionGranularityCharacter
1579         https://bugs.webkit.org/show_bug.cgi?id=162577
1580         <rdar://problem/28481984>
1581
1582         Reviewed by Simon Fraser.
1583
1584         * UIProcess/API/Cocoa/WKWebView.mm:
1585         (-[WKWebView _uiTextSelectionRectViews]): Added this method in the WKTesting category, which
1586           uses UIKit internals to get the views used for the selection highlight.
1587         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1588
1589         * UIProcess/ios/WKContentViewInteraction.mm:
1590         (-[WKContentView _selectionClipRect]): When selection is not confined to a form control or
1591           content-editable element, return the null rect to indicate no clipping, rather than
1592           clipping to the empty rect at the origin.
1593
1594 2016-09-27  Jer Noble  <jer.noble@apple.com>
1595
1596         Remove deprecated ENCRYPTED_MEDIA implementation.
1597         https://bugs.webkit.org/show_bug.cgi?id=161010
1598
1599         Reviewed by Eric Carlson.
1600
1601         Remove ENABLE_ENCRYPTED_MEDIA.
1602
1603         * Configurations/FeatureDefines.xcconfig:
1604
1605 2016-09-27  Chris Dumez  <cdumez@apple.com>
1606
1607         [WK2] Navigating to a Blob URL does not trigger a download
1608         https://bugs.webkit.org/show_bug.cgi?id=162574
1609
1610         Reviewed by Darin Adler.
1611
1612         Add support for converting Blob URL loads into downloads.
1613
1614         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1615         (WebKit::BlobDownloadClient::didReceiveResponseAsync):
1616         Make sure we return a valid suggested filename because the client side (Safari)
1617         does not deal with empty suggested filenames. Use "unknown" by default to
1618         match the default suggested filename of non-Blob downloads.
1619
1620         * NetworkProcess/Downloads/Download.cpp:
1621         (WebKit::Download::startWithHandle):
1622         * NetworkProcess/Downloads/Download.h:
1623         * NetworkProcess/Downloads/DownloadManager.cpp:
1624         (WebKit::DownloadManager::convertHandleToDownload):
1625         * NetworkProcess/Downloads/DownloadManager.h:
1626         * NetworkProcess/Downloads/ios/DownloadIOS.mm:
1627         (WebKit::Download::startNetworkLoadWithHandle):
1628         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1629         (WebKit::Download::startNetworkLoadWithHandle):
1630         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
1631         (WebKit::Download::startNetworkLoadWithHandle):
1632         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1633         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1634         * NetworkProcess/NetworkLoad.h:
1635         (WebKit::NetworkLoad::handle):
1636
1637 2016-09-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1638
1639         [GTK] Unreviewed typo fix
1640
1641         * UIProcess/API/gtk/WebKitWebInspector.cpp:
1642         (webkit_web_inspector_class_init):
1643
1644 2016-09-27  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1645
1646         [GTK] Should check whether GDK can use GL before asking it to
1647         https://bugs.webkit.org/show_bug.cgi?id=162598
1648
1649         Reviewed by Michael Catanzaro.
1650
1651         gdk_cairo_draw_from_gl can fail even when WebKit itself has been able to use GL (its
1652         context creation code might be buggy, GL may have been disabled using GDK_GL=disable, …).
1653         Unfortunately it does not have any error reporting other than a warning printed to
1654         stderr, so we cannot fallback from it. We have to first check if GL can be used by GDK
1655         by trying to create a context.
1656
1657         See https://bugzilla.redhat.com/show_bug.cgi?id=1378987
1658
1659         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1660         (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL): decide whether GDK can use GL by
1661         trying to create a context for a GdkWindow.
1662         (WebKit::AcceleratedBackingStoreWayland::paint): fallback to glReadPixels if GDK cannot
1663         use GL.
1664         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
1665
1666 2016-09-26  Tim Horton  <timothy_horton@apple.com>
1667
1668         Delete some unused code from r202695
1669         https://bugs.webkit.org/show_bug.cgi?id=162595
1670         <rdar://problem/28343784>
1671
1672         Reviewed by Dan Bernstein.
1673
1674         * UIProcess/API/Cocoa/WKWebView.mm:
1675         (-[WKWebView _initializeWithConfiguration:]):
1676         (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]): Deleted.
1677         (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]): Deleted.
1678         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1679         * UIProcess/ios/PageClientImplIOS.mm:
1680         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
1681         We didn't end up needing this mechanism.
1682
1683 2016-09-26  Dan Bernstein  <mitz@apple.com>
1684
1685         -_webViewWebProcessDidBecomeUnresponsive: gets called when the Web process is stopped in the debugger
1686         https://bugs.webkit.org/show_bug.cgi?id=162234
1687
1688         Reviewed by Sam Weinig.
1689
1690         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1691         (WebKit::WebProcessProxy::platformIsBeingDebugged): Use the KERN_PROC sysctl to get the
1692           process flags and check for P_TRACED.
1693
1694         * UIProcess/ResponsivenessTimer.cpp:
1695         (WebKit::ResponsivenessTimer::timerFired): Call the new client function
1696           mayBecomeUnresponsive. If it returns false, restart the timer and bail out without
1697           changing the responsiveness state.
1698
1699         * UIProcess/ResponsivenessTimer.h: Declared new client function mayBecomeUnresponsive.
1700
1701         * UIProcess/WebProcessProxy.cpp:
1702         (WebKit::WebProcessProxy::platformIsBeingDebugged): A generic implementation that always
1703           returns false.
1704         (WebKit::WebProcessProxy::mayBecomeUnresponsive): Implement this new
1705           ResponsivenessTimer::Client function to return true unless the process is being debugged.
1706         * UIProcess/WebProcessProxy.h:
1707
1708 2016-09-26  Chris Dumez  <cdumez@apple.com>
1709
1710         [WK2] BlobDownloadClient should use asynchronous IPC to decide destination path
1711         https://bugs.webkit.org/show_bug.cgi?id=162568
1712
1713         Reviewed by Alex Christensen.
1714
1715         Use DecideDestinationWithSuggestedFilenameAsync IPC to decide the destination
1716         path in the case of Blob downloads, instead of the synchronous alternative.
1717         To achieve this, BlobResourceHandle was updated in WebCore to properly support
1718         asynchronous callback and BlobDownloadClient was updated to use asynchronous
1719         callbacks. When BlobDownloadClient::didReceiveResponseAsync() is called, we
1720         now ask the WebContent process asynchronously to decide what the destination
1721         path should be. Then, when we later get the destination path back from the
1722         WebContent process, we create the file on disk and call
1723         continueDidReceiveResponse() on the BlobResourceHandle so we start getting the
1724         blob data to write.
1725
1726         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1727         (WebKit::BlobDownloadClient::didReceiveResponseAsync):
1728         (WebKit::BlobDownloadClient::didDecideDownloadDestination):
1729         * NetworkProcess/Downloads/BlobDownloadClient.h:
1730         * NetworkProcess/Downloads/Download.cpp:
1731         (WebKit::Download::decideDestinationWithSuggestedFilenameAsync):
1732         (WebKit::Download::didDecideDownloadDestination):
1733         (WebKit::Download::continueDidReceiveResponse):
1734         (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted.
1735         * NetworkProcess/Downloads/Download.h:
1736         * NetworkProcess/Downloads/DownloadManager.cpp:
1737         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
1738         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
1739         (WebKit::DownloadManager::convertHandleToDownload): Deleted.
1740         * NetworkProcess/Downloads/DownloadManager.h:
1741         * NetworkProcess/NetworkLoad.cpp:
1742         (WebKit::NetworkLoad::continueDidReceiveResponse):
1743         * NetworkProcess/NetworkProcess.cpp:
1744         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
1745         * NetworkProcess/NetworkProcess.h:
1746         * NetworkProcess/NetworkProcess.messages.in:
1747         * UIProcess/Downloads/DownloadProxy.cpp:
1748         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): Deleted.
1749         * UIProcess/Downloads/DownloadProxy.h:
1750         * UIProcess/Downloads/DownloadProxy.messages.in:
1751
1752 2016-09-26  Daniel Bates  <dabates@apple.com>
1753
1754         Mark Ping{Handle, Load} as final
1755         https://bugs.webkit.org/show_bug.cgi?id=162576
1756
1757         Reviewed by Alex Christensen.
1758
1759         We should not support subclassing of a ping handle or overriding its NetworkDataTaskClient
1760         callbacks because there are security/privacy implications with a ping request. We should
1761         not encourage subclassing without careful consideration.
1762
1763         * NetworkProcess/PingLoad.h:
1764
1765 2016-09-26  Daniel Bates  <dabates@apple.com>
1766
1767         Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
1768         https://bugs.webkit.org/show_bug.cgi?id=162365
1769
1770         Reviewed by Simon Fraser.
1771
1772         * Configurations/FeatureDefines.xcconfig:
1773         * WebProcess/WebPage/WebPage.cpp:
1774         (WebKit::WebPage::updatePreferences):
1775
1776 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1777
1778         Fix -Wformat warnings in WebLoaderStrategy
1779         https://bugs.webkit.org/show_bug.cgi?id=162553
1780
1781         Reviewed by Alex Christensen.
1782
1783         Consistently use PRIu64 to print uint64_t
1784
1785         * NetworkProcess/Downloads/Download.cpp:
1786         (WebKit::Download::didReceiveResponse):
1787         (WebKit::Download::didReceiveData):
1788         (WebKit::Download::didFinish):
1789         (WebKit::Download::didFail):
1790         (WebKit::Download::didCancel):
1791         * NetworkProcess/NetworkResourceLoader.cpp:
1792         (WebKit::NetworkResourceLoader::start):
1793         (WebKit::NetworkResourceLoader::startNetworkLoad):
1794         (WebKit::NetworkResourceLoader::setDefersLoading):
1795         (WebKit::NetworkResourceLoader::abort):
1796         (WebKit::NetworkResourceLoader::didReceiveBuffer):
1797         (WebKit::NetworkResourceLoader::didFinishLoading):
1798         (WebKit::NetworkResourceLoader::didFailLoading):
1799         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1800         * WebProcess/Network/WebLoaderStrategy.cpp:
1801         (WebKit::WebLoaderStrategy::scheduleLoad):
1802         * WebProcess/Network/WebResourceLoader.cpp:
1803         (WebKit::WebResourceLoader::willSendRequest):
1804         (WebKit::WebResourceLoader::didReceiveResponse):
1805         (WebKit::WebResourceLoader::didReceiveData):
1806         (WebKit::WebResourceLoader::didFinishResourceLoad):
1807         (WebKit::WebResourceLoader::didFailResourceLoad):
1808         (WebKit::WebResourceLoader::didReceiveResource):
1809
1810 == Rolled over to ChangeLog-2016-09-26 ==