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