Printing to PDF should produce internal links when HTML has internal links
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-11-03  Tim Horton  <timothy_horton@apple.com>
2
3         Printing to PDF should produce internal links when HTML has internal links
4         https://bugs.webkit.org/show_bug.cgi?id=112081
5         <rdar://problem/5955705>
6
7         Reviewed by Simon Fraser.
8
9         * UIProcess/mac/WKPrintingView.h:
10         * UIProcess/mac/WKPrintingView.mm:
11         (linkDestinationName):
12         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
13         Propagate link-to-destination annotations (and each page's destinations)
14         into the printed PDF.
15         Generate a unique destination name based on the page and position, because
16         we have lost the fragment name information.
17
18         (-[WKPrintingView drawRect:]):
19         Compute all of the destinations for every page, so that we can add them
20         to the context as we paint the pages (we need the page CTM in order to add them).
21
22 2016-11-03  Alex Christensen  <achristensen@webkit.org>
23
24         Unreviewed, rolling out r208298.
25         https://bugs.webkit.org/show_bug.cgi?id=163939
26
27         caused asan crashes
28
29         Reverted changeset:
30
31         "NetworkSession: Add NetworkDataTask implementation for blobs"
32         https://bugs.webkit.org/show_bug.cgi?id=163939
33         http://trac.webkit.org/changeset/208298
34
35 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
36
37         Unreviewed, rolling out r208330.
38
39         This change appears to have caused two editing tests to fail
40         on macOS.
41
42         Reverted changeset:
43
44         "Reduce PassRefPtr use in WebKit2"
45         https://bugs.webkit.org/show_bug.cgi?id=164360
46         http://trac.webkit.org/changeset/208330
47
48 2016-11-03  Dan Bernstein  <mitz@apple.com>
49
50         WKWebView’s _observedRenderingProgressEvents not restored after web process crash
51         https://bugs.webkit.org/show_bug.cgi?id=164368
52         <rdar://problem/29091954>
53
54         Reviewed by Anders Carlsson.
55
56         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
57
58         * Shared/WebPageCreationParameters.cpp:
59         (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
60         (WebKit::WebPageCreationParameters::decode): Decode it.
61         * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
62
63         * UIProcess/WebPageProxy.cpp:
64         (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
65           m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
66         (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
67           member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
68         (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
69           creation parameters.
70
71         * UIProcess/WebPageProxy.h: Declared new member variable, deleted
72           m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
73
74         * UIProcess/ios/WebPageProxyIOS.mm:
75         (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
76           m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
77
78         * WebProcess/WebPage/WebPage.cpp:
79         (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
80
81 2016-11-02  Alex Christensen  <achristensen@webkit.org>
82
83         Reduce PassRefPtr use in WebKit2
84         https://bugs.webkit.org/show_bug.cgi?id=164360
85
86         Reviewed by Tim Horton.
87
88         * Shared/API/APISecurityOrigin.h:
89         (API::SecurityOrigin::SecurityOrigin):
90         * Shared/API/APISerializedScriptValue.h:
91         (API::SerializedScriptValue::create):
92         (API::SerializedScriptValue::SerializedScriptValue):
93         * Shared/API/c/WKSharedAPICast.h:
94         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
95         (WebKit::toAPI):
96         * Shared/APIWebArchive.h:
97         * Shared/APIWebArchive.mm:
98         (API::WebArchive::create):
99         (API::WebArchive::WebArchive):
100         * UIProcess/API/APIHitTestResult.cpp:
101         (API::HitTestResult::create):
102         * UIProcess/API/APIHitTestResult.h:
103         * UIProcess/API/APIUIClient.h:
104         (API::UIClient::createNewPage):
105         * UIProcess/API/C/WKPage.cpp:
106         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
107         (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
108         (WebKit::RunJavaScriptAlertResultListener::create):
109         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
110         (WebKit::RunJavaScriptConfirmResultListener::create):
111         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
112         (WebKit::RunJavaScriptPromptResultListener::create):
113         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
114         (WKPageSetPageUIClient):
115         * UIProcess/API/Cocoa/WKWebView.mm:
116         (-[WKWebView _takeViewSnapshot]):
117         * UIProcess/API/Cocoa/WKWebViewInternal.h:
118         * UIProcess/Cocoa/UIDelegate.h:
119         * UIProcess/Cocoa/UIDelegate.mm:
120         (WebKit::UIDelegate::UIClient::createNewPage):
121         * UIProcess/ios/WKGeolocationProviderIOS.mm:
122         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
123         * UIProcess/mac/WKImmediateActionController.mm:
124         (-[WKImmediateActionController _webHitTestResult]):
125         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
126         (contextMenuItems):
127         (WKBundlePageCopyContextMenuItems):
128         (WKBundlePageCopyContextMenuAtPointInWindow):
129         * WebProcess/UserContent/WebUserContentController.cpp:
130         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
131         * WebProcess/WebPage/WebUndoStep.cpp:
132         (WebKit::WebUndoStep::create):
133         * WebProcess/WebPage/WebUndoStep.h:
134         (WebKit::WebUndoStep::WebUndoStep):
135
136 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
137
138         Remove PageThrottler & all related code
139         https://bugs.webkit.org/show_bug.cgi?id=164302
140
141         Reviewed by Ryosuke Niwa.
142
143         All relevant information now available from the ActivityState.
144
145         * PluginProcess/PluginProcess.cpp:
146         (WebKit::PluginProcess::PluginProcess):
147         (WebKit::PluginProcess::createWebProcessConnection):
148         (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
149         (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
150         * PluginProcess/PluginProcess.h:
151         (): Deleted.
152         * PluginProcess/WebProcessConnection.cpp:
153         (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
154         (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
155         * PluginProcess/WebProcessConnection.h:
156         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
157         (WebKit::NPRuntimeObjectMap::evaluate):
158         * WebProcess/Plugins/Plugin.h:
159         (WebKit::Plugin::audioHardwareActivity): Deleted.
160         * WebProcess/Plugins/PluginProcessConnection.cpp:
161         (WebKit::PluginProcessConnection::PluginProcessConnection):
162         (WebKit::PluginProcessConnection::didReceiveMessage):
163         (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
164         (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
165         * WebProcess/Plugins/PluginProcessConnection.h:
166         (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
167         (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
168         * WebProcess/Plugins/PluginProcessConnection.messages.in:
169         * WebProcess/Plugins/PluginProxy.cpp:
170         (WebKit::PluginProxy::audioHardwareActivity): Deleted.
171         * WebProcess/Plugins/PluginProxy.h:
172         * WebProcess/Plugins/PluginView.cpp:
173         (WebKit::PluginView::audioHardwareActivity): Deleted.
174         * WebProcess/Plugins/PluginView.h:
175         * WebProcess/WebPage/WebPage.cpp:
176
177 2016-11-03  Dan Bernstein  <mitz@apple.com>
178
179         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
180         https://bugs.webkit.org/show_bug.cgi?id=164340
181         <rdar://problem/29074344>
182
183         Reviewed by Tim Horton.
184
185         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
186         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
187         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
188           function that sends the message to the UI process and resets
189           m_pendingNewlyReachedLayoutMilestones.
190         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
191           pending milestones and send them to the UI process. This way we don’t miss milestones that
192           fire during the commit.
193
194 2016-11-02  David Kilzer  <ddkilzer@apple.com>
195
196         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
197         <https://webkit.org/b/164333>
198         <rdar://problem/29072727>
199
200         Reviewed by Alex Christensen.
201
202         * WebProcess/WebProcess.cpp:
203         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
204         Add private method to log diagnostic message.
205         (WebKit::WebProcess::networkProcessConnectionClosed):
206         Call logDiagnosticMessageForNetworkProcessCrash().
207         * WebProcess/WebProcess.h:
208         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
209         Declare new method.
210
211 2016-11-02  Alex Christensen  <achristensen@webkit.org>
212
213         Remove Battery Status API from the tree
214         https://bugs.webkit.org/show_bug.cgi?id=164213
215
216         Reviewed by Sam Weinig.
217
218         * CMakeLists.txt:
219         * PlatformEfl.cmake:
220         * Shared/API/APIObject.h:
221         * Shared/API/c/WKBase.h:
222         * Shared/WebBatteryStatus.cpp: Removed.
223         * Shared/WebBatteryStatus.h: Removed.
224         * UIProcess/API/C/WKAPICast.h:
225         * UIProcess/API/C/WKBatteryManager.cpp: Removed.
226         * UIProcess/API/C/WKBatteryManager.h: Removed.
227         * UIProcess/API/C/WKBatteryStatus.cpp: Removed.
228         * UIProcess/API/C/WKBatteryStatus.h: Removed.
229         * UIProcess/API/C/WKContext.cpp:
230         (WKContextGetBatteryManager): Deleted.
231         * UIProcess/API/C/WKContext.h:
232         * UIProcess/API/efl/ewk_context.cpp:
233         (EwkContext::EwkContext):
234         * UIProcess/API/efl/ewk_context_private.h:
235         * UIProcess/API/efl/ewk_main.cpp:
236         (WebKit::EwkMain::initialize):
237         (WebKit::EwkMain::finalize):
238         (WebKit::EwkMain::shutdownInitializedEFLModules):
239         * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
240         * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
241         * UIProcess/API/gtk/WebKitWebContext.cpp:
242         (webkitWebContextConstructed):
243         * UIProcess/WebBatteryManagerProxy.cpp: Removed.
244         * UIProcess/WebBatteryManagerProxy.h: Removed.
245         * UIProcess/WebBatteryManagerProxy.messages.in: Removed.
246         * UIProcess/WebBatteryProvider.cpp: Removed.
247         * UIProcess/WebBatteryProvider.h: Removed.
248         * UIProcess/WebProcessPool.cpp:
249         (WebKit::m_hiddenPageThrottlingTimer):
250         * UIProcess/efl/BatteryProvider.cpp: Removed.
251         * UIProcess/efl/BatteryProvider.h: Removed.
252         * WebProcess/Battery: Removed.
253         * WebProcess/Battery/WebBatteryManager.cpp: Removed.
254         * WebProcess/Battery/WebBatteryManager.h: Removed.
255         * WebProcess/Battery/WebBatteryManager.messages.in: Removed.
256         * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
257         * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
258         * WebProcess/WebPage/WebPage.cpp:
259         (WebKit::m_userInterfaceLayoutDirection):
260         * WebProcess/WebProcess.cpp:
261         (WebKit::m_resourceLoadStatisticsStorage):
262
263 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
264
265         NetworkSession: Add NetworkDataTask implementation for blobs
266         https://bugs.webkit.org/show_bug.cgi?id=163939
267
268         Reviewed by Alex Christensen.
269
270         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
271         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
272         is enabled.
273
274         * CMakeLists.txt: Add new files to compilation.
275         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
276         * NetworkProcess/Downloads/BlobDownloadClient.h:
277         * NetworkProcess/Downloads/Download.cpp:
278         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
279         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
280         reveices a NetworkDataTask and is used by Soup backend and blobs.
281         (WebKit::Download::~Download):
282         (WebKit::Download::start):
283         (WebKit::Download::startWithHandle):
284         (WebKit::Download::cancel):
285         (WebKit::Download::didReceiveAuthenticationChallenge):
286         (WebKit::Download::didReceiveData):
287         (WebKit::Download::didFinish):
288         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
289         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
290         * NetworkProcess/Downloads/Download.h:
291         (WebKit::Download::Download):
292         (WebKit::Download::suggestedName):
293         (WebKit::Download::request):
294         * NetworkProcess/Downloads/DownloadManager.cpp:
295         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
296         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
297         * NetworkProcess/Downloads/DownloadManager.h:
298         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
299         (WebKit::Download::platformCancelNetworkLoad):
300         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
301         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
302         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
303         using NetworkSession.
304         * NetworkProcess/NetworkDataTask.cpp:
305         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
306         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
307         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
308         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
309         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
310         (WebKit::NetworkDataTaskBlob::clearStream):
311         (WebKit::NetworkDataTaskBlob::resume):
312         (WebKit::NetworkDataTaskBlob::suspend):
313         (WebKit::NetworkDataTaskBlob::cancel):
314         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
315         (WebKit::NetworkDataTaskBlob::getSizeForNext):
316         (WebKit::NetworkDataTaskBlob::didGetSize):
317         (WebKit::NetworkDataTaskBlob::seek):
318         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
319         (WebKit::NetworkDataTaskBlob::read):
320         (WebKit::NetworkDataTaskBlob::readData):
321         (WebKit::NetworkDataTaskBlob::readFile):
322         (WebKit::NetworkDataTaskBlob::didOpen):
323         (WebKit::NetworkDataTaskBlob::didRead):
324         (WebKit::NetworkDataTaskBlob::consumeData):
325         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
326         (WebKit::NetworkDataTaskBlob::suggestedFilename):
327         (WebKit::NetworkDataTaskBlob::download):
328         (WebKit::NetworkDataTaskBlob::writeDownload):
329         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
330         (WebKit::NetworkDataTaskBlob::didFailDownload):
331         (WebKit::NetworkDataTaskBlob::didFinishDownload):
332         (WebKit::NetworkDataTaskBlob::didFail):
333         (WebKit::NetworkDataTaskBlob::didFinish):
334         * NetworkProcess/NetworkDataTaskBlob.h: Added.
335         * NetworkProcess/NetworkLoad.cpp:
336         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
337         (WebKit::NetworkLoad::~NetworkLoad):
338         (WebKit::NetworkLoad::setDefersLoading):
339         (WebKit::NetworkLoad::cancel):
340         (WebKit::NetworkLoad::continueWillSendRequest):
341         (WebKit::NetworkLoad::continueDidReceiveResponse):
342         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
343         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
344         * NetworkProcess/NetworkLoad.h:
345         * NetworkProcess/NetworkSession.cpp:
346         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
347         * NetworkProcess/NetworkSession.h:
348         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
349         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
350         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
351         because in Cocoa all tasks are invalidated and canceled by the network session.
352         * NetworkProcess/mac/NetworkLoadMac.mm:
353         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
354         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
355         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
356         (WebKit::NetworkDataTaskSoup::download):
357         * NetworkProcess/soup/NetworkDataTaskSoup.h:
358         * NetworkProcess/soup/NetworkSessionSoup.cpp:
359         * NetworkProcess/soup/NetworkSessionSoup.h:
360         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
361         * PlatformGTK.cmake: Ditto.
362         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
363
364 2016-11-02  Andy Estes  <aestes@apple.com>
365
366         REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
367         https://bugs.webkit.org/show_bug.cgi?id=164311
368         <rdar://problem/26995374>
369
370         Reviewed by Tim Horton.
371
372         -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
373         iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
374         Latin-1 encoded.
375
376         * UIProcess/ios/forms/WKFileUploadPanel.mm:
377         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
378         convert fileURL.fileSystemRepresentation to a String.
379
380 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
381
382         NetworkSession: Network process crash when converting main resource to download
383         https://bugs.webkit.org/show_bug.cgi?id=164220
384
385         Reviewed by Alex Christensen.
386
387         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
388         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
389         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
390         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
391         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
392         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
393         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
394         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
395         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
396         created yet. That's not expected to happen and when the response completion handler is called in the
397         NetworkDataTask it tries to use either the client or the download and it crashes.
398
399         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
400         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
401         resource loader in case it's becoming a download.
402         * NetworkProcess/NetworkResourceLoader.cpp:
403         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
404         (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
405         download, but didBecomeDownload() hasn't been called yet.
406         (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
407         because it will be called by didBecomeDownload() later.
408         * NetworkProcess/NetworkResourceLoader.h:
409
410 2016-11-02  David Kilzer  <ddkilzer@apple.com>
411
412         Add logging for "WebKit encountered an internal error" messages
413         <https://webkit.org/b/164272>
414         <rdar://problem/28546064>
415
416         Reviewed by Alex Christensen.
417
418         * NetworkProcess/NetworkResourceLoader.cpp:
419         (WebKit::NetworkResourceLoader::startNetworkLoad):
420         * WebProcess/Network/WebLoaderStrategy.cpp:
421         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
422         * WebProcess/Network/WebResourceLoader.cpp:
423         (WebKit::WebResourceLoader::didReceiveResource):
424         - Add logging for various internalError() events.
425
426 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
427
428         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
429         https://bugs.webkit.org/show_bug.cgi?id=164303
430
431         Reviewed by Michael Catanzaro.
432
433         This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
434         BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
435
436         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
437         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
438         (WebKit::AcceleratedBackingStoreX11::update):
439
440 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
441
442         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
443         https://bugs.webkit.org/show_bug.cgi?id=164315
444
445         Reviewed by Michael Catanzaro.
446
447         * Shared/gtk/ProcessExecutablePathGtk.cpp:
448         (WebKit::getExecutablePath):
449         (WebKit::findWebKitProcess):
450         * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
451         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
452         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
453         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
454         * UIProcess/API/gtk/WebKitWebContext.cpp:
455         (webkitWebContextConstructed):
456         (webkit_web_context_set_favicon_database_directory):
457         (webkit_web_context_set_additional_plugins_directory):
458         (webkit_web_context_set_disk_cache_directory):
459         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
460         (webkitWebsiteDataManagerGetDataStore):
461         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
462         (WebKit::PluginInfoCache::PluginInfoCache):
463         * UIProcess/gtk/WebProcessPoolGtk.cpp:
464         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
465         * WebProcess/gtk/WebGtkExtensionManager.cpp:
466         (WebKit::parseUserData):
467
468 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
469
470         [Readable Streams API] Enable creation of ReadableByteStreamController
471         https://bugs.webkit.org/show_bug.cgi?id=164014
472
473         Reviewed by Youenn Fablet.
474
475         Added flag for the byte stream part of Readable Streams API.
476
477         * Configurations/FeatureDefines.xcconfig:
478
479 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
480
481         PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
482         https://bugs.webkit.org/show_bug.cgi?id=164103
483
484         Reviewed by Michael Catanzaro.
485
486         Follow symlinks when scanning plugins to avoid duplicates.
487
488         * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
489         from the cache.
490         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
491         (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
492
493 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
494
495         [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
496         https://bugs.webkit.org/show_bug.cgi?id=164204
497
498         Reviewed by Michael Catanzaro.
499
500         Check the platform plugin widget is embedded before trying to get its socket window.
501
502         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
503         (WebKit::NetscapePluginX11::geometryDidChange):
504         (WebKit::NetscapePluginX11::visibilityDidChange):
505
506 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
507
508         Turn the Input Events runtime flag on by default
509         https://bugs.webkit.org/show_bug.cgi?id=164297
510
511         Reviewed by Ryosuke Niwa.
512
513         * Shared/WebPreferencesDefinitions.h:
514
515 2016-11-01  Jaehun Lim  <ljaehun.lim@samsung.com>
516
517         Unreviewed, EFL build fix after r208225
518
519         Rename ViewState to ActivityState
520
521         * UIProcess/efl/WebView.cpp:
522         (WebKit::WebView::setActive):
523         (WebKit::WebView::setFocused):
524         (WebKit::WebView::setVisible):
525
526 2016-11-01  Alex Christensen  <achristensen@webkit.org>
527
528         Fix CMake build.
529
530         * PlatformMac.cmake:
531
532 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
533
534         Remove CUSTOM_ELEMENTS build flag
535         https://bugs.webkit.org/show_bug.cgi?id=164267
536
537         Reviewed by Antti Koivisto.
538
539         Removed the build flag.
540
541         * Configurations/FeatureDefines.xcconfig:
542         * WebProcess/InjectedBundle/InjectedBundle.cpp:
543         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
544         * WebProcess/WebPage/WebPage.cpp:
545         (WebKit::WebPage::updatePreferences):
546
547 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
548
549         [MediaStream] restrict media capture secure connections
550         https://bugs.webkit.org/show_bug.cgi?id=164234
551         <rdar://problem/28944906>
552
553         Reviewed by Alex Christensen.
554
555         * Shared/WebPreferencesDefinitions.h:
556    
557         * UIProcess/API/C/WKPreferences.cpp:
558         (WKPreferencesSetMediaCaptureRequiresSecureConnection):
559         (WKPreferencesGetMediaCaptureRequiresSecureConnection):
560         * UIProcess/API/C/WKPreferencesRefPrivate.h:
561    
562         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
563         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by
564          fix: remove some unused parameters in a lambda call.
565
566         * WebProcess/WebPage/WebPage.cpp:
567         (WebKit::WebPage::updatePreferences):
568
569 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
570
571         Add IsAudible, IsLoading to ActivityState
572         https://bugs.webkit.org/show_bug.cgi?id=164286
573
574         Reviewed by Geoff Garen.
575
576         By computing these values in the UIProcess and passing them to WebContent we can
577         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
578
579         * UIProcess/WebPageProxy.cpp:
580         (WebKit::WebPageProxy::updateActivityState):
581             - Added update for IsAudible, IsLoading flags.
582         (WebKit::WebPageProxy::updateThrottleState):
583             - Read IsAudible, IsLoading flags from ActivityState.
584         (WebKit::WebPageProxy::setMuted):
585             - call activityStateDidChange to trigger update.
586         (WebKit::WebPageProxy::isPlayingMediaDidChange):
587             - call activityStateDidChange to trigger update.
588         * UIProcess/WebPageProxy.h:
589         (WebKit::WebPageProxy::isLoadingChanged):
590             - call activityStateDidChange to trigger update.
591
592 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
593
594         Rename ViewState to ActivityState
595         https://bugs.webkit.org/show_bug.cgi?id=164254
596
597         Reviewed by Andreas Kling.
598
599         We plan to add a couple more flags to ViewState that aren't directly related to the view
600         itself - whether there is an ongoing page load, and whether whether there is audio playback.
601         This will allow viewState (now activityState) to fully drive throttling decisions.
602
603         Renaming this bitfield accordingly.
604
605         * Shared/WebPageCreationParameters.cpp:
606         (WebKit::WebPageCreationParameters::encode):
607         (WebKit::WebPageCreationParameters::decode):
608         * Shared/WebPageCreationParameters.h:
609         * UIProcess/API/Cocoa/WKWebView.mm:
610         (-[WKWebView didMoveToWindow]):
611         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
612         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
613         (_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
614         (webkitWebViewBaseScheduleUpdateActivityState):
615         (toplevelWindowFocusInEvent):
616         (toplevelWindowFocusOutEvent):
617         (toplevelWindowStateEvent):
618         (webkitWebViewBaseSetToplevelOnScreenWindow):
619         (webkitWebViewBaseMap):
620         (webkitWebViewBaseUnmap):
621         (webkitWebViewBaseSetFocus):
622         (webkitWebViewBaseIsInWindowActive):
623         (webkitWebViewBaseIsFocused):
624         (webkitWebViewBaseIsVisible):
625         (webkitWebViewBaseIsInWindow):
626         (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
627         (webkitWebViewBaseScheduleUpdateViewState): Deleted.
628         * UIProcess/Cocoa/WebViewImpl.mm:
629         (WebKit::WebViewImpl::becomeFirstResponder):
630         (WebKit::WebViewImpl::resignFirstResponder):
631         (WebKit::WebViewImpl::windowDidOrderOffScreen):
632         (WebKit::WebViewImpl::windowDidOrderOnScreen):
633         (WebKit::WebViewImpl::windowDidBecomeKey):
634         (WebKit::WebViewImpl::windowDidResignKey):
635         (WebKit::WebViewImpl::windowDidMiniaturize):
636         (WebKit::WebViewImpl::windowDidDeminiaturize):
637         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
638         (WebKit::WebViewImpl::viewDidMoveToWindow):
639         (WebKit::WebViewImpl::viewDidHide):
640         (WebKit::WebViewImpl::viewDidUnhide):
641         (WebKit::WebViewImpl::activeSpaceDidChange):
642         (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
643         (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
644         (WebKit::WebViewImpl::prepareForMoveToWindow):
645         * UIProcess/DrawingAreaProxy.h:
646         (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
647         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
648         * UIProcess/WebPageProxy.cpp:
649         (WebKit::WebPageProxy::WebPageProxy):
650         (WebKit::WebPageProxy::reattachToWebProcess):
651         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
652         (WebKit::WebPageProxy::updateActivityState):
653         (WebKit::WebPageProxy::activityStateDidChange):
654         (WebKit::WebPageProxy::dispatchActivityStateChange):
655         (WebKit::WebPageProxy::updateThrottleState):
656         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
657         (WebKit::WebPageProxy::creationParameters):
658         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
659         (WebKit::WebPageProxy::updateViewState): Deleted.
660         (WebKit::WebPageProxy::viewStateDidChange): Deleted.
661         (WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
662         (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
663         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
664         * UIProcess/WebPageProxy.h:
665         (WebKit::WebPageProxy::isInWindow):
666         (WebKit::WebPageProxy::didUpdateActivityState):
667         (WebKit::WebPageProxy::isViewVisible):
668         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
669         * UIProcess/WebPageProxy.messages.in:
670         * UIProcess/WebProcessProxy.cpp:
671         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
672         * UIProcess/efl/WebView.cpp:
673         * UIProcess/ios/WKContentView.mm:
674         (-[WKContentView _applicationDidEnterBackground]):
675         (-[WKContentView _applicationWillEnterForeground]):
676         * UIProcess/ios/WKPDFView.mm:
677         (-[WKPDFView _applicationDidEnterBackground]):
678         (-[WKPDFView _applicationWillEnterForeground]):
679         * UIProcess/ios/WebPageProxyIOS.mm:
680         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
681         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
682         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
683         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
684         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
685         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
686         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
687         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
688         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
689         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
690         * WebProcess/Plugins/PluginView.cpp:
691         (WebKit::PluginView::activityStateDidChange):
692         (WebKit::PluginView::viewStateDidChange): Deleted.
693         * WebProcess/Plugins/PluginView.h:
694         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
695         (WebKit::AcceleratedDrawingArea::activityStateDidChange):
696         (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
697         * WebProcess/WebPage/AcceleratedDrawingArea.h:
698         * WebProcess/WebPage/DrawingArea.h:
699         (WebKit::DrawingArea::activityStateDidChange):
700         (WebKit::DrawingArea::viewStateDidChange): Deleted.
701         * WebProcess/WebPage/WebPage.cpp:
702         (WebKit::m_userInterfaceLayoutDirection):
703         (WebKit::WebPage::reinitializeWebPage):
704         (WebKit::WebPage::updateIsInWindow):
705         (WebKit::WebPage::setActivityState):
706         (WebKit::WebPage::setViewState): Deleted.
707         * WebProcess/WebPage/WebPage.h:
708         (WebKit::WebPage::isVisible):
709         (WebKit::WebPage::isVisibleOrOccluded):
710         * WebProcess/WebPage/WebPage.messages.in:
711         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
712         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
713         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
714         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
715         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
716         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
717         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
718         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
719         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
720         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
721         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
722
723 2016-10-31  Jaehun Lim  <ljaehun.lim@samsung.com>
724
725         Unreviewed, CMake build fix
726
727         Adds #include <WebCore/IDBGetAllRecordsData.h>
728
729         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
730
731 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
732
733         Add basic visual/layout viewport support for fixed position layout
734         https://bugs.webkit.org/show_bug.cgi?id=164261
735
736         Reviewed by Dean Jackson.
737
738         Don't make visualViewportEnabled an experimental feature, because I don't want it enabled
739         by default in WebKitTestRunner (and therefore mismatching DumpRenderTree).
740
741         * Shared/WebPreferencesDefinitions.h:
742
743 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
744
745         JSC should support SharedArrayBuffer
746         https://bugs.webkit.org/show_bug.cgi?id=163986
747
748         Reviewed by Keith Miller.
749         
750         Adds some small things we need for SharedArrayBuffer.
751
752         * UIProcess/API/C/WKPreferencesRefPrivate.h:
753         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
754         * WebProcess/InjectedBundle/InjectedBundle.cpp:
755         (WebKit::InjectedBundle::createWebDataFromUint8Array):
756
757 2016-10-31  Brady Eidson  <beidson@apple.com>
758
759         IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
760         <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
761
762         Reviewed by Darin Adler.
763
764         - Handle moving "Get All" requests to and from the DatabaseProcess.
765         - Handle the additional task of creating/passing Sandbox Extensions for
766           referenced files when necessary. 
767           
768         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
769         (WebKit::WebIDBConnectionToClient::handleGetResult):
770         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
771         (WebKit::WebIDBConnectionToClient::getAllRecords):
772         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
773         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
774         
775         * Shared/WebCoreArgumentCoders.h:
776         
777         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
778         (WebKit::WebIDBConnectionToServer::getAllRecords):
779         (WebKit::preregisterSandboxExtensionsIfNecessary):
780         (WebKit::WebIDBConnectionToServer::didGetAllRecords):
781         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
782         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
783
784 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
785
786         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
787         https://bugs.webkit.org/show_bug.cgi?id=164236
788         <rdar://problem/28747712>
789
790         Reviewed by Beth Dakin.
791
792         See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
793         keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.
794
795         * WebProcess/WebPage/WebPage.cpp:
796         (WebKit::WebPage::didChangeSelection):
797         * WebProcess/WebPage/WebPage.h:
798         * WebProcess/WebPage/mac/WebPageMac.mm:
799         (WebKit::WebPage::dictionaryPopupInfoForRange):
800
801 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
802
803         Implement IntersectionObserver
804         https://bugs.webkit.org/show_bug.cgi?id=159475
805
806         Reviewed by Ryosuke Niwa.
807
808         Add ENABLE_INTERSECTION_OBSERVER, enabled by default.
809
810         * Configurations/FeatureDefines.xcconfig:
811
812 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
813
814         Unreviewed, rolling out r208154.
815
816         This change caused an assertion failure during API tests on
817         macOS.
818
819         Reverted changeset:
820
821         "NetworkSession: Network process crash when converting main
822         resource to download"
823         https://bugs.webkit.org/show_bug.cgi?id=164220
824         http://trac.webkit.org/changeset/208154
825
826 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
827
828         Do a better job of protecting Frame objects in the context of JavaScript calls
829         https://bugs.webkit.org/show_bug.cgi?id=164163
830         <rdar://problem/28955249>
831
832         Reviewed by Darin Adler.
833
834         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
835         (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
836         * WebProcess/WebPage/WebPage.cpp:
837         (WebKit::WebPage::insertTextAsync): Ditto.
838         (WebKit::WebPage::setComposition): Ditto.
839         * WebProcess/WebPage/mac/WebPageMac.mm:
840         (WebKit::WebPage::insertDictatedTextAsync): Ditto.
841
842 2016-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
843
844         NetworkSession: Network process crash when converting main resource to download
845         https://bugs.webkit.org/show_bug.cgi?id=164220
846
847         Reviewed by Alex Christensen.
848
849         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
850         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
851         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
852         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
853         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
854         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
855         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
856         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
857         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
858         created yet. That's not expected to happen and when the response completion handler is called in the
859         NetworkDataTask it tries to use either the client or the download and it crashes.
860
861         * NetworkProcess/NetworkResourceLoader.cpp:
862         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
863         (WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
864         call cleanup() because it will be called by didBecomeDownload() later.
865
866 2016-10-31  Darin Adler  <darin@apple.com>
867
868         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
869         https://bugs.webkit.org/show_bug.cgi?id=164214
870
871         Reviewed by Alex Christensen.
872
873         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
874         (webkit_dom_document_query_selector): Updated exception handling.
875         (webkit_dom_document_query_selector_all): Ditto.
876         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
877         (webkit_dom_document_fragment_query_selector): Ditto.
878         (webkit_dom_document_fragment_query_selector_all): Ditto.
879         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
880         (webkit_dom_element_query_selector): Ditto.
881         (webkit_dom_element_query_selector_all): Ditto.
882
883 2016-10-31  Darin Adler  <darin@apple.com>
884
885         Convert Document from ExceptionCode to Exception
886         https://bugs.webkit.org/show_bug.cgi?id=164212
887
888         Reviewed by Alex Christensen.
889
890         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
891         (webkit_dom_document_create_element): Updated exception handling.
892         (webkit_dom_document_create_cdata_section): Ditto.
893         (webkit_dom_document_create_processing_instruction): Ditto.
894         (webkit_dom_document_create_attribute): Ditto.
895         (webkit_dom_document_import_node): Ditto.
896         (webkit_dom_document_create_element_ns): Ditto.
897         (webkit_dom_document_create_attribute_ns): Ditto.
898         (webkit_dom_document_adopt_node): Ditto.
899         (webkit_dom_document_create_event): Ditto.
900         (webkit_dom_document_set_xml_version): Ditto.
901         (webkit_dom_document_get_cookie): Ditto.
902         (webkit_dom_document_set_cookie): Ditto.
903         (webkit_dom_document_set_body): Ditto.
904         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
905         (-[WKDOMDocument createElement:]): Ditto.
906
907 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
908
909         Holding down a key to choose an accented character should fire "insertReplacementText" input events
910         https://bugs.webkit.org/show_bug.cgi?id=164209
911         <rdar://problem/29019305>
912
913         Reviewed by Darin Adler.
914
915         When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
916         use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
917         changes in order to support testing replacement text insertion.
918
919         * UIProcess/API/Cocoa/WKWebView.mm:
920         (-[WKWebView _insertText:replacementRange:]):
921         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
922         * WebProcess/WebPage/WebPage.cpp:
923         (WebKit::WebPage::insertTextAsync):
924
925 2016-10-30  Darin Adler  <darin@apple.com>
926
927         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
928         https://bugs.webkit.org/show_bug.cgi?id=164206
929
930         Reviewed by Chris Dumez.
931
932         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
933         (webkit_dom_named_node_map_set_named_item): Updated exception handling.
934         (webkit_dom_named_node_map_remove_named_item): Ditto.
935         (webkit_dom_named_node_map_set_named_item_ns): Ditto.
936         (webkit_dom_named_node_map_remove_named_item_ns): Ditto.
937         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
938         (webkit_dom_element_set_attribute): Ditto.
939         (webkit_dom_element_set_attribute_node): Ditto.
940         (webkit_dom_element_remove_attribute_node): Ditto.
941         (webkit_dom_element_set_attribute_ns): Ditto.
942         (webkit_dom_element_set_attribute_node_ns): Ditto.
943         (webkit_dom_element_matches): Ditto.
944         (webkit_dom_element_closest): Ditto.
945         (webkit_dom_element_webkit_matches_selector): Ditto.
946         (webkit_dom_element_insert_adjacent_element): Ditto.
947         (webkit_dom_element_insert_adjacent_html): Ditto.
948         (webkit_dom_element_insert_adjacent_text): Ditto.
949         (webkit_dom_element_set_inner_html): Ditto.
950         (webkit_dom_element_set_outer_html): Ditto.
951         * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
952         (-[WKDOMElement setAttribute:value:]): Ditto.
953
954 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com>
955
956         [DOM] Introduce WebCore::jsDynamicDowncast
957         https://bugs.webkit.org/show_bug.cgi?id=164137
958
959         Reviewed by Darin Adler.
960
961         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
962         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
963
964 2016-10-29  Darin Adler  <darin@apple.com>
965
966         Convert more of DOM from ExceptionCode to Exception
967         https://bugs.webkit.org/show_bug.cgi?id=164173
968
969         Reviewed by Ryosuke Niwa.
970
971         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
972         (webkit_dom_character_data_substring_data): Updated since this
973         now uses ExceptionOr.
974         (webkit_dom_character_data_insert_data): Ditto.
975         (webkit_dom_character_data_delete_data): Ditto.
976         (webkit_dom_character_data_replace_data): Ditto.
977         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
978         (webkit_dom_text_replace_whole_text): Ditto.
979         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
980         (webkit_dom_text_split_text): Ditto.
981
982 2016-10-28  Darin Adler  <darin@apple.com>
983
984         Move all classes in the HTML directory from ExceptionCode to Exception
985         https://bugs.webkit.org/show_bug.cgi?id=163876
986
987         Reviewed by Sam Weinig.
988
989         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
990         (webkit_dom_dom_token_list_add): Updated exception handling.
991         (webkit_dom_dom_token_list_remove): Ditto.
992         (webkit_dom_dom_token_list_toggle): Ditto.
993         (webkit_dom_dom_token_list_replace): Ditto.
994         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
995         (webkit_dom_element_remove): Ditto.
996         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
997         (webkit_dom_html_element_set_inner_text): Ditto.
998         (webkit_dom_html_element_set_outer_text): Ditto.
999         (webkit_dom_html_element_set_content_editable): Ditto.
1000         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1001         (webkit_dom_html_input_element_set_max_length): Ditto.
1002         (webkit_dom_html_input_element_set_size): Ditto.
1003         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1004         (webkit_dom_html_select_element_set_length): Ditto.
1005         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
1006         (webkit_dom_html_table_element_insert_row): Ditto.
1007         (webkit_dom_html_table_element_delete_row): Ditto.
1008         (webkit_dom_html_table_element_set_caption): Ditto.
1009         (webkit_dom_html_table_element_set_t_head): Ditto.
1010         (webkit_dom_html_table_element_set_t_foot): Ditto.
1011         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
1012         (webkit_dom_html_table_row_element_insert_cell): Ditto.
1013         (webkit_dom_html_table_row_element_delete_cell): Ditto.
1014         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
1015         (webkit_dom_html_table_section_element_insert_row): Ditto.
1016         (webkit_dom_html_table_section_element_delete_row): Ditto.
1017
1018         * WebProcess/WebPage/WebPage.cpp:
1019         (WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION.
1020
1021         * WebProcess/WebPage/ios/WebPageIOS.mm:
1022         (WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION.
1023
1024         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1025         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
1026         Changed the code to use a different interface to TimeRange that does
1027         not involve exceptions.
1028
1029 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1030
1031         iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
1032         https://bugs.webkit.org/show_bug.cgi?id=164077
1033         <rdar://problem/28987810>
1034
1035         Reviewed by Simon Fraser.
1036
1037         Small tweak to mark text insertion when autocorrecting as such, as opposed to regular keyboard input.
1038
1039         * WebProcess/WebPage/ios/WebPageIOS.mm:
1040         (WebKit::WebPage::syncApplyAutocorrection):
1041
1042 2016-10-28  Megan Gardner  <megan_gardner@apple.com>
1043
1044         Rename SharedMemoryMac to SharedMemoryCocoa
1045         https://bugs.webkit.org/show_bug.cgi?id=164156
1046
1047         Reviewed by Alex Christensen.
1048
1049         Renamed SharedMemoryMac to SharedMemoryCocoa, as it runs on all cocoa platforms, not exclusively just mac, and
1050         thus should be named to reflect that reality.
1051
1052         * Platform/cocoa: Added.
1053         * Platform/cocoa/SharedMemoryCocoa.cpp: Copied from Source/WebKit2/Platform/mac/SharedMemoryMac.cpp.
1054         * Platform/mac/SharedMemoryMac.cpp: Removed.
1055         * WebKit2.xcodeproj/project.pbxproj:
1056
1057 2016-10-28  Antti Koivisto  <antti@apple.com>
1058
1059         Enable CFNetwork connection cache fast lane for WebKit2
1060         https://bugs.webkit.org/show_bug.cgi?id=164129
1061
1062         Reviewed by Andreas Kling.
1063
1064         The idea of this feature is keep a connection free for higher priority requests so low-priority
1065         image loads can't take all the available connections.
1066
1067         We have this enabled on WK1 but not on WK2. See what enabling it does for performance in bots.
1068
1069         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1070         (WebKit::initializeNetworkSettings):
1071
1072             Based on code inspection setting kHTTPMinimumFastLanePriority is not sufficient to enable this feature,
1073             kHTTPNumFastLanes needs also be set to a non-zero value. Use the same constants as WK1.
1074             Also enable this on Mac to unify behavior.
1075
1076 2016-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1077
1078         [GTK] New stable DOM API headers should be included from webkitdom.h
1079         https://bugs.webkit.org/show_bug.cgi?id=164069
1080
1081         Reviewed by Carlos Garcia Campos.
1082
1083         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
1084
1085 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
1086
1087         Fix when building against the MacOSX10.12.sdk where "macos" is not recognized
1088         in the availability macros.
1089
1090         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1091
1092 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
1093
1094         Add support for wide gamut for ShareableBitmap for image popovers
1095         https://bugs.webkit.org/show_bug.cgi?id=164001
1096
1097         Reviewed by Simon Fraser.
1098
1099         Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels,
1100         and that data is passed back and forth between the processes. The callers of SharedBitmap will determine
1101         if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that
1102         is incapbable of supporting a wide gamut image.
1103         This makes it possible to show wide gamut images in image popovers on iOS.
1104         This is currently untestable, so no tests added.
1105
1106         * Platform/IPC/Decoder.cpp:
1107         (IPC::Decoder::decode):
1108         * Platform/IPC/Decoder.h:
1109         * Platform/IPC/Encoder.cpp:
1110         (IPC::Encoder::encode):
1111         * Platform/IPC/Encoder.h:
1112         * Shared/ShareableBitmap.cpp:
1113         (WebKit::bytesPerPixel):
1114         (WebKit::ShareableBitmap::Handle::encode):
1115         (WebKit::ShareableBitmap::Handle::decode):
1116         (WebKit::ShareableBitmap::Handle::clear):
1117         (WebKit::ShareableBitmap::create):
1118         (WebKit::ShareableBitmap::createShareable):
1119         (WebKit::ShareableBitmap::createHandle):
1120         (WebKit::ShareableBitmap::ShareableBitmap):
1121         * Shared/ShareableBitmap.h:
1122         (WebKit::ShareableBitmap::numBytesForSize):
1123         (WebKit::ShareableBitmap::sizeInBytes):
1124         * Shared/cg/ShareableBitmapCG.cpp:
1125         (WebKit::bitmapInfo):
1126         (WebKit::ShareableBitmap::createGraphicsContext):
1127         (WebKit::ShareableBitmap::createCGImage):
1128         * WebProcess/WebPage/ios/WebPageIOS.mm:
1129         (WebKit::WebPage::getPositionInformation):
1130
1131 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1132
1133         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
1134         https://bugs.webkit.org/show_bug.cgi?id=163948
1135         <rdar://problem/28921433>
1136
1137         Reviewed by Darin Adler.
1138
1139         Add support for new drag and drop-related EditAction enum values.
1140
1141         * UIProcess/WebEditCommandProxy.cpp:
1142         (WebKit::WebEditCommandProxy::nameForEditAction):
1143
1144 2016-10-26  Chris Dumez  <cdumez@apple.com>
1145
1146         Replace IDBKeyPath with a WTF::Variant
1147         https://bugs.webkit.org/show_bug.cgi?id=163909
1148
1149         Reviewed by Darin Adler.
1150
1151         Add coders to encode / decode IDBKeyPath type for IPC.
1152
1153         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
1154         * Shared/WebCoreArgumentCoders.cpp:
1155         (IPC::ArgumentCoder<IDBKeyPath>::encode):
1156         (IPC::ArgumentCoder<IDBKeyPath>::decode):
1157         * Shared/WebCoreArgumentCoders.h:
1158         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1159
1160 2016-10-26  Brian Burg  <bburg@apple.com>
1161
1162         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
1163         https://bugs.webkit.org/show_bug.cgi?id=164046
1164
1165         Reviewed by Joseph Pecoraro.
1166
1167         * WebProcess/WebPage/WebInspector.cpp:
1168         (WebKit::WebInspector::sendMessageToFrontend):
1169         * WebProcess/WebPage/WebInspector.h:
1170
1171 2016-10-26  Eric Carlson  <eric.carlson@apple.com>
1172
1173         [MediaStream] Add "has capture device" bit to media state flags
1174         https://bugs.webkit.org/show_bug.cgi?id=163952
1175
1176         Unreviewed fix after r207839.
1177
1178         * WebProcess/WebPage/WebPage.cpp:
1179         (WebKit::WebPage::setMuted): Take an MutedStateFlags, not a bool.
1180         * WebProcess/WebPage/WebPage.h:
1181
1182 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1183
1184         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.1 release.
1185
1186         * gtk/NEWS: Add release notes for 2.15.1.
1187
1188 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1189
1190         REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
1191         https://bugs.webkit.org/show_bug.cgi?id=162776
1192
1193         Reviewed by Xabier Rodriguez-Calvar.
1194
1195         Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group
1196         to the menu widget.
1197
1198         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1199         (WebKit::WebContextMenuProxyGtk::append):
1200         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
1201         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
1202
1203 2016-10-25  Alex Christensen  <achristensen@webkit.org>
1204
1205         CMake build fix.
1206
1207         * PlatformMac.cmake:
1208         * Shared/WebHitTestResultData.cpp:
1209         (WebKit::WebHitTestResultData::WebHitTestResultData):
1210         Explicitly call AtomicString::string to make the String constructor no longer ambiguous.
1211         It couldn't decide whether to use operator const String& or operator NSString*.
1212
1213 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1214
1215         [SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
1216         https://bugs.webkit.org/show_bug.cgi?id=163941
1217
1218         Reviewed by Michael Catanzaro.
1219
1220         equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use
1221         "get" instead of "GET".
1222
1223         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1224         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1225
1226 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
1227
1228         [MediaStream] Add "has capture device" bit to media state flags
1229         https://bugs.webkit.org/show_bug.cgi?id=163952
1230
1231         Reviewed by Sam Weinig.
1232
1233         * UIProcess/API/C/WKPage.cpp:
1234         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
1235         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
1236
1237 2016-10-25  Commit Queue  <commit-queue@webkit.org>
1238
1239         Unreviewed, rolling out r207827 and r207828.
1240         https://bugs.webkit.org/show_bug.cgi?id=163965
1241
1242         Caused LayoutTest webaudio/web-audio-is-playing.html to time
1243         out on macOS. (Requested by ryanhaddad on #webkit).
1244
1245         Reverted changesets:
1246
1247         "[MediaStream] Add "has capture device" bit to media state
1248         flags"
1249         https://bugs.webkit.org/show_bug.cgi?id=163952
1250         http://trac.webkit.org/changeset/207827
1251
1252         "[MediaStream] Add "has capture device" bit to media state
1253         flags"
1254         https://bugs.webkit.org/show_bug.cgi?id=163952
1255         http://trac.webkit.org/changeset/207828
1256
1257 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
1258
1259         [MediaStream] Add "has capture device" bit to media state flags
1260         https://bugs.webkit.org/show_bug.cgi?id=163952
1261
1262         Reviewed by Sam Weinig.
1263
1264         * UIProcess/API/C/WKPage.cpp:
1265         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
1266         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
1267
1268 2016-10-25  Chris Dumez  <cdumez@apple.com>
1269
1270         Unreviewed, rolling out r207494.
1271
1272         iOS SDK has been updated on the bots now so rollout the
1273         rollout
1274
1275         Reverted changeset:
1276
1277         "Unreviewed, rolling out r207413."
1278         https://bugs.webkit.org/show_bug.cgi?id=163547
1279         http://trac.webkit.org/changeset/207494
1280
1281 2016-10-25  Jonathan Bedard  <jbedard@apple.com>
1282
1283         Unreviewed build fix.
1284
1285         * UIProcess/API/Cocoa/WKWebView.mm:
1286         (-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.
1287
1288 2016-10-19  Jer Noble  <jer.noble@apple.com>
1289
1290         Add WKWebView fullscreen delegate SPI
1291         https://bugs.webkit.org/show_bug.cgi?id=163674
1292
1293         Reviewed by Anders Carlsson.
1294
1295         Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.
1296
1297         * UIProcess/API/APIFullscreenClient.h: Added.
1298         (API::FullscreenClient::~FullscreenClient):
1299         (API::FullscreenClient::willEnterFullscreen):
1300         (API::FullscreenClient::didEnterFullscreen):
1301         (API::FullscreenClient::willExitFullscreen):
1302         (API::FullscreenClient::didExitFullscreen):
1303         * UIProcess/API/Cocoa/WKWebView.mm:
1304         (-[WKWebView _initializeWithConfiguration:]):
1305         (-[WKWebView _setFullscreenDelegate:]):
1306         (-[WKWebView _fullscreenDelegate]):
1307         (-[WKWebView _isInFullscreen]):
1308         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1309         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
1310         * UIProcess/Cocoa/FullscreenClient.h: Added.
1311         (WebKit::FullscreenClient::~FullscreenClient):
1312         * UIProcess/Cocoa/FullscreenClient.mm: Added.
1313         (WebKit::FullscreenClient::FullscreenClient):
1314         (WebKit::FullscreenClient::delegate):
1315         (WebKit::FullscreenClient::setDelegate):
1316         (WebKit::FullscreenClient::willEnterFullscreen):
1317         (WebKit::FullscreenClient::didEnterFullscreen):
1318         (WebKit::FullscreenClient::willExitFullscreen):
1319         (WebKit::FullscreenClient::didExitFullscreen):
1320         * UIProcess/WebFullScreenManagerProxy.cpp:
1321         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
1322         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
1323         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
1324         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
1325         * UIProcess/WebPageProxy.cpp:
1326         (WebKit::WebPageProxy::WebPageProxy):
1327         (WebKit::WebPageProxy::setFullscreenClient):
1328         (WebKit::WebPageProxy::fullScreenManager): Deleted.
1329         * UIProcess/WebPageProxy.h:
1330         (WebKit::WebPageProxy::fullscreenClient):
1331         * WebKit2.xcodeproj/project.pbxproj:
1332
1333 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1334
1335         Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.
1336
1337         * NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency.
1338
1339 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1340
1341         Unreviewed. Fix Soup based ports debug build after r207813.
1342
1343         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1344         (WebKit::NetworkDataTaskSoup::authenticateCallback):
1345         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
1346
1347 2016-10-25  Andreas Kling  <akling@apple.com>
1348
1349         More PassRefPtr purging in WebCore.
1350         <https://webkit.org/b/163895>
1351
1352         Reviewed by Antti Koivisto.
1353
1354         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
1355         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1356         (WebKit::PDFPlugin::createScrollbar):
1357
1358 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1359
1360         NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations
1361         https://bugs.webkit.org/show_bug.cgi?id=163777
1362
1363         Reviewed by Alex Christensen.
1364
1365         The subclass model allows us to choose the implementation at run time, so we could add other implementations
1366         like a mock network class to measure performance, and even one for blobs and finally get rid of ResourceHandle
1367         in WebKit2.
1368
1369         * CMakeLists.txt: Add new files to compilation.
1370         * NetworkProcess/NetworkDataTask.cpp: Added.
1371         (WebKit::NetworkDataTask::create): Create a NetworkDataTaskCocoa or NetworkDataTaskSoup.
1372         (WebKit::NetworkDataTask::NetworkDataTask): Move common code from NetworkDataTaskCocoa and NetworkDataTaskSoup
1373         here to handle the early failures.
1374         (WebKit::NetworkDataTask::~NetworkDataTask):
1375         (WebKit::NetworkDataTask::scheduleFailure):
1376         (WebKit::NetworkDataTask::failureTimerFired):
1377         * NetworkProcess/NetworkDataTask.h: Remove platform specific members.
1378         (WebKit::NetworkDataTask::setPendingDownloadLocation): Make it virtual and set the m_pendingDownloadLocation.
1379         (WebKit::NetworkDataTask::suggestedFilename): Make it virtual and const with a default implementation.
1380         (WebKit::NetworkDataTask::setSuggestedFilename): Ditto.
1381         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): Ditto.
1382         * NetworkProcess/NetworkLoad.cpp: Include NetworkDataTaskCocoa.h.
1383         * NetworkProcess/NetworkLoad.h: Include NetworkDataTask.h instead of NetworkSession.h.
1384         * NetworkProcess/NetworkProcess.cpp:
1385         (WebKit::NetworkProcess::NetworkProcess): Use NetworkSessionCocoa.
1386         * NetworkProcess/NetworkSession.cpp:
1387         (WebKit::NetworkSession::create): Create a NetworkSessionCocoa or NetworkSessionSoup.
1388         (WebKit::NetworkSession::defaultSession): In case of cocoa use NetworkSessionCocoa::defaultSession() because of
1389         the custom protocol manager, otherwise simply create a default session.
1390         (WebKit::NetworkSession::networkStorageSession): Move common code from NetworkSessionCocoa and
1391         NetworkSessionSoup here.
1392         (WebKit::NetworkSession::NetworkSession):
1393         (WebKit::NetworkSession::~NetworkSession):
1394         * NetworkProcess/NetworkSession.h: Remove platform specific members.
1395         (WebKit::NetworkSession::invalidateAndCancel): Make it virtual.
1396         (WebKit::NetworkSession::clearCredentials): Ditto.
1397         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: Include NetworkSession.h.
1398         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Added.
1399         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1400         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1401         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
1402         (WebKit::NetworkDataTaskCocoa::didSendData):
1403         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
1404         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
1405         (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
1406         (WebKit::NetworkDataTaskCocoa::didReceiveData):
1407         (WebKit::NetworkDataTaskCocoa::didBecomeDownload):
1408         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1409         (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation):
1410         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
1411         (WebKit::NetworkDataTaskCocoa::transferSandboxExtensionToDownload):
1412         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
1413         (WebKit::NetworkDataTaskCocoa::suggestedFilename):
1414         (WebKit::NetworkDataTaskCocoa::cancel):
1415         (WebKit::NetworkDataTaskCocoa::resume):
1416         (WebKit::NetworkDataTaskCocoa::suspend):
1417         (WebKit::NetworkDataTaskCocoa::state):
1418         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1419         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1420         * NetworkProcess/cocoa/NetworkSessionCocoa.h: Added.
1421         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1422         (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
1423         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
1424         (WebKit::configurationForSessionID):
1425         (WebKit::NetworkSessionCocoa::setCustomProtocolManager):
1426         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData):
1427         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier):
1428         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
1429         (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType):
1430         (WebKit::NetworkSessionCocoa::create):
1431         (WebKit::NetworkSessionCocoa::defaultSession):
1432         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1433         (WebKit::NetworkSessionCocoa::~NetworkSessionCocoa):
1434         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
1435         (WebKit::NetworkSessionCocoa::clearCredentials):
1436         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
1437         (WebKit::NetworkSessionCocoa::addDownloadID):
1438         (WebKit::NetworkSessionCocoa::downloadID):
1439         (WebKit::NetworkSessionCocoa::takeDownloadID):
1440         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1441         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
1442         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1443         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1444         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
1445         (WebKit::NetworkDataTaskSoup::suggestedFilename):
1446         (WebKit::NetworkDataTaskSoup::setPendingDownloadLocation):
1447         (WebKit::NetworkDataTaskSoup::createRequest):
1448         (WebKit::NetworkDataTaskSoup::clearRequest):
1449         (WebKit::NetworkDataTaskSoup::resume):
1450         (WebKit::NetworkDataTaskSoup::suspend):
1451         (WebKit::NetworkDataTaskSoup::cancel):
1452         (WebKit::NetworkDataTaskSoup::invalidateAndCancel):
1453         (WebKit::NetworkDataTaskSoup::state):
1454         (WebKit::NetworkDataTaskSoup::timeoutFired):
1455         (WebKit::NetworkDataTaskSoup::startTimeout):
1456         (WebKit::NetworkDataTaskSoup::stopTimeout):
1457         (WebKit::NetworkDataTaskSoup::sendRequestCallback):
1458         (WebKit::NetworkDataTaskSoup::didSendRequest):
1459         (WebKit::NetworkDataTaskSoup::didReceiveResponse):
1460         (WebKit::NetworkDataTaskSoup::tlsErrorsChangedCallback):
1461         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
1462         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
1463         (WebKit::NetworkDataTaskSoup::authenticateCallback):
1464         (WebKit::NetworkDataTaskSoup::authenticate):
1465         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
1466         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirectionCallback):
1467         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
1468         (WebKit::NetworkDataTaskSoup::didFinishSkipInputStreamForRedirection):
1469         (WebKit::NetworkDataTaskSoup::shouldStartHTTPRedirection):
1470         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1471         (WebKit::NetworkDataTaskSoup::readCallback):
1472         (WebKit::NetworkDataTaskSoup::read):
1473         (WebKit::NetworkDataTaskSoup::didRead):
1474         (WebKit::NetworkDataTaskSoup::didFinishRead):
1475         (WebKit::NetworkDataTaskSoup::requestNextPartCallback):
1476         (WebKit::NetworkDataTaskSoup::requestNextPart):
1477         (WebKit::NetworkDataTaskSoup::didRequestNextPart):
1478         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
1479         (WebKit::NetworkDataTaskSoup::gotHeadersCallback):
1480         (WebKit::NetworkDataTaskSoup::didGetHeaders):
1481         (WebKit::NetworkDataTaskSoup::wroteBodyDataCallback):
1482         (WebKit::NetworkDataTaskSoup::didWriteBodyData):
1483         (WebKit::NetworkDataTaskSoup::download):
1484         (WebKit::NetworkDataTaskSoup::writeDownloadCallback):
1485         (WebKit::NetworkDataTaskSoup::writeDownload):
1486         (WebKit::NetworkDataTaskSoup::didWriteDownload):
1487         (WebKit::NetworkDataTaskSoup::didFinishDownload):
1488         (WebKit::NetworkDataTaskSoup::didFailDownload):
1489         (WebKit::NetworkDataTaskSoup::cleanDownloadFiles):
1490         (WebKit::NetworkDataTaskSoup::didFail):
1491         (WebKit::NetworkDataTaskSoup::networkEventCallback):
1492         (WebKit::NetworkDataTaskSoup::networkEvent):
1493         (WebKit::NetworkDataTaskSoup::startingCallback):
1494         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
1495         (WebKit::NetworkDataTaskSoup::didStartRequest):
1496         (WebKit::NetworkDataTaskSoup::restartedCallback):
1497         (WebKit::NetworkDataTaskSoup::didRestart):
1498         * NetworkProcess/soup/NetworkDataTaskSoup.h: Added.
1499         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1500         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1501         (WebKit::NetworkSessionSoup::~NetworkSessionSoup):
1502         (WebKit::NetworkSessionSoup::soupSession):
1503         (WebKit::NetworkSessionSoup::invalidateAndCancel):
1504         * NetworkProcess/soup/NetworkSessionSoup.h: Added.
1505         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
1506         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
1507         * PlatformEfl.cmake: Add new files to compilation.
1508         * PlatformGTK.cmake: Ditto.
1509         * WebKit2.xcodeproj/project.pbxproj: Ditto.
1510         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1511         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
1512         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1513         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Ditto.
1514
1515 2016-10-25  Antti Koivisto  <antti@apple.com>
1516
1517         Add support for introducing simulated latency in network process
1518         https://bugs.webkit.org/show_bug.cgi?id=163902
1519
1520         Reviewed by Alex Christensen.
1521
1522         For testing purposes it is useful to have a mechanism for simulating high latency.
1523         This patch adds a basic mechanism that introduces a delay to each response in network
1524         process. In Safari it can be used with
1525
1526              defaults write com.apple.Safari WebKitNetworkLoadThrottleLatencyMilliseconds 200
1527
1528         Setting the delay to 0 disables the feature.
1529
1530         * NetworkProcess/NetworkLoad.cpp:
1531         (WebKit::NetworkLoad::Throttle::Throttle):
1532         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
1533         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1534         (WebKit::NetworkLoad::didReceiveData):
1535         (WebKit::NetworkLoad::didCompleteWithError):
1536         (WebKit::NetworkLoad::throttleDelayCompleted):
1537         * NetworkProcess/NetworkLoad.h:
1538         * NetworkProcess/NetworkProcess.cpp:
1539         (WebKit::NetworkProcess::initializeNetworkProcess):
1540         * NetworkProcess/NetworkProcess.h:
1541         (WebKit::NetworkProcess::loadThrottleLatency):
1542         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1543         (WebKit::NetworkProcessCreationParameters::encode):
1544         (WebKit::NetworkProcessCreationParameters::decode):
1545         * NetworkProcess/NetworkProcessCreationParameters.h:
1546         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1547         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1548
1549 2016-10-24  Dan Bernstein  <mitz@apple.com>
1550
1551         REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
1552         https://bugs.webkit.org/show_bug.cgi?id=163879
1553         <rdar://problem/28728735>
1554
1555         Reviewed by Darin Adler.
1556
1557         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1558         (WebKit::WebProcessProxy::platformIsBeingDebugged): Check if the current process, which is
1559           the UI process, is sandboxed before trying to find out if the Web process is being
1560           debugged.
1561
1562 2016-10-21  Alex Christensen  <achristensen@webkit.org>
1563
1564         URL::port should return Optional<uint16_t>
1565         https://bugs.webkit.org/show_bug.cgi?id=163806
1566
1567         Reviewed by Darin Adler.
1568
1569         * NetworkProcess/mac/NetworkProcessMac.mm:
1570         (WebKit::overrideSystemProxies):
1571         * Shared/API/APISecurityOrigin.h:
1572         (API::SecurityOrigin::create):
1573         * Shared/API/APIURL.h:
1574         (API::URL::protocol):
1575         * Shared/API/c/WKSecurityOriginRef.cpp:
1576         (WKSecurityOriginGetPort):
1577         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
1578         (-[WKSecurityOrigin port]):
1579         * WebProcess/WebPage/WebPage.cpp:
1580         (WebKit::WebPage::canHandleRequest):
1581         * WebProcess/cocoa/WebProcessCocoa.mm:
1582         (WebKit::origin):
1583
1584 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
1585
1586         [MediaStream] Separate media capture and audio playback muting
1587         https://bugs.webkit.org/show_bug.cgi?id=163855
1588         <rdar://problem/28827186>
1589
1590         Reviewed by Darin Adler.
1591
1592         * Shared/WebPageCreationParameters.h: Change 'muted' from bool to MutedStateFlags.
1593
1594         * UIProcess/API/C/WKPage.cpp: Change parameter from bool to WKMediaMutedState.
1595         (WKPageSetMuted):
1596         * UIProcess/API/C/WKPagePrivate.h: Define WKMediaMutedState.
1597
1598         * UIProcess/WebPageProxy.cpp:
1599         (WebKit::WebPageProxy::WebPageProxy):
1600         (WebKit::WebPageProxy::setMuted): m_muted -> m_mutedState.
1601         (WebKit::WebPageProxy::creationParameters): Ditto.
1602         * UIProcess/WebPageProxy.h:
1603
1604         * WebProcess/Plugins/PluginView.cpp:
1605         (WebKit::PluginView::isMuted): page.isMuted -> page.mutedState.
1606
1607         * WebProcess/WebPage/WebPage.messages.in: Change SetMuted parameter.
1608
1609 2016-10-24  Youenn Fablet  <youenn@apple.com>
1610
1611         Activate WEB_RTC compilation flags for Mac bots
1612         https://bugs.webkit.org/show_bug.cgi?id=163886
1613
1614         Reviewed by Eric Carlson.
1615
1616         * Configurations/FeatureDefines.xcconfig:
1617
1618 2016-10-24  Brady Eidson  <beidson@apple.com>
1619
1620         IndexedDB 2.0: Support IDBIndex name assignment.
1621         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
1622
1623         Reviewed by Alex Christensen.
1624
1625         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1626         (WebKit::WebIDBConnectionToClient::didRenameIndex):
1627         (WebKit::WebIDBConnectionToClient::renameIndex):
1628         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1629         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1630
1631         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1632         (WebKit::WebIDBConnectionToServer::renameIndex):
1633         (WebKit::WebIDBConnectionToServer::didRenameIndex):
1634         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1635         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
1636
1637 2016-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1638
1639         [GTK] Remove DO NOT MODIFY headers from files that are no longer autogenerated
1640         https://bugs.webkit.org/show_bug.cgi?id=163867
1641
1642         Reviewed by Darin Adler.
1643
1644         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
1645         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
1646         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttrPrivate.h:
1647         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
1648         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
1649         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlobPrivate.h:
1650         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
1651         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
1652         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASectionPrivate.h:
1653         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
1654         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
1655         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
1656         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleListPrivate.h:
1657         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRulePrivate.h:
1658         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
1659         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclarationPrivate.h:
1660         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
1661         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheetPrivate.h:
1662         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
1663         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
1664         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1665         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
1666         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterDataPrivate.h:
1667         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
1668         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
1669         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCommentPrivate.h:
1670         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
1671         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementationPrivate.h:
1672         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
1673         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
1674         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelectionPrivate.h:
1675         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
1676         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
1677         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenListPrivate.h:
1678         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
1679         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
1680         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowPrivate.h:
1681         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowUnstable.h:
1682         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
1683         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1684         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
1685         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentPrivate.h:
1686         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentUnstable.h:
1687         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h:
1688         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
1689         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
1690         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentTypePrivate.h:
1691         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentUnstable.h:
1692         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1693         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
1694         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h:
1695         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementUnstable.h:
1696         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
1697         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
1698         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventPrivate.h:
1699         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
1700         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
1701         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
1702         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
1703         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileListPrivate.h:
1704         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFilePrivate.h:
1705         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
1706         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
1707         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElementPrivate.h:
1708         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
1709         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
1710         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElementPrivate.h:
1711         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
1712         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
1713         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElementPrivate.h:
1714         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
1715         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
1716         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElementPrivate.h:
1717         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
1718         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
1719         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElementPrivate.h:
1720         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
1721         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
1722         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElementPrivate.h:
1723         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
1724         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
1725         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElementPrivate.h:
1726         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
1727         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
1728         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElementPrivate.h:
1729         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
1730         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
1731         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollectionPrivate.h:
1732         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
1733         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
1734         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElementPrivate.h:
1735         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
1736         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
1737         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElementPrivate.h:
1738         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
1739         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
1740         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElementPrivate.h:
1741         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
1742         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
1743         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocumentPrivate.h:
1744         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1745         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
1746         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementPrivate.h:
1747         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementUnstable.h:
1748         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
1749         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
1750         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElementPrivate.h:
1751         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
1752         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
1753         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElementPrivate.h:
1754         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
1755         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
1756         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElementPrivate.h:
1757         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
1758         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
1759         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElementPrivate.h:
1760         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
1761         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
1762         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElementPrivate.h:
1763         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
1764         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
1765         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElementPrivate.h:
1766         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
1767         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
1768         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElementPrivate.h:
1769         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
1770         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
1771         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElementPrivate.h:
1772         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
1773         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
1774         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElementPrivate.h:
1775         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
1776         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
1777         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElementPrivate.h:
1778         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
1779         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
1780         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElementPrivate.h:
1781         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
1782         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
1783         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElementPrivate.h:
1784         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1785         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
1786         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElementPrivate.h:
1787         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
1788         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
1789         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElementPrivate.h:
1790         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
1791         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
1792         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElementPrivate.h:
1793         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
1794         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
1795         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElementPrivate.h:
1796         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
1797         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
1798         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElementPrivate.h:
1799         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
1800         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
1801         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElementPrivate.h:
1802         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
1803         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
1804         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElementPrivate.h:
1805         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
1806         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
1807         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElementPrivate.h:
1808         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
1809         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
1810         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElementPrivate.h:
1811         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
1812         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
1813         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElementPrivate.h:
1814         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
1815         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
1816         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElementPrivate.h:
1817         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
1818         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
1819         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElementPrivate.h:
1820         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
1821         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
1822         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElementPrivate.h:
1823         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
1824         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
1825         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElementPrivate.h:
1826         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
1827         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
1828         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollectionPrivate.h:
1829         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
1830         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
1831         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElementPrivate.h:
1832         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
1833         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
1834         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElementPrivate.h:
1835         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
1836         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
1837         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElementPrivate.h:
1838         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
1839         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
1840         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
1841         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElementPrivate.h:
1842         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
1843         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
1844         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElementPrivate.h:
1845         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1846         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
1847         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElementPrivate.h:
1848         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
1849         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
1850         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElementPrivate.h:
1851         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
1852         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
1853         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElementPrivate.h:
1854         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
1855         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
1856         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElementPrivate.h:
1857         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
1858         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
1859         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElementPrivate.h:
1860         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
1861         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
1862         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElementPrivate.h:
1863         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
1864         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
1865         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElementPrivate.h:
1866         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
1867         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
1868         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElementPrivate.h:
1869         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
1870         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
1871         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElementPrivate.h:
1872         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
1873         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
1874         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElementPrivate.h:
1875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
1876         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
1877         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElementPrivate.h:
1878         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
1879         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
1880         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEventPrivate.h:
1881         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
1882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaListPrivate.h:
1883         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
1884         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
1885         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEventPrivate.h:
1886         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
1887         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
1888         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMapPrivate.h:
1889         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
1890         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
1891         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
1892         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIteratorPrivate.h:
1893         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
1894         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
1895         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeListPrivate.h:
1896         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h:
1897         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
1898         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
1899         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstructionPrivate.h:
1900         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
1901         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
1902         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangePrivate.h:
1903         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangeUnstable.h:
1904         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
1905         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
1906         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
1907         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
1908         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetListPrivate.h:
1909         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetPrivate.h:
1910         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
1911         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
1912         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTextPrivate.h:
1913         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
1914         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
1915         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalkerPrivate.h:
1916         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
1917         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
1918         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEventPrivate.h:
1919         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
1920         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
1921         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEventPrivate.h:
1922         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
1923         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
1924         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpressionPrivate.h:
1925         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolverPrivate.h:
1926         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
1927         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
1928         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResultPrivate.h:
1929         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
1930         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h:
1931         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h:
1932
1933 2016-10-23  Chris Dumez  <cdumez@apple.com>
1934
1935         Another unreviewed attempt to fix the WatchOS / TvOS build after r207585.
1936         <rdar://problem/28902292>
1937
1938         Disable USE_CFURLCONNECTION on newer WatchOS / TvOS.
1939
1940         * config.h:
1941
1942 2016-10-23  Chris Dumez  <cdumez@apple.com>
1943
1944         Unreviewed attempt to fix WatchOS / TvOS build after r207585.
1945         <rdar://problem/28902292>
1946
1947         Enable NETWORK_SESSION on those platforms.
1948
1949         * config.h:
1950
1951 2016-10-22  Dan Bernstein  <mitz@apple.com>
1952
1953         [iOS] _webViewWillEndNavigationGesture:withNavigationToBackForwardListItem: is never called
1954         https://bugs.webkit.org/show_bug.cgi?id=163758
1955
1956         Reviewed by Darin Adler.
1957
1958         * UIProcess/ios/ViewGestureControllerIOS.mm:
1959         (WebKit::ViewGestureController::beginSwipeGesture): Don’t reset the interactive update
1960           handler.
1961
1962 2016-10-21  David Kilzer  <ddkilzer@apple.com>
1963
1964         Bug 163762: IntSize::area() should used checked arithmetic
1965         <https://webkit.org/b/163762>
1966
1967         Reviewed by Darin Adler.
1968
1969         * Shared/ShareableBitmap.cpp:
1970         (WebKit::ShareableBitmap::create): Add overflow check and return
1971         nullptr on overflow.
1972         (WebKit::ShareableBitmap::createShareable): Ditto.
1973         (WebKit::ShareableBitmap::create): Change debug assert for
1974         adequate buffer size check into release check.
1975         * Shared/ShareableBitmap.h:
1976         (WebKit::ShareableBitmap::numBytesForSize): Change to return a
1977         Checked<unsigned, RecordOverflow> value.
1978         (WebKit::ShareableBitmap::sizeInBytes):
1979         * Shared/cairo/ShareableBitmapCairo.cpp:
1980         (WebKit::ShareableBitmap::numBytesForSize): Ditto.
1981         * UIProcess/API/Cocoa/WKWebView.mm:
1982         (-[WKWebView _takeViewSnapshot]): Call unsafeGet().
1983
1984 2016-10-21  Eric Carlson  <eric.carlson@apple.com>
1985
1986         [MediaStream] Dynamically generate media capture sandbox extensions
1987         https://bugs.webkit.org/show_bug.cgi?id=154861
1988         <rdar://problem/24909411>
1989
1990         Reviewed by Tim Horton.
1991
1992         * Shared/SandboxExtension.h:
1993         (WebKit::SandboxExtension::createHandleForGenericExtension):
1994         * Shared/mac/SandboxExtensionMac.mm:
1995         (WebKit::wkSandboxExtensionType): Add case for generic handle.
1996         (WebKit::SandboxExtension::createHandleForGenericExtension): New.
1997
1998         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1999         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Clear the list of extensions granted.
2000         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Extend the web 
2001           process sandbox as necessary.
2002         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2003
2004         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2005         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Revoke all
2006           sandbox extensions.
2007         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Consume
2008           sandbox extensions.
2009         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2010
2011         * WebProcess/WebPage/WebPage.cpp:
2012         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Pass-through to user media manager.
2013         * WebProcess/WebPage/WebPage.h:
2014
2015         * WebProcess/WebPage/WebPage.messages.in: Add GrantUserMediaDevicesSandboxExtension.
2016
2017         * WebProcess/com.apple.WebProcess.sb.in: Add rules, defines, and a macro to allow dynamic extensions
2018           for media capture devices.
2019
2020 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
2021
2022         WebPageProxy should not need PageActivityState
2023         https://bugs.webkit.org/show_bug.cgi?id=163821
2024
2025         Reviewed by Geoff Garen.
2026
2027         The PageActivityState is currently plumbed back from WebCore up to the UI process, to
2028         determine whether to enabled process suppression. However the information it contains
2029         (whether a page load is ongoing, whether audio is playing) is already available via
2030         other means. Remove this use of PageActivityState.
2031
2032         * UIProcess/PageLoadState.cpp:
2033         (WebKit::PageLoadState::commitChanges):
2034             - PageLoadState notifies WebPageProxy when loading state changes.
2035         * UIProcess/WebPageProxy.cpp:
2036         (WebKit::WebPageProxy::updateThrottleState):
2037             - Now relies on info from PageLoadState, setMuted, isPlayingMediaDidChange.
2038         (WebKit::WebPageProxy::setMuted):
2039         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2040             - If audio playback state changes we may need to update the throttle state.
2041         (WebKit::WebPageProxy::setPageActivityState): Deleted.
2042             - removed PageActivityState from WK2.
2043         * UIProcess/WebPageProxy.h:
2044         (WebKit::WebPageProxy::isLoadingChanged):
2045             - PageLoadState notifies WebPageProxy when loading state changes.
2046         * UIProcess/WebPageProxy.messages.in:
2047             - removed PageActivityState from WK2.
2048         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2049         (WebKit::WebChromeClient::setPageActivityState): Deleted.
2050             - removed PageActivityState from WK2.
2051         * WebProcess/WebCoreSupport/WebChromeClient.h:
2052             - removed PageActivityState from WK2.
2053         * WebProcess/WebPage/WebPage.cpp:
2054         (WebKit::WebPage::setPageActivityState): Deleted.
2055             - removed PageActivityState from WK2.
2056         * WebProcess/WebPage/WebPage.h:
2057             - removed PageActivityState from WK2.
2058
2059 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
2060
2061         WebPage should take UserActivity directly for user input
2062         https://bugs.webkit.org/show_bug.cgi?id=163813
2063
2064         Reviewed by Anders Carlsson.
2065
2066         When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
2067         via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
2068
2069         Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
2070         isn't really achieving the desired effect. The page setting the flag in the throttler to get
2071         the activity to be set is now a less effective way of achieving this goal, since the
2072         PageActivityState bounces back across to the UI process & then messages back to the WebContent
2073         process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
2074         from the initial message isn't lost.
2075
2076         * WebProcess/WebPage/WebPage.cpp:
2077         (WebKit::m_userActivityHysteresis):
2078             - m_userActivityHysteresis triggers updateUserActivity.
2079         (WebKit::WebPage::setPageSuppressed):
2080             - setPageSuppressed starts/stops m_userActivityHysteresis.
2081         (WebKit::WebPage::updateUserActivity):
2082             - update UserActivity based on state of m_userActivityHysteresis.
2083         (WebKit::WebPage::mouseEvent):
2084         (WebKit::WebPage::wheelEvent):
2085         (WebKit::WebPage::keyEvent):
2086             - input events impulse m_userActivityHysteresis.
2087         * WebProcess/WebPage/WebPage.h:
2088
2089 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2090
2091         Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
2092         https://bugs.webkit.org/show_bug.cgi?id=163460
2093         <rdar://problem/28784142>
2094
2095         Reviewed by Darin Adler.
2096
2097         Handle new EditAction types for inserting/deleting pending/final compositions.
2098
2099         * UIProcess/WebEditCommandProxy.cpp:
2100         (WebKit::WebEditCommandProxy::nameForEditAction):
2101
2102 2016-10-21  Jeremy Jones  <jeremyj@apple.com>
2103
2104         Implement basic pointer lock behavior for WebKit and WebKit2.
2105         https://bugs.webkit.org/show_bug.cgi?id=162745
2106
2107         Reviewed by Simon Fraser.
2108
2109         Enable basic pointer lock functionality by plumbing requests through WebPage IPC.
2110         Pass through mouse movement deltas.
2111         Unlock pointer when view is no longer visible.
2112
2113         * Shared/WebEventConversion.cpp:
2114         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): Pass along mouse movement.
2115         * UIProcess/WebPageProxy.cpp:
2116         (WebKit::WebPageProxy::dispatchViewStateChange): Unlock pointer when page is not visible.
2117         (WebKit::WebPageProxy::requestPointerLock): Hide and disassociate pointer.
2118         (WebKit::WebPageProxy::requestPointerUnlock): Show and associate pointer.
2119         * UIProcess/WebPageProxy.h:
2120         * UIProcess/WebPageProxy.messages.in: Add methods.
2121         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2122         (WebKit::WebChromeClient::requestPointerLock): Pass along to web page.
2123         (WebKit::WebChromeClient::requestPointerUnlock): Ditto.
2124         * WebProcess/WebCoreSupport/WebChromeClient.h:
2125         * WebProcess/WebPage/WebPage.cpp:
2126         (WebKit::WebPage::didAcquirePointerLock): Forward to PointerLockController.
2127         (WebKit::WebPage::didNotAcquirePointerLock): Ditto.
2128         (WebKit::WebPage::didLosePointerLock): Ditto.
2129         * WebProcess/WebPage/WebPage.h:
2130         * WebProcess/WebPage/WebPage.messages.in: Add methods.
2131
2132 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2133
2134         Implement InputEvent.getTargetRanges() for the input events spec
2135         https://bugs.webkit.org/show_bug.cgi?id=162947
2136         <rdar://problem/28853079>
2137
2138         Reviewed by Darin Adler.
2139
2140         Boilerplate change to add a runtime guard for InputEvents-related IDL interfaces. See WebCore ChangeLog entry
2141         for more details.
2142
2143         * WebProcess/WebPage/WebPage.cpp:
2144         (WebKit::WebPage::updatePreferences):
2145
2146 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2147
2148         [GTK] Configures but fails to link with ENABLE_OPENGL=OFF
2149         https://bugs.webkit.org/show_bug.cgi?id=163449
2150
2151         Reviewed by Michael Catanzaro.
2152
2153         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2154         (webkitWebViewBaseRealize): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER and also ensure the current
2155         display is X11.
2156         (webkitWebViewBaseUnrealize): Ditto.
2157         (webkitWebViewBaseDidRelaunchWebProcess): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
2158         (webkitWebViewBasePageClosed): Ditto.
2159         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2160         (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): Ditto.
2161         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): Check EGL is enabled before
2162         trying to use the WaylandCompositor.
2163         * UIProcess/AcceleratedDrawingAreaProxy.h:
2164         * UIProcess/WebProcessPool.cpp:
2165         (WebKit::WebProcessPool::createNewWebProcess): Ditto.
2166         * UIProcess/gtk/AcceleratedBackingStore.cpp:
2167         (WebKit::AcceleratedBackingStore::create): Ditto.
2168         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2169         * UIProcess/gtk/WaylandCompositor.cpp:
2170         * UIProcess/gtk/WaylandCompositor.h:
2171         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2172         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
2173         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2174         * WebProcess/WebPage/DrawingArea.h:
2175         * WebProcess/WebPage/DrawingArea.messages.in:
2176         * WebProcess/WebPage/LayerTreeHost.h:
2177
2178 2016-10-20  Chris Dumez  <cdumez@apple.com>
2179
2180         "Download Linked File" context menu action should use 'download' attribute as suggested filename
2181         https://bugs.webkit.org/show_bug.cgi?id=163742
2182         <rdar://problem/28840734>
2183
2184         Reviewed by Darin Adler.
2185
2186         Update "Download Linked File" context menu action to use the anchor
2187         element's 'download' attribute as suggested filename for the download.
2188
2189         * NetworkProcess/NetworkProcess.cpp:
2190         (WebKit::NetworkProcess::downloadRequest):
2191         * NetworkProcess/NetworkProcess.h:
2192         * NetworkProcess/NetworkProcess.messages.in:
2193         * Shared/WebHitTestResultData.cpp:
2194         (WebKit::WebHitTestResultData::WebHitTestResultData):
2195         (WebKit::WebHitTestResultData::encode):
2196         (WebKit::WebHitTestResultData::decode):
2197         * Shared/WebHitTestResultData.h:
2198         * UIProcess/WebPageProxy.cpp:
2199         (WebKit::WebPageProxy::contextMenuItemSelected):
2200         * UIProcess/WebProcessPool.cpp:
2201         (WebKit::WebProcessPool::download):
2202         * UIProcess/WebProcessPool.h:
2203         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2204         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
2205
2206 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
2207
2208         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
2209         https://bugs.webkit.org/show_bug.cgi?id=163374
2210
2211         Reviewed by Darin Adler.
2212
2213         * Configurations/FeatureDefines.xcconfig:
2214
2215 2016-10-20  Brady Eidson  <beidson@apple.com>
2216
2217         IndexedDB 2.0: Support IDBObjectStore name assignment.
2218         <rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
2219
2220         Reviewed by Alex Christensen.
2221
2222         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2223         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
2224         (WebKit::WebIDBConnectionToClient::renameObjectStore):
2225         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2226         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2227
2228         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2229         (WebKit::WebIDBConnectionToServer::renameObjectStore):
2230         (WebKit::WebIDBConnectionToServer::didRenameObjectStore):
2231         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2232         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2233
2234 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2235
2236         [GTK] Avoid strstr() when checking (E)GL extensions
2237         https://bugs.webkit.org/show_bug.cgi?id=161958
2238
2239         Reviewed by Žan Doberšek.
2240
2241         Use GLContext::isExtensionSupported() instead of strstr().
2242
2243         * UIProcess/gtk/WaylandCompositor.cpp:
2244         (WebKit::WaylandCompositor::initializeEGL):
2245
2246 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2247
2248         Wrong use of EGL_DEPTH_SIZE
2249         https://bugs.webkit.org/show_bug.cgi?id=155536
2250
2251         Reviewed by Michael Catanzaro.
2252
2253         Use XErrorTrapper class instead of the custom XErrorHandler.
2254
2255         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2256         (WebKit::PluginProcessMainUnix):
2257
2258 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2259
2260         [SOUP] Add NetworkSession implementation and switch to use it
2261         https://bugs.webkit.org/show_bug.cgi?id=163597
2262
2263         Reviewed by Alex Christensen.
2264
2265         Basically move the ResourceHandle implementation to the network process, but modernized, cleaned up, and adapted
2266         to the NetworkSession model.
2267
2268         * CMakeLists.txt: Add new files to compilation.
2269         * NetworkProcess/Downloads/Download.cpp:
2270         (WebKit::Download::Download): Use the same code for all ports using NetworkSession and add missing
2271         initialization of m_sessionID.
2272         * NetworkProcess/Downloads/Download.h:
2273         (WebKit::Download::Download): Define PlatformDownloadTaskRef on every platform to make the constructor common to
2274         all ports using NetworkSession.
2275         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
2276         (WebKit::Download::cancelNetworkLoad):
2277         (WebKit::Download::platformDidFinish):
2278         * NetworkProcess/NetworkDataTask.h:
2279         (WebKit::NetworkDataTask::pendingDownloadID): Make const.
2280         (WebKit::NetworkDataTask::pendingDownload): Ditto.
2281         (WebKit::NetworkDataTask::pendingDownloadLocation): Ditto.
2282         (WebKit::NetworkDataTask::isDownload): Helper to check if the task is a download.
2283         * NetworkProcess/NetworkLoad.cpp:
2284         (WebKit::NetworkLoad::didReceiveResponseNetworkSession): Use NetworkDataTask::isDownload().
2285         * NetworkProcess/NetworkProcess.cpp:
2286         (WebKit::NetworkProcess::NetworkProcess): NetworkSession::setCustomProtocolManager() is Cocoa only.
2287         * NetworkProcess/NetworkSession.h:
2288         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2289         (WebKit::NetworkSession::networkStorageSession): Make const.
2290         * NetworkProcess/soup/NetworkDataTaskSoup.cpp: Added.
2291         (WebKit::NetworkDataTask::NetworkDataTask):
2292         (WebKit::NetworkDataTask::~NetworkDataTask):
2293         (WebKit::NetworkDataTask::scheduleFailure):
2294         (WebKit::NetworkDataTask::failureTimerFired):
2295         (WebKit::NetworkDataTask::suggestedFilename):
2296         (WebKit::NetworkDataTask::setSuggestedFilename):
2297         (WebKit::NetworkDataTask::setPendingDownloadLocation):
2298         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost):
2299         (WebKit::NetworkDataTask::createRequest):
2300         (WebKit::NetworkDataTask::clearRequest):
2301         (WebKit::NetworkDataTask::resume):
2302         (WebKit::NetworkDataTask::suspend):
2303         (WebKit::NetworkDataTask::cancel):
2304         (WebKit::NetworkDataTask::invalidateAndCancel):
2305         (WebKit::NetworkDataTask::state):
2306         (WebKit::NetworkDataTask::timeoutFired):
2307         (WebKit::NetworkDataTask::startTimeout):
2308         (WebKit::NetworkDataTask::stopTimeout):
2309         (WebKit::NetworkDataTask::sendRequestCallback):
2310         (WebKit::NetworkDataTask::didSendRequest):
2311         (WebKit::NetworkDataTask::didReceiveResponse):
2312         (WebKit::NetworkDataTask::tlsErrorsChangedCallback):
2313         (WebKit::NetworkDataTask::tlsErrorsChanged):
2314         (WebKit::NetworkDataTask::applyAuthenticationToRequest):
2315         (WebKit::NetworkDataTask::authenticateCallback):
2316         (WebKit::isAuthenticationFailureStatusCode):
2317         (WebKit::NetworkDataTask::authenticate):
2318         (WebKit::NetworkDataTask::continueAuthenticate):
2319         (WebKit::NetworkDataTask::skipInputStreamForRedirectionCallback):
2320         (WebKit::NetworkDataTask::skipInputStreamForRedirection):
2321         (WebKit::NetworkDataTask::didFinishSkipInputStreamForRedirection):
2322         (WebKit::shouldRedirectAsGET):
2323         (WebKit::NetworkDataTask::shouldStartHTTPRedirection):
2324         (WebKit::NetworkDataTask::continueHTTPRedirection):
2325         (WebKit::NetworkDataTask::readCallback):
2326         (WebKit::NetworkDataTask::read):
2327         (WebKit::NetworkDataTask::didRead):
2328         (WebKit::NetworkDataTask::didFinishRead):
2329         (WebKit::NetworkDataTask::requestNextPartCallback):
2330         (WebKit::NetworkDataTask::requestNextPart):
2331         (WebKit::NetworkDataTask::didRequestNextPart):
2332         (WebKit::NetworkDataTask::didFinishRequestNextPart):
2333         (WebKit::NetworkDataTask::gotHeadersCallback):
2334         (WebKit::NetworkDataTask::didGetHeaders):
2335         (WebKit::NetworkDataTask::wroteBodyDataCallback):
2336         (WebKit::NetworkDataTask::didWriteBodyData):
2337         (WebKit::NetworkDataTask::download):
2338         (WebKit::NetworkDataTask::writeDownloadCallback):
2339         (WebKit::NetworkDataTask::writeDownload):
2340         (WebKit::NetworkDataTask::didWriteDownload):
2341         (WebKit::NetworkDataTask::didFinishDownload):
2342         (WebKit::NetworkDataTask::didFailDownload):
2343         (WebKit::NetworkDataTask::cleanDownloadFiles):
2344         (WebKit::NetworkDataTask::didFail):
2345         (WebKit::NetworkDataTask::networkEventCallback):
2346         (WebKit::NetworkDataTask::networkEvent):
2347         (WebKit::NetworkDataTask::startingCallback):
2348         (WebKit::NetworkDataTask::requestStartedCallback):
2349         (WebKit::NetworkDataTask::didStartRequest):
2350         (WebKit::NetworkDataTask::restartedCallback):
2351         (WebKit::NetworkDataTask::didRestart):
2352         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2353         (WebKit::NetworkSession::create):
2354         (WebKit::NetworkSession::defaultSession):
2355         (WebKit::NetworkSession::networkStorageSession):
2356         (WebKit::NetworkSession::NetworkSession):
2357         (WebKit::NetworkSession::~NetworkSession):
2358         (WebKit::NetworkSession::soupSession):
2359         (WebKit::NetworkSession::invalidateAndCancel):
2360         (WebKit::NetworkSession::clearCredentials):
2361         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
2362         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Add implementation matching
2363         WebFrameNetworkingContext::ensurePrivateBrowsingSession().
2364         (WebKit::RemoteNetworkingContext::storageSession): Do not always return the default session if the given one is
2365         in the global map.
2366         * PlatformEfl.cmake: Ad new files to compilation.
2367         * PlatformGTK.cmake: Ditto.
2368         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2369         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Also create a NetworkSession.
2370         * config.h: Enable NetworkSession unconditionally for Soup based ports.
2371
2372 2016-10-19  Alex Christensen  <achristensen@webkit.org>
2373
2374         Revert r207151
2375         https://bugs.webkit.org/show_bug.cgi?id=163675
2376
2377         Reviewed by Brent Fulgham.
2378
2379         * NetworkProcess/Downloads/Download.h:
2380         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2381         * NetworkProcess/NetworkLoad.h:
2382         * NetworkProcess/mac/NetworkLoadMac.mm:
2383         (WebKit::NetworkLoad::willCacheResponseAsync):
2384         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2385         (WebKit::AuthenticationManager::receivedCredential):
2386         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2387         (WebKit::AuthenticationManager::receivedCancellation):
2388         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2389         (WebKit::AuthenticationManager::receivedChallengeRejection):
2390         * Shared/WebProcessCreationParameters.cpp:
2391         (WebKit::WebProcessCreationParameters::encode):
2392         (WebKit::WebProcessCreationParameters::decode):
2393         * Shared/WebProcessCreationParameters.h:
2394         * Shared/mac/WebCoreArgumentCodersMac.mm:
2395         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2396         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2397         * WebKit2.xcodeproj/project.pbxproj:
2398
2399 2016-10-19  Chris Dumez  <cdumez@apple.com>
2400
2401         [WK2] Expose suggested filename via WKBundleHitTestResult API
2402         https://bugs.webkit.org/show_bug.cgi?id=163693
2403         <rdar://problem/28840734>
2404
2405         Reviewed by Anders Carlsson.
2406
2407         Expose suggested filename via WKBundleHitTestResult API. The implementation
2408         currently relies on the 'download' attribute on anchor / area elements
2409         that we recently started supporting.
2410
2411         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
2412         (WKBundleHitTestResultCopyLinkSuggestedFilename):
2413         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
2414         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2415         (WebKit::InjectedBundleHitTestResult::create):
2416         (WebKit::InjectedBundleHitTestResult::mediaType):
2417         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
2418         (WebKit::InjectedBundleHitTestResult::imageRect):
2419         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
2420
2421 2016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
2422
2423         Unreviewed, rolling out r207557.
2424
2425         This change caused animations/font-variations tests to time
2426         out on pre-Sierra Macs.
2427
2428         Reverted changeset:
2429
2430         "[macOS] [iOS] Disable variation fonts on macOS El Capitan and
2431         iOS 9"
2432         https://bugs.webkit.org/show_bug.cgi?id=163374
2433         http://trac.webkit.org/changeset/207557
2434
2435 2016-10-19  Andy Estes  <aestes@apple.com>
2436
2437         Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
2438         https://bugs.webkit.org/show_bug.cgi?id=163476
2439         <rdar://problem/26941395>
2440
2441         Reviewed by Andreas Kling.
2442
2443         When custom content providers are registered and a response has a null MIME type, WebPage
2444         will pass a null String to HashSet::contains(). This results in a null pointer dereference,
2445         since the String hash functions do not support null Strings and unconditionally dereference
2446         their StringImpls. Fixed by checking that Strings are non-null before calling
2447         HashSet::contains() on m_mimeTypesWithCustomContentProviders.
2448
2449         New API test: WebKit2.LoadDataWithNilMIMEType.
2450
2451         * WebProcess/WebPage/WebPage.cpp:
2452         (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Checked if mimeType is null
2453         before calling m_mimeTypesWithCustomContentProviders.contains().
2454         (WebKit::WebPage::canShowMIMEType): Ditto.
2455         * WebProcess/WebPage/WebPage.h: Made private the declaration of canPluginHandleResponse().
2456
2457 2016-10-19  Chris Dumez  <cdumez@apple.com>
2458
2459         Move HTML Interactive Form Validation behind an experimental flag
2460         https://bugs.webkit.org/show_bug.cgi?id=163673
2461
2462         Reviewed by Daniel Bates.
2463
2464         Move HTML Interactive Form Validation behind an experimental feature flag
2465         and disable by default until by have a better UI.
2466
2467         * Shared/WebPreferencesDefinitions.h:
2468         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2469         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2470
2471 2016-10-19  Damian Kaleta  <dkaleta@apple.com>
2472
2473         https://bugs.webkit.org/show_bug.cgi?id=163292
2474
2475         Reviewed by Brady Eidson.
2476         
2477         Added ability to display context menu asynchronously.
2478
2479         * Shared/API/APIObject.h: Added ContextMenuListener.
2480         * Shared/API/c/WKBase.h: Added WKContextMenuListenerRef struct.
2481         * UIProcess/API/APIContextMenuClient.h:
2482         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): New method that allows showing context menu asynchronously.
2483         * UIProcess/API/C/WKAPICast.h: Added a new mapping for WebContextMenuListenerProxy.
2484         * UIProcess/API/C/WKContextMenuListener.cpp: Added. New class that allow a client to return results asynchronously.
2485         (WKContextMenuListenerGetTypeID):
2486         (WKContextMenuListenerUseContextMenuItems):
2487         * UIProcess/API/C/WKContextMenuListener.h: Added.
2488         * UIProcess/API/C/WKPage.cpp: Added WKPageContextMenuClientV4.
2489         (WKPageSetPageContextMenuClient):
2490         * UIProcess/API/C/WKPageContextMenuClient.h:
2491         * UIProcess/WebContextMenuListenerProxy.cpp: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h.
2492         (WebKit::WebContextMenuListenerProxy::WebContextMenuListenerProxy):
2493         (WebKit::WebContextMenuListenerProxy::~WebContextMenuListenerProxy):
2494         (WebKit::WebContextMenuListenerProxy::useContextMenuItems): Passes items to m_contextMenuMac.
2495         (WebKit::WebContextMenuListenerProxy::invalidate):
2496         * UIProcess/WebContextMenuListenerProxy.h: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h.
2497         (WebKit::WebContextMenuListenerProxy::create):
2498         * UIProcess/mac/WebContextMenuProxyMac.h:
2499         * UIProcess/mac/WebContextMenuProxyMac.mm:
2500         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): Shows context menu.
2501         (WebKit::WebContextMenuProxyMac::showContextMenu): Extracted some logic to showContextMenuWithItems().
2502         * WebKit2.xcodeproj/project.pbxproj:
2503
2504 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
2505
2506         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
2507         https://bugs.webkit.org/show_bug.cgi?id=163374
2508
2509         Reviewed by Darin Adler.
2510
2511         * Configurations/FeatureDefines.xcconfig:
2512
2513 2016-10-19  Darin Adler  <darin@apple.com>
2514
2515         Move XPath from ExceptionCode to Exception
2516         https://bugs.webkit.org/show_bug.cgi?id=163656
2517
2518         Reviewed by Chris Dumez.
2519
2520         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2521         (webkit_dom_document_create_expression): Use ExceptionOr.
2522         (webkit_dom_document_evaluate): Ditto.
2523         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2524         (webkit_dom_xpath_expression_evaluate): Ditto.
2525         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2526         (webkit_dom_xpath_result_iterate_next): Ditto.
2527         (webkit_dom_xpath_result_snapshot_item): Ditto.
2528         (webkit_dom_xpath_result_get_number_value): Ditto.
2529         (webkit_dom_xpath_result_get_string_value): Ditto.
2530         (webkit_dom_xpath_result_get_boolean_value): Ditto.
2531         (webkit_dom_xpath_result_get_single_node_value): Ditto.
2532         (webkit_dom_xpath_result_get_snapshot_length): Ditto.
2533
2534 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2535
2536         NetworkSession: updatedRequest parameter of NetworkProcess::findPendingDownloadLocation is unused since r206988
2537         https://bugs.webkit.org/show_bug.cgi?id=163588
2538
2539         Reviewed by Alex Christensen.
2540
2541         The parameter was used only for the DownloadProxy::DidStart message that is no longer sent from
2542         findPendingDownloadLocation since r206988.
2543
2544         * NetworkProcess/NetworkDataTask.h:
2545         (WebKit::NetworkDataTask::currentRequest): Removed since it's unused now.
2546         * NetworkProcess/NetworkLoad.cpp:
2547         (WebKit::NetworkLoad::convertTaskToDownload): Update the m_currentRequest and pass it to DidStart message.
2548         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2549         * NetworkProcess/NetworkProcess.cpp:
2550         (WebKit::NetworkProcess::findPendingDownloadLocation):
2551         * NetworkProcess/NetworkProcess.h:
2552         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Remove currentRequest() implementation.
2553
2554 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2555
2556         Unreviewed. Fix GTK+ build after r207522.
2557
2558         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2559         (webkit_dom_dom_window_webkit_message_handlers_post_message): Use new exceptions.
2560
2561 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2562
2563         Unreviewed. Fix GTK+ build after r207497.
2564
2565         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2566         (webkit_dom_html_select_element_add): Update implementation since add() now takes a Variant.
2567
2568 2016-10-18  Simon Fraser  <simon.fraser@apple.com>
2569
2570         Add a MiniBrowser menu item to apply page scale in WK1 and WK2
2571         https://bugs.webkit.org/show_bug.cgi?id=163627
2572
2573         Reviewed by Dean Jackson.
2574
2575         New SPI to set and retrieve page scale.
2576
2577         * UIProcess/API/Cocoa/WKWebView.mm:
2578         (-[WKWebView _setPageScale:withOrigin:]):
2579         (-[WKWebView _pageScale]):
2580         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2581
2582 2016-10-18  Dean Jackson  <dino@apple.com>
2583
2584         Remove CSS_SHAPES feature definition. This should always be on.
2585         https://bugs.webkit.org/show_bug.cgi?id=163628
2586         <rdar://problem/28834613>
2587
2588         Reviewed by Tim Horton.
2589
2590         * Configurations/FeatureDefines.xcconfig:
2591
2592 2016-10-18  Ryan Haddad  <ryanhaddad@apple.com>
2593
2594         Unreviewed, rolling out r207413.
2595
2596         This change broke iOS builds.
2597
2598         Reverted changeset:
2599
2600         "[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to
2601         _UIWebTouchPoint.majorRadiusInScreenCoordinates"
2602         https://bugs.webkit.org/show_bug.cgi?id=163547
2603         http://trac.webkit.org/changeset/207413
2604
2605 2016-10-18  Commit Queue  <commit-queue@webkit.org>
2606
2607         Unreviewed, rolling out r207443.
2608         https://bugs.webkit.org/show_bug.cgi?id=163616
2609
2610         "Caused 5% PLT regression" (Requested by krollin on #webkit).
2611
2612         Reverted changeset:
2613
2614         "Crash in ASCIICaseInsensitiveHash::hash() when a response has
2615         a null MIME type"
2616         https://bugs.webkit.org/show_bug.cgi?id=163476
2617         http://trac.webkit.org/changeset/207443
2618
2619 2016-10-18  Megan Gardner  <megan_gardner@apple.com>
2620
2621         Fix build for platforms where HAVE(LINK_PREVIEW) is false
2622         https://bugs.webkit.org/show_bug.cgi?id=163607
2623
2624         Reviewed by Tim Horton.
2625
2626         Added needed # for link preview
2627
2628         * UIProcess/ios/WKContentViewInteraction.mm:
2629         (-[WKContentView _contentsOfUserInterfaceItem:]):
2630
2631 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
2632
2633         Remote Web Inspector: Timeline UI not updating while recording
2634         https://bugs.webkit.org/show_bug.cgi?id=163582
2635         <rdar://problem/28766837>
2636
2637         Reviewed by Timothy Hatcher.
2638
2639         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
2640         (WebKit::RemoteWebInspectorUI::frontendLoaded):
2641         Local inspector windows keep the web view alive and toggle the
2642         WebInspector.visible state depending on whether or not an inspector is
2643         open. Remote Inspector windows go away when closed, so they can always
2644         be marked as open. This matches earlier remote inspector behavior.
2645
2646 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
2647
2648         [MediaStream] Resolve constraints and enumerate devices in the UI process
2649         https://bugs.webkit.org/show_bug.cgi?id=162147
2650         <rdar://problem/28803569>
2651
2652         Reviewed by Darin Adler.
2653         
2654         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
2655         access happens in the UI process.
2656
2657         * Scripts/webkit/messages.py:
2658         (headers_for_type): Special case MediaConstraintsData.
2659
2660         * Shared/WebCoreArgumentCoders.cpp:
2661         (IPC::encodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap encoder.
2662         (IPC::ArgumentCoder<MediaConstraintsData>::encode): MediaConstraintsData encoder.
2663         (IPC::decodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap decoder.
2664         (IPC::ArgumentCoder<MediaConstraintsData>::decode): MediaConstraintsData decoder.
2665         (IPC::ArgumentCoder<CaptureDevice>::encode): CaptureDevice enoder.
2666         (IPC::ArgumentCoder<CaptureDevice>::decode): CaptureDevice decoder.
2667         * Shared/WebCoreArgumentCoders.h:
2668
2669         * UIProcess/API/APIUIClient.h:  Remove UserMediaPermissionCheckProxy forward declaration.
2670
2671         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
2672         (toWK): Translate UserMediaPermissionRequestDenialReason to UserMediaAccessDenialReason.
2673         (WKUserMediaPermissionRequestDeny): Add "reason" parameter.
2674         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
2675
2676         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2677         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Invalidate pending device requests.
2678         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Make private.
2679         (WebKit::toWebCore): Map from UserMediaAccessDenialReason to MediaAccessDenialReason, cast to
2680           uint64_t to pass to web process.
2681         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest): Send to web process.
2682         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
2683         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Validate
2684           constraints and make sure gUM is enabled before prompting user.
2685         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): New.
2686         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Send 
2687           results of device enumeration to web process.
2688         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
2689         (WebKit::UserMediaPermissionRequestManagerProxy::createUserMediaPermissionCheck): Deleted.
2690         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2691
2692         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2693         (WebKit::UserMediaPermissionRequestProxy::allow):
2694         (WebKit::UserMediaPermissionRequestProxy::deny): Take "reason" parameter.
2695         * UIProcess/UserMediaPermissionRequestProxy.h:
2696
2697         * UIProcess/WebPageProxy.cpp:
2698         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2699         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2700         (WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Deleted.
2701         * UIProcess/WebPageProxy.h:
2702         * UIProcess/WebPageProxy.messages.in:
2703
2704         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2705         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): userMediaAccessDenied -> deny.
2706           Pass the audio and video constraints to the UI process.
2707         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): 
2708         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
2709         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Send the enumeration request
2710           to the UI process.
2711         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
2712         (WebKit::UserMediaPermissionRequestManager::didCompleteMediaDeviceEnumeration):
2713         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): Deleted.
2714         (WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Deleted.
2715         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaPermissionCheck): Deleted.
2716         (WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Deleted.
2717         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2718
2719         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
2720         (WebKit::WebUserMediaClient::enumerateMediaDevices): New.
2721         (WebKit::WebUserMediaClient::cancelMediaDevicesEnumerationRequest): New.
2722         (WebKit::WebUserMediaClient::checkUserMediaPermission): Deleted.
2723         (WebKit::WebUserMediaClient::cancelUserMediaPermissionCheck): Deleted.
2724         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
2725
2726         * WebProcess/WebPage/WebPage.cpp:
2727         (WebKit::WebPage::userMediaAccessWasGranted): New.
2728         (WebKit::WebPage::userMediaAccessWasDenied): Ditto.
2729         (WebKit::WebPage::didCompleteMediaDeviceEnumeration):
2730         (WebKit::WebPage::didReceiveUserMediaPermissionDecision): Deleted.
2731         (WebKit::WebPage::didCompleteUserMediaPermissionCheck): Deleted.
2732         * WebProcess/WebPage/WebPage.h:
2733         * WebProcess/WebPage/WebPage.messages.in:
2734
2735 2016-10-17  Antti Koivisto  <antti@apple.com>
2736
2737         Rename setNeedsStyleRecalc to invalidateStyle
2738         https://bugs.webkit.org/show_bug.cgi?id=163542
2739
2740         Reviewed by Darin Adler.
2741
2742         * WebProcess/Plugins/PluginView.cpp:
2743         (WebKit::PluginView::didInitializePlugin):
2744         (WebKit::PluginView::pluginProcessCrashed):
2745
2746 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2747
2748         NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination
2749         https://bugs.webkit.org/show_bug.cgi?id=163545
2750
2751         Reviewed by Alex Christensen.
2752
2753         If a download started by DownloadManager::startDownload() is cancelled before
2754         DownloadManager::willDecidePendingDownloadDestination() is called, DownloadManager::cancelDownload() does
2755         nothing, because the Download hasn't been created yet and m_downloadsWaitingForDestination map doesn't contain
2756         the download ID, and the PendingDownload is never removed from the m_pendingDownloads map.
2757
2758         * NetworkProcess/Downloads/DownloadManager.cpp:
2759         (WebKit::DownloadManager::cancelDownload): Always take the PendingDownload from m_pendingDownloads map. Then, if
2760         the download was already in m_downloadsWaitingForDestination map, get the network data task to properly cancel
2761         it and then call the completion handler to ignore the request. Otherwise cancel the pending download if exists.
2762         * NetworkProcess/Downloads/PendingDownload.cpp:
2763         (WebKit::PendingDownload::cancel): Cancel the network load and notify the UI process that the download was canceled.
2764         * NetworkProcess/Downloads/PendingDownload.h:
2765
2766 2016-10-17  Megan Gardner  <megan_gardner@apple.com>
2767
2768         Add test and infrastructure for link popover
2769         https://bugs.webkit.org/show_bug.cgi?id=163406
2770
2771         Reviewed by Simon Fraser.
2772
2773         Add infrastructure to see when a link popover appears, and what URL it has loaded.
2774
2775         * UIProcess/API/Cocoa/WKWebView.mm:
2776         (-[WKWebView didShowForcePressPreview]):
2777         (-[WKWebView didDismissForcePressPreview]):
2778         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2779         * UIProcess/ios/WKContentViewInteraction.mm:
2780         (-[WKContentView _contentsOfUserInterfaceItem:]):
2781         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
2782         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
2783         (-[WKContentView _previewItemControllerDidCancelPreview:]):
2784
2785 2016-10-17  Tim Horton  <timothy_horton@apple.com>
2786
2787         REGRESSION (r169805): WKWebView canGoBack returning YES when nothing is in the back-forward list after restoring session state
2788         https://bugs.webkit.org/show_bug.cgi?id=163573
2789         <rdar://problem/28744549>
2790
2791         Reviewed by Dan Bernstein.
2792
2793         * UIProcess/WebPageProxy.cpp:
2794         (WebKit::WebPageProxy::restoreFromSessionState):
2795         Update PageLoadState's canGoBack/canGoForward bits when restoring from
2796         session state, because in the don't-navigate case, nothing else will make this happen,
2797         and it will remain stale.
2798
2799 2016-10-17  Andy Estes  <aestes@apple.com>
2800
2801         Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
2802         https://bugs.webkit.org/show_bug.cgi?id=163476
2803         <rdar://problem/26941395>
2804
2805         Reviewed by Tim Horton.
2806
2807         When custom content providers are registered and a response has a null MIME type, WebPage
2808         will pass a null String to HashSet::contains(). This results in a null pointer dereference,
2809         since the String hash functions do not support null Strings and unconditionally dereference
2810         their StringImpls. Fixed by checking that Strings are non-null before calling
2811         HashSet::contains() on m_mimeTypesWithCustomContentProviders.
2812
2813         Rearranging WebPage::shouldUseCustomContentProviderForResponse() to call
2814         canPluginHandleResponse() before checking m_mimeTypesWithCustomContentProviders uncovered a
2815         crash in existing layout tests where WebPage::m_mainFrame can be NULL during WebPage
2816         construction (m_mainFrame isn't yet initialized). Fixed this by passing the main Frame to
2817         canPluginHandleResponseInFrame() instead of relying on m_mainFrame.
2818
2819         New API test: WebKit2.LoadDataWithNilMIMEType.
2820
2821         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2822         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): Passed
2823         m_frame->coreFrame() to shouldUseCustomContentProviderForResponse().
2824         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Ditto.
2825         * WebProcess/WebPage/WebPage.cpp:
2826         (WebKit::WebPage::canPluginHandleResponse): Added a mainFrame parameter and used it instead
2827         of m_mainFrame->coreFrame().
2828         (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Passed mainFrame to
2829         canPluginHandleResponse(), and checked if mimeType is null before calling
2830         m_mimeTypesWithCustomContentProviders.contains().
2831         (WebKit::WebPage::canShowMIMEType): Checked if MIMEType is null before calling
2832         m_mimeTypesWithCustomContentProviders.contains().
2833         * WebProcess/WebPage/WebPage.h: Made canPluginHandleResponse() a private declaration.
2834
2835 2016-10-17  Chris Dumez  <cdumez@apple.com>
2836
2837         [WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
2838         https://bugs.webkit.org/show_bug.cgi?id=163569
2839         <rdar://problem/28810836>
2840
2841         Reviewed by Antti Koivisto.
2842
2843         PendingFrameLoad objects are created to track frame loads and added to
2844         the m_pendingFrameLoads hash map. These objects are supposed to remove
2845         themselves from the hash map once they detect that the page load has
2846         finished by calling PendingFrameLoad::m_loadCompletionHandler().
2847
2848         PendingFrameLoad::m_loadCompletionHandler() is called from
2849         markLoadAsCompleted() when we detect that the page load has finished
2850         via the m_loadHysteresisActivity HysteresisActivity. We call impulse()
2851         on the HysteresisActivity every time a subresource is loaded in the
2852         frame. The issue is that if no subresource is ever loaded, then we
2853         never call impulse() on the HysteresisActivity, which is therefore
2854         never started. If it nevers starts, then it nevers stops and never
2855         calls markLoadAsCompleted(). To address the problem, we now call
2856         impulse() on the HysteresisActivity as soon as we construct it.
2857
2858         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2859
2860 2016-10-17  Jeremy Jones  <jeremyj@apple.com>
2861
2862         Enable keyboard in fullscreen.
2863         https://bugs.webkit.org/show_bug.cgi?id=163146
2864
2865         Reviewed by Jer Noble.
2866
2867         Allow keyboard in fullscreen.
2868
2869         * UIProcess/WebFullScreenManagerProxy.cpp:
2870         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
2871
2872 2016-10-17  Chris Dumez  <cdumez@apple.com>
2873
2874         Move form.reportValidity() behind InteractiveFormValidation setting
2875         https://bugs.webkit.org/show_bug.cgi?id=163550
2876
2877         Reviewed by Darin Adler.
2878
2879         Enable InteractiveFormValidation setting by default and link it to
2880         RuntimeEnabledFeatures so we can use it in the IDL.
2881
2882         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2883         * WebProcess/WebPage/WebPage.cpp:
2884         (WebKit::WebPage::updatePreferences):
2885
2886 2016-10-17  Gavin Barraclough  <barraclough@apple.com>
2887
2888         UIProcess should determine throttle state for WebContent process
2889         https://bugs.webkit.org/show_bug.cgi?id=163556
2890
2891         Reviewed by Anders Carlsson.
2892
2893         This is a step towards merging page/process throttling code for mac & iOS.
2894
2895         Previously WebPage determined whether to start a UserActivity based on page activity,
2896         visibility and the preference to disable. Now WebPage passes the activity state across
2897         to WebPageProxy, which makes the decision & explicitly instructs WebPage to start/stop
2898         the UserActivity.
2899
2900         * UIProcess/WebPageProxy.cpp:
2901         (WebKit::WebPageProxy::WebPageProxy):
2902             - updateActivityToken + updateProccessSuppressionState -> updateThrottleState
2903         (WebKit::WebPageProxy::reattachToWebProcess):
2904             - updateActivityToken -> updateThrottleState
2905         (WebKit::WebPageProxy::dispatchViewStateChange):
2906             - updateActivityToken -> updateThrottleState
2907         (WebKit::WebPageProxy::setPageActivityState):
2908             - Record activity state passed from WebPage, and update.
2909         (WebKit::WebPageProxy::preferencesDidChange):
2910             - updateProccessSuppressionState -> updateThrottleState
2911         (WebKit::WebPageProxy::updateActivityToken): Deleted.
2912         (WebKit::WebPageProxy::updateProccessSuppressionState): Deleted.
2913         (WebKit::WebPageProxy::updateThrottleState):
2914             - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
2915             - Compute whether page should be suppressed, and send SetPageSuppressed message accordingly.
2916         * UIProcess/WebPageProxy.h:
2917             - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
2918             - Added setPageActivityState/m_activityState to report/record page activity.
2919             - Added m_pageSuppressed to prevent redundant message sends.
2920         * UIProcess/WebPageProxy.messages.in:
2921             - Expose SetPageActivityState message (called by WebPage).
2922         * WebProcess/WebPage/WebPage.cpp:
2923         (WebKit::WebPage::WebPage):
2924             - removed m_processSuppressionEnabled
2925             - updateUserActivity -> setPageSuppressed - explicitly set the page to not be suppressed, until WebPageProxy tells us to do so.
2926         (WebKit::WebPage::setPageActivityState):
2927             - post activity state on to WebPageProxy.
2928         (WebKit::WebPage::setPageSuppressed):
2929             - Start/stop USerActivity accordingly.
2930         (WebKit::WebPage::setViewState):
2931             - No longer need to monitor ViewState changes on the WebProcess side.
2932         (WebKit::WebPage::updatePreferences):
2933             - No longer need to monitor preference changes on the WebProcess side.
2934         (WebKit::WebPage::updateUserActivity): Deleted.
2935             - Only updated on reciept of setPageSuppressed message.
2936         * WebProcess/WebPage/WebPage.h:
2937             - Removed m_activityState, m_processSuppressionEnabled, updateUserActivity.
2938             - Added setPageSuppressed message.
2939         * WebProcess/WebPage/WebPage.messages.in:
2940             - Added SetPageSuppressed message.
2941
2942 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2943
2944         REGRESSION(r206189): logs error statements when API::URLRequest is canceled
2945         https://bugs.webkit.org/show_bug.cgi?id=163393
2946
2947         Reviewed by Antti Koivisto.
2948
2949         Print this case at normal logging level, not as an error.
2950
2951         * WebProcess/Network/WebLoaderStrategy.cpp:
2952         (WebKit::WebLoaderStrategy::loadResource):
2953
2954 2016-10-17  Chris Dumez  <cdumez@apple.com>
2955
2956         [iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
2957         https://bugs.webkit.org/show_bug.cgi?id=163547
2958
2959         Reviewed by Darin Adler.
2960
2961         Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
2962         now that it is available in UIKit.
2963
2964         * Platform/spi/ios/UIKitSPI.h:
2965         * Shared/ios/NativeWebTouchEventIOS.mm:
2966         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
2967
2968 2016-10-17  Konstantin Tokarev  <annulen@yandex.ru>
2969
2970         Eleminate code duplication between ResourceRequest encoding/decoding implementations
2971         https://bugs.webkit.org/show_bug.cgi?id=163507
2972
2973         Reviewed by Carlos Garcia Campos.
2974
2975         ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
2976         ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
2977         ditto for decoding implementations.
2978
2979         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2980         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2981         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2982
2983 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2984
2985         Move user agent quirks to cross-platform location
2986         https://bugs.webkit.org/show_bug.cgi?id=163508
2987
2988         Reviewed by Carlos Garcia Campos.
2989
2990         #include <WebCore/UserAgent.h> instead of <WebCore/UserAgentGtk.h>.
2991
2992         * UIProcess/API/gtk/WebKitSettings.cpp:
2993         * UIProcess/efl/WebPageProxyEfl.cpp:
2994         * UIProcess/gtk/WebPageProxyGtk.cpp:
2995         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2996
2997 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2998
2999         [SOUP] Downloads should always sniff contents
3000         https://bugs.webkit.org/show_bug.cgi?id=163538
3001
3002         Reviewed by Michael Catanzaro.
3003
3004         It's quite common that downloads have weird filenames with no extension, so it would be better if the loader
3005         sniff the contents to guess the mime type.
3006
3007         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
3008         (WebKit::Download::startNetworkLoad): Pass true for shouldContentSniff parameter of ResourceHandle::create().
3009
3010 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3011
3012         [GTK] Switch to use API::DownloadClient instead of the C API client
3013         https://bugs.webkit.org/show_bug.cgi?id=163537
3014
3015         Reviewed by Michael Catanzaro.
3016
3017         The code is simpler and we avoid all the toImpl/toAPI.
3018
3019         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
3020         (attachDownloadClientToContext):
3021         (didStart):
3022         (didReceiveResponse):
3023         (didReceiveData):
3024         (decideDestinationWithSuggestedFilename):
3025         (didCreateDestination):
3026         (didFail):
3027         (didCancel):
3028         (didFinish):
3029
3030 2016-10-17  Manuel Rego Casasnovas  <rego@igalia.com>
3031
3032         [css-grid] Disable CSS Grid Layout runtime flag by default
3033         https://bugs.webkit.org/show_bug.cgi?id=163432
3034
3035         Reviewed by Darin Adler.
3036
3037         It was enabled in r201042, but now Safari Technology Preview
3038         has a UI to switch runtime flags so it doesn't need to be enabled
3039         by default anymore.
3040
3041         * Shared/WebPreferencesDefinitions.h: Disable grid layout runtime flag
3042         by default.
3043
3044 2016-10-16  Darin Adler  <darin@apple.com>
3045
3046         Move CSS classes from ExceptionCode to Exception
3047         https://bugs.webkit.org/show_bug.cgi?id=163494
3048
3049         Reviewed by Sam Weinig.
3050
3051         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
3052         (webkit_dom_css_rule_set_css_text): Updated for ExceptionOr.
3053         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
3054         (webkit_dom_css_style_declaration_remove_property): Ditto.
3055         (webkit_dom_css_style_declaration_set_property): Ditto.
3056         (webkit_dom_css_style_declaration_set_css_text): Ditto.
3057         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
3058         (webkit_dom_css_style_sheet_insert_rule): Ditto.
3059         (webkit_dom_css_style_sheet_delete_rule): Ditto.
3060         (webkit_dom_css_style_sheet_add_rule): Ditto.
3061         (webkit_dom_css_style_sheet_remove_rule): Ditto.
3062         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
3063         (webkit_dom_css_value_set_css_text): Ditto.
3064         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
3065         (webkit_dom_media_list_delete_medium): Ditto.
3066         (webkit_dom_media_list_append_medium): Ditto.
3067         (webkit_dom_media_list_set_media_text): Ditto.
3068
3069 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3070
3071         [GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext
3072         https://bugs.webkit.org/show_bug.cgi?id=163443
3073
3074         Reviewed by Michael Catanzaro.
3075
3076         Adopt the reference returned by webkitWebsiteDataManagerCreate().
3077
3078         * UIProcess/API/gtk/WebKitWebContext.cpp:
3079         (webkitWebContextConstructed):
3080
3081 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3082
3083         [GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
3084         https://bugs.webkit.org/show_bug.cgi?id=163389
3085
3086         Reviewed by Michael Catanzaro.
3087
3088         Update the page URI also when the load is committed.
3089
3090         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3091         (getDocumentLoaderURL):
3092         (didStartProvisionalLoadForFrame):
3093         (didReceiveServerRedirectForProvisionalLoadForFrame):
3094         (didCommitLoadForFrame):
3095         (webkitWebPageCreate):
3096         (getProvisionalURLForFrame): Deleted.
3097
3098 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
3099
3100         Sort the project file.
3101
3102         * WebKit2.xcodeproj/project.pbxproj:
3103
3104 2016-10-14  Anders Carlsson  <andersca@apple.com>
3105
3106         Fix Mac build.
3107
3108         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
3109         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
3110
3111 2016-10-14  Anders Carlsson  <andersca@apple.com>
3112
3113         Pass on networking settings to the PKPaymentRequest
3114         https://bugs.webkit.org/show_bug.cgi?id=163462
3115         rdar://problem/28567629
3116
3117         Reviewed by Dan Bernstein.
3118
3119         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
3120         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3121         (WebKit::toPKPaymentRequest):
3122         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
3123         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
3124
3125 2016-10-14  Anders Carlsson  <andersca@apple.com>
3126
3127         Clean up BackForwardClient
3128         https://bugs.webkit.org/show_bug.cgi?id=163454
3129
3130         Reviewed by Sam Weinig.
3131
3132         Remove empty iOS only stubs.
3133
3134         * WebKit2.xcodeproj/project.pbxproj:
3135         * WebProcess/WebPage/WebBackForwardListProxy.h:
3136         * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed.
3137
3138 2016-10-14  Brady Eidson  <beidson@apple.com>
3139
3140         Enable Gamepads by default in WK2.
3141         https://bugs.webkit.org/show_bug.cgi?id=163447
3142
3143         Rubberstamped by Sam Weinig.
3144
3145         * Shared/WebPreferencesDefinitions.h:
3146
3147 2016-10-14  Gavin Barraclough  <barraclough@apple.com>
3148
3149         Add API to restrict WebKit processes to background priority
3150         https://bugs.webkit.org/show_bug.cgi?id=163363
3151
3152         Reviewed by Anders Carlson.
3153
3154         Add API on _WKProcessPoolConfiguration to flag a process pool as 'alwaysRunsAtBackgroundPriority'.
3155         WebContent and Networking processes associated with that pool will only run a background priority,
3156         when they otherwise would have run at foreground priority.
3157
3158         * UIProcess/API/APIProcessPoolConfiguration.h:
3159             - Add m_alwaysRunsAtBackgroundPriority flag to pool configuration object.
3160         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3161         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3162         (-[_WKProcessPoolConfiguration alwaysRunsAtBackgroundPriority]):
3163         (-[_WKProcessPoolConfiguration setAlwaysRunsAtBackgroundPriority:]):
3164             - Expose new configuration property through API.
3165         * UIProcess/Network/NetworkProcessProxy.cpp:
3166         (WebKit::NetworkProcessProxy::alwaysRunsAtBackgroundPriority):
3167         * UIProcess/Network/NetworkProcessProxy.h:
3168             - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
3169         * UIProcess/ProcessThrottler.cpp:
3170         (WebKit::ProcessThrottler::assertionState):
3171             - When determining whether to take a foreground exception check alwaysRunsAtBackgroundPriority.
3172         * UIProcess/ProcessThrottlerClient.h:
3173             - Add interface to access alwaysRunsAtBackgroundPriority state of WebProcess of NetworkProcess.
3174         * UIProcess/WebProcessPool.cpp:
3175         (WebKit::WebProcessPool::WebProcessPool):
3176         * UIProcess/WebProcessPool.h:
3177             - Add m_alwaysRunsAtBackgroundPriority, set by configuration.
3178         * UIProcess/WebProcessProxy.cpp:
3179         (WebKit::WebProcessProxy::alwaysRunsAtBackgroundPriority):
3180         * UIProcess/WebProcessProxy.h:
3181             - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
3182
3183 2016-10-14  Youenn Fablet  <youenn@apple.com>
3184
3185         Make NetworkCache aware of fetch cache mode
3186         https://bugs.webkit.org/show_bug.cgi?id=163332
3187
3188         Reviewed by Antti Koivisto.
3189
3190         Adding explicit serialization of ResourceRequest cachePolicy since it does no longer map to platform request cache policy.
3191
3192         Added support for:
3193         - Bypassing entirely the network cache in case cache mode is NoStore.
3194         - requiring revalidation in case of cache hit and cache mode is NoCache.
3195         - Not using any entry if cache mode is Reload (but cache can still be updated)
3196
3197         Also made sure that the ResourceRequest::cachePolicy remains the same throughout redirections.
3198
3199         * NetworkProcess/NetworkResourceLoader.cpp:
3200         (WebKit::NetworkResourceLoader::canUseCache):
3201         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3202         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3203         * NetworkProcess/cache/NetworkCache.cpp:
3204         (WebKit::NetworkCache::cachePolicyAllowsExpired):
3205         (WebKit::NetworkCache::makeRetrieveDecision):
3206         * Shared/mac/WebCoreArgumentCodersMac.mm:
3207         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3208         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3209
3210 2016-10-13  Tim Horton  <timothy_horton@apple.com>
3211
3212         Rename the SPI added in r207292 due to post-landing review comments
3213         https://bugs.webkit.org/show_bug.cgi?id=163364
3214         <rdar://problem/28012494>
3215
3216         Reviewed by Simon Fraser.
3217
3218         * UIProcess/API/APIPageConfiguration.h:
3219         (API::PageConfiguration::waitsForPaintAfterViewDidMoveToWindow):
3220         (API::PageConfiguration::setWaitsForPaintAfterViewDidMoveToWindow):
3221         (API::PageConfiguration::shouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
3222         (API::PageConfiguration::setShouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
3223         * UIProcess/API/Cocoa/WKWebView.mm:
3224         (-[WKWebView _initializeWithConfiguration:]):
3225         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3226         (-[WKWebViewConfiguration init]):
3227         (-[WKWebViewConfiguration copyWithZone:]):
3228         (-[WKWebViewConfiguration _waitsForPaintAfterViewDidMoveToWindow]):
3229         (-[WKWebViewConfiguration _setWaitsForPaintAfterViewDidMoveToWindow:]):
3230         (-[WKWebViewConfiguration _shouldWaitForPaintAfterViewDidMoveToWindow]): Deleted.
3231         (-[WKWebViewConfiguration _setShouldWaitForPaintAfterViewDidMoveToWindow:]): Deleted.
3232         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3233         * UIProcess/WebPageProxy.cpp:
3234         (WebKit::WebPageProxy::WebPageProxy):
3235         (WebKit::WebPageProxy::dispatchViewStateChange):
3236         * UIProcess/WebPageProxy.h:
3237
3238 2016-10-13  Jonathan Bedard  <jbedard@apple.com>
3239
3240         GTK and EFL on Mac fail to compile WebTextChecker due to missing definition of WKTextCheckerClientBase
3241         https://bugs.webkit.org/show_bug.cgi?id=163346
3242
3243         Reviewed by Daniel Bates.
3244
3245         * UIProcess/API/C/WKTextChecker.cpp: Fixed #ifdefs for GTK and EFL builds on Darwin machines.
3246         * UIProcess/API/C/WKTextChecker.h: Ditto.
3247
3248 2016-10-13  Tim Horton  <timothy_horton@apple.com>
3249
3250         Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
3251         https://bugs.webkit.org/show_bug.cgi?id=163364
3252         <rdar://problem/28012494>
3253
3254         Reviewed by Geoff Garen.
3255
3256         Some clients may not want the default WKWebView behavior where we synchronously
3257         block on the Web process after the first time a WKWebView is re-added to the window,
3258         because they are e.g. parenting re-used WKWebViews while scrolling.
3259
3260         * UIProcess/API/APIPageConfiguration.h:
3261         (API::PageConfiguration::shouldSynchronizeInitialPaintAfterMovingToWindow):
3262         (API::PageConfiguration::setShouldSynchronizeInitialPaintAfterMovingToWindow):
3263         * UIProcess/API/Cocoa/WKWebView.mm:
3264         (-[WKWebView _initializeWithConfiguration:]):
3265         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3266         (-[WKWebViewConfiguration init]):
3267         (-[WKWebViewConfiguration copyWithZone:]):
3268         (-[WKWebViewConfiguration _shouldSynchronizeInitialPaintAfterMovingToWindow]):
3269         (-[WKWebViewConfiguration _setShouldSynchronizeInitialPaintAfterMovingToWindow:]):
3270         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3271         * UIProcess/WebPageProxy.h:
3272         * UIProcess/WebPageProxy.cpp:
3273         (WebKit::WebPageProxy::WebPageProxy):
3274         Add and plumb a new WKWebView configuration parameter.
3275
3276         (WebKit::WebPageProxy::dispatchViewStateChange):
3277         If the new configuration parameter is set, don't block the main thread when
3278         a view is reparented.
3279
3280 2016-10-12  Chris Dumez  <cdumez@apple.com>
3281
3282         [Web IDL] Drop support for legacy [ConstructorConditional=*]
3283         https://bugs.webkit.org/show_bug.cgi?id=163368
3284
3285         Reviewed by Ryosuke Niwa.
3286
3287         Drop ENABLE_DOM4_EVENTS_CONSTRUCTOR compiler flag.
3288
3289         * Configurations/FeatureDefines.xcconfig:
3290
3291 2016-10-12  Alex Christensen  <achristensen@webkit.org>
3292
3293         Fix assertion after switching to URLParser
3294         https://bugs.webkit.org/show_bug.cgi?id=163350
3295         rdar://problem/28739938
3296
3297         Reviewed by Brady Eidson.
3298         
3299         Covered by a new API test.
3300
3301         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
3302         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
3303         The { } here is not understood by the compiler to mean WebCore::URL(), but rather the empty constructor for the enum ParsedURLStringTag.
3304         We used to be unsafely trusting that the URL was valid and canonicalized, but with URLParser we are canonicalizing it,
3305         and the assertion (url == m_string) in URL.cpp was failing.
3306
3307 2016-10-12  Anders Carlsson  <andersca@apple.com>
3308
3309         Remove an unused function
3310         https://bugs.webkit.org/show_bug.cgi?id=163341
3311
3312         Reviewed by Dan Bernstein.
3313
3314         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3315         (WebKit::WebBackForwardListProxy::isActive): Deleted.
3316         * WebProcess/WebPage/WebBackForwardListProxy.h:
3317
3318 2016-10-11  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
3319
3320         [EFL] Update API tests which are passed or failed
3321         https://bugs.webkit.org/show_bug.cgi?id=163322
3322
3323         Unreviewed, simple on/off API test.
3324
3325         *ewk_favicon_database_clear* has been crashed for a long time, however
3326         *ewk_cookie_manager_permanent_storage* is fine now. So the passing test
3327         is enabled again, and disable the failure tests.
3328
3329         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
3330         (TEST_F):
3331         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
3332         (TEST_F):
3333
3334 2016-10-11  Daniel Bates  <dabates@apple.com>
3335
3336         Attempt to fix the Apple Internal Mac build following r207159
3337         (https://bugs.webkit.org/show_bug.cgi?id=163244)
3338
3339         * UIProcess/API/Cocoa/WKWebView.mm:
3340         (shouldRequireUserGestureToLoadVideo):
3341
3342 2016-10-11  Anders Carlsson  <andersca@apple.com>
3343
3344         Clean up WebPageGroup somewhat
3345         https://bugs.webkit.org/show_bug.cgi?id=163299
3346
3347         Reviewed by Tim Horton.
3348
3349         * Shared/API/c/WKDeprecatedFunctions.cpp:
3350         (WKPageGroupCopyIdentifier):
3351         Move this here from WKPageGroup.
3352
3353         (WKPageGroupAddUserContentFilter):
3354         (WKPageGroupRemoveUserContentFilter):
3355         (WKPageGroupRemoveAllUserContentFilters):
3356         Just call directly into the user content controller.
3357
3358         * UIProcess/API/C/WKPageGroup.cpp:
3359         (WKPageGroupAddUserStyleSheet):
3360         (WKPageGroupRemoveAllUserStyleSheets):
3361         (WKPageGroupAddUserScript):
3362         (WKPageGroupRemoveAllUserScripts):
3363         Just call directly into the user content controller.
3364
3365         * UIProcess/API/C/WKPageGroup.h:
3366         * UIProcess/WebPageGroup.cpp:
3367         (WebKit::WebPageGroup::addUserStyleSheet): Deleted.
3368         (WebKit::WebPageGroup::addUserScript): Deleted.
3369         (WebKit::WebPageGroup::removeAllUserStyleSheets): Deleted.
3370         (WebKit::WebPageGroup::removeAllUserScripts): Deleted.
3371         (WebKit::WebPageGroup::removeAllUserContent): Deleted.
3372         (WebKit::WebPageGroup::addUserContentExtension): Deleted.
3373         (WebKit::WebPageGroup::removeUserContentExtension): Deleted.
3374         (WebKit::WebPageGroup::removeAllUserContentExtensions): Deleted.
3375         Get rid of these, all their callers just call into the user content controller now.
3376
3377         * UIProcess/WebPageGroup.h:
3378         (WebKit::WebPageGroup::identifier): Deleted.
3379         (WebKit::WebPageGroup::sendToAllProcessesInGroup): Deleted.
3380         Remove unused code.
3381
3382 2016-10-11  Daniel Bates  <dabates@apple.com>
3383
3384         [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
3385         https://bugs.webkit.org/show_bug.cgi?id=163244
3386         <rdar://problem/27250015>
3387
3388         Reviewed by Jer Noble.
3389
3390         Enable or disable the Setting::requiresUserGestureToLoadVideo() in WebKit depending on the
3391         version of iOS SDK that the app was linked against. We require a user gesture to begin
3392         loading a video as of iOS 10.
3393
3394         * Shared/WebPreferencesDefinitions.h:
3395         * UIProcess/API/Cocoa/WKWebView.mm:
3396         (shouldRequireUserGestureToLoadVideo): Added.
3397         (-[WKWebView _initializeWithConfiguration:]): Set the requiresUserGestureToLoadVideo preference.
3398         * WebProcess/WebPage/WebPage.cpp:
3399         (WebKit::WebPage::updatePreferences): Modified to pass the WebKit requiresUserGestureToLoadVideo
3400         preference to WebCore.
3401
3402 2016-10-11  Alex Christensen  <achristensen@webkit.org>
3403
3404         Remove dead networking code
3405         https://bugs.webkit.org/show_bug.cgi?id=163263
3406
3407         Reviewed by Daniel Bates.
3408
3409         * NetworkProcess/Downloads/Download.h:
3410         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
3411         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3412         * NetworkProcess/NetworkLoad.h:
3413         * NetworkProcess/mac/NetworkLoadMac.mm:
3414         (WebKit::NetworkLoad::willCacheResponseAsync): Deleted.
3415         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
3416         (WebKit::AuthenticationManager::receivedCredential):
3417         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
3418         (WebKit::AuthenticationManager::receivedCancellation):
3419         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
3420         (WebKit::AuthenticationManager::receivedChallengeRejection):
3421         * Shared/WebProcessCreationParameters.cpp:
3422         (WebKit::WebProcessCreationParameters::encode):
3423         (WebKit::WebProcessCreationParameters::decode):
3424         * Shared/WebProcessCreationParameters.h:
3425         * Shared/mac/WebCoreArgumentCodersMac.mm:
3426         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3427         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3428         * WebKit2.xcodeproj/project.pbxproj:
3429
3430 2016-10-11  Anders Carlsson  <andersca@apple.com>
3431
3432         Move no longer used functions to WKDeprecatedFunctions.cpp
3433         https://bugs.webkit.org/show_bug.cgi?id=163290
3434
3435         Reviewed by Dan Bernstein.
3436
3437         * Shared/API/c/WKDeprecatedFunctions.cpp:
3438         (WKPageGroupAddUserContentFilter):
3439         (WKPageGroupRemoveUserContentFilter):
3440         (WKPageGroupRemoveAllUserContentFilters):
3441         (WKContextSetProcessModel): Deleted.
3442         * UIProcess/API/C/WKPageGroup.cpp:
3443         (WKPageGroupRemoveAllUserScripts):
3444         (WKPageGroupAddUserContentFilter): Deleted.
3445         (WKPageGroupRemoveUserContentFilter): Deleted.
3446         (WKPageGroupRemoveAllUserContentFilters): Deleted.
3447         * UIProcess/API/C/WKPageGroup.h:
3448
3449 2016-10-11  Konstantin Tokarev  <annulen@yandex.ru>
3450
3451         Use modern for loops for iterating supplement maps
3452         https://bugs.webkit.org/show_bug.cgi?id=163274
3453
3454         Reviewed by Alex Christensen.
3455
3456         * NetworkProcess/NetworkProcess.cpp:
3457         (WebKit::NetworkProcess::initializeNetworkProcess):
3458         (WebKit::NetworkProcess::initializeConnection):
3459         * UIProcess/WebProcessPool.cpp:
3460         (WebKit::WebProcessPool::~WebProcessPool):
3461         (WebKit::WebProcessPool::networkProcessCrashed):
3462         (WebKit::WebProcessPool::databaseProcessCrashed): Iterate by values()
3463         like in other places.
3464
3465 2016-10-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3466
3467         The "Input Events" experimental feature runtime flag should not be on by default
3468         https://bugs.webkit.org/show_bug.cgi?id=163278
3469
3470         Reviewed by Zalan Bujtas.
3471
3472         This was intended to be off by default.
3473
3474         * Shared/WebPreferencesDefinitions.h:
3475
3476 2016-10-10  Zan Dobersek  <zdobersek@igalia.com>
3477
3478         Add ENABLE_ENCRYPTED_MEDIA configuration option
3479         https://bugs.webkit.org/show_bug.cgi?id=163219
3480
3481         Reviewed by Darin Adler.
3482
3483         * Configurations/FeatureDefines.xcconfig:
3484         Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
3485         to enable or disable the new EME implementation at build-time.
3486
3487 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3488
3489         NetworkSession: NetworkDataTask is leaked if download finishes in didReceiveResponse completion handler
3490         https://bugs.webkit.org/show_bug.cgi?id=163204
3491
3492         Reviewed by Alex Christensen.
3493
3494         After the completion handler a reference of the NetworkDataTask is saved in m_downloadsAfterDestinationDecided.
3495         If the download failed or was canceled DownloadManager::dataTaskBecameDownloadTask is never called and the data
3496         task is kept in the download manager forever. This patch exposes NSURLSessionTask state property in
3497         NetworkDataTask, so that the download manager can check the task state after the completion handler and return
3498         early if the download finished or was cancelled.
3499
3500         * NetworkProcess/Downloads/DownloadManager.cpp:
3501         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3502         * NetworkProcess/NetworkDataTask.h:
3503         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3504         (WebKit::NetworkDataTask::state):
3505
3506 2016-10-10  Konstantin Tokarev  <annulen@yandex.ru>
3507
3508         Added final specifier to WebInspectorServer and to its overridden methods
3509         https://bugs.webkit.org/show_bug.cgi?id=163228
3510
3511         Reviewed by Darin Adler.
3512
3513         * UIProcess/InspectorServer/WebInspectorServer.h:
3514
3515 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3516
3517         [GTK] 2.14.0 Compile Errors: GTK 3.22.1
3518         https://bugs.webkit.org/show_bug.cgi?id=163190
3519
3520         Reviewed by Alex Christensen.
3521
3522         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Include gtk.h since we are using gtk_widget_queue_draw().
3523
3524 2016-10-10  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
3525
3526         [EFL] ewk_context_preferred_languages has been failed since r206949
3527         https://bugs.webkit.org/show_bug.cgi?id=163211
3528
3529         Reviewed by Chris Dumez.
3530
3531         r206949 changed to return value of navigator.language from en-us to en-US
3532         in order to match other browsers and w3c spec. So ewk_context_preferred_languages
3533         needs to change the expected result as well.
3534
3535         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
3536         (TEST_F):
3537
3538 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3539
3540         NetworkSession: downloads started by startDownload() can fail before starting from the API point of view
3541         https://bugs.webkit.org/show_bug.cgi?id=163107
3542
3543         Reviewed by Alex Christensen.
3544
3545         In the network process we use a PendingDownload in this case, but in the UI process we always have a single
3546         download proxy. If an error happens before the pending download is converted inot a real download, the DidFail
3547         messages is received in the download proxy before the DidStart one. This is problematic at least for the GTK+
3548         API, because it's common to connect to the started signal and connect to all other signals from there, but in
3549         this case the started signal is never emitted, and then the failed one is not handled. This is not a problem for
3550         downloads started by convertTaskToDownload, because in that case those loads are not considered a download by
3551         the UI process when those early errors happen, and then the web page handles them.
3552
3553         * NetworkProcess/Downloads/PendingDownload.cpp:
3554         (WebKit::PendingDownload::PendingDownload): Send DidStart message right after the network load starts like the
3555         non network session code does.
3556         * NetworkProcess/NetworkLoad.cpp:
3557         (WebKit::NetworkLoad::convertTaskToDownload): Send DidStart message now that the normal load has been converted
3558         into a download.
3559         * NetworkProcess/NetworkProcess.cpp:
3560         (WebKit::NetworkProcess::findPendingDownloadLocation): Do not send DidStart message here.
3561
3562 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3563
3564         Network Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecameDownloadTask
3565         https://bugs.webkit.org/show_bug.cgi?id=163006
3566
3567         Reviewed by Alex Christensen.
3568
3569         In DownloadManager::dataTaskBecameDownloadTask() we are supposed to have either a pending download, or a network
3570         data task depending on whether the download was started by startDownload() or convertTaskToDownload. However, in
3571         both cases we do have a data task and never a pending download. In the case of startDownload() the pending
3572         download is removed from m_pendingDownloads in willDecidePendingDownloadDestination(). The task is always
3573         added to m_downloadsWaitingForDestination in willDecidePendingDownloadDestination() and to
3574         m_downloadsAfterDestinationDecided in continueDecidePendingDownloadDestination() in both cases.
3575
3576         * NetworkProcess/Downloads/DownloadManager.cpp:
3577         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Add an ASSERT to ensure we don't have a pending download
3578         at this point and that the download is not already in the map. Remove the download from the
3579         m_downloadsAfterDestinationDecided map, but don't check its result because it might not bein that map if
3580         dataTaskBecameDownloadTask is called synchronously from the didReceiveResponse completion handler.
3581         (WebKit::DownloadManager::willDecidePendingDownloadDestination): Do not take the pending download here, wait
3582         until didReceiveResponse completion handler is called.
3583         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Take the pending download here ensuring
3584         it's alive while the didReceiveResponse completion handler is called. Also remove invalid early return when
3585         either networkDataTask or completionHandler are nullptr because we are using both unconditionally, we should
3586         return early if both are nullptr to avoid crashes. However, we are checking that the download is in the
3587         m_downloadsWaitingForDestination and in that case we should always have both, so better add asserts there. If
3588         the download is already in the map after the completion handler it means that dataTaskBecameDownloadTask() has
3589         alrady been called, so we can just return in that case.
3590         * NetworkProcess/Downloads/DownloadManager.h:
3591         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3592         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Protect the NetworkDataTask that can
3593         be deleted by dataTaskBecameDownloadTask().
3594
3595 2016-10-10  Tim Horton  <timothy_horton@apple.com>
3596
3597         Share more code between iOS and macOS ViewGestureController
3598         https://bugs.webkit.org/show_bug.cgi?id=163158
3599
3600         Reviewed by Simon Fraser.
3601
3602         Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
3603         Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
3604         because it shouldn't know anything about WKWebView.
3605         Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
3606
3607         * UIProcess/API/Cocoa/WKWebView.mm:
3608         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
3609         * UIProcess/Cocoa/ViewGestureController.cpp:
3610         (WebKit::ViewGestureController::ViewGestureController):
3611         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
3612         (WebKit::ViewGestureController::canSwipeInDirection):
3613         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
3614         * UIProcess/Cocoa/ViewGestureController.h:
3615         * UIProcess/WebPageProxy.cpp:
3616         (WebKit::WebPageProxy::WebPageProxy):
3617         * UIProcess/WebPageProxy.h:
3618         (WebKit::WebPageProxy::createWeakPtr):
3619         * UIProcess/ios/ViewGestureControllerIOS.mm:
3620         (WebKit::ViewGestureController::beginSwipeGesture):
3621         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
3622         (WebKit::ViewGestureController::canSwipeInDirection): Deleted.
3623         * UIProcess/mac/ViewGestureControllerMac.mm:
3624         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
3625         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
3626         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
3627
3628 2016-10-10  Tomas Popela  <tpopela@redhat.com>
3629
3630         [GTK] UIProcess crashes when using Japanese IM
3631         https://bugs.webkit.org/show_bug.cgi?id=163011
3632
3633         We have to reference the current GdkEventKey before we try process it
3634         as later when the lambda body is reached the event could be already
3635         freed.
3636
3637         Reviewed by Carlos Garcia Campos.
3638
3639         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3640         (webkitWebViewBaseKeyPressEvent):
3641         (webkitWebViewBaseKeyReleaseEvent):
3642         * UIProcess/gtk/InputMethodFilter.h:
3643         Use non-copyable Function so we can use WTFMove to pass the event to
3644         lambda.
3645
3646 2016-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
3647
3648         Support InputEvent.inputType for the new InputEvent spec
3649         https://bugs.webkit.org/show_bug.cgi?id=163025
3650         <rdar://problem/28658092>
3651
3652         Reviewed by Darin Adler.
3653
3654         Accounts for some changes to the EditAction enum in nameForEditAction. Some former edit
3655         actions, such as EditActionTyping, have been split out into its more specific subtypes,
3656         so we preserve shipping behavior by treating all of the new subtypes the same way as the
3657         original type.
3658
3659         * UIProcess/WebEditCommandProxy.cpp:
3660         (WebKit::WebEditCommandProxy::nameForEditAction):
3661
3662 2016-10-08  Emanuele Aina  <emanuele.aina@collabora.com>
3663
3664         [GTK] Drop redundant wl_display_flush_clients() call
3665         https://bugs.webkit.org/show_bug.cgi?id=161904
3666
3667         Reviewed by Michael Catanzaro.
3668
3669         The Wayland GSource::prepare() function already calls
3670         wl_display_flush_clients() at every mainloop iteration, so there's no
3671         need to further call it on Surface::commit().
3672
3673         * UIProcess/gtk/WaylandCompositor.cpp:
3674         (WebKit::WaylandCompositor::Surface::commit):
3675         * UIProcess/gtk/WaylandCompositor.h:
3676
3677 2016-10-06  Darin Adler  <darin@apple.com>
3678
3679         Next step on moving to modern way to return DOM exceptions
3680         https://bugs.webkit.org/show_bug.cgi?id=163016
3681
3682         Reviewed by Ryosuke Niwa.
3683
3684         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
3685         (webkit_dom_dom_implementation_create_document_type): Updated for name change
3686         from takeReturnValue to releaseReturnValue.
3687         (webkit_dom_dom_implementation_create_document): Ditto.
3688         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
3689         (webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode.
3690         (webkit_dom_dom_selection_collapse_to_start): Ditto.
3691         (webkit_dom_dom_selection_extend): Ditto.
3692         (webkit_dom_dom_selection_get_range_at): Ditto.
3693
3694 2016-10-08  Commit Queue  <commit-queue@webkit.org>
3695
3696         Unreviewed, rolling out r206950.
3697         https://bugs.webkit.org/show_bug.cgi?id=163169
3698
3699         broke an API test (Requested by thorton on #webkit).
3700
3701         Reverted changeset:
3702
3703         "Share more code between iOS and macOS ViewGestureController"
3704         https://bugs.webkit.org/show_bug.cgi?id=163158
3705         http://trac.webkit.org/changeset/206950
3706
3707 2016-10-08  Tim Horton  <timothy_horton@apple.com>
3708
3709         Share more code between iOS and macOS ViewGestureController
3710         https://bugs.webkit.org/show_bug.cgi?id=163158
3711
3712         Reviewed by Simon Fraser.
3713
3714         Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
3715         Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
3716         because it shouldn't know anything about WKWebView.
3717         Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
3718
3719         * UIProcess/API/Cocoa/WKWebView.mm:
3720         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
3721         * UIProcess/Cocoa/ViewGestureController.cpp:
3722         (WebKit::ViewGestureController::ViewGestureController):
3723         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
3724         (WebKit::ViewGestureController::canSwipeInDirection):
3725         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
3726         * UIProcess/Cocoa/ViewGestureController.h:
3727         * UIProcess/WebPageProxy.cpp:
3728         (WebKit::WebPageProxy::WebPageProxy):
3729         * UIProcess/WebPageProxy.h:
3730         (WebKit::WebPageProxy::createWeakPtr):
3731         * UIProcess/ios/ViewGestureControllerIOS.mm:
3732         (WebKit::ViewGestureController::beginSwipeGesture):
3733         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
3734         (WebKit::ViewGestureController::canSwipeInDirection): Deleted.
3735         * UIProcess/mac/ViewGestureControllerMac.mm:
3736         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
3737         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
3738         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
3739
3740 2016-10-07  Anders Carlsson  <andersca@apple.com>
3741
3742         Get rid of API::Session and WKSessionRef
3743         https://bugs.webkit.org/show_bug.cgi?id=163140
3744
3745         Reviewed by Tim Horton.
3746
3747         This API is no longer used.
3748
3749         * CMakeLists.txt:
3750         * Shared/API/APIObject.h:
3751         * Shared/API/c/WKSharedAPICast.h:
3752         * UIProcess/API/APISession.cpp: Removed.
3753         (API::generateID): Deleted.
3754         (API::Session::defaultSession): Deleted.
3755         (API::Session::Session): Deleted.
3756         (API::Session::createEphemeral): Deleted.
3757         (API::Session::isEphemeral): Deleted.
3758         (API::Session::getID): Deleted.
3759         (API::Session::~Session): Deleted.
3760         * UIProcess/API/APISession.h: Removed.
3761         * UIProcess/API/C/WKPage.h:
3762         * UIProcess/API/C/WKSessionRef.cpp: Removed.
3763         (WKSessionCreate): Deleted.
3764         (WKSessionGetTypeID): Deleted.
3765         (WKSessionIsEphemeral): Deleted.
3766         * UIProcess/API/C/WKSessionRef.h: Removed.
3767         * UIProcess/WebPageProxy.h:
3768         * UIProcess/WebProcessProxy.h:
3769         * WebKit2.xcodeproj/project.pbxproj:
3770
3771 2016-10-07  Tim Horton  <timothy_horton@apple.com>
3772
3773         Move ViewGestureController files to more accurate locations
3774         https://bugs.webkit.org/show_bug.cgi?id=163141
3775
3776         Reviewed by Anders Carlsson.
3777
3778         * PlatformMac.cmake:
3779         * UIProcess/Cocoa/ViewGestureController.cpp: Renamed from UIProcess/ViewGestureController.cpp.
3780         * UIProcess/Cocoa/ViewGestureController.h: Renamed from UIProcess/mac/ViewGestureController.h.
3781         * UIProcess/Cocoa/ViewGestureController.messages.in: Renamed from UIProcess/mac/ViewGestureController.messages.in.
3782         * WebKit2.xcodeproj/project.pbxproj:
3783
3784 2016-10-07  Tim Horton  <timothy_horton@apple.com>
3785
3786         Adopt BlockPtr in ViewGestureController
3787         https://bugs.webkit.org/show_bug.cgi?id=163132
3788
3789         Reviewed by Anders Carlsson.
3790
3791         * UIProcess/Cocoa/WebViewImpl.h:
3792         * UIProcess/Cocoa/WebViewImpl.mm:
3793         (WebKit::WebViewImpl::setDidMoveSwipeSnapshotCallback):
3794         * UIProcess/ViewGestureController.cpp:
3795         (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
3796         * UIProcess/mac/ViewGestureController.h:
3797         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
3798         (WebKit::ViewGestureController::m_didMoveSwipeSnapshotCallback): Deleted.
3799         * UIProcess/mac/ViewGestureControllerMac.mm:
3800         (WebKit::ViewGestureController::platformTeardown):
3801         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): Deleted.
3802
3803 2016-10-07  Anders Carlsson  <andersca@apple.com>
3804
3805         Get rid of WKPageSetSession
3806         https://bugs.webkit.org/show_bug.cgi?id=163129
3807
3808         Reviewed by Tim Horton.
3809
3810         This function is no longer used.
3811
3812         * UIProcess/API/C/WKPage.cpp:
3813         (WKPageSetSession): Deleted.
3814         * UIProcess/API/C/WKPage.h:
3815         * UIProcess/WebPageProxy.cpp:
3816         (WebKit::WebPageProxy::setSessionID): Deleted.
3817         * UIProcess/WebPageProxy.h:
3818         (WebKit::WebPageProxy::sessionID):
3819         * WebProcess/WebPage/WebPage.messages.in:
3820
3821 2016-10-07  Commit Queue  <commit-queue@webkit.org>
3822
3823         Unreviewed, rolling out r206909.
3824         https://bugs.webkit.org/show_bug.cgi?id=163116
3825
3826         Caused most of  GTK layout tests to crash (Requested by KaL on
3827         #webkit).
3828
3829         Reverted changeset:
3830
3831         "[GTK] UIProcess crashes when using Japanese IM"
3832         https://bugs.webkit.org/show_bug.cgi?id=163011
3833         http://trac.webkit.org/changeset/206909
3834
3835 2016-10-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3836
3837         Network Session: Allow NetworkDataTask decide what to do when override is allowed for a download
3838         https://bugs.webkit.org/show_bug.cgi?id=163010
3839
3840         Reviewed by Alex Christensen.
3841
3842         Current code always deletes the file before starting a download when allow override is True. In soup backend we
3843         use glib API that takes care of it and tries to ensure that the original file is not deleted if the new file
3844         creation fails for whatever reason.
3845
3846         * NetworkProcess/Downloads/DownloadManager.cpp:
3847         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Pass allowOverride to setPendingDownloadLocation().
3848         * NetworkProcess/NetworkDataTask.h:
3849         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3850         (WebKit::NetworkDataTask::setPendingDownloadLocation): Delete the destination file if exists and allowOverride
3851         is True.
3852
3853 2016-10-07  Tomas Popela  <tpopela@redhat.com>
3854
3855         [GTK] UIProcess crashes when using Japanese IM
3856         https://bugs.webkit.org/show_bug.cgi?id=163011
3857
3858         We have to reference the current GdkEventKey before we try process it
3859         as later when the lambda body is reached the event could be already
3860         freed.
3861
3862         Reviewed by Carlos Garcia Campos.
3863
3864         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3865         (webkitWebViewBaseKeyPressEvent):
3866         (webkitWebViewBaseKeyReleaseEvent):
3867         * UIProcess/gtk/InputMethodFilter.h:
3868         Use non-copyable Function so we can use WTFMove to pass the event to
3869         lambda.
3870
3871 2016-10-06  Michael Catanzaro  <mcatanzaro@igalia.com>
3872
3873         [GTK] Expose WebKitDOMHTMLInputElement APIs for form autofill
3874         https://bugs.webkit.org/show_bug.cgi?id=163082
3875
3876         Reviewed by Darin Adler.
3877
3878         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
3879         (webkit_dom_html_input_element_get_auto_filled): Added.
3880         (webkit_dom_html_input_element_set_auto_filled): Added.
3881         (webkit_dom_html_input_element_set_editing_value): Added.
3882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
3883         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
3884
3885 2016-10-06  John Wilander  <wilander@apple.com>
3886
3887         Update Resource Load Statistics
3888         https://bugs.webkit.org/show_bug.cgi?id=162811
3889
3890         Reviewed by Alex Christensen.
3891
3892         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3893         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics):
3894             Switched to vector-based classification.
3895         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
3896             Simplified logic and moved the split between has and has
3897             no user interaction into ResourceLoadStatisticsStore.
3898         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords):
3899             Added.
3900         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3901             Updated to make use of the new functions.
3902         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
3903             Removed stray whitespace.
3904         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
3905             Removed stray whitespace.
3906         (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk):
3907             Removed stray whitespace.
3908         (WebKit::hasPrevalentResourceCharacteristics): Deleted.
3909         (WebKit::classifyPrevalentResources): Deleted.
3910         * UIProcess/WebResourceLoadStatisticsStore.h:
3911             Added member variables for clearing of data records.
3912
3913 2016-10-06  Youenn Fablet  <youenn@apple.com>
3914
3915         [WK2] 304 revalidation on the network process does not update the validated response
3916         https://bugs.webkit.org/show_bug.cgi?id=162973
3917
3918         Reviewed by Darin Adler.
3919
3920         * NetworkProcess/NetworkResourceLoader.cpp: Updating cache entry with the revalidated one.
3921
3922 2016-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3923
3924         Introduce InputEvent bindings in preparation for the input events spec
3925         https://bugs.webkit.org/show_bug.cgi?id=162954
3926
3927         Reviewed by Ryosuke Niwa.
3928
3929         Adds a new runtime switch for enabling InputEvents.
3930
3931         * Shared/WebPreferencesDefinitions.h:
3932         * WebProcess/WebPage/WebPage.cpp:
3933         (WebKit::WebPage::updatePreferences):
3934
3935 2016-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
3936
3937         Put variation fonts work behind a compile-time flag
3938         https://bugs.webkit.org/show_bug.cgi?id=162949
3939
3940         Reviewed by Simon Fraser.
3941
3942         * Configurations/FeatureDefines.xcconfig:
3943
3944 2016-10-05  Tim Horton  <timothy_horton@apple.com>
3945
3946         Fix the build.
3947
3948         * UIProcess/Cocoa/WebViewImpl.mm:
3949
3950 2016-10-05  Tim Horton  <timothy_horton@apple.com>
3951
3952         Avoid automatically re-taking snapshots for back-forward items that were never loaded into the view
3953         https://bugs.webkit.org/show_bug.cgi?id=162955
3954         <rdar://problem/27659173>
3955
3956         Reviewed by Simon Fraser.
3957
3958         Make it possible for clients to control the snapshot for back-forward
3959         items that are restored from session state without navigating to them,
3960         by ensuring that we won't stomp on the snapshot that they explicitly take,
3961         until a load occurs.
3962
3963         * UIProcess/WebBackForwardList.cpp:
3964         (WebKit::WebBackForwardList::addItem):
3965         (WebKit::WebBackForwardList::goToItem):
3966         * UIProcess/ios/ViewGestureControllerIOS.mm:
3967         (WebKit::ViewGestureController::beginSwipeGesture):
3968         * UIProcess/mac/ViewGestureControllerMac.mm:
3969         (WebKit::ViewGestureController::trackSwipeGesture):
3970         Disambiguate explicit API-driven snapshot recording from automatic,
3971         navigation-driven snapshot recording.
3972
3973         * UIProcess/Cocoa/WebViewImpl.mm:
3974         (WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
3975         Get rid of the version of recordNavigationSnapshot() that doesn't take a
3976         back-forward list item, and grab the current item at the one remaining caller.
3977         
3978         * UIProcess/WebPageProxy.cpp:
3979         (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):