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