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