Unreviewed. Fix GTK+ build after r207522.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         Unreviewed. Fix GTK+ build after r207522.
4
5         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
6         (webkit_dom_dom_window_webkit_message_handlers_post_message): Use new exceptions.
7
8 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
9
10         Unreviewed. Fix GTK+ build after r207497.
11
12         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
13         (webkit_dom_html_select_element_add): Update implementation since add() now takes a Variant.
14
15 2016-10-18  Simon Fraser  <simon.fraser@apple.com>
16
17         Add a MiniBrowser menu item to apply page scale in WK1 and WK2
18         https://bugs.webkit.org/show_bug.cgi?id=163627
19
20         Reviewed by Dean Jackson.
21
22         New SPI to set and retrieve page scale.
23
24         * UIProcess/API/Cocoa/WKWebView.mm:
25         (-[WKWebView _setPageScale:withOrigin:]):
26         (-[WKWebView _pageScale]):
27         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
28
29 2016-10-18  Dean Jackson  <dino@apple.com>
30
31         Remove CSS_SHAPES feature definition. This should always be on.
32         https://bugs.webkit.org/show_bug.cgi?id=163628
33         <rdar://problem/28834613>
34
35         Reviewed by Tim Horton.
36
37         * Configurations/FeatureDefines.xcconfig:
38
39 2016-10-18  Ryan Haddad  <ryanhaddad@apple.com>
40
41         Unreviewed, rolling out r207413.
42
43         This change broke iOS builds.
44
45         Reverted changeset:
46
47         "[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to
48         _UIWebTouchPoint.majorRadiusInScreenCoordinates"
49         https://bugs.webkit.org/show_bug.cgi?id=163547
50         http://trac.webkit.org/changeset/207413
51
52 2016-10-18  Commit Queue  <commit-queue@webkit.org>
53
54         Unreviewed, rolling out r207443.
55         https://bugs.webkit.org/show_bug.cgi?id=163616
56
57         "Caused 5% PLT regression" (Requested by krollin on #webkit).
58
59         Reverted changeset:
60
61         "Crash in ASCIICaseInsensitiveHash::hash() when a response has
62         a null MIME type"
63         https://bugs.webkit.org/show_bug.cgi?id=163476
64         http://trac.webkit.org/changeset/207443
65
66 2016-10-18  Megan Gardner  <megan_gardner@apple.com>
67
68         Fix build for platforms where HAVE(LINK_PREVIEW) is false
69         https://bugs.webkit.org/show_bug.cgi?id=163607
70
71         Reviewed by Tim Horton.
72
73         Added needed # for link preview
74
75         * UIProcess/ios/WKContentViewInteraction.mm:
76         (-[WKContentView _contentsOfUserInterfaceItem:]):
77
78 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
79
80         Remote Web Inspector: Timeline UI not updating while recording
81         https://bugs.webkit.org/show_bug.cgi?id=163582
82         <rdar://problem/28766837>
83
84         Reviewed by Timothy Hatcher.
85
86         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
87         (WebKit::RemoteWebInspectorUI::frontendLoaded):
88         Local inspector windows keep the web view alive and toggle the
89         WebInspector.visible state depending on whether or not an inspector is
90         open. Remote Inspector windows go away when closed, so they can always
91         be marked as open. This matches earlier remote inspector behavior.
92
93 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
94
95         [MediaStream] Resolve constraints and enumerate devices in the UI process
96         https://bugs.webkit.org/show_bug.cgi?id=162147
97         <rdar://problem/28803569>
98
99         Reviewed by Darin Adler.
100         
101         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
102         access happens in the UI process.
103
104         * Scripts/webkit/messages.py:
105         (headers_for_type): Special case MediaConstraintsData.
106
107         * Shared/WebCoreArgumentCoders.cpp:
108         (IPC::encodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap encoder.
109         (IPC::ArgumentCoder<MediaConstraintsData>::encode): MediaConstraintsData encoder.
110         (IPC::decodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap decoder.
111         (IPC::ArgumentCoder<MediaConstraintsData>::decode): MediaConstraintsData decoder.
112         (IPC::ArgumentCoder<CaptureDevice>::encode): CaptureDevice enoder.
113         (IPC::ArgumentCoder<CaptureDevice>::decode): CaptureDevice decoder.
114         * Shared/WebCoreArgumentCoders.h:
115
116         * UIProcess/API/APIUIClient.h:  Remove UserMediaPermissionCheckProxy forward declaration.
117
118         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
119         (toWK): Translate UserMediaPermissionRequestDenialReason to UserMediaAccessDenialReason.
120         (WKUserMediaPermissionRequestDeny): Add "reason" parameter.
121         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
122
123         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
124         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Invalidate pending device requests.
125         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Make private.
126         (WebKit::toWebCore): Map from UserMediaAccessDenialReason to MediaAccessDenialReason, cast to
127           uint64_t to pass to web process.
128         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest): Send to web process.
129         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
130         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Validate
131           constraints and make sure gUM is enabled before prompting user.
132         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): New.
133         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Send 
134           results of device enumeration to web process.
135         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
136         (WebKit::UserMediaPermissionRequestManagerProxy::createUserMediaPermissionCheck): Deleted.
137         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
138
139         * UIProcess/UserMediaPermissionRequestProxy.cpp:
140         (WebKit::UserMediaPermissionRequestProxy::allow):
141         (WebKit::UserMediaPermissionRequestProxy::deny): Take "reason" parameter.
142         * UIProcess/UserMediaPermissionRequestProxy.h:
143
144         * UIProcess/WebPageProxy.cpp:
145         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
146         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
147         (WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Deleted.
148         * UIProcess/WebPageProxy.h:
149         * UIProcess/WebPageProxy.messages.in:
150
151         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
152         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): userMediaAccessDenied -> deny.
153           Pass the audio and video constraints to the UI process.
154         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): 
155         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
156         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Send the enumeration request
157           to the UI process.
158         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
159         (WebKit::UserMediaPermissionRequestManager::didCompleteMediaDeviceEnumeration):
160         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): Deleted.
161         (WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Deleted.
162         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaPermissionCheck): Deleted.
163         (WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Deleted.
164         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
165
166         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
167         (WebKit::WebUserMediaClient::enumerateMediaDevices): New.
168         (WebKit::WebUserMediaClient::cancelMediaDevicesEnumerationRequest): New.
169         (WebKit::WebUserMediaClient::checkUserMediaPermission): Deleted.
170         (WebKit::WebUserMediaClient::cancelUserMediaPermissionCheck): Deleted.
171         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
172
173         * WebProcess/WebPage/WebPage.cpp:
174         (WebKit::WebPage::userMediaAccessWasGranted): New.
175         (WebKit::WebPage::userMediaAccessWasDenied): Ditto.
176         (WebKit::WebPage::didCompleteMediaDeviceEnumeration):
177         (WebKit::WebPage::didReceiveUserMediaPermissionDecision): Deleted.
178         (WebKit::WebPage::didCompleteUserMediaPermissionCheck): Deleted.
179         * WebProcess/WebPage/WebPage.h:
180         * WebProcess/WebPage/WebPage.messages.in:
181
182 2016-10-17  Antti Koivisto  <antti@apple.com>
183
184         Rename setNeedsStyleRecalc to invalidateStyle
185         https://bugs.webkit.org/show_bug.cgi?id=163542
186
187         Reviewed by Darin Adler.
188
189         * WebProcess/Plugins/PluginView.cpp:
190         (WebKit::PluginView::didInitializePlugin):
191         (WebKit::PluginView::pluginProcessCrashed):
192
193 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
194
195         NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination
196         https://bugs.webkit.org/show_bug.cgi?id=163545
197
198         Reviewed by Alex Christensen.
199
200         If a download started by DownloadManager::startDownload() is cancelled before
201         DownloadManager::willDecidePendingDownloadDestination() is called, DownloadManager::cancelDownload() does
202         nothing, because the Download hasn't been created yet and m_downloadsWaitingForDestination map doesn't contain
203         the download ID, and the PendingDownload is never removed from the m_pendingDownloads map.
204
205         * NetworkProcess/Downloads/DownloadManager.cpp:
206         (WebKit::DownloadManager::cancelDownload): Always take the PendingDownload from m_pendingDownloads map. Then, if
207         the download was already in m_downloadsWaitingForDestination map, get the network data task to properly cancel
208         it and then call the completion handler to ignore the request. Otherwise cancel the pending download if exists.
209         * NetworkProcess/Downloads/PendingDownload.cpp:
210         (WebKit::PendingDownload::cancel): Cancel the network load and notify the UI process that the download was canceled.
211         * NetworkProcess/Downloads/PendingDownload.h:
212
213 2016-10-17  Megan Gardner  <megan_gardner@apple.com>
214
215         Add test and infrastructure for link popover
216         https://bugs.webkit.org/show_bug.cgi?id=163406
217
218         Reviewed by Simon Fraser.
219
220         Add infrastructure to see when a link popover appears, and what URL it has loaded.
221
222         * UIProcess/API/Cocoa/WKWebView.mm:
223         (-[WKWebView didShowForcePressPreview]):
224         (-[WKWebView didDismissForcePressPreview]):
225         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
226         * UIProcess/ios/WKContentViewInteraction.mm:
227         (-[WKContentView _contentsOfUserInterfaceItem:]):
228         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
229         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
230         (-[WKContentView _previewItemControllerDidCancelPreview:]):
231
232 2016-10-17  Tim Horton  <timothy_horton@apple.com>
233
234         REGRESSION (r169805): WKWebView canGoBack returning YES when nothing is in the back-forward list after restoring session state
235         https://bugs.webkit.org/show_bug.cgi?id=163573
236         <rdar://problem/28744549>
237
238         Reviewed by Dan Bernstein.
239
240         * UIProcess/WebPageProxy.cpp:
241         (WebKit::WebPageProxy::restoreFromSessionState):
242         Update PageLoadState's canGoBack/canGoForward bits when restoring from
243         session state, because in the don't-navigate case, nothing else will make this happen,
244         and it will remain stale.
245
246 2016-10-17  Andy Estes  <aestes@apple.com>
247
248         Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
249         https://bugs.webkit.org/show_bug.cgi?id=163476
250         <rdar://problem/26941395>
251
252         Reviewed by Tim Horton.
253
254         When custom content providers are registered and a response has a null MIME type, WebPage
255         will pass a null String to HashSet::contains(). This results in a null pointer dereference,
256         since the String hash functions do not support null Strings and unconditionally dereference
257         their StringImpls. Fixed by checking that Strings are non-null before calling
258         HashSet::contains() on m_mimeTypesWithCustomContentProviders.
259
260         Rearranging WebPage::shouldUseCustomContentProviderForResponse() to call
261         canPluginHandleResponse() before checking m_mimeTypesWithCustomContentProviders uncovered a
262         crash in existing layout tests where WebPage::m_mainFrame can be NULL during WebPage
263         construction (m_mainFrame isn't yet initialized). Fixed this by passing the main Frame to
264         canPluginHandleResponseInFrame() instead of relying on m_mainFrame.
265
266         New API test: WebKit2.LoadDataWithNilMIMEType.
267
268         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
269         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): Passed
270         m_frame->coreFrame() to shouldUseCustomContentProviderForResponse().
271         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Ditto.
272         * WebProcess/WebPage/WebPage.cpp:
273         (WebKit::WebPage::canPluginHandleResponse): Added a mainFrame parameter and used it instead
274         of m_mainFrame->coreFrame().
275         (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Passed mainFrame to
276         canPluginHandleResponse(), and checked if mimeType is null before calling
277         m_mimeTypesWithCustomContentProviders.contains().
278         (WebKit::WebPage::canShowMIMEType): Checked if MIMEType is null before calling
279         m_mimeTypesWithCustomContentProviders.contains().
280         * WebProcess/WebPage/WebPage.h: Made canPluginHandleResponse() a private declaration.
281
282 2016-10-17  Chris Dumez  <cdumez@apple.com>
283
284         [WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
285         https://bugs.webkit.org/show_bug.cgi?id=163569
286         <rdar://problem/28810836>
287
288         Reviewed by Antti Koivisto.
289
290         PendingFrameLoad objects are created to track frame loads and added to
291         the m_pendingFrameLoads hash map. These objects are supposed to remove
292         themselves from the hash map once they detect that the page load has
293         finished by calling PendingFrameLoad::m_loadCompletionHandler().
294
295         PendingFrameLoad::m_loadCompletionHandler() is called from
296         markLoadAsCompleted() when we detect that the page load has finished
297         via the m_loadHysteresisActivity HysteresisActivity. We call impulse()
298         on the HysteresisActivity every time a subresource is loaded in the
299         frame. The issue is that if no subresource is ever loaded, then we
300         never call impulse() on the HysteresisActivity, which is therefore
301         never started. If it nevers starts, then it nevers stops and never
302         calls markLoadAsCompleted(). To address the problem, we now call
303         impulse() on the HysteresisActivity as soon as we construct it.
304
305         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
306
307 2016-10-17  Jeremy Jones  <jeremyj@apple.com>
308
309         Enable keyboard in fullscreen.
310         https://bugs.webkit.org/show_bug.cgi?id=163146
311
312         Reviewed by Jer Noble.
313
314         Allow keyboard in fullscreen.
315
316         * UIProcess/WebFullScreenManagerProxy.cpp:
317         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
318
319 2016-10-17  Chris Dumez  <cdumez@apple.com>
320
321         Move form.reportValidity() behind InteractiveFormValidation setting
322         https://bugs.webkit.org/show_bug.cgi?id=163550
323
324         Reviewed by Darin Adler.
325
326         Enable InteractiveFormValidation setting by default and link it to
327         RuntimeEnabledFeatures so we can use it in the IDL.
328
329         * UIProcess/API/C/WKPreferencesRefPrivate.h:
330         * WebProcess/WebPage/WebPage.cpp:
331         (WebKit::WebPage::updatePreferences):
332
333 2016-10-17  Gavin Barraclough  <barraclough@apple.com>
334
335         UIProcess should determine throttle state for WebContent process
336         https://bugs.webkit.org/show_bug.cgi?id=163556
337
338         Reviewed by Anders Carlsson.
339
340         This is a step towards merging page/process throttling code for mac & iOS.
341
342         Previously WebPage determined whether to start a UserActivity based on page activity,
343         visibility and the preference to disable. Now WebPage passes the activity state across
344         to WebPageProxy, which makes the decision & explicitly instructs WebPage to start/stop
345         the UserActivity.
346
347         * UIProcess/WebPageProxy.cpp:
348         (WebKit::WebPageProxy::WebPageProxy):
349             - updateActivityToken + updateProccessSuppressionState -> updateThrottleState
350         (WebKit::WebPageProxy::reattachToWebProcess):
351             - updateActivityToken -> updateThrottleState
352         (WebKit::WebPageProxy::dispatchViewStateChange):
353             - updateActivityToken -> updateThrottleState
354         (WebKit::WebPageProxy::setPageActivityState):
355             - Record activity state passed from WebPage, and update.
356         (WebKit::WebPageProxy::preferencesDidChange):
357             - updateProccessSuppressionState -> updateThrottleState
358         (WebKit::WebPageProxy::updateActivityToken): Deleted.
359         (WebKit::WebPageProxy::updateProccessSuppressionState): Deleted.
360         (WebKit::WebPageProxy::updateThrottleState):
361             - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
362             - Compute whether page should be suppressed, and send SetPageSuppressed message accordingly.
363         * UIProcess/WebPageProxy.h:
364             - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
365             - Added setPageActivityState/m_activityState to report/record page activity.
366             - Added m_pageSuppressed to prevent redundant message sends.
367         * UIProcess/WebPageProxy.messages.in:
368             - Expose SetPageActivityState message (called by WebPage).
369         * WebProcess/WebPage/WebPage.cpp:
370         (WebKit::WebPage::WebPage):
371             - removed m_processSuppressionEnabled
372             - updateUserActivity -> setPageSuppressed - explicitly set the page to not be suppressed, until WebPageProxy tells us to do so.
373         (WebKit::WebPage::setPageActivityState):
374             - post activity state on to WebPageProxy.
375         (WebKit::WebPage::setPageSuppressed):
376             - Start/stop USerActivity accordingly.
377         (WebKit::WebPage::setViewState):
378             - No longer need to monitor ViewState changes on the WebProcess side.
379         (WebKit::WebPage::updatePreferences):
380             - No longer need to monitor preference changes on the WebProcess side.
381         (WebKit::WebPage::updateUserActivity): Deleted.
382             - Only updated on reciept of setPageSuppressed message.
383         * WebProcess/WebPage/WebPage.h:
384             - Removed m_activityState, m_processSuppressionEnabled, updateUserActivity.
385             - Added setPageSuppressed message.
386         * WebProcess/WebPage/WebPage.messages.in:
387             - Added SetPageSuppressed message.
388
389 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
390
391         REGRESSION(r206189): logs error statements when API::URLRequest is canceled
392         https://bugs.webkit.org/show_bug.cgi?id=163393
393
394         Reviewed by Antti Koivisto.
395
396         Print this case at normal logging level, not as an error.
397
398         * WebProcess/Network/WebLoaderStrategy.cpp:
399         (WebKit::WebLoaderStrategy::loadResource):
400
401 2016-10-17  Chris Dumez  <cdumez@apple.com>
402
403         [iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
404         https://bugs.webkit.org/show_bug.cgi?id=163547
405
406         Reviewed by Darin Adler.
407
408         Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
409         now that it is available in UIKit.
410
411         * Platform/spi/ios/UIKitSPI.h:
412         * Shared/ios/NativeWebTouchEventIOS.mm:
413         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
414
415 2016-10-17  Konstantin Tokarev  <annulen@yandex.ru>
416
417         Eleminate code duplication between ResourceRequest encoding/decoding implementations
418         https://bugs.webkit.org/show_bug.cgi?id=163507
419
420         Reviewed by Carlos Garcia Campos.
421
422         ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
423         ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
424         ditto for decoding implementations.
425
426         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
427         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
428         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
429
430 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
431
432         Move user agent quirks to cross-platform location
433         https://bugs.webkit.org/show_bug.cgi?id=163508
434
435         Reviewed by Carlos Garcia Campos.
436
437         #include <WebCore/UserAgent.h> instead of <WebCore/UserAgentGtk.h>.
438
439         * UIProcess/API/gtk/WebKitSettings.cpp:
440         * UIProcess/efl/WebPageProxyEfl.cpp:
441         * UIProcess/gtk/WebPageProxyGtk.cpp:
442         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
443
444 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
445
446         [SOUP] Downloads should always sniff contents
447         https://bugs.webkit.org/show_bug.cgi?id=163538
448
449         Reviewed by Michael Catanzaro.
450
451         It's quite common that downloads have weird filenames with no extension, so it would be better if the loader
452         sniff the contents to guess the mime type.
453
454         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
455         (WebKit::Download::startNetworkLoad): Pass true for shouldContentSniff parameter of ResourceHandle::create().
456
457 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
458
459         [GTK] Switch to use API::DownloadClient instead of the C API client
460         https://bugs.webkit.org/show_bug.cgi?id=163537
461
462         Reviewed by Michael Catanzaro.
463
464         The code is simpler and we avoid all the toImpl/toAPI.
465
466         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
467         (attachDownloadClientToContext):
468         (didStart):
469         (didReceiveResponse):
470         (didReceiveData):
471         (decideDestinationWithSuggestedFilename):
472         (didCreateDestination):
473         (didFail):
474         (didCancel):
475         (didFinish):
476
477 2016-10-17  Manuel Rego Casasnovas  <rego@igalia.com>
478
479         [css-grid] Disable CSS Grid Layout runtime flag by default
480         https://bugs.webkit.org/show_bug.cgi?id=163432
481
482         Reviewed by Darin Adler.
483
484         It was enabled in r201042, but now Safari Technology Preview
485         has a UI to switch runtime flags so it doesn't need to be enabled
486         by default anymore.
487
488         * Shared/WebPreferencesDefinitions.h: Disable grid layout runtime flag
489         by default.
490
491 2016-10-16  Darin Adler  <darin@apple.com>
492
493         Move CSS classes from ExceptionCode to Exception
494         https://bugs.webkit.org/show_bug.cgi?id=163494
495
496         Reviewed by Sam Weinig.
497
498         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
499         (webkit_dom_css_rule_set_css_text): Updated for ExceptionOr.
500         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
501         (webkit_dom_css_style_declaration_remove_property): Ditto.
502         (webkit_dom_css_style_declaration_set_property): Ditto.
503         (webkit_dom_css_style_declaration_set_css_text): Ditto.
504         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
505         (webkit_dom_css_style_sheet_insert_rule): Ditto.
506         (webkit_dom_css_style_sheet_delete_rule): Ditto.
507         (webkit_dom_css_style_sheet_add_rule): Ditto.
508         (webkit_dom_css_style_sheet_remove_rule): Ditto.
509         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
510         (webkit_dom_css_value_set_css_text): Ditto.
511         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
512         (webkit_dom_media_list_delete_medium): Ditto.
513         (webkit_dom_media_list_append_medium): Ditto.
514         (webkit_dom_media_list_set_media_text): Ditto.
515
516 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
517
518         [GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext
519         https://bugs.webkit.org/show_bug.cgi?id=163443
520
521         Reviewed by Michael Catanzaro.
522
523         Adopt the reference returned by webkitWebsiteDataManagerCreate().
524
525         * UIProcess/API/gtk/WebKitWebContext.cpp:
526         (webkitWebContextConstructed):
527
528 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
529
530         [GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
531         https://bugs.webkit.org/show_bug.cgi?id=163389
532
533         Reviewed by Michael Catanzaro.
534
535         Update the page URI also when the load is committed.
536
537         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
538         (getDocumentLoaderURL):
539         (didStartProvisionalLoadForFrame):
540         (didReceiveServerRedirectForProvisionalLoadForFrame):
541         (didCommitLoadForFrame):
542         (webkitWebPageCreate):
543         (getProvisionalURLForFrame): Deleted.
544
545 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
546
547         Sort the project file.
548
549         * WebKit2.xcodeproj/project.pbxproj:
550
551 2016-10-14  Anders Carlsson  <andersca@apple.com>
552
553         Fix Mac build.
554
555         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
556         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
557
558 2016-10-14  Anders Carlsson  <andersca@apple.com>
559
560         Pass on networking settings to the PKPaymentRequest
561         https://bugs.webkit.org/show_bug.cgi?id=163462
562         rdar://problem/28567629
563
564         Reviewed by Dan Bernstein.
565
566         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
567         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
568         (WebKit::toPKPaymentRequest):
569         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
570         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
571
572 2016-10-14  Anders Carlsson  <andersca@apple.com>
573
574         Clean up BackForwardClient
575         https://bugs.webkit.org/show_bug.cgi?id=163454
576
577         Reviewed by Sam Weinig.
578
579         Remove empty iOS only stubs.
580
581         * WebKit2.xcodeproj/project.pbxproj:
582         * WebProcess/WebPage/WebBackForwardListProxy.h:
583         * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed.
584
585 2016-10-14  Brady Eidson  <beidson@apple.com>
586
587         Enable Gamepads by default in WK2.
588         https://bugs.webkit.org/show_bug.cgi?id=163447
589
590         Rubberstamped by Sam Weinig.
591
592         * Shared/WebPreferencesDefinitions.h:
593
594 2016-10-14  Gavin Barraclough  <barraclough@apple.com>
595
596         Add API to restrict WebKit processes to background priority
597         https://bugs.webkit.org/show_bug.cgi?id=163363
598
599         Reviewed by Anders Carlson.
600
601         Add API on _WKProcessPoolConfiguration to flag a process pool as 'alwaysRunsAtBackgroundPriority'.
602         WebContent and Networking processes associated with that pool will only run a background priority,
603         when they otherwise would have run at foreground priority.
604
605         * UIProcess/API/APIProcessPoolConfiguration.h:
606             - Add m_alwaysRunsAtBackgroundPriority flag to pool configuration object.
607         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
608         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
609         (-[_WKProcessPoolConfiguration alwaysRunsAtBackgroundPriority]):
610         (-[_WKProcessPoolConfiguration setAlwaysRunsAtBackgroundPriority:]):
611             - Expose new configuration property through API.
612         * UIProcess/Network/NetworkProcessProxy.cpp:
613         (WebKit::NetworkProcessProxy::alwaysRunsAtBackgroundPriority):
614         * UIProcess/Network/NetworkProcessProxy.h:
615             - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
616         * UIProcess/ProcessThrottler.cpp:
617         (WebKit::ProcessThrottler::assertionState):
618             - When determining whether to take a foreground exception check alwaysRunsAtBackgroundPriority.
619         * UIProcess/ProcessThrottlerClient.h:
620             - Add interface to access alwaysRunsAtBackgroundPriority state of WebProcess of NetworkProcess.
621         * UIProcess/WebProcessPool.cpp:
622         (WebKit::WebProcessPool::WebProcessPool):
623         * UIProcess/WebProcessPool.h:
624             - Add m_alwaysRunsAtBackgroundPriority, set by configuration.
625         * UIProcess/WebProcessProxy.cpp:
626         (WebKit::WebProcessProxy::alwaysRunsAtBackgroundPriority):
627         * UIProcess/WebProcessProxy.h:
628             - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
629
630 2016-10-14  Youenn Fablet  <youenn@apple.com>
631
632         Make NetworkCache aware of fetch cache mode
633         https://bugs.webkit.org/show_bug.cgi?id=163332
634
635         Reviewed by Antti Koivisto.
636
637         Adding explicit serialization of ResourceRequest cachePolicy since it does no longer map to platform request cache policy.
638
639         Added support for:
640         - Bypassing entirely the network cache in case cache mode is NoStore.
641         - requiring revalidation in case of cache hit and cache mode is NoCache.
642         - Not using any entry if cache mode is Reload (but cache can still be updated)
643
644         Also made sure that the ResourceRequest::cachePolicy remains the same throughout redirections.
645
646         * NetworkProcess/NetworkResourceLoader.cpp:
647         (WebKit::NetworkResourceLoader::canUseCache):
648         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
649         (WebKit::NetworkResourceLoader::continueWillSendRequest):
650         * NetworkProcess/cache/NetworkCache.cpp:
651         (WebKit::NetworkCache::cachePolicyAllowsExpired):
652         (WebKit::NetworkCache::makeRetrieveDecision):
653         * Shared/mac/WebCoreArgumentCodersMac.mm:
654         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
655         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
656
657 2016-10-13  Tim Horton  <timothy_horton@apple.com>
658
659         Rename the SPI added in r207292 due to post-landing review comments
660         https://bugs.webkit.org/show_bug.cgi?id=163364
661         <rdar://problem/28012494>
662
663         Reviewed by Simon Fraser.
664
665         * UIProcess/API/APIPageConfiguration.h:
666         (API::PageConfiguration::waitsForPaintAfterViewDidMoveToWindow):
667         (API::PageConfiguration::setWaitsForPaintAfterViewDidMoveToWindow):
668         (API::PageConfiguration::shouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
669         (API::PageConfiguration::setShouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
670         * UIProcess/API/Cocoa/WKWebView.mm:
671         (-[WKWebView _initializeWithConfiguration:]):
672         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
673         (-[WKWebViewConfiguration init]):
674         (-[WKWebViewConfiguration copyWithZone:]):
675         (-[WKWebViewConfiguration _waitsForPaintAfterViewDidMoveToWindow]):
676         (-[WKWebViewConfiguration _setWaitsForPaintAfterViewDidMoveToWindow:]):
677         (-[WKWebViewConfiguration _shouldWaitForPaintAfterViewDidMoveToWindow]): Deleted.
678         (-[WKWebViewConfiguration _setShouldWaitForPaintAfterViewDidMoveToWindow:]): Deleted.
679         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
680         * UIProcess/WebPageProxy.cpp:
681         (WebKit::WebPageProxy::WebPageProxy):
682         (WebKit::WebPageProxy::dispatchViewStateChange):
683         * UIProcess/WebPageProxy.h:
684
685 2016-10-13  Jonathan Bedard  <jbedard@apple.com>
686
687         GTK and EFL on Mac fail to compile WebTextChecker due to missing definition of WKTextCheckerClientBase
688         https://bugs.webkit.org/show_bug.cgi?id=163346
689
690         Reviewed by Daniel Bates.
691
692         * UIProcess/API/C/WKTextChecker.cpp: Fixed #ifdefs for GTK and EFL builds on Darwin machines.
693         * UIProcess/API/C/WKTextChecker.h: Ditto.
694
695 2016-10-13  Tim Horton  <timothy_horton@apple.com>
696
697         Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
698         https://bugs.webkit.org/show_bug.cgi?id=163364
699         <rdar://problem/28012494>
700
701         Reviewed by Geoff Garen.
702
703         Some clients may not want the default WKWebView behavior where we synchronously
704         block on the Web process after the first time a WKWebView is re-added to the window,
705         because they are e.g. parenting re-used WKWebViews while scrolling.
706
707         * UIProcess/API/APIPageConfiguration.h:
708         (API::PageConfiguration::shouldSynchronizeInitialPaintAfterMovingToWindow):
709         (API::PageConfiguration::setShouldSynchronizeInitialPaintAfterMovingToWindow):
710         * UIProcess/API/Cocoa/WKWebView.mm:
711         (-[WKWebView _initializeWithConfiguration:]):
712         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
713         (-[WKWebViewConfiguration init]):
714         (-[WKWebViewConfiguration copyWithZone:]):
715         (-[WKWebViewConfiguration _shouldSynchronizeInitialPaintAfterMovingToWindow]):
716         (-[WKWebViewConfiguration _setShouldSynchronizeInitialPaintAfterMovingToWindow:]):
717         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
718         * UIProcess/WebPageProxy.h:
719         * UIProcess/WebPageProxy.cpp:
720         (WebKit::WebPageProxy::WebPageProxy):
721         Add and plumb a new WKWebView configuration parameter.
722
723         (WebKit::WebPageProxy::dispatchViewStateChange):
724         If the new configuration parameter is set, don't block the main thread when
725         a view is reparented.
726
727 2016-10-12  Chris Dumez  <cdumez@apple.com>
728
729         [Web IDL] Drop support for legacy [ConstructorConditional=*]
730         https://bugs.webkit.org/show_bug.cgi?id=163368
731
732         Reviewed by Ryosuke Niwa.
733
734         Drop ENABLE_DOM4_EVENTS_CONSTRUCTOR compiler flag.
735
736         * Configurations/FeatureDefines.xcconfig:
737
738 2016-10-12  Alex Christensen  <achristensen@webkit.org>
739
740         Fix assertion after switching to URLParser
741         https://bugs.webkit.org/show_bug.cgi?id=163350
742         rdar://problem/28739938
743
744         Reviewed by Brady Eidson.
745         
746         Covered by a new API test.
747
748         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
749         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
750         The { } here is not understood by the compiler to mean WebCore::URL(), but rather the empty constructor for the enum ParsedURLStringTag.
751         We used to be unsafely trusting that the URL was valid and canonicalized, but with URLParser we are canonicalizing it,
752         and the assertion (url == m_string) in URL.cpp was failing.
753
754 2016-10-12  Anders Carlsson  <andersca@apple.com>
755
756         Remove an unused function
757         https://bugs.webkit.org/show_bug.cgi?id=163341
758
759         Reviewed by Dan Bernstein.
760
761         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
762         (WebKit::WebBackForwardListProxy::isActive): Deleted.
763         * WebProcess/WebPage/WebBackForwardListProxy.h:
764
765 2016-10-11  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
766
767         [EFL] Update API tests which are passed or failed
768         https://bugs.webkit.org/show_bug.cgi?id=163322
769
770         Unreviewed, simple on/off API test.
771
772         *ewk_favicon_database_clear* has been crashed for a long time, however
773         *ewk_cookie_manager_permanent_storage* is fine now. So the passing test
774         is enabled again, and disable the failure tests.
775
776         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
777         (TEST_F):
778         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
779         (TEST_F):
780
781 2016-10-11  Daniel Bates  <dabates@apple.com>
782
783         Attempt to fix the Apple Internal Mac build following r207159
784         (https://bugs.webkit.org/show_bug.cgi?id=163244)
785
786         * UIProcess/API/Cocoa/WKWebView.mm:
787         (shouldRequireUserGestureToLoadVideo):
788
789 2016-10-11  Anders Carlsson  <andersca@apple.com>
790
791         Clean up WebPageGroup somewhat
792         https://bugs.webkit.org/show_bug.cgi?id=163299
793
794         Reviewed by Tim Horton.
795
796         * Shared/API/c/WKDeprecatedFunctions.cpp:
797         (WKPageGroupCopyIdentifier):
798         Move this here from WKPageGroup.
799
800         (WKPageGroupAddUserContentFilter):
801         (WKPageGroupRemoveUserContentFilter):
802         (WKPageGroupRemoveAllUserContentFilters):
803         Just call directly into the user content controller.
804
805         * UIProcess/API/C/WKPageGroup.cpp:
806         (WKPageGroupAddUserStyleSheet):
807         (WKPageGroupRemoveAllUserStyleSheets):
808         (WKPageGroupAddUserScript):
809         (WKPageGroupRemoveAllUserScripts):
810         Just call directly into the user content controller.
811
812         * UIProcess/API/C/WKPageGroup.h:
813         * UIProcess/WebPageGroup.cpp:
814         (WebKit::WebPageGroup::addUserStyleSheet): Deleted.
815         (WebKit::WebPageGroup::addUserScript): Deleted.
816         (WebKit::WebPageGroup::removeAllUserStyleSheets): Deleted.
817         (WebKit::WebPageGroup::removeAllUserScripts): Deleted.
818         (WebKit::WebPageGroup::removeAllUserContent): Deleted.
819         (WebKit::WebPageGroup::addUserContentExtension): Deleted.
820         (WebKit::WebPageGroup::removeUserContentExtension): Deleted.
821         (WebKit::WebPageGroup::removeAllUserContentExtensions): Deleted.
822         Get rid of these, all their callers just call into the user content controller now.
823
824         * UIProcess/WebPageGroup.h:
825         (WebKit::WebPageGroup::identifier): Deleted.
826         (WebKit::WebPageGroup::sendToAllProcessesInGroup): Deleted.
827         Remove unused code.
828
829 2016-10-11  Daniel Bates  <dabates@apple.com>
830
831         [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
832         https://bugs.webkit.org/show_bug.cgi?id=163244
833         <rdar://problem/27250015>
834
835         Reviewed by Jer Noble.
836
837         Enable or disable the Setting::requiresUserGestureToLoadVideo() in WebKit depending on the
838         version of iOS SDK that the app was linked against. We require a user gesture to begin
839         loading a video as of iOS 10.
840
841         * Shared/WebPreferencesDefinitions.h:
842         * UIProcess/API/Cocoa/WKWebView.mm:
843         (shouldRequireUserGestureToLoadVideo): Added.
844         (-[WKWebView _initializeWithConfiguration:]): Set the requiresUserGestureToLoadVideo preference.
845         * WebProcess/WebPage/WebPage.cpp:
846         (WebKit::WebPage::updatePreferences): Modified to pass the WebKit requiresUserGestureToLoadVideo
847         preference to WebCore.
848
849 2016-10-11  Alex Christensen  <achristensen@webkit.org>
850
851         Remove dead networking code
852         https://bugs.webkit.org/show_bug.cgi?id=163263
853
854         Reviewed by Daniel Bates.
855
856         * NetworkProcess/Downloads/Download.h:
857         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
858         * NetworkProcess/Downloads/mac/DownloadMac.mm:
859         * NetworkProcess/NetworkLoad.h:
860         * NetworkProcess/mac/NetworkLoadMac.mm:
861         (WebKit::NetworkLoad::willCacheResponseAsync): Deleted.
862         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
863         (WebKit::AuthenticationManager::receivedCredential):
864         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
865         (WebKit::AuthenticationManager::receivedCancellation):
866         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
867         (WebKit::AuthenticationManager::receivedChallengeRejection):
868         * Shared/WebProcessCreationParameters.cpp:
869         (WebKit::WebProcessCreationParameters::encode):
870         (WebKit::WebProcessCreationParameters::decode):
871         * Shared/WebProcessCreationParameters.h:
872         * Shared/mac/WebCoreArgumentCodersMac.mm:
873         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
874         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
875         * WebKit2.xcodeproj/project.pbxproj:
876
877 2016-10-11  Anders Carlsson  <andersca@apple.com>
878
879         Move no longer used functions to WKDeprecatedFunctions.cpp
880         https://bugs.webkit.org/show_bug.cgi?id=163290
881
882         Reviewed by Dan Bernstein.
883
884         * Shared/API/c/WKDeprecatedFunctions.cpp:
885         (WKPageGroupAddUserContentFilter):
886         (WKPageGroupRemoveUserContentFilter):
887         (WKPageGroupRemoveAllUserContentFilters):
888         (WKContextSetProcessModel): Deleted.
889         * UIProcess/API/C/WKPageGroup.cpp:
890         (WKPageGroupRemoveAllUserScripts):
891         (WKPageGroupAddUserContentFilter): Deleted.
892         (WKPageGroupRemoveUserContentFilter): Deleted.
893         (WKPageGroupRemoveAllUserContentFilters): Deleted.
894         * UIProcess/API/C/WKPageGroup.h:
895
896 2016-10-11  Konstantin Tokarev  <annulen@yandex.ru>
897
898         Use modern for loops for iterating supplement maps
899         https://bugs.webkit.org/show_bug.cgi?id=163274
900
901         Reviewed by Alex Christensen.
902
903         * NetworkProcess/NetworkProcess.cpp:
904         (WebKit::NetworkProcess::initializeNetworkProcess):
905         (WebKit::NetworkProcess::initializeConnection):
906         * UIProcess/WebProcessPool.cpp:
907         (WebKit::WebProcessPool::~WebProcessPool):
908         (WebKit::WebProcessPool::networkProcessCrashed):
909         (WebKit::WebProcessPool::databaseProcessCrashed): Iterate by values()
910         like in other places.
911
912 2016-10-11  Wenson Hsieh  <wenson_hsieh@apple.com>
913
914         The "Input Events" experimental feature runtime flag should not be on by default
915         https://bugs.webkit.org/show_bug.cgi?id=163278
916
917         Reviewed by Zalan Bujtas.
918
919         This was intended to be off by default.
920
921         * Shared/WebPreferencesDefinitions.h:
922
923 2016-10-10  Zan Dobersek  <zdobersek@igalia.com>
924
925         Add ENABLE_ENCRYPTED_MEDIA configuration option
926         https://bugs.webkit.org/show_bug.cgi?id=163219
927
928         Reviewed by Darin Adler.
929
930         * Configurations/FeatureDefines.xcconfig:
931         Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
932         to enable or disable the new EME implementation at build-time.
933
934 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
935
936         NetworkSession: NetworkDataTask is leaked if download finishes in didReceiveResponse completion handler
937         https://bugs.webkit.org/show_bug.cgi?id=163204
938
939         Reviewed by Alex Christensen.
940
941         After the completion handler a reference of the NetworkDataTask is saved in m_downloadsAfterDestinationDecided.
942         If the download failed or was canceled DownloadManager::dataTaskBecameDownloadTask is never called and the data
943         task is kept in the download manager forever. This patch exposes NSURLSessionTask state property in
944         NetworkDataTask, so that the download manager can check the task state after the completion handler and return
945         early if the download finished or was cancelled.
946
947         * NetworkProcess/Downloads/DownloadManager.cpp:
948         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
949         * NetworkProcess/NetworkDataTask.h:
950         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
951         (WebKit::NetworkDataTask::state):
952
953 2016-10-10  Konstantin Tokarev  <annulen@yandex.ru>
954
955         Added final specifier to WebInspectorServer and to its overridden methods
956         https://bugs.webkit.org/show_bug.cgi?id=163228
957
958         Reviewed by Darin Adler.
959
960         * UIProcess/InspectorServer/WebInspectorServer.h:
961
962 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
963
964         [GTK] 2.14.0 Compile Errors: GTK 3.22.1
965         https://bugs.webkit.org/show_bug.cgi?id=163190
966
967         Reviewed by Alex Christensen.
968
969         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Include gtk.h since we are using gtk_widget_queue_draw().
970
971 2016-10-10  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
972
973         [EFL] ewk_context_preferred_languages has been failed since r206949
974         https://bugs.webkit.org/show_bug.cgi?id=163211
975
976         Reviewed by Chris Dumez.
977
978         r206949 changed to return value of navigator.language from en-us to en-US
979         in order to match other browsers and w3c spec. So ewk_context_preferred_languages
980         needs to change the expected result as well.
981
982         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
983         (TEST_F):
984
985 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
986
987         NetworkSession: downloads started by startDownload() can fail before starting from the API point of view
988         https://bugs.webkit.org/show_bug.cgi?id=163107
989
990         Reviewed by Alex Christensen.
991
992         In the network process we use a PendingDownload in this case, but in the UI process we always have a single
993         download proxy. If an error happens before the pending download is converted inot a real download, the DidFail
994         messages is received in the download proxy before the DidStart one. This is problematic at least for the GTK+
995         API, because it's common to connect to the started signal and connect to all other signals from there, but in
996         this case the started signal is never emitted, and then the failed one is not handled. This is not a problem for
997         downloads started by convertTaskToDownload, because in that case those loads are not considered a download by
998         the UI process when those early errors happen, and then the web page handles them.
999
1000         * NetworkProcess/Downloads/PendingDownload.cpp:
1001         (WebKit::PendingDownload::PendingDownload): Send DidStart message right after the network load starts like the
1002         non network session code does.
1003         * NetworkProcess/NetworkLoad.cpp:
1004         (WebKit::NetworkLoad::convertTaskToDownload): Send DidStart message now that the normal load has been converted
1005         into a download.
1006         * NetworkProcess/NetworkProcess.cpp:
1007         (WebKit::NetworkProcess::findPendingDownloadLocation): Do not send DidStart message here.
1008
1009 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1010
1011         Network Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecameDownloadTask
1012         https://bugs.webkit.org/show_bug.cgi?id=163006
1013
1014         Reviewed by Alex Christensen.
1015
1016         In DownloadManager::dataTaskBecameDownloadTask() we are supposed to have either a pending download, or a network
1017         data task depending on whether the download was started by startDownload() or convertTaskToDownload. However, in
1018         both cases we do have a data task and never a pending download. In the case of startDownload() the pending
1019         download is removed from m_pendingDownloads in willDecidePendingDownloadDestination(). The task is always
1020         added to m_downloadsWaitingForDestination in willDecidePendingDownloadDestination() and to
1021         m_downloadsAfterDestinationDecided in continueDecidePendingDownloadDestination() in both cases.
1022
1023         * NetworkProcess/Downloads/DownloadManager.cpp:
1024         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Add an ASSERT to ensure we don't have a pending download
1025         at this point and that the download is not already in the map. Remove the download from the
1026         m_downloadsAfterDestinationDecided map, but don't check its result because it might not bein that map if
1027         dataTaskBecameDownloadTask is called synchronously from the didReceiveResponse completion handler.
1028         (WebKit::DownloadManager::willDecidePendingDownloadDestination): Do not take the pending download here, wait
1029         until didReceiveResponse completion handler is called.
1030         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Take the pending download here ensuring
1031         it's alive while the didReceiveResponse completion handler is called. Also remove invalid early return when
1032         either networkDataTask or completionHandler are nullptr because we are using both unconditionally, we should
1033         return early if both are nullptr to avoid crashes. However, we are checking that the download is in the
1034         m_downloadsWaitingForDestination and in that case we should always have both, so better add asserts there. If
1035         the download is already in the map after the completion handler it means that dataTaskBecameDownloadTask() has
1036         alrady been called, so we can just return in that case.
1037         * NetworkProcess/Downloads/DownloadManager.h:
1038         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1039         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Protect the NetworkDataTask that can
1040         be deleted by dataTaskBecameDownloadTask().
1041
1042 2016-10-10  Tim Horton  <timothy_horton@apple.com>
1043
1044         Share more code between iOS and macOS ViewGestureController
1045         https://bugs.webkit.org/show_bug.cgi?id=163158
1046
1047         Reviewed by Simon Fraser.
1048
1049         Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
1050         Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
1051         because it shouldn't know anything about WKWebView.
1052         Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
1053
1054         * UIProcess/API/Cocoa/WKWebView.mm:
1055         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
1056         * UIProcess/Cocoa/ViewGestureController.cpp:
1057         (WebKit::ViewGestureController::ViewGestureController):
1058         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
1059         (WebKit::ViewGestureController::canSwipeInDirection):
1060         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
1061         * UIProcess/Cocoa/ViewGestureController.h:
1062         * UIProcess/WebPageProxy.cpp:
1063         (WebKit::WebPageProxy::WebPageProxy):
1064         * UIProcess/WebPageProxy.h:
1065         (WebKit::WebPageProxy::createWeakPtr):
1066         * UIProcess/ios/ViewGestureControllerIOS.mm:
1067         (WebKit::ViewGestureController::beginSwipeGesture):
1068         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
1069         (WebKit::ViewGestureController::canSwipeInDirection): Deleted.
1070         * UIProcess/mac/ViewGestureControllerMac.mm:
1071         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
1072         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
1073         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
1074
1075 2016-10-10  Tomas Popela  <tpopela@redhat.com>
1076
1077         [GTK] UIProcess crashes when using Japanese IM
1078         https://bugs.webkit.org/show_bug.cgi?id=163011
1079
1080         We have to reference the current GdkEventKey before we try process it
1081         as later when the lambda body is reached the event could be already
1082         freed.
1083
1084         Reviewed by Carlos Garcia Campos.
1085
1086         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1087         (webkitWebViewBaseKeyPressEvent):
1088         (webkitWebViewBaseKeyReleaseEvent):
1089         * UIProcess/gtk/InputMethodFilter.h:
1090         Use non-copyable Function so we can use WTFMove to pass the event to
1091         lambda.
1092
1093 2016-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1094
1095         Support InputEvent.inputType for the new InputEvent spec
1096         https://bugs.webkit.org/show_bug.cgi?id=163025
1097         <rdar://problem/28658092>
1098
1099         Reviewed by Darin Adler.
1100
1101         Accounts for some changes to the EditAction enum in nameForEditAction. Some former edit
1102         actions, such as EditActionTyping, have been split out into its more specific subtypes,
1103         so we preserve shipping behavior by treating all of the new subtypes the same way as the
1104         original type.
1105
1106         * UIProcess/WebEditCommandProxy.cpp:
1107         (WebKit::WebEditCommandProxy::nameForEditAction):
1108
1109 2016-10-08  Emanuele Aina  <emanuele.aina@collabora.com>
1110
1111         [GTK] Drop redundant wl_display_flush_clients() call
1112         https://bugs.webkit.org/show_bug.cgi?id=161904
1113
1114         Reviewed by Michael Catanzaro.
1115
1116         The Wayland GSource::prepare() function already calls
1117         wl_display_flush_clients() at every mainloop iteration, so there's no
1118         need to further call it on Surface::commit().
1119
1120         * UIProcess/gtk/WaylandCompositor.cpp:
1121         (WebKit::WaylandCompositor::Surface::commit):
1122         * UIProcess/gtk/WaylandCompositor.h:
1123
1124 2016-10-06  Darin Adler  <darin@apple.com>
1125
1126         Next step on moving to modern way to return DOM exceptions
1127         https://bugs.webkit.org/show_bug.cgi?id=163016
1128
1129         Reviewed by Ryosuke Niwa.
1130
1131         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
1132         (webkit_dom_dom_implementation_create_document_type): Updated for name change
1133         from takeReturnValue to releaseReturnValue.
1134         (webkit_dom_dom_implementation_create_document): Ditto.
1135         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
1136         (webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode.
1137         (webkit_dom_dom_selection_collapse_to_start): Ditto.
1138         (webkit_dom_dom_selection_extend): Ditto.
1139         (webkit_dom_dom_selection_get_range_at): Ditto.
1140
1141 2016-10-08  Commit Queue  <commit-queue@webkit.org>
1142
1143         Unreviewed, rolling out r206950.
1144         https://bugs.webkit.org/show_bug.cgi?id=163169
1145
1146         broke an API test (Requested by thorton on #webkit).
1147
1148         Reverted changeset:
1149
1150         "Share more code between iOS and macOS ViewGestureController"
1151         https://bugs.webkit.org/show_bug.cgi?id=163158
1152         http://trac.webkit.org/changeset/206950
1153
1154 2016-10-08  Tim Horton  <timothy_horton@apple.com>
1155
1156         Share more code between iOS and macOS ViewGestureController
1157         https://bugs.webkit.org/show_bug.cgi?id=163158
1158
1159         Reviewed by Simon Fraser.
1160
1161         Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
1162         Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
1163         because it shouldn't know anything about WKWebView.
1164         Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
1165
1166         * UIProcess/API/Cocoa/WKWebView.mm:
1167         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
1168         * UIProcess/Cocoa/ViewGestureController.cpp:
1169         (WebKit::ViewGestureController::ViewGestureController):
1170         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
1171         (WebKit::ViewGestureController::canSwipeInDirection):
1172         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
1173         * UIProcess/Cocoa/ViewGestureController.h:
1174         * UIProcess/WebPageProxy.cpp:
1175         (WebKit::WebPageProxy::WebPageProxy):
1176         * UIProcess/WebPageProxy.h:
1177         (WebKit::WebPageProxy::createWeakPtr):
1178         * UIProcess/ios/ViewGestureControllerIOS.mm:
1179         (WebKit::ViewGestureController::beginSwipeGesture):
1180         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
1181         (WebKit::ViewGestureController::canSwipeInDirection): Deleted.
1182         * UIProcess/mac/ViewGestureControllerMac.mm:
1183         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
1184         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
1185         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
1186
1187 2016-10-07  Anders Carlsson  <andersca@apple.com>
1188
1189         Get rid of API::Session and WKSessionRef
1190         https://bugs.webkit.org/show_bug.cgi?id=163140
1191
1192         Reviewed by Tim Horton.
1193
1194         This API is no longer used.
1195
1196         * CMakeLists.txt:
1197         * Shared/API/APIObject.h:
1198         * Shared/API/c/WKSharedAPICast.h:
1199         * UIProcess/API/APISession.cpp: Removed.
1200         (API::generateID): Deleted.
1201         (API::Session::defaultSession): Deleted.
1202         (API::Session::Session): Deleted.
1203         (API::Session::createEphemeral): Deleted.
1204         (API::Session::isEphemeral): Deleted.
1205         (API::Session::getID): Deleted.
1206         (API::Session::~Session): Deleted.
1207         * UIProcess/API/APISession.h: Removed.
1208         * UIProcess/API/C/WKPage.h:
1209         * UIProcess/API/C/WKSessionRef.cpp: Removed.
1210         (WKSessionCreate): Deleted.
1211         (WKSessionGetTypeID): Deleted.
1212         (WKSessionIsEphemeral): Deleted.
1213         * UIProcess/API/C/WKSessionRef.h: Removed.
1214         * UIProcess/WebPageProxy.h:
1215         * UIProcess/WebProcessProxy.h:
1216         * WebKit2.xcodeproj/project.pbxproj:
1217
1218 2016-10-07  Tim Horton  <timothy_horton@apple.com>
1219
1220         Move ViewGestureController files to more accurate locations
1221         https://bugs.webkit.org/show_bug.cgi?id=163141
1222
1223         Reviewed by Anders Carlsson.
1224
1225         * PlatformMac.cmake:
1226         * UIProcess/Cocoa/ViewGestureController.cpp: Renamed from UIProcess/ViewGestureController.cpp.
1227         * UIProcess/Cocoa/ViewGestureController.h: Renamed from UIProcess/mac/ViewGestureController.h.
1228         * UIProcess/Cocoa/ViewGestureController.messages.in: Renamed from UIProcess/mac/ViewGestureController.messages.in.
1229         * WebKit2.xcodeproj/project.pbxproj:
1230
1231 2016-10-07  Tim Horton  <timothy_horton@apple.com>
1232
1233         Adopt BlockPtr in ViewGestureController
1234         https://bugs.webkit.org/show_bug.cgi?id=163132
1235
1236         Reviewed by Anders Carlsson.
1237
1238         * UIProcess/Cocoa/WebViewImpl.h:
1239         * UIProcess/Cocoa/WebViewImpl.mm:
1240         (WebKit::WebViewImpl::setDidMoveSwipeSnapshotCallback):
1241         * UIProcess/ViewGestureController.cpp:
1242         (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
1243         * UIProcess/mac/ViewGestureController.h:
1244         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
1245         (WebKit::ViewGestureController::m_didMoveSwipeSnapshotCallback): Deleted.
1246         * UIProcess/mac/ViewGestureControllerMac.mm:
1247         (WebKit::ViewGestureController::platformTeardown):
1248         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): Deleted.
1249
1250 2016-10-07  Anders Carlsson  <andersca@apple.com>
1251
1252         Get rid of WKPageSetSession
1253         https://bugs.webkit.org/show_bug.cgi?id=163129
1254
1255         Reviewed by Tim Horton.
1256
1257         This function is no longer used.
1258
1259         * UIProcess/API/C/WKPage.cpp:
1260         (WKPageSetSession): Deleted.
1261         * UIProcess/API/C/WKPage.h:
1262         * UIProcess/WebPageProxy.cpp:
1263         (WebKit::WebPageProxy::setSessionID): Deleted.
1264         * UIProcess/WebPageProxy.h:
1265         (WebKit::WebPageProxy::sessionID):
1266         * WebProcess/WebPage/WebPage.messages.in:
1267
1268 2016-10-07  Commit Queue  <commit-queue@webkit.org>
1269
1270         Unreviewed, rolling out r206909.
1271         https://bugs.webkit.org/show_bug.cgi?id=163116
1272
1273         Caused most of  GTK layout tests to crash (Requested by KaL on
1274         #webkit).
1275
1276         Reverted changeset:
1277
1278         "[GTK] UIProcess crashes when using Japanese IM"
1279         https://bugs.webkit.org/show_bug.cgi?id=163011
1280         http://trac.webkit.org/changeset/206909
1281
1282 2016-10-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1283
1284         Network Session: Allow NetworkDataTask decide what to do when override is allowed for a download
1285         https://bugs.webkit.org/show_bug.cgi?id=163010
1286
1287         Reviewed by Alex Christensen.
1288
1289         Current code always deletes the file before starting a download when allow override is True. In soup backend we
1290         use glib API that takes care of it and tries to ensure that the original file is not deleted if the new file
1291         creation fails for whatever reason.
1292
1293         * NetworkProcess/Downloads/DownloadManager.cpp:
1294         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Pass allowOverride to setPendingDownloadLocation().
1295         * NetworkProcess/NetworkDataTask.h:
1296         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1297         (WebKit::NetworkDataTask::setPendingDownloadLocation): Delete the destination file if exists and allowOverride
1298         is True.
1299
1300 2016-10-07  Tomas Popela  <tpopela@redhat.com>
1301
1302         [GTK] UIProcess crashes when using Japanese IM
1303         https://bugs.webkit.org/show_bug.cgi?id=163011
1304
1305         We have to reference the current GdkEventKey before we try process it
1306         as later when the lambda body is reached the event could be already
1307         freed.
1308
1309         Reviewed by Carlos Garcia Campos.
1310
1311         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1312         (webkitWebViewBaseKeyPressEvent):
1313         (webkitWebViewBaseKeyReleaseEvent):
1314         * UIProcess/gtk/InputMethodFilter.h:
1315         Use non-copyable Function so we can use WTFMove to pass the event to
1316         lambda.
1317
1318 2016-10-06  Michael Catanzaro  <mcatanzaro@igalia.com>
1319
1320         [GTK] Expose WebKitDOMHTMLInputElement APIs for form autofill
1321         https://bugs.webkit.org/show_bug.cgi?id=163082
1322
1323         Reviewed by Darin Adler.
1324
1325         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1326         (webkit_dom_html_input_element_get_auto_filled): Added.
1327         (webkit_dom_html_input_element_set_auto_filled): Added.
1328         (webkit_dom_html_input_element_set_editing_value): Added.
1329         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
1330         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
1331
1332 2016-10-06  John Wilander  <wilander@apple.com>
1333
1334         Update Resource Load Statistics
1335         https://bugs.webkit.org/show_bug.cgi?id=162811
1336
1337         Reviewed by Alex Christensen.
1338
1339         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1340         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics):
1341             Switched to vector-based classification.
1342         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
1343             Simplified logic and moved the split between has and has
1344             no user interaction into ResourceLoadStatisticsStore.
1345         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords):
1346             Added.
1347         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1348             Updated to make use of the new functions.
1349         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
1350             Removed stray whitespace.
1351         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1352             Removed stray whitespace.
1353         (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk):
1354             Removed stray whitespace.
1355         (WebKit::hasPrevalentResourceCharacteristics): Deleted.
1356         (WebKit::classifyPrevalentResources): Deleted.
1357         * UIProcess/WebResourceLoadStatisticsStore.h:
1358             Added member variables for clearing of data records.
1359
1360 2016-10-06  Youenn Fablet  <youenn@apple.com>
1361
1362         [WK2] 304 revalidation on the network process does not update the validated response
1363         https://bugs.webkit.org/show_bug.cgi?id=162973
1364
1365         Reviewed by Darin Adler.
1366
1367         * NetworkProcess/NetworkResourceLoader.cpp: Updating cache entry with the revalidated one.
1368
1369 2016-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1370
1371         Introduce InputEvent bindings in preparation for the input events spec
1372         https://bugs.webkit.org/show_bug.cgi?id=162954
1373
1374         Reviewed by Ryosuke Niwa.
1375
1376         Adds a new runtime switch for enabling InputEvents.
1377
1378         * Shared/WebPreferencesDefinitions.h:
1379         * WebProcess/WebPage/WebPage.cpp:
1380         (WebKit::WebPage::updatePreferences):
1381
1382 2016-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
1383
1384         Put variation fonts work behind a compile-time flag
1385         https://bugs.webkit.org/show_bug.cgi?id=162949
1386
1387         Reviewed by Simon Fraser.
1388
1389         * Configurations/FeatureDefines.xcconfig:
1390
1391 2016-10-05  Tim Horton  <timothy_horton@apple.com>
1392
1393         Fix the build.
1394
1395         * UIProcess/Cocoa/WebViewImpl.mm:
1396
1397 2016-10-05  Tim Horton  <timothy_horton@apple.com>
1398
1399         Avoid automatically re-taking snapshots for back-forward items that were never loaded into the view
1400         https://bugs.webkit.org/show_bug.cgi?id=162955
1401         <rdar://problem/27659173>
1402
1403         Reviewed by Simon Fraser.
1404
1405         Make it possible for clients to control the snapshot for back-forward
1406         items that are restored from session state without navigating to them,
1407         by ensuring that we won't stomp on the snapshot that they explicitly take,
1408         until a load occurs.
1409
1410         * UIProcess/WebBackForwardList.cpp:
1411         (WebKit::WebBackForwardList::addItem):
1412         (WebKit::WebBackForwardList::goToItem):
1413         * UIProcess/ios/ViewGestureControllerIOS.mm:
1414         (WebKit::ViewGestureController::beginSwipeGesture):
1415         * UIProcess/mac/ViewGestureControllerMac.mm:
1416         (WebKit::ViewGestureController::trackSwipeGesture):
1417         Disambiguate explicit API-driven snapshot recording from automatic,
1418         navigation-driven snapshot recording.
1419
1420         * UIProcess/Cocoa/WebViewImpl.mm:
1421         (WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
1422         Get rid of the version of recordNavigationSnapshot() that doesn't take a
1423         back-forward list item, and grab the current item at the one remaining caller.
1424         
1425         * UIProcess/WebPageProxy.cpp:
1426         (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
1427         (WebKit::WebPageProxy::recordNavigationSnapshot):
1428         (WebKit::WebPageProxy::restoreFromSessionState):
1429         (WebKit::WebPageProxy::didCommitLoadForFrame):
1430         * UIProcess/WebPageProxy.h:
1431         Rename m_suppressNavigationSnapshotting to m_suppressAutomaticNavigationSnapshotting,
1432         and make it be only about automatic (navigation-driven) snapshots; it won't have
1433         any impact on explicit snapshots forced by clients.
1434         
1435         Set m_suppressAutomaticNavigationSnapshotting unconditionally when restoring
1436         from session state, so that we won't start automatically snapshotting until
1437         something has loaded in the view.
1438
1439 2016-10-05  Tim Horton  <timothy_horton@apple.com>
1440
1441         Make it possible to test ViewSnapshotStore behaviors
1442         https://bugs.webkit.org/show_bug.cgi?id=162983
1443
1444         Reviewed by Simon Fraser.
1445
1446         Add two pieces of SPI to make it easier to test ViewSnapshotStore:
1447
1448         - [WKWebView _disableBackForwardSnapshotVolatilityForTesting]
1449             This makes it so that we don't make snapshots volatile after we
1450             take them, so that they won't get purged while the test is running
1451             and cause the test to be flaky.
1452
1453         - [WKBackForwardListItem _copySnapshotForTesting]
1454             This returns a CGImage with the content of the given back-forward
1455             item's current snapshot, if there is one.
1456
1457         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
1458         (-[WKBackForwardListItem _copySnapshotForTesting]):
1459         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
1460         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Added.
1461         Add WKBackForwardListItem SPI to retrieve the snapshot for a given back-forward list item.
1462
1463         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1464         * UIProcess/API/Cocoa/WKWebView.mm:
1465         (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]):
1466         Add WKWebView SPI to disable volatility of snapshots, for testing purposes.
1467         
1468         * UIProcess/Cocoa/WebViewImpl.h:
1469         * UIProcess/Cocoa/WebViewImpl.mm:
1470         (WebKit::WebViewImpl::takeViewSnapshot):
1471         Adopt ViewSnapshot::setVolatile instead of reaching into the surface.
1472
1473         * UIProcess/mac/ViewGestureControllerMac.mm:
1474         (WebKit::ViewGestureController::removeSwipeSnapshot):
1475         Adopt ViewSnapshot::setVolatile instead of reaching into the surface.
1476
1477         * UIProcess/mac/ViewSnapshotStore.h:
1478         (WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
1479         (WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting):
1480         * UIProcess/mac/ViewSnapshotStore.mm:
1481         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
1482         (WebKit::ViewSnapshot::setVolatile):
1483         (WebKit::ViewSnapshot::asLayerContents):
1484         Move all touching of snapshot volatility into the new setVolatile,
1485         and short-circuit if the testing-only m_disableSnapshotVolatility bit is set
1486
1487         (WebKit::ViewSnapshot::asImageForTesting):
1488         Make a CGImageRef for the aforementioned WKBackForwardListItem SPI.
1489         This is currently not implemented for the iOS Simulator, because we
1490         don't have access to the bits of the image in that case.
1491
1492 2016-10-05  Chris Dumez  <cdumez@apple.com>
1493
1494         KeyboardEvent.getModifierState() should support "CapsLock" modifier
1495         https://bugs.webkit.org/show_bug.cgi?id=162861
1496
1497         Reviewed by Darin Adler.
1498
1499         Add support for CapsLock modifier on events.
1500
1501         * Shared/API/c/WKEvent.h:
1502         * Shared/API/c/WKSharedAPICast.h:
1503         (WebKit::toAPI):
1504         * Shared/WebEventConversion.cpp:
1505         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1506         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
1507         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1508         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
1509         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
1510         * Shared/efl/WebEventFactory.cpp:
1511         (WebKit::toWebEventModifiers):
1512         * Shared/ios/WebIOSEventFactory.mm:
1513         (modifiersForEvent):
1514         * Shared/mac/WebEventFactory.mm:
1515         (WebKit::modifiersForEvent):
1516         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1517         (toNSEventModifierFlags):
1518         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1519         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1520
1521 2016-10-05  Zan Dobersek  <zdobersek@igalia.com>
1522
1523         Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
1524         https://bugs.webkit.org/show_bug.cgi?id=162903
1525
1526         Reviewed by Alex Christensen.
1527
1528         Rename build guards for the remaining implementation of the legacy EME API
1529         to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
1530         of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.
1531
1532         * Configurations/FeatureDefines.xcconfig:
1533         * WebProcess/WebPage/WebPage.cpp:
1534         (WebKit::m_userInterfaceLayoutDirection):
1535         * WebProcess/WebProcess.cpp:
1536         (WebKit::m_resourceLoadStatisticsStorage):
1537
1538 2016-10-05  Daniel Bates  <dabates@apple.com>
1539
1540         [WK2][NetworkSession] Ping requests should follow redirects if applicable
1541         https://bugs.webkit.org/show_bug.cgi?id=162580
1542         <rdar://problem/28631274>
1543
1544         Reviewed by Alex Christensen.
1545
1546         Implement support for following redirects, if applicable, of a ping request when using the
1547         Network Session (ENABLE(NETWORK_SESSION)) code path in WebKit2. For ping requests that are
1548         in response to hyperlink auditing (e.g. <a ping>) we should follow redirect responses.
1549         For Content Security Policy and XSS Auditor violation reports we should not follow redirect
1550         responses.
1551
1552         Currently we always ignore redirects for ping requests that are sent using the Network Session
1553         code path in WebKit2. This behavior disagrees with the behavior described in section
1554         "Hyperlink auditing" of the HTML standard, <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (27 September 2016),
1555         as well as the behavior in Legacy WebKit and WebKit2 with Network Session disabled. We should
1556         follow redirects for ping requests initiated as part of hyperlink auditing to more closely
1557         conform to the HTML standard and match the behavior in Legacy WebKit and WebKit2 with Network
1558         Session disabled.
1559
1560         * NetworkProcess/PingLoad.h:
1561
1562 2016-10-05  Daniel Bates  <dabates@apple.com>
1563
1564         Do not follow redirects when sending violation report
1565         https://bugs.webkit.org/show_bug.cgi?id=162520
1566         <rdar://problem/27957639>
1567
1568         Reviewed by Alex Christensen.
1569
1570         Update the non-Network Session WebKit2 implementation to follow redirect responses for a ping
1571         request, if applicable. I did not update the Network Session implementation at this time. I
1572         will fix it in <https://bugs.webkit.org/show_bug.cgi?id=162580>.
1573
1574         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1575         (WebKit::NetworkConnectionToWebProcess::loadPing): Tell PingHandle whether to follow redirects.
1576         * NetworkProcess/NetworkLoadParameters.h:
1577         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1578         (WebKit::NetworkResourceLoadParameters::encode): Encode NetworkResourceLoadParameters::shouldFollowRedirects.
1579         (WebKit::NetworkResourceLoadParameters::decode): Decode NetworkResourceLoadParameters::shouldFollowRedirects.
1580         * NetworkProcess/PingLoad.h: Added FIXME comment to implement support for following redirects,
1581         if applicable (for hyperlink auditing). See <https://bugs.webkit.org/show_bug.cgi?id=162580>
1582         for more details.
1583         * WebProcess/Network/WebLoaderStrategy.cpp:
1584         (WebKit::WebLoaderStrategy::createPingHandle): Modified to take a boolean whether to follow
1585         redirects responses and set NetworkResourceLoadParameters::shouldFollowRedirects as appropriate.
1586         * WebProcess/Network/WebLoaderStrategy.h:
1587
1588 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1589
1590         [SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
1591         https://bugs.webkit.org/show_bug.cgi?id=162910
1592
1593         Reviewed by Alex Christensen.
1594
1595         Use SoupNetworkSession instead of ResourceHandle.
1596
1597         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1598         (WebKit::NetworkProcess::setIgnoreTLSErrors):
1599         (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost):
1600
1601 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1602
1603         Unreviewed. Fix GTK+ build with USE_REDIRECTED_XCOMPOSITE_WINDOW disabled.
1604
1605         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
1606         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
1607
1608 2016-10-04  Chris Dumez  <cdumez@apple.com>
1609
1610         Implement KeyboardEvent.code from the UI Event spec
1611         https://bugs.webkit.org/show_bug.cgi?id=149584
1612
1613         Reviewed by Darin Adler.
1614
1615         Add support for Keyboard.code attribute:
1616         - https://w3c.github.io/uievents/#dom-keyboardevent-code
1617         - https://w3c.github.io/uievents-code/
1618
1619         * Shared/WebEvent.h:
1620         (WebKit::WebKeyboardEvent::code):
1621         * Shared/WebEventConversion.cpp:
1622         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1623         * Shared/WebKeyboardEvent.cpp:
1624         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1625         (WebKit::WebKeyboardEvent::encode):
1626         (WebKit::WebKeyboardEvent::decode):
1627         * Shared/mac/WebEventFactory.mm:
1628         (WebKit::WebEventFactory::createWebKeyboardEvent):
1629
1630 2016-10-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1631
1632         The dragged image should be the current frame only of the animated image
1633         https://bugs.webkit.org/show_bug.cgi?id=162109
1634
1635         Reviewed by Tim Horton.
1636
1637         * UIProcess/Cocoa/WebViewImpl.mm:
1638         (WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.
1639
1640 2016-10-04  Ryosuke Niwa  <rniwa@webkit.org>
1641
1642         Revert a change erroneously committed in r206795.
1643
1644         * WebProcess/WebPage/WebPage.cpp:
1645         (WebKit::WebPage::updatePreferences):
1646
1647 2016-10-04  Anders Carlsson  <andersca@apple.com>
1648
1649         Properly kill web processes in the launching state
1650         https://bugs.webkit.org/show_bug.cgi?id=162938
1651
1652         Reviewed by Tim Horton.
1653
1654         * UIProcess/Launcher/ProcessLauncher.h:
1655         Add m_xpcConnection member.
1656
1657         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1658         (WebKit::ProcessLauncher::launchProcess):
1659         Store the XPC connection in the m_xpcConnection member variable.
1660         In the reply handler, handle m_xpcConnection being null.
1661
1662         (WebKit::ProcessLauncher::platformInvalidate):
1663         Cancel and kill the connection.
1664
1665         * UIProcess/WebPageProxy.cpp:
1666         (WebKit::WebPageProxy::terminateProcess):
1667         Get rid of an assertion.
1668
1669         * UIProcess/WebProcessProxy.cpp:
1670         (WebKit::WebProcessProxy::requestTermination):
1671         Handle the launching state.
1672
1673 2016-10-04  Tim Horton  <timothy_horton@apple.com>
1674
1675         Fix the build.
1676
1677         * Shared/WebBackForwardListItem.cpp:
1678         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1679         (WebKit::WebBackForwardListItem::highestUsedItemID):
1680
1681 2016-10-04  Tim Horton  <timothy_horton@apple.com>
1682
1683         Fix a typo in WebBackForwardListItem (highed->highest)
1684         https://bugs.webkit.org/show_bug.cgi?id=162935
1685
1686         Reviewed by Anders Carlsson.
1687
1688         * Shared/WebBackForwardListItem.cpp:
1689         (WebKit::WebBackForwardListItem::highestUsedItemID):
1690         (WebKit::WebBackForwardListItem::highedUsedItemID): Deleted.
1691         * Shared/WebBackForwardListItem.h:
1692         * UIProcess/WebPageProxy.cpp:
1693         (WebKit::WebPageProxy::creationParameters):
1694
1695 2016-10-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1696
1697         [DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information
1698         https://bugs.webkit.org/show_bug.cgi?id=162916
1699
1700         Reviewed by Filip Pizlo.
1701
1702         * CMakeLists.txt:
1703
1704 2016-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1705
1706         [SOUP] Remove SSLPolicyFlags from SoupNetworkSession
1707         https://bugs.webkit.org/show_bug.cgi?id=162906
1708
1709         Reviewed by Michael Catanzaro.
1710
1711         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
1712         (WebKit::NetworkProcessMainUnix):
1713
1714 2016-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1715
1716         Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
1717         https://bugs.webkit.org/show_bug.cgi?id=162766
1718         <rdar://problem/28533523>
1719
1720         Reviewed by Jer Noble.
1721
1722         Plumbs some more Now Playing information from the web process to the UI process for testing purposes. See
1723         WebCore ChangeLog for more details.
1724
1725         * UIProcess/API/Cocoa/WKWebView.mm:
1726         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
1727         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]): Deleted.
1728         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1729         * UIProcess/PageClient.h:
1730         * UIProcess/WebPageProxy.cpp:
1731         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
1732         * UIProcess/WebPageProxy.h:
1733         * UIProcess/WebPageProxy.messages.in:
1734         * UIProcess/mac/PageClientImpl.h:
1735         * UIProcess/mac/PageClientImpl.mm:
1736         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
1737         * WebProcess/WebPage/mac/WebPageMac.mm:
1738         (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
1739
1740 2016-10-04  Zan Dobersek  <zdobersek@igalia.com>
1741
1742         Unreviewed GTK+ build fix.
1743
1744         * UIProcess/API/C/WKPage.cpp:
1745         (WKPageSetPageNavigationClient): Guard the call to getDefaultWebCryptoMasterKey()
1746         with ENABLE(SUBTLE_CRYPTO), since the same guard is used for the definition. Fixes
1747         GTK+ production builds where the feature is disabled.
1748
1749 2016-10-03  Keith Rollin  <krollin@apple.com>
1750
1751         More logging to diagnose "WebKit encountered an internal error" messages
1752         https://bugs.webkit.org/show_bug.cgi?id=162754
1753
1754         Reviewed by Antti Koivisto.
1755
1756         Add more logging around calls to internalError, as well as some
1757         low-level logging around SharedMemory, and mach_vm_map in particular.
1758
1759         * NetworkProcess/NetworkResourceLoader.cpp:
1760         (WebKit::NetworkResourceLoader::startNetworkLoad):
1761         * Platform/Logging.h:
1762         * Platform/mac/SharedMemoryMac.cpp:
1763         (WebKit::SharedMemory::allocate):
1764         (WebKit::makeMemoryEntry):
1765         (WebKit::SharedMemory::map):
1766         (WebKit::SharedMemory::~SharedMemory):
1767         * WebProcess/Network/WebLoaderStrategy.cpp:
1768         (WebKit::WebLoaderStrategy::networkProcessCrashed):
1769         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1770         * WebProcess/Network/WebResourceLoader.cpp:
1771         (WebKit::WebResourceLoader::didReceiveResource):
1772
1773 2016-10-03  Ryan Haddad  <ryanhaddad@apple.com>
1774
1775         Unreviewed, rolling out r206754.
1776
1777         This change broke the El Capitan and Yosemite debug builds.
1778
1779         Reverted changeset:
1780
1781         "More logging to diagnose "WebKit encountered an internal
1782         error" messages"
1783         https://bugs.webkit.org/show_bug.cgi?id=162754
1784         http://trac.webkit.org/changeset/206754
1785
1786 2016-10-03  Keith Rollin  <krollin@apple.com>
1787
1788         More logging to diagnose "WebKit encountered an internal error" messages
1789         https://bugs.webkit.org/show_bug.cgi?id=162754
1790
1791         Reviewed by Antti Koivisto.
1792
1793         Add more logging around calls to internalError, as well as some
1794         low-level logging around SharedMemory, and mach_vm_map in particular.
1795
1796         * NetworkProcess/NetworkResourceLoader.cpp:
1797         (WebKit::NetworkResourceLoader::startNetworkLoad):
1798         * Platform/Logging.h:
1799         * Platform/mac/SharedMemoryMac.cpp:
1800         (WebKit::SharedMemory::allocate):
1801         (WebKit::makeMemoryEntry):
1802         (WebKit::SharedMemory::map):
1803         (WebKit::SharedMemory::~SharedMemory):
1804         * WebProcess/Network/WebLoaderStrategy.cpp:
1805         (WebKit::WebLoaderStrategy::networkProcessCrashed):
1806         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1807         * WebProcess/Network/WebResourceLoader.cpp:
1808         (WebKit::WebResourceLoader::didReceiveResource):
1809
1810 2016-10-03  Chris Dumez  <cdumez@apple.com>
1811
1812         Add support for KeyboardEvent.key attribute
1813         https://bugs.webkit.org/show_bug.cgi?id=36267
1814
1815         Reviewed by Darin Adler.
1816
1817         Add support for KeyboardEvent.key attribute.
1818
1819         * Shared/WebEvent.h:
1820         (WebKit::WebKeyboardEvent::key):
1821         (WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
1822         * Shared/WebEventConversion.cpp:
1823         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1824         * Shared/WebKeyboardEvent.cpp:
1825         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1826         (WebKit::WebKeyboardEvent::encode):
1827         (WebKit::WebKeyboardEvent::decode):
1828         * Shared/mac/WebEventFactory.mm:
1829         (WebKit::WebEventFactory::createWebKeyboardEvent):
1830
1831 2016-10-03  Chris Dumez  <cdumez@apple.com>
1832
1833         Add support for KeyboardEvent.key attribute
1834         https://bugs.webkit.org/show_bug.cgi?id=36267
1835
1836         Reviewed by Darin Adler.
1837
1838         Add support for KeyboardEvent.key attribute.
1839
1840         * Shared/WebEvent.h:
1841         (WebKit::WebKeyboardEvent::key):
1842         (WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
1843         * Shared/WebEventConversion.cpp:
1844         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1845         * Shared/WebKeyboardEvent.cpp:
1846         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1847         (WebKit::WebKeyboardEvent::encode):
1848         (WebKit::WebKeyboardEvent::decode):
1849         * Shared/mac/WebEventFactory.mm:
1850         (WebKit::WebEventFactory::createWebKeyboardEvent):
1851
1852 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1853
1854         [SOUP] Cleanup persistent credential storage code
1855         https://bugs.webkit.org/show_bug.cgi?id=162777
1856
1857         Reviewed by Alex Christensen.
1858
1859         Use USE(LIBSECRET) instead of ENABLE(CREDENTIAL_STORAGE).
1860
1861         * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
1862         (webkit_authentication_request_can_save_credentials):
1863
1864 2016-10-02  Ryan Haddad  <ryanhaddad@apple.com>
1865
1866         Unreviewed, rolling out r206683.
1867
1868         This change caused API test WebKit2.FindMatches to fail on
1869         Mac.
1870
1871         Reverted changeset:
1872
1873         "The dragged image should be the current frame only of the
1874         animated image"
1875         https://bugs.webkit.org/show_bug.cgi?id=162109
1876         http://trac.webkit.org/changeset/206683
1877
1878 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
1879
1880         Follow-up patch after r206701
1881         https://bugs.webkit.org/show_bug.cgi?id=162818
1882
1883         Unreviewed.
1884
1885         I missed one place required to enable an experimental feature by default.
1886
1887         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1888         (WebKit::registerUserDefaultsIfNeeded):
1889
1890 2016-09-30  Dan Bernstein  <mitz@apple.com>
1891
1892         [iOS] Editing menu omits the Share command if the selected text is longer than 200 characters
1893         https://bugs.webkit.org/show_bug.cgi?id=162821
1894         <rdar://problem/28409828>
1895
1896         Reviewed by Tim Horton.
1897
1898         * UIProcess/ios/WKContentViewInteraction.mm:
1899         (-[WKContentView canPerformAction:withSender:]): Changed to return YES for the _share:
1900           action even if the selection is longer than 200 characters. While Define should not have
1901           been available for longer selections, Share does not have such a limitation.
1902
1903 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
1904
1905         Turn variation fonts on by default
1906         https://bugs.webkit.org/show_bug.cgi?id=162818
1907
1908         Reviewed by Simon Fraser.
1909
1910         * Shared/WebPreferencesDefinitions.h:
1911
1912 2016-09-30  Brady Eidson  <beidson@apple.com>
1913
1914         REGRESSION (Safari 10 combined with WK changes): Unable to store WebCrypto keys in IndexedDB database.
1915         <rdar://problem/28334440> and https://bugs.webkit.org/show_bug.cgi?id=162554
1916
1917         Reviewed by Alexey Proskuryakov.
1918
1919         Safari 10 has a WKPageNavigation client but does not implement the "copyWebCryptoMasterKey" callback.
1920
1921         WebKit just fails in this case, instead of falling back to "getDefaultWebCryptoMasterKey".
1922         It should fall back.
1923
1924         Additionally there's a WKContextClient callback to get the crypto key, also, but it is completely unused.
1925         So it should be pulled.
1926
1927         * UIProcess/API/APILoaderClient.h:
1928         (API::LoaderClient::webCryptoMasterKey): Deleted.
1929         * UIProcess/API/C/WKContext.h:
1930
1931         * UIProcess/API/C/WKPage.cpp:
1932         (WKPageSetPageLoaderClient):
1933         (WKPageSetPageNavigationClient): If the client doesn't implement this method, fallback to getDefaultWebCryptoMasterKey.
1934
1935         * UIProcess/Cocoa/NavigationState.mm:
1936         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): If the client doesn't implement this method,
1937           fallback to getDefaultWebCryptoMasterKey.
1938
1939         * UIProcess/WebContextClient.cpp:
1940         (WebKit::WebContextClient::copyWebCryptoMasterKey): Deleted.
1941         * UIProcess/WebContextClient.h:
1942
1943         * UIProcess/WebPageProxy.cpp:
1944         (WebKit::WebPageProxy::wrapCryptoKey): Only ask the NavigationClient before falling back. Don't ask the loader client.
1945         (WebKit::WebPageProxy::unwrapCryptoKey): Ditto.
1946
1947 2016-09-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1948
1949         The dragged image should be the current frame only of the animated image
1950         https://bugs.webkit.org/show_bug.cgi?id=162109
1951
1952         Reviewed by Tim Horton.
1953
1954         * UIProcess/Cocoa/WebViewImpl.mm:
1955         (WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.
1956
1957 2016-09-30  Anders Carlsson  <andersca@apple.com>
1958
1959         Second time going into fullscreen using silverlight, will hide the menu bar and dock for Safari
1960         https://bugs.webkit.org/show_bug.cgi?id=162805
1961         rdar://problem/28208495
1962
1963         Reviewed by Dan Bernstein.
1964
1965         Turns out that the WindowRef wrappers for full screen NSWindows can end up in the m_windows HashSet,
1966         and never go away. 
1967         
1968         Fix this by storing the canonical CGWindowIDs in the hash map instead.
1969
1970         * PluginProcess/mac/PluginProcessMac.mm:
1971         (WebKit::cgWindowID):
1972         (WebKit::windowCoversAnyScreen):
1973         (WebKit::FullscreenWindowTracker::windowShown):
1974         (WebKit::FullscreenWindowTracker::windowHidden):
1975
1976 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
1977
1978         Create runtime flag for variation font work
1979         https://bugs.webkit.org/show_bug.cgi?id=162780
1980
1981         Reviewed by Alex Christensen.
1982
1983         * Shared/WebPreferencesDefinitions.h:
1984         * WebProcess/WebPage/WebPage.cpp:
1985         (WebKit::WebPage::updatePreferences):
1986
1987 2016-09-30  Chris Dumez  <cdumez@apple.com>
1988
1989         [WK2][iOS] Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint
1990         https://bugs.webkit.org/show_bug.cgi?id=162787
1991         <rdar://problem/28554292>
1992
1993         Reviewed by Benjamin Poulain.
1994
1995         Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint.
1996
1997         * Platform/spi/ios/UIKitSPI.h:
1998         * Shared/WebEvent.h:
1999         (WebKit::WebPlatformTouchPoint::setRadiusX):
2000         (WebKit::WebPlatformTouchPoint::radiusX):
2001         (WebKit::WebPlatformTouchPoint::setRadiusY):
2002         (WebKit::WebPlatformTouchPoint::radiusY):
2003         (WebKit::WebPlatformTouchPoint::setRotationAngle):
2004         (WebKit::WebPlatformTouchPoint::rotationAngle):
2005         * Shared/WebEventConversion.cpp:
2006         (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
2007         * Shared/ios/NativeWebTouchEventIOS.mm:
2008         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
2009         * Shared/ios/WebPlatformTouchPointIOS.cpp:
2010         (WebKit::WebPlatformTouchPoint::encode):
2011         (WebKit::WebPlatformTouchPoint::decode):
2012
2013 2016-09-30  Megan Gardner  <megan_gardner@apple.com>
2014
2015         Make it possible to test web-related user-interface features
2016         https://bugs.webkit.org/show_bug.cgi?id=162657
2017
2018         Reviewed by Simon Fraser.
2019
2020         Added the ability to pull the strings from an Action Sheet and pass them to
2021         test scripts to make sure we are giving the correct available actions for
2022         the item we are interacting with.
2023         Added a test for long press on an image, and used the sheet scraping functionality
2024         to make sure that the correct actions were being displayed.
2025         Test for previous patch, Changeset 205915; Bug 161761
2026
2027         * UIProcess/API/Cocoa/WKWebView.mm:
2028         (-[WKWebView _contentsOfUserInterfaceItem:]):
2029         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2030         * UIProcess/ios/WKActionSheetAssistant.h:
2031         * UIProcess/ios/WKActionSheetAssistant.mm:
2032         (-[WKActionSheetAssistant currentAvailableActionStrings]):
2033         * UIProcess/ios/WKContentViewInteraction.h:
2034         * UIProcess/ios/WKContentViewInteraction.mm:
2035         (-[WKContentView _contentsOfUserInterfaceItem:]):
2036
2037 2016-09-27  Anders Carlsson  <andersca@apple.com>
2038
2039         Remove a couple of unused members from PlatformKeyboardEvent
2040         https://bugs.webkit.org/show_bug.cgi?id=162641
2041
2042         Reviewed by Tim Horton.
2043
2044         * Shared/WebEventConversion.cpp:
2045         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
2046
2047 2016-09-29  Nan Wang  <n_wang@apple.com>
2048
2049         AX: iOS: Tapping <input> in Safari zooms in a bit when page has max scale = 1
2050         https://bugs.webkit.org/show_bug.cgi?id=162471
2051
2052         Reviewed by Simon Fraser.
2053
2054         * Shared/AssistedNodeInformation.cpp:
2055         (WebKit::AssistedNodeInformation::encode):
2056         (WebKit::AssistedNodeInformation::decode):
2057         * Shared/AssistedNodeInformation.h:
2058         * UIProcess/ios/WKContentViewInteraction.mm:
2059         (-[WKContentView _displayFormNodeInputView]):
2060         * WebProcess/WebPage/WebPage.h:
2061         * WebProcess/WebPage/ios/WebPageIOS.mm:
2062         (WebKit::WebPage::maximumPageScaleFactorIgnoringAlwaysScalable):
2063         (WebKit::WebPage::getAssistedNodeInformation):
2064
2065 2016-09-29  Daniel Bates  <dabates@apple.com>
2066
2067         Mark NetworkLoad as final
2068         https://bugs.webkit.org/show_bug.cgi?id=162681
2069
2070         Reviewed by Alex Christensen.
2071
2072         Mark class NetworkLoad as final as we do not have any derived classes at the moment and it
2073         is unclear if it would make sense to subclass it. We can always unmark the class if it turns
2074         out that it makes sense to subclass it.
2075
2076         * NetworkProcess/NetworkLoad.h:
2077
2078 2016-09-29  Sam Weinig  <sam@webkit.org>
2079
2080         Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
2081         <rdar://problem/27648683>
2082         https://bugs.webkit.org/show_bug.cgi?id=162735
2083
2084         Reviewed by Dan Bernstein.
2085
2086         Add SPI for overriding the following NSURLSessionConfigurations properties:
2087             - _sourceApplicationBundleIdentifier
2088             - _sourceApplicationSecondaryIdentifier
2089             - _CTDataConnectionServiceType
2090
2091         * NetworkProcess/NetworkProcess.cpp:
2092         (WebKit::NetworkProcess::initializeNetworkProcess):
2093         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2094         (WebKit::NetworkProcessCreationParameters::encode):
2095         (WebKit::NetworkProcessCreationParameters::decode):
2096         * NetworkProcess/NetworkProcessCreationParameters.h:
2097         * NetworkProcess/NetworkSession.h:
2098         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2099         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2100         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2101         (WebKit::globalSourceApplicationBundleIdentifier):
2102         (WebKit::globalSourceApplicationSecondaryIdentifier):
2103         (WebKit::globalCTDataConnectionServiceType):
2104         (WebKit::NetworkSession::setCustomProtocolManager):
2105         (WebKit::NetworkSession::setSourceApplicationAuditTokenData):
2106         (WebKit::NetworkSession::setSourceApplicationBundleIdentifier):
2107         (WebKit::NetworkSession::setSourceApplicationSecondaryIdentifier):
2108         (WebKit::NetworkSession::setCTDataConnectionServiceType):
2109         (WebKit::NetworkSession::NetworkSession):
2110         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2111         (API::ProcessPoolConfiguration::copy):
2112         * UIProcess/API/APIProcessPoolConfiguration.h:
2113         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2114         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2115         (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
2116         (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
2117         (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
2118         (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
2119         (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]):
2120         (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]):
2121         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2122         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2123         * WebProcess/WebProcess.cpp:
2124         (WebKit::WebProcess::initializeWebProcess):
2125         * WebProcess/cocoa/WebProcessCocoa.mm:
2126         (WebKit::WebProcess::platformInitializeWebProcess):
2127
2128 2016-09-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2129
2130         NetworkSession: HTTP authentication doesn't work if PROTECTION_SPACE_AUTH_CALLBACK is not enabled
2131         https://bugs.webkit.org/show_bug.cgi?id=162724
2132
2133         Reviewed by Alex Christensen.
2134
2135         NetworkLoad always expects continueCanAuthenticateAgainstProtectionSpace() to be called to complete the
2136         authentication challenge, which is only defined when PROTECTION_SPACE_AUTH_CALLBACK is enabled.
2137         I've added missing #ifdefs for PROTECTION_SPACE_AUTH_CALLBACK.
2138
2139         * NetworkProcess/Downloads/DownloadManager.cpp:
2140         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
2141         * NetworkProcess/Downloads/DownloadManager.h:
2142         * NetworkProcess/Downloads/PendingDownload.cpp:
2143         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
2144         * NetworkProcess/Downloads/PendingDownload.h:
2145         * NetworkProcess/NetworkLoad.cpp:
2146         (WebKit::NetworkLoad::~NetworkLoad):
2147         (WebKit::NetworkLoad::didReceiveChallenge): Call completeAuthenticationChallenge() instead of
2148         canAuthenticateAgainstProtectionSpaceAsync() when PROTECTION_SPACE_AUTH_CALLBACK is not enabled.
2149         (WebKit::NetworkLoad::completeAuthenticationChallenge): Moved common code to complete the authentication
2150         challenge from continueCanAuthenticateAgainstProtectionSpace().
2151         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Call completeAuthenticationChallenge().
2152         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2153         * NetworkProcess/NetworkLoad.h:
2154         * NetworkProcess/NetworkLoadClient.h:
2155         * NetworkProcess/NetworkProcess.cpp:
2156         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload):
2157         * NetworkProcess/NetworkProcess.h:
2158         * NetworkProcess/NetworkProcess.messages.in:
2159         * NetworkProcess/NetworkResourceLoader.cpp:
2160         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
2161         (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
2162         * NetworkProcess/NetworkResourceLoader.h:
2163         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2164         * Shared/Authentication/AuthenticationManager.h:
2165         * UIProcess/Downloads/DownloadProxy.cpp:
2166         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
2167         * UIProcess/Downloads/DownloadProxy.h:
2168         * UIProcess/Downloads/DownloadProxy.messages.in:
2169
2170 2016-09-28  Joseph Pecoraro  <pecoraro@apple.com>
2171
2172         WKSharedAPICast should not warn about acceptable custom context menu tag values
2173         https://bugs.webkit.org/show_bug.cgi?id=162597
2174         <rdar://problem/28487627>
2175
2176         Reviewed by Tim Horton.
2177
2178         * Shared/API/c/WKSharedAPICast.h:
2179         (WebKit::toAPI):
2180         (WebKit::toImpl):
2181         Don't log an error when casting ContextMenu types if it is within
2182         the Custom ContextMenu tag range.
2183
2184 2016-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2185
2186         Adopt MediaRemote SPI to achieve desired Now Playing behavior
2187         https://bugs.webkit.org/show_bug.cgi?id=162658
2188         <rdar://problem/28499358>
2189
2190         Reviewed by Jer Noble.
2191
2192         Plumbs Now Playing session information (for now, this is just a flag indicating whether or not there is an
2193         active session) across from the web process to the UI process for testing in the form of asynchronous request/
2194         handle-response messages on the WebPage and its proxy in the UI process.
2195
2196         * UIProcess/API/Cocoa/WKWebView.mm:
2197         (-[WKWebView _requestActiveNowPlayingSessionInfo]):
2198         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]):
2199         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2200         * UIProcess/PageClient.h:
2201         * UIProcess/WebPageProxy.cpp:
2202         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
2203         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
2204         * UIProcess/WebPageProxy.h:
2205         * UIProcess/WebPageProxy.messages.in:
2206         * UIProcess/mac/PageClientImpl.h:
2207         * UIProcess/mac/PageClientImpl.mm:
2208         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
2209         * WebProcess/WebPage/WebPage.h:
2210         * WebProcess/WebPage/WebPage.messages.in:
2211         * WebProcess/WebPage/mac/WebPageMac.mm:
2212         (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
2213
2214 2016-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2215
2216         [GTK] Switch to use GMenu internally in the context menu implementation
2217         https://bugs.webkit.org/show_bug.cgi?id=162603
2218
2219         Reviewed by Michael Catanzaro.
2220
2221         Switch to use GAction instead of GtkAction internally, but still keeping a GtkAction associated to the GAction,
2222         because our API depends on GtkAction.
2223
2224         * Shared/gtk/WebContextMenuItemGtk.cpp:
2225         (WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk):
2226         (WebKit::WebContextMenuItemGtk::createActionIfNeeded): Create the GAction and the associated GtkAction. Ensure a
2227         unique name for the GAction, since the name now matters.
2228         * Shared/gtk/WebContextMenuItemGtk.h:
2229         (WebKit::WebContextMenuItemGtk::gtkAction):
2230         (WebKit::WebContextMenuItemGtk::gAction):
2231         (WebKit::WebContextMenuItemGtk::submenuItems): Deleted.
2232         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2233         (WebKit::contextMenuItemActivatedCallback): Use the GAction.
2234         (WebKit::WebContextMenuProxyGtk::append): Create a new GMenuItem for the GAction.
2235         (WebKit::WebContextMenuProxyGtk::buildMenu): Build a GMenu for the given items.
2236         (WebKit::WebContextMenuProxyGtk::populate): Create a GMenu and bind it ot the GtkMenu.
2237         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): Create the GActionGroup for the menu.
2238         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Remove the action group from the GtkMenu.
2239         * UIProcess/gtk/WebContextMenuProxyGtk.h:
2240
2241 2016-09-27  Daniel Bates  <dabates@apple.com>
2242
2243         NetworkLoad and PingLoad should use private inheritance
2244         https://bugs.webkit.org/show_bug.cgi?id=162649
2245
2246         Reviewed by Alex Christensen.
2247
2248         Make NetworkLoad privately inherit from NetworkDataTaskClient and ResourceHandleClient,
2249         and make the client callbacks from these interfaces private as this class implements
2250         these interfaces.
2251
2252         Similarly, make PingLoad privately inherit from ResourceHandleClient.
2253
2254         * NetworkProcess/NetworkLoad.h:
2255         * NetworkProcess/PingLoad.h:
2256
2257 2016-09-20  Anders Carlsson  <andersca@apple.com>
2258
2259         PlatformEvent::m_modifiers should be an OptionSet
2260         https://bugs.webkit.org/show_bug.cgi?id=162326
2261
2262         Reviewed by Daniel Bates.
2263
2264         * Shared/WebEventConversion.cpp:
2265         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2266         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
2267         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
2268         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
2269
2270 2016-09-27  Dan Bernstein  <mitz@apple.com>
2271
2272         [iOS] REGRESSION (r182126): Selection highlight and handles aren’t visible with WKSelectionGranularityCharacter
2273         https://bugs.webkit.org/show_bug.cgi?id=162577
2274         <rdar://problem/28481984>
2275
2276         Reviewed by Simon Fraser.
2277
2278         * UIProcess/API/Cocoa/WKWebView.mm:
2279         (-[WKWebView _uiTextSelectionRectViews]): Added this method in the WKTesting category, which
2280           uses UIKit internals to get the views used for the selection highlight.
2281         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2282
2283         * UIProcess/ios/WKContentViewInteraction.mm:
2284         (-[WKContentView _selectionClipRect]): When selection is not confined to a form control or
2285           content-editable element, return the null rect to indicate no clipping, rather than
2286           clipping to the empty rect at the origin.
2287
2288 2016-09-27  Jer Noble  <jer.noble@apple.com>
2289
2290         Remove deprecated ENCRYPTED_MEDIA implementation.
2291         https://bugs.webkit.org/show_bug.cgi?id=161010
2292
2293         Reviewed by Eric Carlson.
2294
2295         Remove ENABLE_ENCRYPTED_MEDIA.
2296
2297         * Configurations/FeatureDefines.xcconfig:
2298
2299 2016-09-27  Chris Dumez  <cdumez@apple.com>
2300
2301         [WK2] Navigating to a Blob URL does not trigger a download
2302         https://bugs.webkit.org/show_bug.cgi?id=162574
2303
2304         Reviewed by Darin Adler.
2305
2306         Add support for converting Blob URL loads into downloads.
2307
2308         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2309         (WebKit::BlobDownloadClient::didReceiveResponseAsync):
2310         Make sure we return a valid suggested filename because the client side (Safari)
2311         does not deal with empty suggested filenames. Use "unknown" by default to
2312         match the default suggested filename of non-Blob downloads.
2313
2314         * NetworkProcess/Downloads/Download.cpp:
2315         (WebKit::Download::startWithHandle):
2316         * NetworkProcess/Downloads/Download.h:
2317         * NetworkProcess/Downloads/DownloadManager.cpp:
2318         (WebKit::DownloadManager::convertHandleToDownload):
2319         * NetworkProcess/Downloads/DownloadManager.h:
2320         * NetworkProcess/Downloads/ios/DownloadIOS.mm:
2321         (WebKit::Download::startNetworkLoadWithHandle):
2322         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2323         (WebKit::Download::startNetworkLoadWithHandle):
2324         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
2325         (WebKit::Download::startNetworkLoadWithHandle):
2326         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2327         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2328         * NetworkProcess/NetworkLoad.h:
2329         (WebKit::NetworkLoad::handle):
2330
2331 2016-09-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2332
2333         [GTK] Unreviewed typo fix
2334
2335         * UIProcess/API/gtk/WebKitWebInspector.cpp:
2336         (webkit_web_inspector_class_init):
2337
2338 2016-09-27  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2339
2340         [GTK] Should check whether GDK can use GL before asking it to
2341         https://bugs.webkit.org/show_bug.cgi?id=162598
2342
2343         Reviewed by Michael Catanzaro.
2344
2345         gdk_cairo_draw_from_gl can fail even when WebKit itself has been able to use GL (its
2346         context creation code might be buggy, GL may have been disabled using GDK_GL=disable, …).
2347         Unfortunately it does not have any error reporting other than a warning printed to
2348         stderr, so we cannot fallback from it. We have to first check if GL can be used by GDK
2349         by trying to create a context.
2350
2351         See https://bugzilla.redhat.com/show_bug.cgi?id=1378987
2352
2353         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2354         (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL): decide whether GDK can use GL by
2355         trying to create a context for a GdkWindow.
2356         (WebKit::AcceleratedBackingStoreWayland::paint): fallback to glReadPixels if GDK cannot
2357         use GL.
2358         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
2359
2360 2016-09-26  Tim Horton  <timothy_horton@apple.com>
2361
2362         Delete some unused code from r202695
2363         https://bugs.webkit.org/show_bug.cgi?id=162595
2364         <rdar://problem/28343784>
2365
2366         Reviewed by Dan Bernstein.
2367
2368         * UIProcess/API/Cocoa/WKWebView.mm:
2369         (-[WKWebView _initializeWithConfiguration:]):
2370         (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]): Deleted.
2371         (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]): Deleted.
2372         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2373         * UIProcess/ios/PageClientImplIOS.mm:
2374         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
2375         We didn't end up needing this mechanism.
2376
2377 2016-09-26  Dan Bernstein  <mitz@apple.com>
2378
2379         -_webViewWebProcessDidBecomeUnresponsive: gets called when the Web process is stopped in the debugger
2380         https://bugs.webkit.org/show_bug.cgi?id=162234
2381
2382         Reviewed by Sam Weinig.
2383
2384         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2385         (WebKit::WebProcessProxy::platformIsBeingDebugged): Use the KERN_PROC sysctl to get the
2386           process flags and check for P_TRACED.
2387
2388         * UIProcess/ResponsivenessTimer.cpp:
2389         (WebKit::ResponsivenessTimer::timerFired): Call the new client function
2390           mayBecomeUnresponsive. If it returns false, restart the timer and bail out without
2391           changing the responsiveness state.
2392
2393         * UIProcess/ResponsivenessTimer.h: Declared new client function mayBecomeUnresponsive.
2394
2395         * UIProcess/WebProcessProxy.cpp:
2396         (WebKit::WebProcessProxy::platformIsBeingDebugged): A generic implementation that always
2397           returns false.
2398         (WebKit::WebProcessProxy::mayBecomeUnresponsive): Implement this new
2399           ResponsivenessTimer::Client function to return true unless the process is being debugged.
2400         * UIProcess/WebProcessProxy.h:
2401
2402 2016-09-26  Chris Dumez  <cdumez@apple.com>
2403
2404         [WK2] BlobDownloadClient should use asynchronous IPC to decide destination path
2405         https://bugs.webkit.org/show_bug.cgi?id=162568
2406
2407         Reviewed by Alex Christensen.
2408
2409         Use DecideDestinationWithSuggestedFilenameAsync IPC to decide the destination
2410         path in the case of Blob downloads, instead of the synchronous alternative.
2411         To achieve this, BlobResourceHandle was updated in WebCore to properly support
2412         asynchronous callback and BlobDownloadClient was updated to use asynchronous
2413         callbacks. When BlobDownloadClient::didReceiveResponseAsync() is called, we
2414         now ask the WebContent process asynchronously to decide what the destination
2415         path should be. Then, when we later get the destination path back from the
2416         WebContent process, we create the file on disk and call
2417         continueDidReceiveResponse() on the BlobResourceHandle so we start getting the
2418         blob data to write.
2419
2420         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2421         (WebKit::BlobDownloadClient::didReceiveResponseAsync):
2422         (WebKit::BlobDownloadClient::didDecideDownloadDestination):
2423         * NetworkProcess/Downloads/BlobDownloadClient.h:
2424         * NetworkProcess/Downloads/Download.cpp:
2425         (WebKit::Download::decideDestinationWithSuggestedFilenameAsync):
2426         (WebKit::Download::didDecideDownloadDestination):
2427         (WebKit::Download::continueDidReceiveResponse):
2428         (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted.
2429         * NetworkProcess/Downloads/Download.h:
2430         * NetworkProcess/Downloads/DownloadManager.cpp:
2431         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
2432         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2433         (WebKit::DownloadManager::convertHandleToDownload): Deleted.
2434         * NetworkProcess/Downloads/DownloadManager.h:
2435         * NetworkProcess/NetworkLoad.cpp:
2436         (WebKit::NetworkLoad::continueDidReceiveResponse):
2437         * NetworkProcess/NetworkProcess.cpp:
2438         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
2439         * NetworkProcess/NetworkProcess.h:
2440         * NetworkProcess/NetworkProcess.messages.in:
2441         * UIProcess/Downloads/DownloadProxy.cpp:
2442         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): Deleted.
2443         * UIProcess/Downloads/DownloadProxy.h:
2444         * UIProcess/Downloads/DownloadProxy.messages.in:
2445
2446 2016-09-26  Daniel Bates  <dabates@apple.com>
2447
2448         Mark Ping{Handle, Load} as final
2449         https://bugs.webkit.org/show_bug.cgi?id=162576
2450
2451         Reviewed by Alex Christensen.
2452
2453         We should not support subclassing of a ping handle or overriding its NetworkDataTaskClient
2454         callbacks because there are security/privacy implications with a ping request. We should
2455         not encourage subclassing without careful consideration.
2456
2457         * NetworkProcess/PingLoad.h:
2458
2459 2016-09-26  Daniel Bates  <dabates@apple.com>
2460
2461         Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
2462         https://bugs.webkit.org/show_bug.cgi?id=162365
2463
2464         Reviewed by Simon Fraser.
2465
2466         * Configurations/FeatureDefines.xcconfig:
2467         * WebProcess/WebPage/WebPage.cpp:
2468         (WebKit::WebPage::updatePreferences):
2469
2470 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2471
2472         Fix -Wformat warnings in WebLoaderStrategy
2473         https://bugs.webkit.org/show_bug.cgi?id=162553
2474
2475         Reviewed by Alex Christensen.
2476
2477         Consistently use PRIu64 to print uint64_t
2478
2479         * NetworkProcess/Downloads/Download.cpp:
2480         (WebKit::Download::didReceiveResponse):
2481         (WebKit::Download::didReceiveData):
2482         (WebKit::Download::didFinish):
2483         (WebKit::Download::didFail):
2484         (WebKit::Download::didCancel):
2485         * NetworkProcess/NetworkResourceLoader.cpp:
2486         (WebKit::NetworkResourceLoader::start):
2487         (WebKit::NetworkResourceLoader::startNetworkLoad):
2488         (WebKit::NetworkResourceLoader::setDefersLoading):
2489         (WebKit::NetworkResourceLoader::abort):
2490         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2491         (WebKit::NetworkResourceLoader::didFinishLoading):
2492         (WebKit::NetworkResourceLoader::didFailLoading):
2493         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2494         * WebProcess/Network/WebLoaderStrategy.cpp:
2495         (WebKit::WebLoaderStrategy::scheduleLoad):
2496         * WebProcess/Network/WebResourceLoader.cpp:
2497         (WebKit::WebResourceLoader::willSendRequest):
2498         (WebKit::WebResourceLoader::didReceiveResponse):
2499         (WebKit::WebResourceLoader::didReceiveData):
2500         (WebKit::WebResourceLoader::didFinishResourceLoad):
2501         (WebKit::WebResourceLoader::didFailResourceLoad):
2502         (WebKit::WebResourceLoader::didReceiveResource):
2503
2504 == Rolled over to ChangeLog-2016-09-26 ==