c9d55c350a5bb8bcc0b84cb5de54e0555759ecf7
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-08-07  Brady Eidson  <beidson@apple.com>
2
3         Move concrete KeyedDecoder/Encoder implementations to WebCore.
4         https://bugs.webkit.org/show_bug.cgi?id=147757.
5
6         Rubberstamped by Andy Estes.
7
8         * DatabaseProcess/IndexedDB/IDBSerialization.cpp:
9         (WebKit::serializeIDBKeyPath):
10         (WebKit::deserializeIDBKeyPath):
11         (WebKit::serializeIDBKeyData):
12         (WebKit::deserializeIDBKeyData):
13         
14         * PlatformEfl.cmake:
15         * PlatformGTK.cmake:
16         * WebKit2.xcodeproj/project.pbxproj:
17
18 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
19
20         Unreviewed. Fix GTK+ compile warning also introduced in r188121.
21
22         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
23         (webkit_install_missing_media_plugins_permission_request_get_description):
24
25 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
26
27         Unreviewed. Fix GTK+ debug build after r188121.
28
29         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
30         (webkit_install_missing_media_plugins_permission_request_get_description):
31
32 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
33
34         [GStreamer] Do not automatically show PackageKit codec installation notifications
35         https://bugs.webkit.org/show_bug.cgi?id=135973
36
37         Reviewed by Philippe Normand.
38
39         Add InstallMissingMediaPluginsPermissionRequest to ask the API
40         layer whether to allow or deny the installation of missing media
41         plugins. And add a GTK+ implementation based on current permission
42         request API. Replace the
43         PageClientImpl::createGstInstallPluginsContext() with
44         decicePolicyForInstallMissingMediaPluginsPermissionRequest() that
45         passes the InstallMissingMediaPluginsPermissionRequest object to
46         the API layer. The allow method receives the
47         GstInstallPluginsContext now, so that it can be created by the API implementation.
48
49         * PlatformEfl.cmake:
50         * PlatformGTK.cmake:
51         * UIProcess/API/gtk/PageClientImpl.cpp:
52         (WebKit::PageClientImpl::decicePolicyForInstallMissingMediaPluginsPermissionRequest):
53         * UIProcess/API/gtk/PageClientImpl.h:
54         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: Added.
55         (createGstInstallPluginsContext):
56         (webkitInstallMissingMediaPluginsPermissionRequestAllow):
57         (webkitInstallMissingMediaPluginsPermissionRequestDeny):
58         (webkit_permission_request_interface_init):
59         (webkitInstallMissingMediaPluginsPermissionRequestDispose):
60         (webkit_install_missing_media_plugins_permission_request_class_init):
61         (webkitInstallMissingMediaPluginsPermissionRequestCreate):
62         (webkit_install_missing_media_plugins_permission_request_get_description):
63         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.h: Added.
64         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: Added.
65         * UIProcess/API/gtk/WebKitWebView.cpp:
66         (webkitWebViewRequestInstallMissingMediaPlugins):
67         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
68         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
69         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
70         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
71         * UIProcess/API/gtk/webkit2.h:
72         * UIProcess/PageClient.h:
73         * UIProcess/WebPageProxy.h:
74         * UIProcess/WebPageProxy.messages.in:
75         * UIProcess/efl/WebViewEfl.h:
76         * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp: Copied from Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp.
77         (WebKit::InstallMissingMediaPluginsPermissionRequest::InstallMissingMediaPluginsPermissionRequest):
78         (WebKit::InstallMissingMediaPluginsPermissionRequest::~InstallMissingMediaPluginsPermissionRequest):
79         (WebKit::InstallMissingMediaPluginsPermissionRequest::allow):
80         (WebKit::InstallMissingMediaPluginsPermissionRequest::deny):
81         (WebKit::InstallMissingMediaPluginsPermissionRequest::didEndRequestInstallMissingMediaPlugins):
82         * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.h: Copied from Source/WebKit2/WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp.
83         (WebKit::InstallMissingMediaPluginsPermissionRequest::create):
84         (WebKit::InstallMissingMediaPluginsPermissionRequest::page):
85         (WebKit::InstallMissingMediaPluginsPermissionRequest::details):
86         (WebKit::InstallMissingMediaPluginsPermissionRequest::description):
87         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
88         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
89         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
90         (WebKit::WebChromeClient::requestInstallMissingMediaPlugins):
91         * WebProcess/WebCoreSupport/WebChromeClient.h:
92         * WebProcess/WebPage/WebPage.h:
93         * WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp:
94         (WebKit::WebPage::requestInstallMissingMediaPlugins):
95
96 2015-08-06  Beth Dakin  <bdakin@apple.com>
97
98         TextIndicator can have stale contentImage data and crash
99         https://bugs.webkit.org/show_bug.cgi?id=147770
100         -and corresponding-
101         rdar://problem/22181735
102
103         Reviewed by Tim Horton.
104
105         If there is no contentImage or contentImageWithHighlight, set them to 
106         nullptr.
107         * Shared/WebCoreArgumentCoders.cpp:
108         (IPC::ArgumentCoder<TextIndicatorData>::decode):
109
110 2015-08-06  Dan Bernstein  <mitz@apple.com>
111
112         Fixed all the builds after trying to fix the non-HAVE(LINK_PREVIEW) build.
113
114         * UIProcess/ios/WKContentViewInteraction.mm:
115
116 2015-08-06  Dan Bernstein  <mitz@apple.com>
117
118         Fixed the non-HAVE(LINK_PREVIEW) build.
119
120         * UIProcess/ios/WKContentViewInteraction.mm:
121
122 2015-08-06  Enrica Casucci  <enrica@apple.com>
123
124         Cleanup action sheet only when long press is canceled (non ended).
125         https://bugs.webkit.org/show_bug.cgi?id=147766
126         rdar://problem/22181842
127
128         Reviewed by Tim Horton.
129
130         * UIProcess/ios/WKContentViewInteraction.mm:
131         (-[WKContentView _longPressRecognized:]):
132
133 2015-08-06  Matt Rajca  <mrajca@apple.com>
134
135         Media Session: notify focus manager clients when the playing state of the focused media element changes
136         https://bugs.webkit.org/show_bug.cgi?id=147745
137
138         Reviewed by Tim Horton.
139
140         Added plumbing to allow focus manager's clients to be notified when the focused Content media element begins
141         playing or is paused.
142
143         * UIProcess/API/C/WKMediaSessionFocusManager.cpp:
144         (WKMediaSessionFocusManagerSetClient):
145         * UIProcess/API/C/WKMediaSessionFocusManager.h:
146         * UIProcess/WebMediaSessionFocusManager.cpp:
147         (WebKit::WebMediaSessionFocusManager::initializeClient):
148         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange):
149         * UIProcess/WebMediaSessionFocusManager.h:
150         * UIProcess/WebMediaSessionFocusManagerClient.cpp:
151         (WebKit::WebMediaSessionFocusManagerClient::didChangePlaybackAttribute):
152         * UIProcess/WebMediaSessionFocusManagerClient.h:
153         * WebKit2.xcodeproj/project.pbxproj:
154
155 2015-08-06  Alex Christensen  <achristensen@webkit.org>
156
157         Make CMake usable on Mac.
158         https://bugs.webkit.org/show_bug.cgi?id=147756
159
160         Reviewed by Tim Horton.
161
162         * PlatformMac.cmake:
163         DatabaseProcess_SOURCES needs something in order to not have errors when generating build systems from CMake.
164         This doesn't fix everything, but it can now be used to build jsc again.
165
166 2015-08-06  Enrica Casucci  <enrica@apple.com>
167
168         Build fix for iOS after http://trac.webkit.org/changeset/188053.
169
170         Unreviewed.
171
172         * UIProcess/ios/WKContentViewInteraction.mm:
173         (-[WKContentView _registerPreview]):
174
175 2015-08-06  Enrica Casucci  <enrica@apple.com>
176
177         Allow long press to cancel link preview.
178         https://bugs.webkit.org/show_bug.cgi?id=147743
179         rdar://problem/22128839
180
181         Reviewed by Tim Horton.
182
183         We should be able to show the context menu at the beginnig of link preview.
184
185         * UIProcess/ios/WKContentViewInteraction.h:
186         * UIProcess/ios/WKContentViewInteraction.mm:
187         (-[WKContentView _removeDefaultGestureRecognizers]):
188         (-[WKContentView _addDefaultGestureRecognizers]):
189         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
190         (-[WKContentView _longPressRecognized:]):
191         (-[WKContentView _singleTapRecognized:]):
192         (-[WKContentView _registerPreview]):
193         (-[WKContentView _unregisterPreview]):
194
195 2015-08-06  Matt Rajca  <mrajca@apple.com>
196
197         Media Session: rename isFocusedContentMediaElementPaused and get rid of callback
198         https://bugs.webkit.org/show_bug.cgi?id=147726
199
200         Reviewed by Simon Fraser.
201
202         - isFocusedContentMediaElementPaused should be renamed to isFocusedContentMediaElementPlaying to match recent
203           refactoring work.
204         - isFocusedContentMediaElementPlaying itself does not need a callback anymore because the value can be returned
205           directly.
206
207         * UIProcess/API/C/WKMediaSessionFocusManager.cpp:
208         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPlaying): Removed callback and renamed from...
209         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPaused): Deleted.
210         * UIProcess/API/C/WKMediaSessionFocusManager.h:
211         * UIProcess/WebMediaSessionFocusManager.cpp:
212         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPlaying): Removed callback and renamed from...
213         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Deleted.
214         * UIProcess/WebMediaSessionFocusManager.h:
215
216 2015-08-06  Csaba Osztrogonác  <ossy@webkit.org>
217
218         [EFL] Bump EFL version to 1.15.0
219         https://bugs.webkit.org/show_bug.cgi?id=147450
220
221         Reviewed by Gyuyoung Kim.
222
223         * PlatformEfl.cmake:
224
225 2015-08-06  Carlos Garcia Campos  <cgarcia@igalia.com>
226
227         [GTK] Crash closing a page when a context menu is open
228         https://bugs.webkit.org/show_bug.cgi?id=147682
229
230         Reviewed by Sergio Villar Senin.
231
232         Implement WebContextMenuProxy::cancelTracking() to clear the
233         internal menu when the web page is closed.
234
235         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
236         (WebKit::WebContextMenuProxyGtk::cancelTracking):
237         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Deleted.
238         * UIProcess/gtk/WebContextMenuProxyGtk.h:
239
240 2015-08-04  Matt Rajca  <mrajca@apple.com>
241
242         Media Session: push paused state to the media session focus manager instead of polling
243         https://bugs.webkit.org/show_bug.cgi?id=147633
244
245         Reviewed by Simon Fraser.
246
247         * UIProcess/WebMediaSessionFocusManager.cpp:
248         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Report whether the focused media
249          element is currently playing. The callback is no longer necessary and will be removed in a future patch in
250          favor of returning a value directly.
251         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange): Keep track of whether the focused media
252          element is currently playing.
253         * UIProcess/WebMediaSessionFocusManager.h:
254         * UIProcess/WebPageProxy.cpp:
255         (WebKit::WebPageProxy::isPlayingMediaDidChange): If the focused media element begins/ends playing, keep track
256          of its playing state.
257         (WebKit::WebPageProxy::isMediaElementPaused): Deleted. We now push media playback state changes instead of
258          polling.
259         * UIProcess/WebPageProxy.h: isPlayingMediaDidChange is now passed the ID of the media element that triggered
260          the 'playing' state change. This can be used in conjunction with the IsSourcePlaying media flag to identify
261          whether the source element begin/ended playing.
262         * UIProcess/WebPageProxy.messages.in: Ditto.
263         * WebProcess/Plugins/PluginView.cpp:
264         (WebKit::PluginView::setPluginIsPlayingAudio): Since a media element did not trigger this, pass in 0 for the
265          source media element.
266         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
267         (WebKit::WebChromeClient::isPlayingMediaDidChange): isPlayingMediaDidChange is now passed the ID of the media
268          element that triggered the 'playing' state change.
269         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
270         * WebProcess/WebPage/WebPage.cpp:
271         (WebKit::WebPage::isMediaElementPaused): Deleted. We now push media playback state changes instead of polling.
272         * WebProcess/WebPage/WebPage.h: Ditto.
273         * WebProcess/WebPage/WebPage.messages.in: Ditto.
274
275 2015-08-05  Tim Horton  <timothy_horton@apple.com>
276
277         PDFPlugins are clipped in link previews (and remain so when opened)
278         https://bugs.webkit.org/show_bug.cgi?id=147708
279         <rdar://problem/22055130>
280
281         Reviewed by Simon Fraser.
282
283         * UIProcess/API/mac/WKView.mm:
284         (-[WKView initWithFrame:processPool:configuration:webView:]):
285         (-[WKView _supportsArbitraryLayoutModes]):
286         (-[WKView _didCommitLoadForMainFrame]):
287         (-[WKView _setLayoutMode:]):
288         (-[WKView _setViewScale:]):
289         Avoid using any layout mode other than "ViewSize" for main frame PluginDocuments,
290         because they will often end up behaving incorrectly (especially with PDFPlugin,
291         which is even more special in that it takes over application of page scale).
292
293         Save any incoming changes to the viewScale and layoutMode, and re-apply
294         them once we load something in the main frame that is *not* a PluginDocument.
295
296         * UIProcess/API/mac/WKViewInternal.h:
297         * WebProcess/WebPage/WebPage.cpp:
298         (WebKit::WebPage::scalePage):
299         Make sure to reset WebCore's page scale if the main frame contains a 
300         PluginDocument that takes care of page scale itself.
301
302         (WebKit::WebPage::didCommitLoad):
303         Do the same thing as what we do in WKView _didCommitLoadForMainFrame,
304         but without the UI process round-trip, to avoid an ugly flash.
305
306         * UIProcess/WebFrameProxy.cpp:
307         (WebKit::WebFrameProxy::didCommitLoad):
308         * UIProcess/WebFrameProxy.h:
309         (WebKit::WebFrameProxy::containsPluginDocument):
310         * UIProcess/WebPageProxy.cpp:
311         (WebKit::WebPageProxy::didCommitLoadForFrame):
312         * UIProcess/WebPageProxy.h:
313         * UIProcess/WebPageProxy.messages.in:
314         * UIProcess/mac/PageClientImpl.mm:
315         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
316         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
317         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
318         Plumb and keep track of whether the main frame contains a PluginDocument or not.
319
320 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
321
322         Unreviewed, roll out http://trac.webkit.org/changeset/187972.
323
324         * DatabaseProcess/DatabaseProcess.cpp:
325         (WebKit::DatabaseProcess::postDatabaseTask):
326         (WebKit::DatabaseProcess::performNextDatabaseTask):
327         * DatabaseProcess/DatabaseProcess.h:
328         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
329         (WebKit::UniqueIDBDatabase::shutdown):
330         (WebKit::UniqueIDBDatabase::postMainThreadTask):
331         (WebKit::UniqueIDBDatabase::performNextMainThreadTask):
332         (WebKit::UniqueIDBDatabase::postDatabaseTask):
333         (WebKit::UniqueIDBDatabase::performNextDatabaseTask):
334         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
335         * Platform/IPC/Connection.cpp:
336         (IPC::Connection::sendSyncMessage):
337         (IPC::Connection::sendSyncMessageFromSecondaryThread):
338         (IPC::Connection::waitForSyncReply):
339         (IPC::Connection::processIncomingSyncReply):
340         (IPC::Connection::connectionDidClose):
341         * Platform/IPC/Connection.h:
342         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
343         (WebKit::CoordinatedGraphicsScene::appendUpdate):
344         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
345         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
346         (WebKit::ThreadedCompositor::createCompositingThread):
347         (WebKit::ThreadedCompositor::runCompositingThread):
348         (WebKit::ThreadedCompositor::terminateCompositingThread):
349         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
350         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
351         (WebKit::CustomProtocolManager::addCustomProtocol):
352         (WebKit::CustomProtocolManager::removeCustomProtocol):
353         (WebKit::CustomProtocolManager::registerScheme):
354         (WebKit::CustomProtocolManager::unregisterScheme):
355         (WebKit::CustomProtocolManager::supportsScheme):
356         (WebKit::CustomProtocolManager::protocolForID):
357         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
358         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
359         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
360         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
361         (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
362         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
363         * WebProcess/Plugins/PluginProcessConnectionManager.h:
364         * WebProcess/WebPage/EventDispatcher.cpp:
365         (WebKit::EventDispatcher::addScrollingTreeForPage):
366         (WebKit::EventDispatcher::removeScrollingTreeForPage):
367         (WebKit::EventDispatcher::wheelEvent):
368         * WebProcess/WebPage/EventDispatcher.h:
369         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
370         (webkitSoupRequestInputStreamReadAsync):
371         (webkitSoupRequestInputStreamAddData):
372
373 2015-08-05  Ryosuke Niwa  <rniwa@webkit.org>
374
375         WebInspectorProxy should make WKWebView first responder
376         https://bugs.webkit.org/show_bug.cgi?id=147676
377
378         Reviewed by Timothy Hatcher.
379
380         Revert r181927 now that WKWebView forwards the first responder role to WKView as needed.
381
382         * UIProcess/mac/WebInspectorProxyMac.mm:
383         (WebKit::WebInspectorProxy::platformBringToFront):
384         (WebKit::WebInspectorProxy::platformAttach):
385
386 2015-08-04  Filip Pizlo  <fpizlo@apple.com>
387
388         Rename Mutex to DeprecatedMutex
389         https://bugs.webkit.org/show_bug.cgi?id=147675
390
391         Reviewed by Geoffrey Garen.
392
393         * DatabaseProcess/DatabaseProcess.cpp:
394         (WebKit::DatabaseProcess::postDatabaseTask):
395         (WebKit::DatabaseProcess::performNextDatabaseTask):
396         * DatabaseProcess/DatabaseProcess.h:
397         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
398         (WebKit::UniqueIDBDatabase::shutdown):
399         (WebKit::UniqueIDBDatabase::postMainThreadTask):
400         (WebKit::UniqueIDBDatabase::performNextMainThreadTask):
401         (WebKit::UniqueIDBDatabase::postDatabaseTask):
402         (WebKit::UniqueIDBDatabase::performNextDatabaseTask):
403         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
404         * Platform/IPC/Connection.cpp:
405         (IPC::Connection::sendSyncMessage):
406         (IPC::Connection::sendSyncMessageFromSecondaryThread):
407         (IPC::Connection::waitForSyncReply):
408         (IPC::Connection::processIncomingSyncReply):
409         (IPC::Connection::connectionDidClose):
410         * Platform/IPC/Connection.h:
411         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
412         (WebKit::CoordinatedGraphicsScene::appendUpdate):
413         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
414         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
415         (WebKit::ThreadedCompositor::createCompositingThread):
416         (WebKit::ThreadedCompositor::runCompositingThread):
417         (WebKit::ThreadedCompositor::terminateCompositingThread):
418         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
419         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
420         (WebKit::CustomProtocolManager::addCustomProtocol):
421         (WebKit::CustomProtocolManager::removeCustomProtocol):
422         (WebKit::CustomProtocolManager::registerScheme):
423         (WebKit::CustomProtocolManager::unregisterScheme):
424         (WebKit::CustomProtocolManager::supportsScheme):
425         (WebKit::CustomProtocolManager::protocolForID):
426         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
427         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
428         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
429         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
430         (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
431         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
432         * WebProcess/Plugins/PluginProcessConnectionManager.h:
433         * WebProcess/WebPage/EventDispatcher.cpp:
434         (WebKit::EventDispatcher::addScrollingTreeForPage):
435         (WebKit::EventDispatcher::removeScrollingTreeForPage):
436         (WebKit::EventDispatcher::wheelEvent):
437         * WebProcess/WebPage/EventDispatcher.h:
438         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
439         (webkitSoupRequestInputStreamReadAsync):
440         (webkitSoupRequestInputStreamAddData):
441
442 2015-08-05  Daniel Bates  <dabates@apple.com>
443
444         REGRESSION (r185111): Clicking phone numbers doesn't prompt to call sometimes
445         https://bugs.webkit.org/show_bug.cgi?id=147678
446         <rdar://problem/21827815>
447
448         Reviewed by Brady Eidson.
449
450         Teach WebKit to save and restore the "should open external URLs" policy.
451
452         * Shared/SessionState.cpp:
453         (WebKit::isValidEnum): Added.
454         (WebKit::PageState::encode): Modified to encode the "should open external URLs" policy.
455         (WebKit::PageState::decode): Modified to decode the "should open external URLs" policy.
456         * Shared/SessionState.h: Added ShouldOpenExternalURLsPolicy to PageState (defaults to WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow).
457         * UIProcess/API/Cocoa/WKWebView.mm:
458         (-[WKWebView _killWebContentProcessAndResetState]): Added; used in the unit test TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm.
459         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declare -[WKWebView _killWebContentProcessAndResetState].
460         * UIProcess/mac/LegacySessionStateCoding.cpp: Defined constant sessionHistoryEntryShouldOpenExternalURLsPolicyKey.
461         (WebKit::encodeSessionHistory): Modified to encode the "should open external URLs" policy.
462         (WebKit::decodeSessionHistoryEntry): Modified to decode the "should open external URLs" policy.
463         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
464         (WebKit::toPageState): Copy "should open external URLs" policy from specified history item.
465         (WebKit::toHistoryItem): Apply "should open external URLs" policy from PageState to HistoryItem.
466
467 2015-08-04  Antti Koivisto  <antti@apple.com>
468
469         Network cache fetches should have timeout
470         https://bugs.webkit.org/show_bug.cgi?id=147631
471
472         Reviewed by Andreas Kling.
473
474         System might be under heavy I/O pressure. If it takes long time to get data from disk we should load from network instead.
475
476         This patch introduces 1.5s timeout for disk reads. If the last dispatched cache read takes longer than that we cancel all
477         active and pending reads and just load those resources from network.
478
479         * NetworkProcess/cache/NetworkCacheStorage.cpp:
480         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
481         (WebKit::NetworkCache::Storage::ReadOperation::cancel):
482         (WebKit::NetworkCache::Storage::ReadOperation::finish):
483
484             Factor to functions.
485
486         (WebKit::NetworkCache::Storage::Storage):
487         (WebKit::NetworkCache::Storage::updateFileModificationTime):
488         (WebKit::NetworkCache::Storage::dispatchReadOperation):
489         (WebKit::NetworkCache::Storage::finishReadOperation):
490         (WebKit::NetworkCache::Storage::cancelAllReadOperations):
491         (WebKit::NetworkCache::Storage::dispatchPendingReadOperations):
492         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
493
494             Also make dispatch functions transfer the operation ownership.
495
496         (WebKit::NetworkCache::shouldStoreBodyAsBlob):
497         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
498         * NetworkProcess/cache/NetworkCacheStorage.h:
499
500 2015-08-04  Matt Rajca  <mrajca@apple.com>
501
502         Media Session: add a focus manager that WebKit clients can use to access the focused media element
503         https://bugs.webkit.org/show_bug.cgi?id=147629
504
505         Reviewed by Tim Horton.
506
507         * Shared/API/APIObject.h: Added a new type for the focus manager.
508         * Shared/API/c/WKBase.h: Added a new type for the focus manager.
509         * UIProcess/API/C/WKAPICast.h: Added a new type for the focus manager.
510         * UIProcess/API/C/WKContext.cpp: The "global" focus manager is accessed via WKContext.
511         (WKContextGetMediaSessionFocusManager):
512         * UIProcess/API/C/WKContext.h:
513         * UIProcess/API/C/WKMediaSessionFocusManager.cpp: Added C wrapper for WebMediaSessionFocusManager.
514         (WKMediaSessionFocusManagerGetTypeID):
515         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPaused):
516         * UIProcess/API/C/WKMediaSessionFocusManager.h: Added C wrapper for WebMediaSessionFocusManager.
517         * UIProcess/WebMediaSessionFocusManager.cpp: Added to keep track of the focused media element in the UI process and let clients query this state.
518         (WebKit::WebMediaSessionFocusManager::supplementName):
519         (WebKit::WebMediaSessionFocusManager::create):
520         (WebKit::WebMediaSessionFocusManager::WebMediaSessionFocusManager):
521         (WebKit::WebMediaSessionFocusManager::refWebContextSupplement):
522         (WebKit::WebMediaSessionFocusManager::derefWebContextSupplement):
523         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Check if the media element on the focused page is paused.
524         (WebKit::WebMediaSessionFocusManager::setFocusedMediaElement): Keep track of the focused page / media element pair.
525         (WebKit::WebMediaSessionFocusManager::clearFocusedMediaElement): Reset the focused page / media element pair.
526         * UIProcess/WebMediaSessionFocusManager.h: Added.
527         * UIProcess/WebPageProxy.cpp:
528         (WebKit::WebPageProxy::isMediaElementPaused): Updated to take a UnsignedCallback.
529         (WebKit::WebPageProxy::focusedContentMediaElementDidChange): Store the focused media element in the focus manager.
530         * UIProcess/WebPageProxy.h:
531         * UIProcess/WebProcessPool.cpp: Added WebMediaSessionFocusManager as a supplement.
532         * UIProcess/WebProcessPool.h: WebMediaSessionFocusManager is a supplement, so include its header.
533         * WebKit2.xcodeproj/project.pbxproj: Added new sources and ran sort-xcode-project.
534
535 2015-08-04  Anders Carlsson  <andersca@apple.com>
536
537         Get rid of ReasonForCallingAllowPlugins since it's not used anywhere
538         https://bugs.webkit.org/show_bug.cgi?id=147648
539
540         Reviewed by Andreas Kling.
541
542         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
543         (WebKit::WebFrameLoaderClient::objectContentType):
544         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
545         (WebKit::WebPlatformStrategies::getPluginInfo):
546         * WebProcess/WebPage/WebPage.cpp:
547         (WebKit::WebPage::createPlugin):
548         (WebKit::WebPage::canPluginHandleResponse):
549         (WebKit::WebPage::canShowMIMEType):
550
551 2015-08-04  Alexey Proskuryakov  <ap@apple.com>
552
553         Implement NPAPI redirect handling
554         https://bugs.webkit.org/show_bug.cgi?id=138675
555         rdar://problem/15779101
556
557         Patch by Jeffrey Pfau, updated and tweaked by me.
558
559         Reviewed by Anders Carlsson.
560
561         * PluginProcess/PluginControllerProxy.cpp:
562         (WebKit::PluginControllerProxy::loadURL):
563         (WebKit::PluginControllerProxy::continueStreamLoad):
564         (WebKit::PluginControllerProxy::cancelStreamLoad):
565         (WebKit::PluginControllerProxy::didEvaluateJavaScript):
566         (WebKit::PluginControllerProxy::streamWillSendRequest):
567         (WebKit::PluginControllerProxy::streamDidReceiveResponse):
568         * PluginProcess/PluginControllerProxy.h:
569         * PluginProcess/PluginControllerProxy.messages.in:
570         * WebProcess/Network/WebResourceLoader.cpp:
571         (WebKit::WebResourceLoader::willSendRequest):
572         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
573         (WebKit::NPN_ConvertPoint):
574         (WebKit::NPN_URLRedirectResponse):
575         (WebKit::initializeBrowserFuncs):
576         (WebKit::netscapeBrowserFuncs):
577         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
578         (WebKit::NetscapePlugin::getAuthenticationInfo):
579         (WebKit::NetscapePlugin::registerRedirect):
580         (WebKit::NetscapePlugin::urlRedirectResponse):
581         (WebKit::NetscapePlugin::setIsPlayingAudio):
582         (WebKit::NetscapePlugin::NPP_URLNotify):
583         (WebKit::NetscapePlugin::NPP_URLRedirectNotify):
584         (WebKit::NetscapePlugin::NPP_GetValue):
585         (WebKit::NetscapePlugin::didEvaluateJavaScript):
586         (WebKit::NetscapePlugin::streamWillSendRequest):
587         (WebKit::NetscapePlugin::streamDidReceiveResponse):
588         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
589         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
590         (WebKit::NetscapePluginStream::~NetscapePluginStream):
591         (WebKit::NetscapePluginStream::willSendRequest):
592         (WebKit::NetscapePluginStream::didReceiveResponse):
593         (WebKit::NetscapePluginStream::stop):
594         (WebKit::NetscapePluginStream::setURL):
595         (WebKit::NetscapePluginStream::cancel):
596         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
597         (WebKit::NetscapePluginStream::streamID):
598         (WebKit::NetscapePluginStream::npStream):
599         * WebProcess/Plugins/PDF/PDFPlugin.h:
600         * WebProcess/Plugins/Plugin.h:
601         * WebProcess/Plugins/PluginController.h:
602         * WebProcess/Plugins/PluginProxy.cpp:
603         (WebKit::PluginProxy::didEvaluateJavaScript):
604         (WebKit::PluginProxy::streamWillSendRequest):
605         (WebKit::PluginProxy::streamDidReceiveResponse):
606         (WebKit::PluginProxy::setPluginIsPlayingAudio):
607         (WebKit::PluginProxy::continueStreamLoad):
608         (WebKit::PluginProxy::cancelStreamLoad):
609         * WebProcess/Plugins/PluginProxy.h:
610         * WebProcess/Plugins/PluginProxy.messages.in:
611         * WebProcess/Plugins/PluginView.cpp:
612         (WebKit::PluginView::Stream::streamID):
613         (WebKit::PluginView::Stream::Stream):
614         (WebKit::PluginView::Stream::cancel):
615         (WebKit::PluginView::Stream::continueLoad):
616         (WebKit::buildHTTPHeaders):
617         (WebKit::lastModifiedDateMS):
618         (WebKit::PluginView::Stream::willSendRequest):
619         (WebKit::PluginView::Stream::didReceiveResponse):
620         (WebKit::PluginView::cancelStreamLoad):
621         (WebKit::PluginView::continueStreamLoad):
622         (WebKit::PluginView::cancelManualStreamLoad):
623         * WebProcess/Plugins/PluginView.h:
624
625 2015-08-04  Chris Dumez  <cdumez@apple.com>
626
627         Unreviewed, rolling out r187812.
628
629         This is not safe
630
631         Reverted changeset:
632
633         "[WK2] Reserve Vector capacity in VectorArgumentCoder<false,
634         T, inlineCapacity>::decode()"
635         https://bugs.webkit.org/show_bug.cgi?id=147619
636         http://trac.webkit.org/changeset/187812
637
638 2015-08-03  Chris Dumez  <cdumez@apple.com>
639
640         [WK2] Reserve Vector capacity in VectorArgumentCoder<false, T, inlineCapacity>::decode()
641         https://bugs.webkit.org/show_bug.cgi?id=147619
642
643         Reviewed by Andreas Kling.
644
645         Reserve Vector capacity in VectorArgumentCoder<false, T, inlineCapacity>::decode()
646         as we know the size of the Vector in advance.
647
648         * Platform/IPC/ArgumentCoders.h:
649
650 2015-08-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
651
652         [CoordinatedGraphics] Rearrange uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS
653         https://bugs.webkit.org/show_bug.cgi?id=147256
654
655         Reviewed by Benjamin Poulain.
656
657         Reduce uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS guard in order to fix build
658         breaks when USE_COORDINATED_GRAPHICS_MULTIPROCESS is off. This is first step to switch
659         between multiprocess model to thread model.
660
661         * PlatformEfl.cmake:
662         * Shared/DrawingAreaInfo.h:
663         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
664         (WKViewFindZoomableAreaForRect):
665         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
666         (WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy):
667         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
668         (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
669         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
670         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
671         (WebKit::PageViewportController::pageTransitionViewportReady):
672         * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp:
673         * UIProcess/CoordinatedGraphics/WebView.cpp:
674         * UIProcess/CoordinatedGraphics/WebView.h:
675         * UIProcess/WebPageProxy.cpp:
676         (WebKit::WebPageProxy::commitPageTransitionViewport):
677         * UIProcess/WebPageProxy.h:
678         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
679         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
680         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
681         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
682         * WebProcess/WebPage/DrawingAreaImpl.cpp:
683         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
684         * WebProcess/WebPage/DrawingAreaImpl.h:
685         * WebProcess/WebPage/LayerTreeHost.cpp:
686         (WebKit::LayerTreeHost::create):
687         * WebProcess/WebPage/WebPage.cpp:
688         (WebKit::WebPage::sendViewportAttributesChanged):
689         (WebKit::WebPage::pageDidRequestScroll):
690         * WebProcess/WebPage/WebPage.h:
691         * WebProcess/WebPage/WebPage.messages.in:
692
693 2015-08-03  Matt Rajca  <mrajca@apple.com>
694
695         Media Session: let UI clients query whether a media element is paused
696         https://bugs.webkit.org/show_bug.cgi?id=147588
697
698         Reviewed by Tim Horton.
699
700         Added plumbing to determine if a page's media element is paused.
701
702         * UIProcess/WebPageProxy.cpp:
703         (WebKit::WebPageProxy::isMediaElementPaused):
704         * UIProcess/WebPageProxy.h:
705         * WebProcess/WebPage/WebPage.cpp:
706         (WebKit::WebPage::isMediaElementPaused):
707         * WebProcess/WebPage/WebPage.h:
708         * WebProcess/WebPage/WebPage.messages.in:
709
710 2015-08-03  Chris Dumez  <cdumez@apple.com>
711
712         Make sure error handling code APIUserContentExtensionStore closes open file descriptors
713         https://bugs.webkit.org/show_bug.cgi?id=147562
714
715         Reviewed by Alex Christensen.
716
717         Make sure error handling code APIUserContentExtensionStore closes open
718         file descriptors to avoid leaking them.
719
720         * NetworkProcess/cache/NetworkCacheData.cpp:
721         (WebKit::NetworkCache::adoptAndMapFile):
722         * UIProcess/API/APIUserContentExtensionStore.cpp:
723         (API::compiledToFile):
724
725 2015-08-03  Beth Dakin  <bdakin@apple.com>
726
727         Need WKWebView API to enable/disable link preview
728         https://bugs.webkit.org/show_bug.cgi?id=147573
729         -and corresponding-
730         rdar://problem/22077836
731
732         Reviewed by Dan Bernstein.
733
734         WKView implementation.
735         * UIProcess/API/Cocoa/WKViewPrivate.h:
736
737         New API. Call into WKView to handle Mac.
738         * UIProcess/API/Cocoa/WKWebView.h:
739         * UIProcess/API/Cocoa/WKWebView.mm:
740         (-[WKWebView initWithFrame:configuration:]):
741         (-[WKWebView allowsLinkPreview]):
742         (-[WKWebView setAllowsLinkPreview:]):
743
744         Remove the SPI declaration from WKWebViewPrivate in order to make this API.
745         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
746
747         Handle the Mac side.
748         * UIProcess/API/mac/WKView.mm:
749         (-[WKView viewDidMoveToWindow]):
750         (-[WKView initWithFrame:processPool:configuration:webView:]):
751         (-[WKView allowsBackForwardNavigationGestures]):
752         (-[WKView allowsLinkPreview]):
753         (-[WKView setAllowsLinkPreview:]):
754
755         Don’t register previews when link preview is prevented.
756         * UIProcess/ios/WKContentViewInteraction.mm:
757         (-[WKContentView _registerPreview]):
758
759 2015-08-03  Tim Horton  <timothy_horton@apple.com>
760
761         [iOS] Link previews sometimes don't hide the link highlight
762         https://bugs.webkit.org/show_bug.cgi?id=147585
763         <rdar://problem/22119648>
764
765         Reviewed by Beth Dakin.
766
767         * UIProcess/ios/WKContentViewInteraction.mm:
768         (-[WKContentView _interactionStartedFromPreviewItemController:]):
769         (-[WKContentView _interactionStoppedFromPreviewItemController:]):
770         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
771         (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]): Deleted.
772         Use interactionStarted/Stopped, which are always called, instead of didDismiss/willPresent,
773         which are only called if we return a custom view controller from _presentedViewControllerForPreviewItemController.
774         We continue using didDismiss to inform clients of dismissal because they'll
775         only care if they customized the view controller.
776
777 2015-08-03  Chris Dumez  <cdumez@apple.com>
778
779         [WK2][NetworkCache] Do not munmap() on the main thread
780         https://bugs.webkit.org/show_bug.cgi?id=147569
781
782         Reviewed by Geoffrey Garen.
783
784         Do not munmap() on the main thread for performance reasons and
785         consistency as we already make sure to mmap() on another thread.
786
787         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
788         (WebKit::NetworkCache::Data::adoptMap):
789
790 2015-08-03  Wenson Hsieh  <wenson_hsieh@apple.com>
791
792         Inputs with the autofocus attribute cause the keyboard to not deploy
793         https://bugs.webkit.org/show_bug.cgi?id=147555
794         <rdar://problem/22018044>
795
796         Reviewed by Andreas Kling.
797
798         Upon submitting a form by pressing "Go" on the keyboard, an <input> on the next page with the
799         autofocus attribute may become non-interactible. When attempting to tap on the input, nothing
800         seems to happen. This is because the state of WebPage upon invoking WebPage::elementDidFocus
801         indicates (incorrectly) that the input element is already focused, and therefore hits an early
802         return. To solve this, we explicitly reset m_hasFocusedDueToUserInteraction upon transitioning
803         to a new page.
804
805         * WebProcess/WebPage/WebPage.cpp:
806         (WebKit::WebPage::didStartPageTransition): On iOS, resets m_hasFocusedDueToUserInteraction as
807             well. It was previously thought that this would be handled by blur() called on the assisted
808             element when submitting a form. However, pressing "Go" on the iOS keyboard is an implicit
809             submission and does not trigger a blur event.
810
811 2015-08-03  Chris Dumez  <cdumez@apple.com>
812
813         Fix error handling case in Cache::dumpContentsToFile()
814         https://bugs.webkit.org/show_bug.cgi?id=147567
815
816         Reviewed by Andreas Kling.
817
818         Cache::dumpContentsToFile() was expecting openFile() to return 0 in case
819         of error. However, it returns invalidPlatformFileHandle, which is -1 on
820         Unix.
821
822         * NetworkProcess/cache/NetworkCache.cpp:
823         (WebKit::NetworkCache::Cache::dumpContentsToFile):
824
825 2015-08-03  Chris Dumez  <cdumez@apple.com>
826
827         Make sure WebMemorySampler doesn't leak file descriptor
828         https://bugs.webkit.org/show_bug.cgi?id=147564
829
830         Reviewed by Anders Carlsson.
831
832         WebMemorySampler was opening files but never closing them.
833
834         * Shared/WebMemorySampler.cpp:
835         (WebKit::WebMemorySampler::stop):
836         * Shared/WebMemorySampler.h:
837
838 2015-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
839
840         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.5 release.
841
842         * gtk/NEWS: Add release notes for 2.9.5.
843
844 2015-07-27  Matt Rajca  <mrajca@apple.com>
845
846         Media Session: inform the UI process when the focused Content media element changes
847         https://bugs.webkit.org/show_bug.cgi?id=147323
848
849         Reviewed by Tim Horton.
850
851         * UIProcess/WebPageProxy.cpp:
852         (WebKit::WebPageProxy::isPlayingMediaDidChange):
853         * UIProcess/WebPageProxy.h:
854         * UIProcess/WebPageProxy.messages.in:
855         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
856         (WebKit::WebChromeClient::focusedContentMediaElementDidChange):
857         * WebProcess/WebCoreSupport/WebChromeClient.h:
858
859 2015-07-31  Chris Dumez  <cdumez@apple.com>
860
861         Drop dummy Timer callbacks
862         https://bugs.webkit.org/show_bug.cgi?id=147516
863
864         Reviewed by Alexey Proskuryakov.
865
866         Drop dummy Timer callbacks in the code base. A lot of Timer callbacks
867         do nothing else beside calling a particular method. In such case, we
868         can use the called method as Timer callback instead.
869
870         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
871         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
872         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
873         (WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired): Deleted.
874
875 2015-07-31  Chris Dumez  <cdumez@apple.com>
876
877         [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
878         https://bugs.webkit.org/show_bug.cgi?id=143348
879
880         Reviewed by Antti Koivisto.
881
882         Drop HTTP method from NetworkCache::Key as we only cache GET responses
883         for now. Even when we start caching HEAD responses, we likely will not
884         want the method to be part of the key because:
885         - A HEAD response can be used to update the headers of a previously cached response to GET
886         - A cached GET response may be used to satisfy subsequent HEAD requests
887
888         * NetworkProcess/cache/NetworkCache.cpp:
889         (WebKit::NetworkCache::makeCacheKey):
890         * NetworkProcess/cache/NetworkCacheKey.cpp:
891         (WebKit::NetworkCache::Key::Key):
892         (WebKit::NetworkCache::Key::operator==):
893         (WebKit::NetworkCache::Key::decode):
894         (WebKit::NetworkCache::Key::operator=): Deleted.
895         (WebKit::NetworkCache::Key::computeHash): Deleted.
896         (WebKit::NetworkCache::Key::encode): Deleted.
897         * NetworkProcess/cache/NetworkCacheKey.h:
898         (WebKit::NetworkCache::Key::method): Deleted.
899
900 2015-07-31  Chris Dumez  <cdumez@apple.com>
901
902         Coalesce concurrent authentication challenges for the same ProtectionSpace
903         https://bugs.webkit.org/show_bug.cgi?id=147496
904         <rdar://problem/16839069>
905
906         Reviewed by Alexey Proskuryakov.
907
908         Coalesce concurrent authentication challenges for the same ProtectionSpace.
909         Ideally, this would be done in the network layer but short term, this will
910         make sure the user no longer gets repeating authentication dialogs for the
911         same protection space.
912
913         This gets rid of a long-standing bug in WebKit / Safari where visiting a
914         site using HTTP authentication would pop up one authentication dialog for
915         each subresource being loaded from the network (especially when the main
916         resource is loaded from the cache).
917
918         * Shared/Authentication/AuthenticationManager.cpp:
919         (WebKit::canCoalesceChallenge):
920         (WebKit::AuthenticationManager::addChallengeToChallengeMap):
921         (WebKit::AuthenticationManager::shouldCoalesceChallenge):
922         (WebKit::AuthenticationManager::coalesceChallengesMatching):
923         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
924         (WebKit::AuthenticationManager::useCredentialForChallenge):
925         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
926         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
927         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
928         (WebKit::AuthenticationManager::cancelChallenge):
929         (WebKit::AuthenticationManager::cancelSingleChallenge):
930         (WebKit::AuthenticationManager::performDefaultHandling):
931         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
932         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
933         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
934         (WebKit::AuthenticationManager::AuthenticationManager): Deleted.
935         * Shared/Authentication/AuthenticationManager.h:
936
937 2015-07-31  Joseph Pecoraro  <pecoraro@apple.com>
938
939         Unreviewed parameter name typo fix.
940
941         * UIProcess/API/Cocoa/WKPreferences.mm:
942         (-[WKPreferences _setHiddenPageDOMTimerThrottlingEnabled:]):
943
944 2015-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
945
946         [GTK] NPAPI code crashes on Wayland
947         https://bugs.webkit.org/show_bug.cgi?id=147297
948
949         Reviewed by Žan Doberšek.
950
951         Do not crete NPAPI plugins when runing on Wayland, since they are
952         not supported. ENABLE_NETSCAPE_PLUGIN_API option used to be
953         incompatible with building with the Wayland target, but now that
954         we allow to build X11 and Wayland targets at the same time, we
955         need runtime checks to avoid creating NPAPI plugins in Wayland.
956
957         * UIProcess/API/gtk/WebKitSettings.cpp:
958         (webkit_settings_set_enable_plugins): Do not allow to change the
959         setting when running in Wayland.
960         * UIProcess/gtk/WebPreferencesGtk.cpp:
961         (WebKit::WebPreferences::platformInitializeStore): Initialize
962         EnablePlugins preference to false when running in Wayland.
963
964 2015-07-30  Joseph Pecoraro  <pecoraro@apple.com>
965
966         LayoutTests/inspector frequently run slow and timeout when run in WebKit2 but not WebKit1
967         https://bugs.webkit.org/show_bug.cgi?id=147456
968
969         Reviewed by Timothy Hatcher.
970
971         By default, WebKit2 WebPage's on PLATFORM(COCOA) enabling DOM Timer
972         throttling. Under testing, this ends up impacting Web Inspector
973         tests that create their own WKWebView which never gets displayed
974         and so gets throttled. Disable throttling on the Inspector's view
975         during testing.
976
977         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
978         * UIProcess/API/Cocoa/WKPreferences.mm:
979         (-[WKPreferences _hiddenPageDOMTimerThrottlingEnabled]):
980         (-[WKPreferences _setHiddenPageDOMTimerThrottlingEnabled:]):
981         SPI to toggle DOM timer throttling.
982
983         * UIProcess/WebInspectorProxy.cpp:
984         (WebKit::WebInspectorProxy::createInspectorPage):
985         * UIProcess/WebInspectorProxy.h:
986         (WebKit::WebInspectorProxy::isUnderTest):
987         Provide a way to get if we are under test, and set it before
988         calling into the platform method.
989
990         * UIProcess/mac/WebInspectorProxyMac.mm:
991         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
992         When testing, disable timer throttling.
993
994 2015-07-30  Eric Carlson  <eric.carlson@apple.com>
995
996         [iOS] Set AirPlay discovery mode to disabled when page is hidden
997         https://bugs.webkit.org/show_bug.cgi?id=147455
998
999         Reviewed by Enrica Casucci.
1000
1001         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1002         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Set discovery mode to disabled after
1003           the picker has been closed.
1004         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Ditto.
1005
1006 2015-07-29  Dean Jackson  <dino@apple.com>
1007
1008         Don't use (Details) when exposing SPI
1009         https://bugs.webkit.org/show_bug.cgi?id=147426
1010         <rdar://problem/22062407>
1011
1012         Reviewed by Dan Bernstein.
1013
1014         If we are declaring the interface without any implementation,
1015         we should use class extensions.
1016
1017         * Platform/spi/ios/AssertionServicesSPI.h:
1018         * Platform/spi/ios/CorePDFSPI.h:
1019         * Platform/spi/ios/DataDetectorsUISPI.h:
1020         * Platform/spi/ios/ManagedConfigurationSPI.h:
1021         * Platform/spi/ios/UIKitSPI.h:
1022         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1023         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
1024         * UIProcess/_WKWebViewPrintFormatter.mm:
1025         * UIProcess/mac/WebPageProxyMac.mm:
1026
1027 2015-07-30  Chris Dumez  <cdumez@apple.com>
1028
1029         [WK2][NetworkCache] Stop closing files on the main thread
1030         https://bugs.webkit.org/show_bug.cgi?id=147410
1031
1032         Reviewed by Andreas Kling.
1033
1034         After r186510, we no longer open cache files on the main thread.
1035         However, we still close them on the main thread. This patch makes
1036         sure we close the files on another thread instead.
1037
1038         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1039         (WebKit::NetworkCache::IOChannel::IOChannel):
1040
1041 2015-07-30  Simon Fraser  <simon.fraser@apple.com>
1042
1043         Convert Path applier to use std::function
1044         https://bugs.webkit.org/show_bug.cgi?id=147368
1045
1046         Reviewed by Sam Weinig.
1047
1048         Use std::function for Path::apply().
1049
1050         * Shared/WebCoreArgumentCoders.cpp:
1051         (IPC::pathEncodeApplierFunction):
1052         (IPC::ArgumentCoder<Path>::encode):
1053         (IPC::pathPointCountApplierFunction): Deleted.
1054
1055 2015-07-30  Joonghun Park  <jh718.park@samsung.com>
1056
1057         [EFL] Enable IndexedDB based on DatabaseProcess
1058         https://bugs.webkit.org/show_bug.cgi?id=147221
1059
1060         Reviewed by Csaba Osztrogonác.
1061
1062         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Add ecore_init().
1063         Without this call, it leads to crash when launching DatabaseProcess.
1064         * PlatformEfl.cmake: Add missing include_directory.
1065         * Shared/efl/ProcessExecutablePathEfl.cpp:
1066         (WebKit::executablePathOfDatabaseProcess):
1067         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
1068         (WebKit::ProcessLauncher::launchProcess):
1069         * UIProcess/efl/WebProcessPoolEfl.cpp:
1070         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
1071         Add default path for indexedDB sqlite3 db file.
1072
1073 2015-07-30  Chris Dumez  <cdumez@apple.com>
1074
1075         Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
1076         https://bugs.webkit.org/show_bug.cgi?id=147446
1077
1078         Reviewed by Simon Fraser.
1079
1080         Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
1081         by leveraging the fact that we know in advance how many layer IDs are going to be added. We
1082         now set the Vector size from the start, instead of clearing it and then growing the vector
1083         capacity when appending the layer IDs one by one.
1084
1085         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1086         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1087
1088 2015-07-30  Chris Dumez  <cdumez@apple.com>
1089
1090         Mark more classes as fast allocated
1091         https://bugs.webkit.org/show_bug.cgi?id=147440
1092
1093         Reviewed by Sam Weinig.
1094
1095         Mark more classes as fast allocated for performance. We heap-allocate
1096         objects of those types throughout the code base.
1097
1098         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1099         * NetworkProcess/cache/NetworkCacheStorage.h:
1100         * Platform/IPC/MessageRecorder.h:
1101         * Platform/mac/LayerHostingContext.h:
1102
1103 2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
1104
1105         Implement basic types for ECMAScript Internationalization API
1106         https://bugs.webkit.org/show_bug.cgi?id=146926
1107
1108         Reviewed by Benjamin Poulain.
1109
1110         * Configurations/FeatureDefines.xcconfig: Enabled INTL.
1111
1112 2015-07-29  Chris Dumez  <cdumez@apple.com>
1113
1114         [WK2] Use FastMalloc in IPC::MessageDecoder
1115         https://bugs.webkit.org/show_bug.cgi?id=147425
1116
1117         Reviewed by Sam Weinig.
1118
1119         Use FastMalloc in IPC::MessageDecoder instead of system malloc, for
1120         performance reasons and consistency.
1121
1122         * Platform/IPC/ArgumentDecoder.cpp:
1123         (IPC::ArgumentDecoder::~ArgumentDecoder):
1124         (IPC::ArgumentDecoder::initialize):
1125
1126 2015-07-29  Enrica Casucci  <enrica@apple.com>
1127
1128         Preview should not start if touch handler prevents default.
1129         https://bugs.webkit.org/show_bug.cgi?id=147423
1130         rdar://problem/22061043
1131
1132         Reviewed by Tim Horton.
1133
1134         We need to check if _highlightLongPressCanClick has not been reset before
1135         we allow the preview. It can be reset by a touch handler preventing default.
1136
1137         * UIProcess/ios/WKContentViewInteraction.mm:
1138         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1139
1140 2015-07-29  Chris Fleizach  <cfleizach@apple.com>
1141
1142         AX: iOS: VoiceOver hangs indefinitely when an JS alert appears
1143         https://bugs.webkit.org/show_bug.cgi?id=147386
1144
1145         Reviewed by Dan Bernstein.
1146
1147         Make sure this also builds on iOS8.
1148
1149         * Platform/IPC/mac/ConnectionMac.mm:
1150
1151 2015-07-29  Michael Catanzaro  <mcatanzaro@igalia.com>
1152
1153         [Seccomp] Further improvements to default web process policy
1154         https://bugs.webkit.org/show_bug.cgi?id=142987
1155
1156         Provide various helper functions to allow more flexible construction of
1157         filesystem access policies.
1158
1159         Reviewed by Žan Doberšek.
1160
1161         Improve the policy. Also, remove ifdefs to reduce potential for breakage in non-default
1162         configurations.
1163
1164         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
1165         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
1166
1167 2015-07-29  Chris Dumez  <cdumez@apple.com>
1168
1169         Avoid unnecessarily constructing PlatformMediaSessionManager on Document destruction
1170         https://bugs.webkit.org/show_bug.cgi?id=147398
1171
1172         Reviewed by Jer Noble.
1173
1174         Only call PlatformMediaSessionManager::stopAllMediaPlaybackForProcess() in
1175         destructors if an PlatformMediaSessionManager instance already exists, to 
1176         avoid constructing one unecessarily at that point.
1177
1178         * WebProcess/WebProcess.cpp:
1179         (WebKit::WebProcess::didClose):
1180
1181 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1182
1183         [GTK] Add API to set the maximum number of web processes per WebKitWebContext
1184         https://bugs.webkit.org/show_bug.cgi?id=147108
1185
1186         Reviewed by Gustavo Noronha Silva.
1187
1188         * UIProcess/API/gtk/WebKitWebContext.cpp:
1189         (webkit_web_context_set_web_process_count_limit):
1190         (webkit_web_context_get_web_process_count_limit):
1191         * UIProcess/API/gtk/WebKitWebContext.h:
1192         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1193
1194 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1195
1196         [GTK] Fix empty space in popup menus when first item is selected
1197         https://bugs.webkit.org/show_bug.cgi?id=147358
1198
1199         Reviewed by Martin Robinson.
1200
1201         It happens when one of the first elements are selected, because we
1202         try to center the current selection on the combo element. When the
1203         menu is large enough to make the element centered we need to leave
1204         empty space at the beginning. This can be fixed by not scrolling
1205         to center the selected item when it's above the combo
1206         element. This ensure the selected item will always be visible,
1207         even if it's not centered. If the selected item is already
1208         centered or below the combo element, the behaviour doesn't change
1209         and we scroll to center it.
1210
1211         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
1212         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
1213
1214 2015-07-28  Jincheol Jo  <jincheol.jo@navercorp.com>
1215
1216         [EFL] Fix typos in ewk_extension.cpp
1217         https://bugs.webkit.org/show_bug.cgi?id=147396
1218
1219         Reviewed by Gyuyoung Kim.
1220
1221         Fix from toEwkExtendion to toEwkExtension.
1222
1223         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
1224         (toEwkExtension):
1225         (EwkExtension::didCreatePage):
1226         (EwkExtension::willDestroyPage):
1227         (EwkExtension::didReceiveMessage):
1228         (toEwkExtendion): Deleted.
1229
1230 2015-07-28  Alexey Proskuryakov  <ap@apple.com>
1231
1232         Clean up usesAsyncCallbacks handling in ResourceHandle
1233         https://bugs.webkit.org/show_bug.cgi?id=147342
1234
1235         Reviewed by Darin Adler.
1236
1237         Update for a renaming in WebCore.
1238
1239         * NetworkProcess/NetworkResourceLoader.cpp:
1240         (WebKit::NetworkResourceLoader::cleanup):
1241         * Shared/Downloads/soup/DownloadSoup.cpp:
1242         (WebKit::Download::platformInvalidate):
1243
1244 2015-07-28  Chris Fleizach  <cfleizach@apple.com>
1245
1246         AX: iOS: VoiceOver hangs indefinitely when an JS alert appears
1247         https://bugs.webkit.org/show_bug.cgi?id=147386
1248
1249         Reviewed by Anders Carlsson.
1250
1251         Support the iOS platform API to notify accessibility clients when the WebProcess is about to suspend (because of some modal dialog).
1252         Luckily, we did all the hardwork for OSX a few years ago to support this paradigm.         
1253
1254         * Platform/IPC/mac/ConnectionMac.mm:
1255         (IPC::AccessibilityProcessSuspendedNotification):
1256         (IPC::Connection::willSendSyncMessage):
1257         (IPC::Connection::didReceiveSyncReply):
1258
1259 2015-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
1260
1261         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"
1262         https://bugs.webkit.org/show_bug.cgi?id=147350
1263
1264         Reviewed by Sam Weinig.
1265
1266         * Configurations/FeatureDefines.xcconfig:
1267
1268 2015-07-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
1269
1270         [iOS] REGRESSION(r168075): Fullscreen web video doesn't pause on screen lock
1271         https://bugs.webkit.org/show_bug.cgi?id=147269
1272
1273         Reviewed by Andreas Kling.
1274
1275         Media elements should pause when the application is going to EnterBackground
1276         under lock regardless whether it is in full screen or not.
1277
1278         * Platform/spi/ios/UIKitSPI.h: Forward declare [UIApplication isSuspendedUnderLock].
1279
1280         * UIProcess/ios/WebPageProxyIOS.mm:
1281         (WebKit::WebPageProxy::applicationDidEnterBackground):
1282         [UIApp isSuspendedUnderLock] can only be called in the UIProcess. We need
1283         to call it here and pass it to the WebPage in the WebProcess as part of the
1284         ApplicationDidEnterBackground message.
1285         
1286         * WebProcess/WebPage/WebPage.h:
1287         * WebProcess/WebPage/WebPage.messages.in: Add the new parameter:
1288         'isSuspendedUnderLock' to the ApplicationDidEnterBackground message.
1289         
1290         * WebProcess/WebPage/ios/WebPageIOS.mm:
1291         (WebKit::WebPage::applicationDidEnterBackground): On iOS, the WebPage needs
1292         to notify the MediaSessionManagerIOS that it received the message 
1293         ApplicationDidEnterBackground.
1294
1295 2015-07-28  Yongjun Zhang  <yongjun_zhang@apple.com>
1296
1297         Bounds in InteractionInformationAtPosition should be always in main frame coordinate space.
1298         https://bugs.webkit.org/show_bug.cgi?id=147372
1299
1300         When we prepare the bounds for InteractionInformationAtPosition, we should convert the rect to
1301         main frame space since WKContent in UIProcess expects it to be in the web view space.
1302
1303         Reviewed by Tim Horton.
1304
1305         * WebProcess/WebPage/ios/WebPageIOS.mm:
1306         (WebKit::WebPage::getPositionInformation): Convert the bounding rect to main frame space if the element is inside a sub-frame.
1307
1308 2015-07-27  Simon Fraser  <simon.fraser@apple.com>
1309
1310         PathApplierFunction should take a reference to a PathElement
1311         https://bugs.webkit.org/show_bug.cgi?id=147337
1312
1313         Reviewed by Dan Bates.
1314
1315         Convert PathApplierFunction to take a const PathElement&, since it can never be null.
1316
1317         * Shared/WebCoreArgumentCoders.cpp:
1318         (IPC::pathPointCountApplierFunction):
1319         (IPC::pathEncodeApplierFunction):
1320
1321 2015-07-28  Jer Noble  <jer.noble@apple.com>
1322
1323         [iOS] Notify fullscreen controller in UIProcess whether external playback is allowed
1324         https://bugs.webkit.org/show_bug.cgi?id=147343
1325
1326         Reviewed by Brady Eidson.
1327
1328         Pass the boolean property wirelessVideoPlaybackDisabled across the UIProcess/WebProcess boundary.
1329
1330         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1331         (WebKit::WebVideoFullscreenManagerProxy::setWirelessVideoPlaybackDisabled):
1332         * WebProcess/ios/WebVideoFullscreenManager.mm:
1333         (WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
1334         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
1335         (WebKit::WebVideoFullscreenManager::setWirelessVideoPlaybackDisabled):
1336
1337 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1338
1339         [GTK] Use fastMalloc instead of g_slice
1340         https://bugs.webkit.org/show_bug.cgi?id=147357
1341
1342         Reviewed by Sergio Villar Senin.
1343
1344         The use of g_slice is no longer encouraged by glib developers.
1345
1346         * UIProcess/API/gtk/WebKitCredential.cpp:
1347         (webkitCredentialCreate):
1348         (webkit_credential_free):
1349         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
1350         (webkitJavascriptResultCreate):
1351         (webkit_javascript_result_unref):
1352         * UIProcess/API/gtk/WebKitMimeInfo.cpp:
1353         (webkitMimeInfoCreate):
1354         (webkit_mime_info_unref):
1355         * UIProcess/API/gtk/WebKitNavigationAction.cpp:
1356         (webkitNavigationActionCreate):
1357         (webkit_navigation_action_copy):
1358         (webkit_navigation_action_free):
1359         * UIProcess/API/gtk/WebKitPrivate.h:
1360         * UIProcess/API/gtk/WebKitScriptDialog.cpp:
1361         (webkitScriptDialogCopy):
1362         (webkitScriptDialogFree):
1363         * UIProcess/API/gtk/WebKitUserContent.cpp:
1364         (webkit_user_style_sheet_unref):
1365         (webkit_user_style_sheet_new):
1366         (webkit_user_script_unref):
1367         (webkit_user_script_new):
1368
1369 2015-07-27  Dan Bernstein  <mitz@apple.com>
1370
1371         [iOS] REGRESSION (r187376): Form editing buttons are missing from the Shortcut Bar
1372         https://bugs.webkit.org/show_bug.cgi?id=147351
1373
1374         Reviewed by Adele Peterson.
1375
1376         We were relying on -[WKContentView inputAccessoryView] getting called to initialize the form
1377         accessory view, even when that method would always return nil, as it does on iPad. After
1378         r187376, that method changed to initializing the view only when returning it, which caused
1379         this bug.
1380
1381         * UIProcess/ios/WKContentViewInteraction.mm:
1382         (-[WKContentView _displayFormNodeInputView]): Call the new -_ensureFormAccessoryView from
1383         here, when we are going to need the view.
1384         (-[WKContentView _ensureFormAccessoryView]): Moved initialization code from
1385         -inputAccessoryView here, and removed outdated +instancesRespondToSelector: check.
1386         (-[WKContentView inputAccessoryView]): Now calls through -formAccessoryView.
1387         (-[WKContentView formAccessoryView]): Added call to -_ensureFormAccessoryView here.
1388
1389 2015-07-27  Andreas Kling  <akling@apple.com>
1390
1391         WebsiteDataStore should clean up its storage in the network process when destroyed.
1392         <https://webkit.org/b/147349>
1393         <rdar://problem/21838764>
1394
1395         Reviewed by Darin Adler.
1396
1397         Have ~WebsiteDataStore() send a DestroyPrivateBrowsingSession message to all networking processes
1398         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
1399         CFNetwork object graph.
1400
1401         This complements r187115 which did the same for network process storage owned by
1402         API::Session objects.
1403
1404         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1405         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1406
1407 2015-07-27  Tim Horton  <timothy_horton@apple.com>
1408
1409         First in-window viewStateChange synchronously blocks despite not previously being in-window
1410         https://bugs.webkit.org/show_bug.cgi?id=147344
1411         <rdar://problem/22021772>
1412
1413         Reviewed by Simon Fraser.
1414
1415         * UIProcess/WebPageProxy.cpp:
1416         (WebKit::WebPageProxy::updateViewState):
1417         (WebKit::WebPageProxy::dispatchViewStateChange):
1418         The whole point of m_viewWasEverInWindow was so that we would not
1419         synchronously wait when a view was added to a window for the first time,
1420         only all subsequent times.
1421
1422         However, since m_viewWasEverInWindow was being set *before* being
1423         checked in dispatchViewStateChange, we were always blocking. This is
1424         a huge waste of main-thread time, because there's no reason to wait
1425         for the first paint if you've never seen the view before (and shouldn't
1426         expect it to have content).
1427
1428         Instead, set the flag after dispatching a view state change, so it becomes
1429         "have we ever sent a view state with IsInWindow set" instead.
1430
1431 2015-07-27  Tim Horton  <timothy_horton@apple.com>
1432
1433         [iOS] Long press or link click can sometimes trigger during/after a preview
1434         https://bugs.webkit.org/show_bug.cgi?id=147338
1435         <rdar://problem/22020770>
1436
1437         Reviewed by Enrica Casucci.
1438
1439         * UIProcess/ios/WKContentViewInteraction.mm:
1440         (-[WKContentView _longPressRecognized:]):
1441         Bail if we're previewing.
1442
1443         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1444         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
1445         Always avoid allowing clicks and start interaction when previewing a link.
1446
1447 2015-07-27  Andreas Kling  <akling@apple.com>
1448
1449         [iOS] Occasional crashes in WebPage::elementDidBlur()'s async block.
1450         <https://webkit.org/b/147281>
1451         <rdar://problem/21701858>
1452
1453         Reviewed by Anders Carlsson.
1454
1455         Protect the WebPage object until the dispatch_async block has finished.
1456         I have no way to repro this, but there's evidence of some crashing here.
1457
1458         * WebProcess/WebPage/ios/WebPageIOS.mm:
1459         (WebKit::WebPage::elementDidBlur):
1460
1461 2015-07-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1462
1463         [Seccomp] Set appropriate filters when trapping syscalls by default
1464         https://bugs.webkit.org/show_bug.cgi?id=142983
1465
1466         If we trap syscalls by default, we must not set separate filters to trap
1467         anything here, since it will fail causing us to crash.
1468
1469         But also, there are some things we must allow unconditionally even when
1470         trapping by default. sigreturn, obviously. Also, let's whitelist brk
1471         here instead of in platform-specific code.
1472
1473         Reviewed by Žan Doberšek.
1474
1475         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1476         (WebKit::SeccompBroker::launchProcess): Don't trap sigprocmask or sigaction unless allow is
1477         the default action. Also, allow sigreturn and brk is allow is not the default.
1478         * Shared/linux/SeccompFilters/SeccompFilters.cpp: Added
1479         (WebKit::SeccompFilters::defaultAction):
1480         * Shared/linux/SeccompFilters/SeccompFilters.h: Added defaultAction
1481
1482 2015-07-27  Matthew Daiter  <mdaiter@apple.com>
1483
1484         Renamed duplicate vectors inside UserMediaPermissionRequestProxy
1485         https://bugs.webkit.org/show_bug.cgi?id=147321
1486         <rdar://problem/22011290>
1487
1488         Reviewed by Eric Carlson.
1489
1490         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1491         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
1492         * UIProcess/UserMediaPermissionRequestProxy.h:
1493         (WebKit::UserMediaPermissionRequestProxy::videoDeviceUIDs):
1494         (WebKit::UserMediaPermissionRequestProxy::audioDeviceUIDs):
1495         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsVideo): Deleted.
1496         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsAudio): Deleted.
1497         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1498         (WebKit::UserMediaPermissionRequestManager::startRequest):
1499
1500 2015-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1501
1502         [GTK] Pass a GstInstallPluginsContext to gst_install_plugins_async
1503         https://bugs.webkit.org/show_bug.cgi?id=147103
1504
1505         Reviewed by Philippe Normand.
1506
1507         This allows PackageKit to properly position the window and make it
1508         transient to the web view window.
1509
1510         * UIProcess/API/gtk/PageClientImpl.cpp:
1511         (WebKit::PageClientImpl::setCursor): Disambiguate Cursor now that
1512         we include gtkx.h.
1513         (WebKit::PageClientImpl::createGstInstallPluginsContext): Create a
1514         new GstInstallPluginsContext and set the web view window XID when
1515         running on X11.
1516         * UIProcess/API/gtk/PageClientImpl.h:
1517         * UIProcess/PageClient.h:
1518         * UIProcess/efl/WebViewEfl.h:
1519         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
1520         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Use
1521         PageClient::createGstInstallPluginsContext() to create a new
1522         GstInstallPluginsContext and pass it to gst_install_plugins_async().
1523
1524 2015-07-26  Gwang Yoon Hwang  <yoon@igalia.com>
1525
1526         [ThreadedCompositor] Unreviewed build fix after r186059
1527         https://bugs.webkit.org/show_bug.cgi?id=147315
1528
1529         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1530         (WebKit::ThreadedCompositor::glContext):
1531         Explicitly cast u_int64 to GLNativeWindowType.
1532         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1533         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
1534         Update declaration to match with modified definition.
1535
1536
1537 2015-07-26  Chris Dumez  <cdumez@apple.com>
1538
1539         [WK2][iOS] WebContent process main thread should have fixed priority
1540         https://bugs.webkit.org/show_bug.cgi?id=147313
1541         <rdar://problem/22003112>
1542
1543         Reviewed by Darin Adler.
1544
1545         WebContent process main thread should have fixed priority on iOS 9.
1546         Priority decay regresses PLT and fixing the main thread's priority
1547         gives up a ~3% progression on warm PLT (tested on iPhone 5s).
1548
1549         * WebProcess/cocoa/WebProcessCocoa.mm:
1550         (WebKit::WebProcess::platformInitializeWebProcess):
1551
1552 2015-07-26  Dan Bernstein  <mitz@apple.com>
1553
1554         Suppressed an Xcode 7 warning about including a nib in an iOS build product.
1555
1556         * Configurations/BaseLegacyProcess.xcconfig: Exclude xib files on iOS.
1557         * Configurations/BaseXPCService.xcconfig: Ditto.
1558
1559 2015-07-24  Ryosuke Niwa  <rniwa@webkit.org>
1560
1561         iOS 8 build fix attempt after r187215.
1562
1563         * UIProcess/API/Cocoa/WKWebView.mm:
1564         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Deleted.
1565
1566 2015-07-24  Yongjun Zhang  <yongjun_zhang@apple.com>
1567
1568         Don't create UIWebFormAccessory if we don't require accessory view.
1569         https://bugs.webkit.org/show_bug.cgi?id=147283
1570
1571         Don't try to intialize _formAccessoryView if requiresAccessoryView returns false since we don't
1572         need it yet.
1573
1574         Reviewed by Dan Bernstein.
1575
1576         * UIProcess/ios/WKContentViewInteraction.mm:
1577         (-[WKContentView inputAccessoryView]):
1578
1579 2015-07-24  Anders Carlsson  <andersca@apple.com>
1580
1581         WKWebsiteDataStore remove methods don't properly delete cookies
1582         https://bugs.webkit.org/show_bug.cgi?id=147282
1583         rdar://problem/21948230
1584
1585         Reviewed by Sam Weinig.
1586
1587         * NetworkProcess/NetworkProcess.cpp:
1588         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1589         Call deleteCookiesForHostnames instead of iterating over each hostname.
1590
1591         * WebProcess/Cookies/WebCookieManager.cpp:
1592         (WebKit::WebCookieManager::deleteCookiesForHostname):
1593         Call deleteCookiesForHostnames.
1594
1595 2015-07-24  Anders Carlsson  <andersca@apple.com>
1596
1597         Networking process crash in NetworkConnectionToWebProcess::convertMainResourceLoadToDownload while attempting to download a blob
1598         https://bugs.webkit.org/show_bug.cgi?id=147276
1599         rdar://problem/21423353
1600
1601         Reviewed by Andreas Kling.
1602
1603         We currently don't support downloading blobs, so for now just bail if we encounter a null loader inside
1604         convertMainResourceLoadToDownload (which happens when trying to download a blob URL).
1605
1606         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1607         (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
1608         Rewrite the assertion to be more clear - it's fine to do an extra hash lookup in debug builds.
1609
1610         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1611         Bail if loader is null.
1612
1613 2015-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1614
1615         Remove runtime flags for symbols
1616         https://bugs.webkit.org/show_bug.cgi?id=147246
1617
1618         Reviewed by Alex Christensen.
1619
1620         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1621         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1622
1623 2015-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1624
1625         Object.getOwnPropertySymbols on large list takes very long
1626         https://bugs.webkit.org/show_bug.cgi?id=146137
1627
1628         Reviewed by Mark Lam.
1629
1630         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1631         (WebKit::NPJSObject::enumerate):
1632
1633 2015-07-24  Simon Fraser  <simon.fraser@apple.com>
1634
1635         Recode.net gets into a continual resize loop in split fullscreen
1636         https://bugs.webkit.org/show_bug.cgi?id=147266
1637         rdar://problem/21409047
1638
1639         Reviewed by Tim Horton.
1640         
1641         In split fullscreen, we use fixed layout and scale to shrink pages down to
1642         fit a given width. This is re-evaluated every time the document width changes.
1643         However some pages, like recode.net, end up continually resizing because
1644         when laid out unconstrained they use a narrower width than when laid out with
1645         a fixed layout size. In fixed layout, they actually use more width than the fixed
1646         layout size.
1647         
1648         Detect and break this cycle by just not re-scaling when we've done one fixed layout,
1649         and the document is now taking more width than the fixed layout width.
1650
1651         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1652         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
1653
1654 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1655
1656         [GStreamer] Crashes during plugin installation
1657         https://bugs.webkit.org/show_bug.cgi?id=144099
1658
1659         Reviewed by Philippe Normand.
1660
1661         Move the missing plugins installation to the UI process, ensuring
1662         there's a single installer running and cancelling the request when
1663         the page is closed or the media player is deleted.
1664
1665         * PlatformEfl.cmake: Add new files to compilation.
1666         * PlatformGTK.cmake: Ditto.
1667         * UIProcess/WebPageProxy.h:
1668         * UIProcess/WebPageProxy.messages.in: Add
1669         RequestInstallMissingMediaPlugins message.
1670         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: Added.
1671         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Call
1672         gst_install_plugins_async() and send
1673         DidEndRequestInstallMissingMediaPlugins message back to the web
1674         process when done.
1675         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1676         (WebKit::WebChromeClient::requestInstallMissingMediaPlugins): Call
1677         WebPage::requestInstallMissingMediaPlugins().
1678         * WebProcess/WebCoreSupport/WebChromeClient.h:
1679         * WebProcess/WebPage/WebPage.cpp:
1680         (WebKit::WebPage::close): Invalidate the install missing plugins
1681         request callback.
1682         * WebProcess/WebPage/WebPage.h:
1683         * WebProcess/WebPage/WebPage.messages.in: Add
1684         DidEndRequestInstallMissingMediaPlugins message.
1685         * WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp: Added.
1686         (WebKit::WebPage::requestInstallMissingMediaPlugins): Send
1687         RequestInstallMissingMediaPlugins to the UI process or complete
1688         the request early if there's already a request in progress.
1689         (WebKit::WebPage::didEndRequestInstallMissingMediaPlugins):
1690         Complete the request.
1691
1692 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1693
1694         Unreviewed. Fix the build with MEDIA_STREAM disabled after r187282.
1695
1696         RealtimeMediaSource is only defined when MEDIA_STREAM is enabled.
1697
1698         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1699         * UIProcess/UserMediaPermissionRequestProxy.h:
1700
1701 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1702
1703         REGRESSION(r187100): [GTK] ASSERTION FAILED: Attempt to access post layout data before receiving it when typing backspace
1704         https://bugs.webkit.org/show_bug.cgi?id=147196
1705
1706         Reviewed by Žan Doberšek.
1707
1708         Do not try to use the PostLayoutData from EditorState when
1709         isMissingPostLayoutData is true. That happens when there's a
1710         layout pending, and EditorStateChanged is sent again after that
1711         layout with the post layout data. So we can just return early and
1712         wait until the second message.
1713
1714         * UIProcess/API/gtk/WebKitEditorState.cpp:
1715         (webkitEditorStateChanged):
1716         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1717         (webkitWebViewBaseUpdateTextInputState):
1718
1719 2015-07-23  Alex Christensen  <achristensen@webkit.org>
1720
1721         Fix 32-bit build after r187272.
1722
1723         * UIProcess/mac/PageClientImpl.mm:
1724         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
1725         Added some WK_API_ENABLED.
1726
1727 2015-07-23  Dan Bernstein  <mitz@apple.com>
1728
1729         <rdar://problem/21929532> REGRESSION (r184026): Safari AutoFill with Contact info for phone number is broken
1730         https://bugs.webkit.org/show_bug.cgi?id=147249
1731
1732         Reviewed by Sam Weinig.
1733
1734         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1735         (encodeObject): Use encodeString only for strings that encode as NSString or
1736         NSMutableString. It can’t encode arbitrary NSString subclasses.
1737         (decodeObject): Use decodeString for NSMutableString as well.
1738
1739 2015-07-23  Zalan Bujtas  <zalan@apple.com>
1740
1741         [iOS] REGRESSION (187131): Loading CuteOverload zooms in to the top left corner.
1742         https://bugs.webkit.org/show_bug.cgi?id=147251
1743         rdar://problem/21953359
1744
1745         Calling zoomToRect() should result in essentially the same zoom scale as if we
1746         called setZoomScale with the new page scale factor.
1747  
1748         Reviewed by Benjamin Poulain.
1749
1750         * UIProcess/API/Cocoa/WKWebView.mm:
1751         (-[WKWebView _didCommitLayerTree:]):
1752
1753 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
1754
1755         Linking WebKit2 to be able to grab media sources from a UID
1756         https://bugs.webkit.org/show_bug.cgi?id=147202
1757         <rdar://problem/21947608>
1758
1759         Reviewed by Brent Fulgham.
1760
1761         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1762         (WebKit::UserMediaPermissionRequestProxy::getDeviceNameForUID):
1763         * UIProcess/UserMediaPermissionRequestProxy.h:
1764
1765 2015-07-23  Alex Christensen  <achristensen@webkit.org>
1766
1767         Remove compile and runtime flags for promises.
1768         https://bugs.webkit.org/show_bug.cgi?id=147244
1769
1770         Reviewed by Yusuke Suzuki.
1771
1772         * Configurations/FeatureDefines.xcconfig:
1773         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1774         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1775
1776 2015-07-21  Jer Noble  <jer.noble@apple.com>
1777
1778         Notify the UI delegate when a MediaDocument's natural size changes
1779         https://bugs.webkit.org/show_bug.cgi?id=147182
1780
1781         Reviewed by Simon Fraser.
1782
1783         Pipe notifications of media document natural size changes up from the chrome client, through
1784         to the UIProcess,  through the page client, through the WKWebView, to the UIDelegate.
1785
1786         * UIProcess/API/APIUIClient.h:
1787         (API::UIClient::mediaDocumentNaturalSizeChanged):
1788         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1789         * UIProcess/API/Cocoa/WKWebView.mm:
1790         (-[WKWebView _mediaDocumentNaturalSizeChanged:]):
1791         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1792         * UIProcess/Cocoa/UIDelegate.h:
1793         * UIProcess/Cocoa/UIDelegate.mm:
1794         (WebKit::UIDelegate::setDelegate):
1795         (WebKit::UIDelegate::UIClient::mediaDocumentNaturalSizeChanged):
1796         * UIProcess/PageClient.h:
1797         * UIProcess/WebPageProxy.cpp:
1798         (WebKit::WebPageProxy::mediaDocumentNaturalSizeChanged):
1799         * UIProcess/WebPageProxy.h:
1800         * UIProcess/WebPageProxy.messages.in:
1801         * UIProcess/ios/PageClientImplIOS.h:
1802         * UIProcess/ios/PageClientImplIOS.mm:
1803         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
1804         * UIProcess/mac/PageClientImpl.h:
1805         * UIProcess/mac/PageClientImpl.mm:
1806         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
1807         * WebProcess/WebCoreSupport/WebChromeClient.h:
1808         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1809         (WebKit::WebChromeClient::mediaDocumentNaturalSizeChanged):
1810         * WebProcess/WebPage/WebPage.cpp:
1811         (WebKit::WebPage::mediaDocumentNaturalSizeChanged):
1812         * WebProcess/WebPage/WebPage.h:
1813         * UIProcess/API/gtk/PageClientImpl.h: Add default, empty implementation of new pure-virtual method.
1814         * UIProcess/efl/WebViewEfl.h: Ditto.
1815
1816 2015-07-23  Enrica Casucci  <enrica@apple.com>
1817
1818         Removing one incorrect annotation from the previous change.
1819
1820         Unreviewed.
1821
1822         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1823
1824 2015-07-23  Enrica Casucci  <enrica@apple.com>
1825
1826         [iOS] Add another preview delegate for didDismissPreview.
1827         https://bugs.webkit.org/show_bug.cgi?id=147241
1828         rdar://problem/21664211
1829
1830         Reviewed by Tim Horton and Yongjun Zhang.
1831
1832         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1833         * UIProcess/ios/WKContentViewInteraction.mm:
1834         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
1835
1836 2015-07-23  Dan Bernstein  <mitz@apple.com>
1837
1838         <rdar://problem/21910578> Second pass at [iOS] Keyboard shortcuts that take focus away from the web view end up typing a letter into the newly focused field
1839         https://bugs.webkit.org/show_bug.cgi?id=146732
1840
1841         Reviewed by Darin Adler.
1842
1843         * UIProcess/ios/WKContentViewInteraction.mm:
1844         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Rather than checking if the view is
1845         first responder, which it might still be when the Web Content processes invokes this
1846         callback, check if we are in editable content before forwarding the event to the keyboard.
1847
1848 2015-07-23  Jer Noble  <jer.noble@apple.com>
1849
1850         Unreviewed build fix after r187251; rename flag -> allows.
1851
1852         * UIProcess/WebPageProxy.cpp:
1853         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
1854
1855 2015-07-23  Alex Christensen  <achristensen@webkit.org>
1856
1857         [iOS] Unreviewed build fix after r187251.
1858
1859         * UIProcess/WebPageProxy.cpp:
1860         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
1861         Use the correct name for the boolean to pass along to SetAllowsMediaDocumentInlinePlayback.
1862
1863 2015-07-23  Enrica Casucci  <enrica@apple.com>
1864
1865         One more iOS build fix.
1866
1867         Unreviewed.
1868
1869         * Platform/spi/ios/UIKitSPI.h:
1870         * UIProcess/ios/WKContentViewInteraction.h:
1871
1872 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
1873
1874         Bridged passing lists of devices between the UIProcess and the WebProcess
1875         https://bugs.webkit.org/show_bug.cgi?id=147056
1876         <rdar://problem/21883094>
1877
1878         Reviewed by Brent Fulgham.
1879
1880         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Modified file
1881         to reflect changes made to the header in the .messages.in file
1882         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Ditto
1883         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision):
1884         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto
1885         * UIProcess/UserMediaPermissionRequestProxy.cpp: Ditto
1886         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
1887         * UIProcess/UserMediaPermissionRequestProxy.h:
1888         (WebKit::UserMediaPermissionRequestProxy::create):
1889         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsVideo):
1890         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsAudio):
1891         * UIProcess/WebPageProxy.cpp:
1892         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
1893         * UIProcess/WebPageProxy.h:
1894         * UIProcess/WebPageProxy.messages.in: Changed heading
1895         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1896         (WebKit::UserMediaPermissionRequestManager::startRequest):
1897         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision):
1898         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1899         * WebProcess/WebPage/WebPage.cpp:
1900         (WebKit::WebPage::didReceiveUserMediaPermissionDecision):
1901         * WebProcess/WebPage/WebPage.h:
1902         * WebProcess/WebPage/WebPage.messages.in: Changed heading
1903
1904 2015-07-23  Yongjun Zhang  <yongjun_zhang@apple.com>
1905
1906         Adopt the new _previewItemControllerDidCancelPreview delegate method.
1907         https://bugs.webkit.org/show_bug.cgi?id=147238
1908
1909         Don't allow hightlight long press to trigger tap if the link preview is cancelled because
1910         the link is not preview-able.
1911
1912         Reviewed by Beth Dakin.
1913
1914         * UIProcess/ios/WKContentViewInteraction.mm:
1915         (-[WKContentView _previewItemControllerDidCancelPreview:]): 
1916
1917 2015-07-23  Enrica Casucci  <enrica@apple.com>
1918
1919         iOS build fix after http://trac.webkit.org/changeset/187238.
1920
1921         Unreviewed.
1922
1923         * Platform/spi/ios/UIKitSPI.h:
1924
1925 2015-07-23  Jer Noble  <jer.noble@apple.com>
1926
1927         [WK2] Add a WKWebView property for whether the view is displaying a media document
1928         https://bugs.webkit.org/show_bug.cgi?id=147233
1929
1930         Reviewed by Beth Dakin.
1931
1932         Add a _isDisplayingStandaloneMediaDocument property, which queries the frame for whether
1933         the current MIME type is one which our media engines support.
1934
1935         * UIProcess/API/Cocoa/WKWebView.mm:
1936         (-[WKWebView _isDisplayingStandaloneMediaDocument]):
1937         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1938         * UIProcess/WebFrameProxy.cpp:
1939         (WebKit::WebFrameProxy::isDisplayingStandaloneMediaDocument):
1940         * UIProcess/WebFrameProxy.h:
1941
1942 2015-07-21  Jer Noble  <jer.noble@apple.com>
1943
1944         [iOS] Add an explicit API to allow media documents to (temporarily) play inline
1945         https://bugs.webkit.org/show_bug.cgi?id=147181
1946
1947         Reviewed by Beth Dakin.
1948
1949         Add a WKWebView(Private) API which allows MediaDocuments loaded by the view to play their contents inline, regardless
1950         of whether inline playback is restricted on the current device.
1951
1952         * UIProcess/API/Cocoa/WKWebView.mm:
1953         (-[WKWebView _setRequiresUserActionForMediaPlayback:]): Added. Pass through to WebPageProxy.
1954         (-[WKWebView _allowsMediaDocumentInlinePlayback]): Ditto.
1955         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1956         * UIProcess/WebPageProxy.cpp:
1957         (WebKit::WebPageProxy::allowsMediaDocumentInlinePlayback): Simple getter.
1958         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback): Set, and conditionally pass the new value to WebPage.
1959         * UIProcess/WebPageProxy.h:
1960         * WebProcess/WebPage/WebPage.cpp:
1961         (WebKit::WebPage::setAllowsMediaDocumentInlinePlayback): Set, and conditionally notify WebCore page of the change.
1962         * WebProcess/WebPage/WebPage.h:
1963         (WebKit::WebPage::allowsMediaDocumentInlinePlayback): Simple getter.
1964         * WebProcess/WebPage/WebPage.messages.in: Add new messages.
1965
1966 2015-07-23  Beth Dakin  <bdakin@apple.com>
1967
1968         Should not allow previews of 1x1 images
1969         https://bugs.webkit.org/show_bug.cgi?id=147237
1970         -and corresponding-
1971         rdar://problem/21968460
1972
1973         Reviewed by Tim Horton.
1974
1975         1x1 images are used on some sites to cover actual images, which leads to a 
1976         misleading preview experience. There is not any reason why you would really 
1977         want to preview an image this small nor any reason to believe that the 
1978         preview would result in anything useful.
1979         * WebProcess/WebPage/ios/WebPageIOS.mm:
1980         (WebKit::WebPage::getPositionInformation):
1981
1982 2015-07-23  Brady Eidson  <beidson@apple.com>
1983
1984         Crash in WebPlatformStrategies::createPingHandle - Deref a null NetworkingContext.
1985         <rdar://problem/21949735> and https://bugs.webkit.org/show_bug.cgi?id=147227
1986
1987         Reviewed by Alexey Proskuryakov.
1988
1989         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1990         (WebKit::WebPlatformStrategies::createPingHandle): Skip it if there's a null NetworkingContext.
1991
1992 2015-07-23  Tim Horton  <timothy_horton@apple.com>
1993
1994         Remove some files that should have been removed with WebKit2 Windows
1995         https://bugs.webkit.org/show_bug.cgi?id=147223
1996
1997         Reviewed by Csaba Osztrogonác.
1998
1999         * Shared/API/c/cf/WKURLRequestCF.cpp: Removed.
2000         * Shared/API/c/cf/WKURLRequestCF.h: Removed.
2001         * Shared/API/c/cf/WKURLResponseCF.cpp: Removed.
2002         * Shared/API/c/cf/WKURLResponseCF.h: Removed.
2003
2004 2015-07-23  Timothy Horton  <timothy_horton@apple.com>
2005
2006         Fix the build
2007
2008         * Platform/spi/ios/UIKitSPI.h:
2009
2010 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2011
2012         Remove files that were meant to be removed in r173929
2013
2014         * WebProcess/WebPage/mac/WebInspectorMac.mm: Removed.
2015
2016 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2017
2018         Remove files that were meant to be removed in r168213
2019
2020         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: Removed.
2021
2022 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2023
2024         Remove files that were meant to be removed in r168229
2025
2026         * UIProcess/API/Cocoa/WKSession.h: Removed.
2027         * UIProcess/API/Cocoa/WKSession.mm: Removed.
2028         * UIProcess/API/Cocoa/WKSessionInternal.h: Removed.
2029
2030 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2031
2032         Remove files that were meant to be removed in r165014
2033
2034         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.h: Removed.
2035         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: Removed.
2036
2037 2015-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2038
2039         [GTK] Add API to allow executing editing commands that require an argument
2040         https://bugs.webkit.org/show_bug.cgi?id=146781
2041
2042         Reviewed by Gustavo Noronha Silva.
2043
2044         Commands like InsertImage or CreateLink receive an argument, but
2045         we only have webkit_web_view_execute_editing_command() that
2046         doesn't receive any argument. This patch adds
2047         webkit_web_view_execute_editing_command_with_argument() for those
2048         commands. It also adds WEBKIT_EDITING_COMMAND_INSERT_IMAGE and
2049         WEBKIT_EDITING_COMMAND_CREATE_LINK to the predefined editing commands.
2050
2051         * UIProcess/API/gtk/WebKitEditingCommands.h: Add
2052         WEBKIT_EDITING_COMMAND_INSERT_IMAGE and WEBKIT_EDITING_COMMAND_CREATE_LINK.
2053         * UIProcess/API/gtk/WebKitWebView.cpp:
2054         (webkit_web_view_execute_editing_command_with_argument):
2055         * UIProcess/API/gtk/WebKitWebView.h:
2056         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2057         * UIProcess/WebPageProxy.cpp:
2058         (WebKit::WebPageProxy::executeEditCommand): Pass also the argument
2059         to the message.
2060         * UIProcess/WebPageProxy.h:
2061         * WebProcess/WebPage/WebPage.cpp:
2062         (WebKit::WebPage::executeEditCommand): Add the argument parameter
2063         to the message handler.
2064         * WebProcess/WebPage/WebPage.h:
2065         * WebProcess/WebPage/WebPage.messages.in: Add argument parameter
2066         to ExecuteEditCommand message.
2067
2068 2015-07-22  Sukolsak Sakshuwong  <sukolsak@gmail.com>
2069
2070         Add ENABLE_WEBASSEMBLY feature flag for WebAssembly
2071         https://bugs.webkit.org/show_bug.cgi?id=147212
2072
2073         Reviewed by Filip Pizlo.
2074
2075         * Configurations/FeatureDefines.xcconfig:
2076
2077 2015-07-22  James Savage  <james.savage@apple.com>
2078
2079         Use updated CoreAnimation snapshot SPI.
2080         https://bugs.webkit.org/show_bug.cgi?id=147197
2081         <rdar://problem/21032083>
2082
2083         Reviewed by Tim Horton.
2084         Patch by James Savage.
2085
2086         * Platform/spi/ios/UIKitSPI.h:
2087         * UIProcess/API/Cocoa/WKWebView.mm:
2088         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2089
2090 2015-07-22  Timothy Horton  <timothy_horton@apple.com>
2091
2092         Fix the build
2093
2094         * UIProcess/ios/WKContentViewInteraction.mm:
2095         (-[WKContentView setupInteraction]):
2096         (-[WKContentView cleanupInteraction]):
2097
2098 2015-07-22  Commit Queue  <commit-queue@webkit.org>
2099
2100         Unreviewed, rolling out r187196.
2101         https://bugs.webkit.org/show_bug.cgi?id=147213
2102
2103         broke all the iOS builds (Requested by thorton on #webkit).
2104
2105         Reverted changeset:
2106
2107         "Use updated CoreAnimation snapshot SPI."
2108         https://bugs.webkit.org/show_bug.cgi?id=147197
2109         http://trac.webkit.org/changeset/187196
2110
2111 2015-07-22  Tim Horton  <timothy_horton@apple.com>
2112
2113         Fix the build
2114
2115         * UIProcess/ios/WKContentViewInteraction.h:
2116
2117 2015-07-22  Tim Horton  <timothy_horton@apple.com>
2118
2119         [iOS] Adjust the preview architecture
2120         https://bugs.webkit.org/show_bug.cgi?id=147203
2121         <rdar://problem/21945775>
2122
2123         Reviewed by Simon Fraser.
2124
2125         * UIProcess/ios/WKContentViewInteraction.mm:
2126         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2127         Link previews should win over image previews if both are possible.
2128
2129 2015-07-22  James Savage  <james.savage@apple.com>
2130
2131         Use updated CoreAnimation snapshot SPI.
2132         https://bugs.webkit.org/show_bug.cgi?id=147197
2133
2134         Reviewed by Tim Horton.
2135
2136         * Platform/spi/ios/UIKitSPI.h:
2137         * UIProcess/API/Cocoa/WKWebView.mm:
2138         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2139
2140 2015-07-22  Tim Horton  <timothy_horton@apple.com>
2141
2142         [iOS] Adjust the preview architecture
2143         https://bugs.webkit.org/show_bug.cgi?id=147203
2144         <rdar://problem/21945775>
2145
2146         Reviewed by Beth Dakin.
2147
2148         * Platform/spi/ios/UIKitSPI.h:
2149         * UIProcess/API/Cocoa/WKWebView.mm:
2150         (-[WKWebView _setAllowsLinkPreview:]): Deleted.
2151         * UIProcess/ios/WKContentView.mm:
2152         (-[WKContentView willMoveToWindow:]): Deleted.
2153         * UIProcess/ios/WKContentViewInteraction.h:
2154         * UIProcess/ios/WKContentViewInteraction.mm:
2155         (-[WKContentView setupInteraction]):
2156         (-[WKContentView cleanupInteraction]):
2157         (-[WKContentView _registerPreview]):
2158         (-[WKContentView _unregisterPreview]):
2159         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2160         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2161         (-[WKContentView _presentationRectForPreviewItemController:]):
2162         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
2163         (-[WKContentView _previewItemController:commitPreview:]):
2164         (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]):
2165         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
2166         (-[WKContentView _presentationSnapshotForPreviewItemController:]):
2167         (-[WKContentView _presentationRectsForPreviewItemController:]):
2168         (-[WKContentView gestureRecognizerShouldBegin:]): Deleted.
2169         (-[WKContentView _registerPreviewInWindow:]): Deleted.
2170         (-[WKContentView _unregisterPreviewInWindow:]): Deleted.
2171         (-[WKContentView previewViewControllerForPosition:inSourceView:]): Deleted.
2172         (-[WKContentView commitPreviewViewController:]): Deleted.
2173         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Deleted.
2174         (-[WKContentView didDismissPreviewViewController:committing:]): Deleted.
2175         Register and unregister in setup/cleanupInteraction instead of when moving between windows.
2176         Implement 'shouldBegin' instead of interacting directly with the recognizer.
2177         Make use of system enums instead of our own.
2178         Let UIPreviewItemController handle shrink-wrapping and the indicator view.
2179
2180 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2181
2182         [EFL] Support indexeddb for WK2
2183         https://bugs.webkit.org/show_bug.cgi?id=145867
2184
2185         Reviewed by Csaba Osztrogonác.
2186
2187         Add stub implementation for indexeddb. Move KeyedDecoder and KeyedEncoder from gtk to glib
2188         in order to share it between GTK and EFL ports.
2189
2190         * DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp:
2191         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
2192         (WebKit::DatabaseProcessMainUnix):
2193         * PlatformEfl.cmake:
2194         * PlatformGTK.cmake:
2195         * Shared/glib/KeyedDecoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.cpp.
2196         (WebKit::KeyedDecoder::KeyedDecoder):
2197         (WebKit::KeyedDecoder::~KeyedDecoder):
2198         (WebKit::KeyedDecoder::dictionaryFromGVariant):
2199         (WebKit::KeyedDecoder::decodeBytes):
2200         (WebKit::KeyedDecoder::decodeSimpleValue):
2201         (WebKit::KeyedDecoder::decodeBool):
2202         (WebKit::KeyedDecoder::decodeUInt32):
2203         (WebKit::KeyedDecoder::decodeInt32):
2204         (WebKit::KeyedDecoder::decodeInt64):
2205         (WebKit::KeyedDecoder::decodeFloat):
2206         (WebKit::KeyedDecoder::decodeDouble):
2207         (WebKit::KeyedDecoder::decodeString):
2208         (WebKit::KeyedDecoder::beginObject):
2209         (WebKit::KeyedDecoder::endObject):
2210         (WebKit::KeyedDecoder::beginArray):
2211         (WebKit::KeyedDecoder::beginArrayElement):
2212         (WebKit::KeyedDecoder::endArrayElement):
2213         (WebKit::KeyedDecoder::endArray):
2214         * Shared/glib/KeyedDecoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.h.
2215         * Shared/glib/KeyedEncoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.cpp.
2216         (WebKit::KeyedEncoder::KeyedEncoder):
2217         (WebKit::KeyedEncoder::~KeyedEncoder):
2218         (WebKit::KeyedEncoder::encodeBytes):
2219         (WebKit::KeyedEncoder::encodeBool):
2220         (WebKit::KeyedEncoder::encodeUInt32):
2221         (WebKit::KeyedEncoder::encodeInt32):
2222         (WebKit::KeyedEncoder::encodeInt64):
2223         (WebKit::KeyedEncoder::encodeFloat):
2224         (WebKit::KeyedEncoder::encodeDouble):
2225         (WebKit::KeyedEncoder::encodeString):
2226         (WebKit::KeyedEncoder::beginObject):
2227         (WebKit::KeyedEncoder::endObject):
2228         (WebKit::KeyedEncoder::beginArray):
2229         (WebKit::KeyedEncoder::beginArrayElement):
2230         (WebKit::KeyedEncoder::endArrayElement):
2231         (WebKit::KeyedEncoder::endArray):
2232         (WebKit::KeyedEncoder::finishEncoding):
2233         * Shared/glib/KeyedEncoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.h.
2234         * UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
2235         (WebKit::DatabaseProcessProxy::platformGetLaunchOptions):
2236
2237 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2238
2239         [Seccomp] Canonicalize filesystem path when whitelisting it
2240         https://bugs.webkit.org/show_bug.cgi?id=142986
2241
2242         Reviewed by Žan Doberšek.
2243
2244         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2245         (WebKit::canonicalizeFileName):
2246         (WebKit::SyscallPolicy::addFilePermission):
2247         (WebKit::SyscallPolicy::addDirectoryPermission):
2248
2249 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
2250
2251         Add logging for TiledCoreAnimationDrawingArea resizing
2252         https://bugs.webkit.org/show_bug.cgi?id=147180
2253
2254         Reviewed by Tim Horton.
2255
2256         Add a "Resize" log channel for WebKit2, and use it to log data in scaleViewToFitDocumentIfNeeded().
2257
2258         * Platform/Logging.h:
2259         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2260         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2261
2262 2015-07-22  Sam Weinig  <sam@webkit.org>
2263
2264         Encode/Decode underlying errors when serializing NSErrors
2265         <rdar://problem/21818117>
2266         https://bugs.webkit.org/show_bug.cgi?id=147199
2267
2268         Reviewed by Anders Carlsson.
2269
2270         * Shared/mac/WebCoreArgumentCodersMac.mm:
2271         (IPC::ArgumentCoder<CertificateInfo>::decode):
2272         (IPC::encodeNSError):
2273         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
2274         (IPC::decodeNSError):
2275         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
2276         Break out encoding/decoding of the NSErrors into a helpers so they can be called
2277         for the underlying error.
2278
2279 2015-07-22  Beth Dakin  <bdakin@apple.com>
2280
2281         Animated images should animate in previews
2282         https://bugs.webkit.org/show_bug.cgi?id=147173
2283         -and corresponding-
2284         rdar://problem/21637698
2285
2286         Reviewed by Dan Bernstein.
2287
2288         InteractionInformationAtPosition needs to know if it’s an animated image.
2289         * Shared/InteractionInformationAtPosition.cpp:
2290         (WebKit::InteractionInformationAtPosition::encode):
2291         (WebKit::InteractionInformationAtPosition::decode):
2292         * Shared/InteractionInformationAtPosition.h:
2293
2294         New delegate method to create a link preview view controller for animated 
2295         images.
2296         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2297
2298         Treat animated images more like link previews.
2299         * UIProcess/ios/WKContentViewInteraction.mm:
2300         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
2301
2302         Set info.isAnimatedImage
2303         * WebProcess/WebPage/ios/WebPageIOS.mm:
2304         (WebKit::WebPage::getPositionInformation):
2305
2306 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2307
2308         [Seccomp Filters] Add helpers to get XDG base directory locations
2309         https://bugs.webkit.org/show_bug.cgi?id=142982
2310
2311         Reviewed by Zan Dobersek.
2312
2313         * PlatformEfl.cmake:
2314         * PlatformGTK.cmake:
2315         * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Added.
2316         * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Added.
2317         (WebKit::userHomeDirectory):
2318         (WebKit::userCacheDirectory):
2319         (WebKit::userConfigDirectory):
2320         (WebKit::userDataDirectory):
2321         (WebKit::userRuntimeDirectory):
2322
2323 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2324
2325         [EFL][WK2] EWK2ContextTestMultipleProcesses.ewk_context_network_process_model fails to pass
2326         https://bugs.webkit.org/show_bug.cgi?id=142967
2327
2328         Reviewed by Csaba Osztrogonác.
2329
2330         Though processIdentifier() can return 0 when a page is not closed, ewk_context_network_process_model has
2331         not been considered process id can be 0. This patch adds a protection logic which doesn't test when process
2332         id is 0 at the moment.
2333
2334         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
2335         (TEST_F):
2336
2337 2015-07-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2338
2339         Unreviewed. Fix some warnings when generating GTK+ HTML API docs.
2340
2341         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add
2342         WebKitWebsiteDataManager and WebKitWebEditor.
2343
2344 2015-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2345
2346         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.4 release.
2347
2348         * gtk/NEWS: Add release notes for 2.9.4.
2349
2350 2015-07-21  Joseph Pecoraro  <pecoraro@apple.com>
2351
2352         Web Inspector: [Mac] "Open Image In New Window" context menu item does nothing on an image
2353         https://bugs.webkit.org/show_bug.cgi?id=147175
2354
2355         Reviewed by Timothy Hatcher.
2356
2357         * UIProcess/mac/WebInspectorProxyMac.mm:
2358         (WebKit::getContextMenuFromProposedMenu):
2359         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2360         Remove default context menus that won't work in the inspector page.
2361
2362 2015-07-21  Benjamin Poulain  <benjamin@webkit.org>
2363
2364         [Content Extensions] Use a jump table when consecutive transitions have different targets
2365         https://bugs.webkit.org/show_bug.cgi?id=147099
2366
2367         Reviewed by Alex Christensen.
2368
2369         * UIProcess/API/APIUserContentExtensionStore.h:
2370
2371 2015-07-21  Daniel Bates  <dabates@apple.com>
2372
2373         Fix the build following <https://trac.webkit.org/changeset/187129>
2374         (https://bugs.webkit.org/show_bug.cgi?id=147112)
2375
2376         * UIProcess/WebProcessProxy.cpp:
2377         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Guard implementation with PLATFORM(IOS)
2378         since this logic is specific to the iOS port.
2379
2380 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
2381
2382         Rename the 'View' log channel to 'Printing'
2383         https://bugs.webkit.org/show_bug.cgi?id=147172
2384
2385         Reviewed by Zalan Bujtas.
2386
2387         "View" was a terrible name for a log channel that was all about printing.
2388         Sort the log channels.
2389
2390         * Platform/Logging.h:
2391         * UIProcess/API/mac/WKView.mm:
2392         (-[WKView drawRect:]):
2393         (-[WKView printOperationWithPrintInfo:forFrame:]):
2394         * UIProcess/mac/WKPrintingView.mm:
2395         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
2396         (pageDidComputePageRects):
2397         (-[WKPrintingView knowsPageRange:]):
2398         (-[WKPrintingView drawRect:]):
2399         (-[WKPrintingView rectForPage:]):
2400         (-[WKPrintingView beginDocument]):
2401         (-[WKPrintingView endDocument]):
2402
2403 2015-07-21  Zalan Bujtas  <zalan@apple.com>
2404
2405         [iOS] Menu drop down such as on nike.com does not stay
2406         https://bugs.webkit.org/show_bug.cgi?id=147047
2407         rdar://problem/21046961
2408
2409         Reviewed by Benjamin Poulain.
2410
2411         This is a workaround for unintended scrolling while scaling.
2412         (Based on Benjamin Poulain's WIP patch for webkit.org/b/136904)
2413
2414         In certain cases when scaling would result in moving the scrollview (which would trigger
2415         a scroll event on WebCore side), zoomRect is called instead of setZoomScale to ensure
2416         that the scroll position stays intact.
2417
2418         * UIProcess/API/Cocoa/WKWebView.mm:
2419         (-[WKWebView _didCommitLayerTree:]):
2420
2421 2015-07-21  Daniel Bates  <dabates@apple.com>
2422
2423         WTFCrash() in WebKit::WebProcess::networkConnection()
2424         https://bugs.webkit.org/show_bug.cgi?id=147112
2425         <rdar://problem/18477459>
2426
2427         Reviewed by Gavin Barraclough.
2428
2429         Fixes an issue where a newly launched network process may be jetsam'd because it has not
2430         taken a process assertion between the time it was launched and the time when a web process
2431         makes use of it.
2432
2433         Initially a network process does not have a process assertion. A process assertion is taken
2434         (if one has not been taken) for the network process when a process assertion is taken for at
2435         least one web process. When the network process crashes a WebProcess may ultimately launch a
2436         new network process in WebProcess::networkConnection(). The new network process may be jetsam'd
2437         immediately when the system is under some measure pressure because it has a low jetsam priority,
2438         0 (since it does not have a process assertion and higher priority implies that a process is less
2439         likely to be jetsam'd). And the logic in WebProcess::networkConnection() explicitly calls
2440         CRASH() if the newly launched network process crashes immediately. Towards preventing the newly
2441         launched network process from being jetsam'd we should obtain a process assertion for it.
2442
2443         * UIProcess/WebProcessPool.cpp:
2444         (WebKit::WebProcessPool::WebProcessPool): Initialize m_didNetworkProcessCrash to false.
2445         (WebKit::WebProcessPool::ensureNetworkProcess): If the network process crashed (m_didNetworkProcessCrash == true)
2446         then tell each process in the pool to reinstate their network activity token for the new network process.
2447         (WebKit::WebProcessPool::networkProcessCrashed): Set m_didNetworkProcessCrash to true when the
2448         network process crashed.
2449         * UIProcess/WebProcessPool.h:
2450         * UIProcess/WebProcessProxy.cpp:
2451         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Added.
2452         (WebKit::WebProcessProxy::didSetAssertionState): Add assert to ensure we never have both
2453         a background- and foreground- activity token for the network process.
2454         * UIProcess/WebProcessProxy.h:
2455
2456 2015-07-21  Daniel Bates  <dabates@apple.com>
2457
2458         ASSERT(m_suspendMessageCount >= 0) fails in ProcessThrottler::didCancelProcessSuspension()
2459         when WebContent process crashes; Network process may never voluntarily suspend
2460         https://bugs.webkit.org/show_bug.cgi?id=147122
2461         <rdar://problem/21906759>
2462
2463         Reviewed by Chris Dumez.
2464
2465         Fixes an issue where the network process may never voluntarily release its process assertion.
2466
2467         Currently the network process always sends both a ProcessReadyToSuspend and CancelPrepareToSuspend
2468         message in response to receiving a PrepareToSuspend message and CancelPrepareToSuspend message,
2469         respectively. The process throttler expects to receive either a ProcessReadyToSuspend message
2470         or a CancelPrepareToSuspend message (and not both) in response to sending the message sequence
2471         PrepareToSuspend, CancelPrepareToSuspend. When a process throttler receives both messages in
2472         response to this sequence then its internal message count becomes imbalanced and it will
2473         never release the process assertion it manages. One user interaction that can cause such an
2474         imbalance, in the process throttler held by NetworkProcessProxy, is switching tabs.
2475
2476         * NetworkProcess/NetworkProcess.cpp:
2477         (WebKit::NetworkProcess::cancelPrepareToSuspend): Do not send message NetworkProcessProxy::DidCancelProcessSuspension. 
2478         * UIProcess/Network/NetworkProcessProxy.cpp:
2479         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Deleted.
2480         * UIProcess/Network/NetworkProcessProxy.h:
2481         * UIProcess/Network/NetworkProcessProxy.messages.in: Remove message NetworkProcessProxy::DidCancelProcessSuspension.
2482
2483 2015-07-21  Matthew Daiter  <mdaiter@apple.com>
2484
2485         Make sure to invalidate requests for user media after webpage reset
2486         https://bugs.webkit.org/show_bug.cgi?id=147155
2487         <rdar://problem/21924174>
2488
2489         Reviewed by Brent Fulgham.
2490
2491         * UIProcess/WebPageProxy.cpp:
2492         (WebKit::WebPageProxy::resetState): Added user media reset
2493
2494 2015-07-21  Tim Horton  <timothy_horton@apple.com>
2495
2496         [iOS] Avoid using a TextIndicator if there are non-text things to indicate
2497         https://bugs.webkit.org/show_bug.cgi?id=147152
2498         <rdar://problem/21921061>
2499
2500         Reviewed by Beth Dakin.
2501
2502         * UIProcess/ios/WKContentViewInteraction.mm:
2503         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
2504         * WebProcess/WebPage/ios/WebPageIOS.mm:
2505         (WebKit::shouldUseTextIndicatorForLink):
2506         (WebKit::WebPage::getPositionInformation):
2507         Fall back to a rectangular area instead of a TextIndicator if there are any
2508         non-inline elements inside the link.
2509
2510 2015-07-21  Andreas Kling  <akling@apple.com>
2511
2512         API::Session should clean up its storage in the network process when destroyed.
2513         <https://webkit.org/b/147139>
2514         <rdar://problem/21838764>
2515
2516         Reviewed by Anders Carlsson.
2517
2518         Have ~Session() send a DestroyPrivateBrowsingSession message to all networking processes
2519         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
2520         CFNetwork object graph.
2521
2522         * UIProcess/API/APISession.cpp:
2523         (API::Session::~Session):
2524
2525 2015-07-21  Sungmann Cho  <sungmann.cho@navercorp.com>
2526
2527         Make PluginProxy::handleMouseEvent() asynchronous.
2528         https://bugs.webkit.org/show_bug.cgi?id=146142
2529
2530         Reviewed by Anders Carlsson.
2531
2532         PluginProxy::handleMouseEvent() forwards the generated mouse event to PluginControllerProxy
2533         using a synchronous message, but the recipient always reply immediately with the same value("true")
2534         even before handling the received message. So I think PluginProxy::handleMouseEvent() is perfectly
2535         OK to process its messages asynchronously.
2536
2537         * PluginProcess/PluginControllerProxy.cpp:
2538         (WebKit::PluginControllerProxy::handleMouseEvent):
2539         * PluginProcess/PluginControllerProxy.h:
2540         * PluginProcess/PluginControllerProxy.messages.in:
2541         * WebProcess/Plugins/PluginProxy.cpp:
2542         (WebKit::PluginProxy::handleMouseEvent):
2543
2544 2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2545
2546         [GTK] Add API to be notified about editor state changes
2547         https://bugs.webkit.org/show_bug.cgi?id=145875
2548
2549         Reviewed by Gustavo Noronha Silva.
2550
2551         Add WebKitEditorState object, that is created on demand by the
2552         WebKitWebView and can be used to get the typing attributes of the
2553         editor at the current position or selection.
2554
2555         * PlatformGTK.cmake:
2556         * Shared/EditorState.cpp: Use part of the PostLayoutData struct
2557         for the GTK port too.
2558         (WebKit::EditorState::encode): Encode PostLayoutData for GTK and
2559         remove our custom cursorRect.
2560         (WebKit::EditorState::decode): Decode PostLayoutData for GTK and
2561         remove our custom cursorRect.
2562         (WebKit::EditorState::PostLayoutData::encode): Reorder it to
2563         reduce the amonut of ifdefs.
2564         (WebKit::EditorState::PostLayoutData::decode): Ditto.
2565         * Shared/EditorState.h: Add AttributeStrikeThrough to
2566         TypingAttributes enum.
2567         * UIProcess/API/gtk/PageClientImpl.cpp:
2568         (WebKit::PageClientImpl::selectionDidChange): Rename
2569         updateTextInputState() to selectionDidChange() and also notify the
2570         WebKitWebView.
2571         * UIProcess/API/gtk/PageClientImpl.h:
2572         * UIProcess/API/gtk/WebKitEditorState.cpp: Added.
2573         (webkitEditorStateGetProperty):
2574         (webkit_editor_state_class_init):
2575         (webkitEditorStateSetTypingAttributes):
2576         (webkitEditorStateCreate):
2577         (webkitEditorStateChanged):
2578         (webkit_editor_state_get_typing_attributes):
2579         * UIProcess/API/gtk/WebKitEditorState.h: Added.
2580         * UIProcess/API/gtk/WebKitEditorStatePrivate.h: Added.
2581         * UIProcess/API/gtk/WebKitWebView.cpp:
2582         (webkitWebViewSelectionDidChange): Notify the WebKitEditorState if
2583         it has already been created.
2584         (webkit_web_view_get_editor_state): Ensure a WebKitEditorState and
2585         return it.
2586         * UIProcess/API/gtk/WebKitWebView.h:
2587         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2588         (webkitWebViewBaseUpdateTextInputState): Get the caret cursor rect
2589         from PostLayoutData.
2590         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
2591         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2592         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add webkit_editor_state_get_type.
2593         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitEditorState.
2594         * UIProcess/API/gtk/webkit2.h: Include WebKitEditorState.h.
2595         * UIProcess/PageClient.h:
2596         * UIProcess/gtk/WebPageProxyGtk.cpp:
2597         (WebKit::WebPageProxy::editorStateChanged): Call PageClientImpl::selectionDidChange().
2598         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2599         (WebKit::WebPage::platformEditorState): Add typing attributes to EditorState.
2600
2601 2015-07-20  Simon Fraser  <simon.fraser@apple.com>
2602
2603         Fix the iOS build.
2604
2605         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2606
2607 2015-07-20  Simon Fraser  <simon.fraser@apple.com>
2608
2609         Facebook in tiled fullscreen is slow
2610         https://bugs.webkit.org/show_bug.cgi?id=147134
2611         rdar://problem/21823349
2612
2613         Reviewed by Tim Horton.
2614         
2615         TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() could cause a page to toggle
2616         between two fixed layout sizes differing by a pixel, because of rounding. This would cause
2617         lots of extra layouts and painting.
2618         
2619         This happened because the the fixed layout size was computed using ceil(m_webPage.size().width() / viewScale)
2620
2621         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2622         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2623
2624 2015-07-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2625
2626         Fix crash due to RemoteLayerTreeDisplayRefreshMonitor outliving RemoteLayerTreeDrawingArea
2627         https://bugs.webkit.org/show_bug.cgi?id=147124
2628         <rdar://problem/21582858>
2629
2630         Reviewed by Simon Fraser.
2631
2632         Refactors RemoteLayerTreeDisplayRefreshMonitor to use a weak pointer rather than a reference
2633         to its RemoteLayerTreeDrawingArea, since the drawing area may be deallocated before the monitor
2634         in some rare cases. This rarely caused pages using requestAnimationFrame to crash on iOS. However,
2635         this should not be the case: logically, a RemoteLayerTreeDrawingArea should always outlive its
2636         refresh monitors. Refer to https://bugs.webkit.org/show_bug.cgi?id=147128 for more details.
2637
2638         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h:
2639         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm:
2640         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
2641         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::~RemoteLayerTreeDisplayRefreshMonitor): On destruction, checks
2642             first to see whether or not the drawing area has been deallocated before telling it to update its monitors.
2643         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback):
2644         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2645         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr): Creates and returns a new weak pointer to itself.
2646         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2647         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2648
2649 2015-07-20  Alex Christensen  <achristensen@webkit.org>
2650
2651         [Content Extensions] Cache actions with domains that match everything
2652         https://bugs.webkit.org/show_bug.cgi?id=147050
2653
2654         Reviewed by Benjamin Poulain.
2655
2656         * UIProcess/API/APIUserContentExtensionStore.h:
2657
2658 2015-07-20  Gordon Sheridan  <gordon_sheridan@apple.com>
2659
2660         Support blocking a plug-in for non-security reasons
2661         https://bugs.webkit.org/show_bug.cgi?id=145009
2662
2663         Reviewed by Anders Carlsson.
2664
2665         * Shared/Plugins/PluginModuleInfo.h:
2666         Replace PluginModuleBlocked with separate enum values for blocking for security and compatibility.
2667
2668         * UIProcess/API/C/WKAPICast.h:
2669         (WebKit::toWKPluginLoadPolicy):
2670         Modify to handle change to PluginModuleBlocked enum.
2671
2672         (WebKit::toPluginModuleLoadPolicy):
2673         Ditto.
2674
2675         * UIProcess/API/C/WKPluginLoadPolicy.h:
2676         Added enum value for blocking a plugin for compatibility reasons.
2677
2678         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2679         (WebKit::shouldBlockPlugin):
2680         Check load policy for both reasons a plugin may be blocked.
2681
2682         (WebKit::WKPlugInModuleLoadPolicyToPluginModuleLoadPolicy):
2683         Added function to convert between load policy enum types.
2684
2685         (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin):
2686         Modified to call WKLoadPolicyForPluginVersion() which can distinguish between blocked for security or compatibility.
2687
2688         * UIProcess/WebPageProxy.cpp:
2689         (WebKit::WebPageProxy::findPlugin):
2690         Updated to recognize both PluginModuleBlocked enum values that indicate a plugin is blocked.
2691
2692         * WebProcess/WebPage/WebPage.cpp:
2693         (WebKit::WebPage::createPlugin):
2694         Ditto.
2695
2696         (WebKit::WebPage::canPluginHandleResponse):
2697         Ditto.
2698
2699 2015-07-20  Antti Koivisto  <antti@apple.com>
2700
2701         NSURLCache fallback does not work on iOS due to sandboxing
2702         https://bugs.webkit.org/show_bug.cgi?id=146314
2703         <rdar://problem/21433691>
2704
2705         Reviewed by Anders Carlsson.
2706
2707         This broke with earlier cache path computation changes.
2708
2709         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2710         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2711
2712             NSURLCache path is relative to the container cache path so "." is sufficient.
2713             This puts the cache files under
2714             <container>/Library/Caches/com.apple.WebKit.Networking/
2715
2716 2015-07-20  Jeremy Jones  <jeremyj@apple.com>
2717
2718         Adopt AVPlayerLayerView
2719         https://bugs.webkit.org/show_bug.cgi?id=146862
2720
2721         Reviewed by Simon Fraser.
2722
2723         The CALayerHost is replaced with WebLayerHostView to be compatible with UIView animations.
2724         videoLayerFrame and videoLayerGravity no longer need to be stored because they are stored
2725         where they are used in the interface. Some animation is improved in the conversion.
2726
2727         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2728         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2729         (+[WebLayerHostView layerClass]): Add class WebLayerHostView.
2730         (-[WebLayerHostView contextID]):
2731         (-[WebLayerHostView setContextID:]):
2732         (-[WebLayerHostView layerHost]):
2733         (WebKit::WebVideoFullscreenManagerProxy::invalidate): layer -> view
2734         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
2735         Apply the hostingDeviceScaleFactor transform to -sublayerTransform instead of to
2736         -transform. This more directly inverts the tranform WebProcess and allows -transform
2737         to be used for animation in the UIProcess. This is important because UIView's actions
2738         animate -transform, but not -sublayerTrasform.
2739
2740         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): layer -> view
2741         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted.
2742         (WebKit::WebVideoFullscreenModelContext::videoLayerFrame): Deleted.
2743         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted.
2744         (WebKit::WebVideoFullscreenModelContext::videoLayerGravity): Deleted.
2745         * WebProcess/ios/WebVideoFullscreenManager.mm:
2746         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
2747         Set initial video layer frame to fix start point of animation.
2748
2749         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
2750         dispatch_async allows the CATransaction to complete before continuing with the animation.
2751         This prevents a flash during animation.
2752
2753 2015-07-20  Tim Horton  <timothy_horton@apple.com>
2754
2755         REGRESSION (r174287): Flash of black when opening a new web view or navigating to a new page
2756         https://bugs.webkit.org/show_bug.cgi?id=147127
2757         <rdar://problem/21474317>
2758
2759         Reviewed by Simon Fraser.
2760
2761         * WebProcess/WebPage/WebPage.cpp:
2762         (WebKit::WebPage::snapshotAtSize):
2763         Avoid using an invalid documentBackgroundColor, fall back to baseBackgroundColor
2764         like we did before r174287.
2765
2766 2015-07-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2767
2768         [Seccomp] Should be easier to debug blocked syscalls
2769         https://bugs.webkit.org/show_bug.cgi?id=142980
2770
2771         These should be printed even when not running in debug mode. There is no
2772         value in hiding errors from release build users.
2773
2774         Reviewed by Žan Doberšek.
2775
2776         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
2777         (WebKit::SeccompBroker::runLoop): Don't close stderr et. al. in release builds.
2778         * Shared/linux/SeccompFilters/Syscall.cpp:
2779         (WebKit::write_uint): Added.
2780         (WebKit::reportUnexpectedSyscall): Added.
2781         (WebKit::Syscall::createFromContext): Call reportUnexpectedSyscall. Also, no need to crash
2782         here in release builds.
2783         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2784         (WebKit::SyscallPolicy::hasPermissionForPath): Print a warning when access is denied.
2785         (WebKit::SyscallPolicy::permissionToString): Added.
2786         * Shared/linux/SeccompFilters/SyscallPolicy.h: Add permissionToString.
2787
2788 2015-07-20  Csaba Osztrogonác  <ossy@webkit.org>
2789
2790         Fix the !ENABLE(VIDEO) build after r186396
2791         https://bugs.webkit.org/show_bug.cgi?id=147116
2792
2793         Reviewed by Brent Fulgham.
2794
2795         * WebProcess/WebProcess.cpp:
2796         (WebKit::WebProcess::didClose):
2797
2798 2015-07-20  Tomas Popela  <tpopela@redhat.com>
2799
2800         [GTK] Add selection-changed signal to the WebKit2 API
2801         https://bugs.webkit.org/show_bug.cgi?id=137116
2802
2803         Reviewed by Carlos Garcia Campos.
2804
2805         Add a new object WebKitWebEditor where the editing capabilities of a
2806         WebPage will be grouped and exposed. Add the selection-changed signal
2807         there (we used the same name as in WK1 API).
2808
2809         * PlatformGTK.cmake:
2810         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2811         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: Added.
2812         (didChangeSelection):
2813         (webkitWebEditorCreate):
2814         (webkit_web_editor_get_page):
2815         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: Added.
2816         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h: Added.
2817         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2818         (webkitWebPageGetPage):
2819         (webkit_web_page_get_editor):
2820         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
2821         * WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h:
2822         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
2823
2824 2015-07-16  Anders Carlsson  <andersca@apple.com>
2825
2826         WebsiteDataStore operations need to grab background assertions
2827         https://bugs.webkit.org/show_bug.cgi?id=147015
2828         rdar://problem/21799011
2829
2830         Reviewed by Sam Weinig.
2831
2832         * UIProcess/Network/NetworkProcessProxy.cpp:
2833         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2834         (WebKit::NetworkProcessProxy::deleteWebsiteData):
2835         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2836         * UIProcess/WebProcessProxy.cpp:
2837         (WebKit::WebProcessProxy::fetchWebsiteData):
2838         (WebKit::WebProcessProxy::deleteWebsiteData):
2839         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
2840
2841 2015-07-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2842
2843         Unreviewed, placate -Wmismatched-tags after r187011
2844
2845         It's basically bug #146990 again. Oops.
2846
2847         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h:
2848
2849 2015-07-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2850
2851         [GTK] Add seccomp filters support
2852         https://bugs.webkit.org/show_bug.cgi?id=110014
2853
2854         Reviewed by Žan Doberšek.
2855
2856         Allow building with ENABLE_SECCOMP_FILTERS=ON. Based on work by Thiago Marcos P. Santos.
2857
2858         * PlatformGTK.cmake: Support ENABLE_SECCOMP_FILTERS build option.
2859         * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Added.
2860         (WebKit::SeccompFiltersWebProcessGtk::SeccompFiltersWebProcessGtk):
2861         (WebKit::SeccompFiltersWebProcessGtk::platformInitialize):
2862         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Added.
2863         * WebProcess/soup/WebProcessSoup.cpp:
2864         (WebKit::WebProcess::platformInitializeWebProcess): Initialize default
2865         GTK+ web process seccomp filters.
2866
2867 2015-07-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2868
2869         Reduce PassRefPtr in WebKit2 - 3
2870         https://bugs.webkit.org/show_bug.cgi?id=146995
2871
2872         Reviewed by Daniel Bates.
2873
2874         To remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
2875         Because some uses depend on WebCore, WebCore, WK1 ports are modified as well.
2876
2877         * DatabaseProcess/DatabaseProcess.cpp:
2878         (WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase):
2879         * DatabaseProcess/DatabaseProcess.h:
2880         * PluginProcess/PluginControllerProxy.cpp:
2881         (WebKit::PluginControllerProxy::takeInitializationReply):
2882         * PluginProcess/PluginControllerProxy.h:
2883         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2884         (WebKit::CoordinatedBackingStore::texture):
2885         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
2886         (WebKit::CoordinatedBackingStore::create):
2887         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
2888         (WebKit::WebCoordinatedSurface::create):
2889         (WebKit::WebCoordinatedSurface::createWithSurface):
2890         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
2891         * UIProcess/API/APILoaderClient.h:
2892         (API::LoaderClient::webCryptoMasterKey):
2893         * UIProcess/API/APINavigationClient.h:
2894         (API::NavigationClient::webCryptoMasterKey):
2895         * UIProcess/API/C/WKPage.cpp:
2896         (WKPageSetPageLoaderClient):
2897         (WKPageSetPageNavigationClient):
2898         * UIProcess/API/gtk/PageClientImpl.cpp:
2899         (WebKit::PageClientImpl::createPopupMenuProxy):
2900         (WebKit::PageClientImpl::createContextMenuProxy):
2901         (WebKit::PageClientImpl::createColorPicker):
2902         * UIProcess/API/gtk/PageClientImpl.h:
2903         * UIProcess/Authentication/WebCredential.h:
2904         * UIProcess/Authentication/WebProtectionSpace.h:
2905         * UIProcess/AutoCorrectionCallback.h:
2906         * UIProcess/Cocoa/NavigationState.h:
2907         * UIProcess/Cocoa/NavigationState.mm:
2908         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
2909         * UIProcess/CoordinatedGraphics/WebView.cpp:
2910         (WebKit::WebView::createPopupMenuProxy):
2911         (WebKit::WebView::createContextMenuProxy):
2912         (WebKit::WebView::createColorPicker):
2913         * UIProcess/CoordinatedGraphics/WebView.h:
2914         * UIProcess/PageClient.h:
2915         * UIProcess/WebPageProxy.h:
2916         * UIProcess/efl/WebViewEfl.cpp:
2917         (WebKit::WebViewEfl::createPopupMenuProxy):
2918         (WebKit::WebViewEfl::createContextMenuProxy):
2919         (WebKit::WebViewEfl::createColorPicker):
2920         * UIProcess/efl/WebViewEfl.h:
2921         * UIProcess/ios/PageClientImplIOS.h:
2922         * UIProcess/ios/PageClientImplIOS.mm:
2923         (WebKit::PageClientImpl::createPopupMenuProxy):
2924         (WebKit::PageClientImpl::createContextMenuProxy):
2925         * UIProcess/ios/WebPageProxyIOS.mm:
2926         (WebKit::WebPageProxy::dataSelectionForPasteboard):
2927         * UIProcess/mac/PageClientImpl.h:
2928         * UIProcess/mac/PageClientImpl.mm:
2929         (WebKit::PageClientImpl::createPopupMenuProxy):
2930         (WebKit::PageClientImpl::createContextMenuProxy):
2931         (WebKit::PageClientImpl::createColorPicker):
2932         * UIProcess/mac/WebPageProxyMac.mm:
2933         (WebKit::WebPageProxy::dataSelectionForPasteboard):
2934         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2935         (WebKit::WebResourceLoadScheduler::scheduleSubresourceLoad):
2936         (WebKit::WebResourceLoadScheduler::schedulePluginStreamLoad):
2937         * WebProcess/Network/WebResourceLoadScheduler.h:
2938         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2939         (WebKit::NetscapePlugin::fromNPP):
2940         (WebKit::NetscapePlugin::snapshot):
2941         (WebKit::NetscapePlugin::liveResourceData):
2942         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2943         * WebProcess/Plugins/Plugin.h:
2944         * WebProcess/Plugins/PluginProxy.cpp:
2945         (WebKit::PluginProxy::snapshot):
2946         (WebKit::PluginProxy::liveResourceData):
2947         * WebProcess/Plugins/PluginProxy.h:
2948         * WebProcess/Storage/StorageNamespaceImpl.cpp:
2949         (WebKit::StorageNamespaceImpl::storageArea):
2950         (WebKit::StorageNamespaceImpl::copy):
2951         * WebProcess/Storage/StorageNamespaceImpl.h:
2952         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2953         (WebKit::toHistoryItem):
2954         * WebProcess/WebCoreSupport/SessionStateConversion.h:
2955         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2956         (WebKit::WebChromeClient::createPopupMenu):
2957         (WebKit::WebChromeClient::createSearchPopupMenu):
2958         * WebProcess/WebCoreSupport/WebChromeClient.h:
2959         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2960         (WebKit::WebFrameLoaderClient::createDocumentLoader):
2961         (WebKit::WebFrameLoaderClient::createFrame):
2962         (WebKit::WebFrameLoaderClient::createPlugin):
2963         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2964         * WebProcess/WebPage/WebPage.cpp:
2965         (WebKit::WebPage::create):
2966         (WebKit::WebPage::createDocumentLoader):
2967         * WebProcess/WebPage/WebPage.h:
2968         * WebProcess/WebPage/mac/WebPageMac.mm:
2969         (WebKit::WebPage::lookupTextAtLocation):
2970
2971 2015-07-18  Simon Fraser  <simon.fraser@apple.com>
2972
2973         Scroll position jumps when scrolling scaling pages down in split view
2974         https://bugs.webkit.org/show_bug.cgi?id=147072
2975         rdar://problem/21769577
2976
2977         Reviewed by Sam Weinig.
2978         
2979         When apple.com/music is in Split View at a reduced scale, scrolling the page
2980         can cause unwanted scroll jumps. This happened because we'd enter
2981         TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() with a pending
2982         layout, so run the autosizing logic. When scrolled near the bottom, the unconstrained
2983         layout resulted in a shorter document, which truncated the scroll position. The
2984         scaled layout then restored the longer document, but it also restored that
2985         truncated scroll position.
2986         
2987         Forcing a layout is sufficient to fix the bug for this page, and doing a single
2988         layout (which will happen anyway) is preferable to running the autosize logic
2989         if layout happens to be dirty.
2990
2991         I was not able to make a test to reproduce the problem. Entering
2992         scaleViewToFitDocumentIfNeeded() with pending layout was triggerable
2993         using a transform transition, but I was not able to reproduce incorrect
2994         scroll position restoration.
2995
2996         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2997         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2998
2999 2015-07-17  Andy Estes  <aestes@apple.com>
3000
3001         [iOS] Further tighten the sandbox around pages fetched with Content-Disposition: attachment
3002         https://bugs.webkit.org/show_bug.cgi?id=147044
3003         rdar://problem/21567820
3004
3005         Reviewed by Brady Eidson.
3006
3007         * WebProcess/WebPage/WebPage.cpp:
3008         (WebKit::WebPage::WebPage): Enabled Content-Disposition: attachment sandbox on iOS.
3009
3010 2015-07-17  Tim Horton  <timothy_horton@apple.com>
3011
3012         [iOS] TextIndicator has a large forehead when line-height > 1
3013         https://bugs.webkit.org/show_bug.cgi?id=147058
3014         <rdar://problem/21643094>
3015
3016         Reviewed by Dean Jackson.
3017
3018         * WebProcess/WebPage/ios/WebPageIOS.mm:
3019         (WebKit::WebPage::getPositionInformation):
3020         Apply a review comment that I left myself and then forgot about.
3021
3022 2015-07-17  Enrica Casucci  <enrica@apple.com>
3023
3024         [iOS] Implement selectionInteractionAssistant accessor.
3025         https://bugs.webkit.org/show_bug.cgi?id=147054
3026         rdar://problem/20864286
3027
3028         Reviewed by Tim Horton.
3029
3030         One more change to adopt the new selection interaction
3031         model on iOS.
3032
3033         * UIProcess/ios/WKContentViewInteraction.mm:
3034         (-[WKContentView selectionInteractionAssistant]):
3035
3036 2015-07-17  Dan Bernstein  <mitz@apple.com>
3037
3038         REGRESSION (r186964): Crash in WebKit2.CloseFromWithinCreatePage
3039         https://bugs.webkit.org/show_bug.cgi?id=147055
3040
3041         Reviewed by Alex Christensen.
3042
3043         * UIProcess/WebPageProxy.cpp:
3044         (WebKit::WebPageProxy::createNewPage): Grab the main frame’s URL before calling out to the
3045         client, who may destroy the frame.
3046
3047 2015-07-17  Dan Bernstein  <mitz@apple.com>
3048
3049         WebKit2 part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
3050         https://bugs.webkit.org/show_bug.cgi?id=147040
3051
3052         Reviewed by Dean Jackson.
3053
3054         * UIProcess/Cocoa/UIDelegate.mm:
3055         (WebKit::UIDelegate::UIClient::createNewPage): Disallow App Links if the new page is for the
3056         same protocol, host and port as the main frame of this page.
3057
3058         * UIProcess/WebPageProxy.cpp:
3059         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Disallow App Links if
3060         m_shouldSuppressAppLinksInNextNavigationPolicyDecision is set, and reset it. See below for
3061         when we set it.
3062         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Disallow App Links if the new window
3063         is for the same protocol, host and port as the main frame of this page.
3064         (WebKit::WebPageProxy::createNewPage): Make the new page disallow App Links in the first
3065         policy decision if it is for the same protocol, host and port as the main frame of this
3066         page.
3067         * UIProcess/WebPageProxy.h: Added m_shouldSuppressAppLinksInNextNavigationPolicyDecision
3068         member variable.
3069
3070         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3071         (WebKit::WebChromeClient::createWindow): Pass the shouldOpenExternalURLsPolicy.
3072
3073         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3074         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
3075
3076 2015-07-17  Tim Horton  <timothy_horton@apple.com>
3077
3078         iOS TextIndicators include text that is not supposed to be indicated
3079         https://bugs.webkit.org/show_bug.cgi?id=147028
3080         <rdar://problem/21643094>
3081
3082         Reviewed by Sam Weinig.
3083
3084         * WebProcess/Plugins/PluginView.cpp:
3085         (WebKit::PluginView::shouldCreateTransientPaintingSnapshot):
3086
3087 2015-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3088
3089         [GTK] Cleanup PasteboardHelper
3090         https://bugs.webkit.org/show_bug.cgi?id=147035
3091
3092         Reviewed by Žan Doberšek.
3093
3094         Use PasteboardHelper::singleton() instead of
3095         PasteboardHelper::defaultPasteboardHelper().
3096
3097         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3098         (webkitWebViewBaseConstructed):
3099         * UIProcess/gtk/DragAndDropHandler.cpp:
3100         (WebKit::DragAndDropHandler::startDrag):
3101         (WebKit::DragAndDropHandler::fillDragData):
3102         (WebKit::DragAndDropHandler::dataObjectForDropData):
3103         (WebKit::DragAndDropHandler::requestDragData):
3104
3105 2015-07-16  Matt Baker  <mattbaker@apple.com>
3106
3107         [Mac] Web Inspector toolbar can be covered by the Safari tab bar when docked to the right
3108         https://bugs.webkit.org/show_bug.cgi?id=146994
3109
3110         Reviewed by Timothy Hatcher.
3111
3112         WebInspectorProxy contained logic which ignored the next frame change notification from the inspected view,
3113         whenever it updated the frames of both the Inspector view and inspected view. This patch removes that logic,
3114         as it prevented the Inspector's frame from being adjusted after changes to the browser's top content inset.
3115
3116         * UIProcess/mac/WebInspectorProxyMac.mm:
3117         (-[WKWebInspectorProxyObjCAdapter ignoreNextInspectedViewFrameDidChange]): Deleted.
3118         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]): Deleted.
3119         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Deleted.
3120
3121 2015-07-16  Joseph Pecoraro  <pecoraro@apple.com>
3122
3123         Web Inspector: [Mac] Save dialog not working when inspector is docked
3124         https://bugs.webkit.org/show_bug.cgi?id=146991
3125
3126         Reviewed by Sam Weinig.
3127
3128         * UIProcess/mac/WebInspectorProxyMac.mm:
3129         (WebKit::runOpenPanel):
3130         (WebKit::WebInspectorProxy::platformSave):
3131         When the window is nil (docked) use a non-window version of running the dialog.
3132
3133 2015-07-16  Tim Horton  <timothy_horton@apple.com>
3134
3135         Add shrink-wrapped link highlights
3136         https://bugs.webkit.org/show_bug.cgi?id=147021
3137         <rdar://problem/21643094>
3138
3139         Reviewed by Enrica Casucci.
3140
3141         * Shared/InteractionInformationAtPosition.cpp:
3142         (WebKit::InteractionInformationAtPosition::encode):
3143         (WebKit::InteractionInformationAtPosition::decode):
3144         * Shared/InteractionInformationAtPosition.h:
3145         Add a TextIndicator to InteractionInformationAtPosition.
3146         Make use of some new C++ features.
3147
3148         * UIProcess/ios/WKContentViewInteraction.h:
3149         * UIProcess/ios/WKContentViewInteraction.mm:
3150         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
3151         (-[WKContentView didDismissPreviewViewController:committing:]):
3152         Make use of the TextIndicator (if we have one) to show a shrink-wrapped
3153         snapshot of the link.
3154
3155         * WebProcess/WebPage/ios/WebPageIOS.mm:
3156         (WebKit::WebPage::getPositionInformation):
3157         Build a TextIndicator for the link if possible.
3158
3159 2015-07-16  Matt Rajca  <mrajca@apple.com>
3160
3161         Media Session: remove plumbing for delivering start/end-of-interruption events
3162         https://bugs.webkit.org/show_bug.cgi?id=147005
3163
3164         Reviewed by Eric Carlson.
3165
3166         Instead of receiving interruptions through WebKit, we will provide platform-specific implementations in WebCore
3167         so the same behavior is available to all clients.
3168
3169         * UIProcess/API/C/WKPage.cpp:
3170         * UIProcess/API/C/WKPagePrivate.h:
3171         * UIProcess/WebPageProxy.cpp:
3172         * UIProcess/WebPageProxy.h:
3173         * WebProcess/WebPage/WebPage.cpp:
3174         * WebProcess/WebPage/WebPage.h:
3175         * WebProcess/WebPage/WebPage.messages.in:
3176
3177 2015-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
3178
3179         REGRESSION(r186464): [SOUP] ASSERTION FAILED: !m_messageReceiverMapCount when closing any tab
3180         https://bugs.webkit.org/show_bug.cgi?id=147006
3181
3182         Reviewed by Anders Carlsson.
3183
3184         Remove the message receiver before it is deallocated.
3185
3186         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
3187         (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
3188
3189 2015-07-16  Brady Eidson  <beidson@apple.com>
3190
3191         Review feedback followup for:
3192         REGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
3193         <rdar://problem/21692212> and https://bugs.webkit.org/show_bug.cgi?id=146988
3194
3195         * UIProcess/mac/PageClientImpl.mm:
3196         (WebKit::PageClientImpl::refView): CFRetain instead of Obj-C retain.
3197         (WebKit::PageClientImpl::derefView): CFRelease instead of Obj-C release.
3198
3199
3200 2015-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
3201
3202         [Linux] Seccomp: fix -Wmismatched-tags
3203         https://bugs.webkit.org/show_bug.cgi?id=146990
3204
3205         Reviewed by Žan Doberšek.
3206
3207         WebProcessCreationParameters is a struct nowadays, not a class, so declare it appropriately.
3208
3209         * Shared/linux/SeccompFilters/SyscallPolicy.h:
3210
3211 2015-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3212
3213         REGRESSION(r185415): [GTK] Browsers crash when an input method is enabled
3214         https://bugs.webkit.org/show_bug.cgi?id=146639
3215
3216         Reviewed by Žan Doberšek.
3217
3218         In r185415 I assumed that preedit signals were always emitted
3219         after a keypress was handled by the WebView. However, some input
3220         methods handle the keyboard events before the WebView, and preedit
3221         signals are emitted but no key event has been handled by the
3222         WebView. So, instead of asserting when filter key event completion
3223         handler is nullptr, we should check whether the current event was
3224         generated for a WebView filter request or not. In case the
3225         completion handler is nullptr, we send the event directly to the
3226         page, instead of going through the WebView, since there won't be
3227         editing commands for those events anyway.
3228
3229         * UIProcess/gtk/InputMethodFilter.cpp:
3230         (WebKit::InputMethodFilter::handleKeyboardEvent):
3231         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
3232
3233 2015-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3234
3235         Unreviewed. Follow up to r186887 for GTK+.
3236
3237         Add GTK+ implementation of PageClientImpl::refView/derefView.
3238
3239         * UIProcess/API/gtk/PageClientImpl.cpp:
3240         (WebKit::PageClientImpl::refView):
3241         (WebKit::PageClientImpl::derefView):
3242         * UIProcess/API/gtk/PageClientImpl.h:
3243
3244 2015-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3245
3246         [GTK] Input method filter is always enabled when the view is focused
3247         https://bugs.webkit.org/show_bug.cgi?id=146965
3248
3249         Reviewed by Martin Robinson.
3250
3251         It should only be enabled when the view is focused and there's an
3252         editable element focused. In r138544, when input methods were
3253         implemented, the message SetInputMethodState was added, but it was
3254         never used. Instead, the notifyFocusIn method of the IM filter
3255         enables the input method unconditionally. We should actually use
3256         the SetInputMethodState message to enable/disable input methods
3257         when editable elements are focused/unfocused.
3258
3259         * UIProcess/gtk/InputMethodFilter.cpp:
3260         (WebKit::InputMethodFilter::setEnabled): Call notifyFocusedIn/Out
3261         when inputs methods are enabled/disabled instead of notifying the
3262         IM context directly.
3263         (WebKit::InputMethodFilter::setCursorRect): Do not update the
3264         cursor position if input methods are didabled.
3265         (WebKit::InputMethodFilter::notifyFocusedIn): Do nothing when
3266         input methods are disabled. Do not enable input methods
3267         uncontionally here.
3268         (WebKit::InputMethodFilter::notifyFocusedOut): Do not disable
3269         input methods uncontionally here.
3270         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3271         (WebKit::WebEditorClient::setInputMethodState): Call
3272         WebPage::setInputMethodState() for GTK platform.
3273         * WebProcess/WebPage/WebPage.h: Add setInputMethodState() for GTK platform.
3274         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3275         (WebKit::WebPage::setInputMethodState): Update input method state
3276         and send SetInputMethodState message to the UI process if state changed.
3277
3278 2015-07-15  Brady Eidson  <beidson@apple.com>
3279
3280         REGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
3281         <rdar://problem/21692212> and https://bugs.webkit.org/show_bug.cgi?id=146988
3282
3283         Reviewed by Sam Weinig.
3284
3285         When a loader delegate callback results in the WKView getting deallocated, then the PageClient
3286         is also destroyed.
3287
3288         WebPageProxy then (often) turns around and uses the PageClient anyways.
3289
3290         Tried to write a TestWebKitAPI test for this, but only didFailLoadForFrame appears to obviously 
3291         be vulnerable, and there seems to be no way to reproduce that failure case under TestWebKitAPI.
3292
3293         * UIProcess/PageClient.h: Add ref/derefView.
3294
3295         * UIProcess/API/gtk/PageClientImpl.h: Stub them out.
3296         * UIProcess/efl/WebViewEfl.h: Stub them out.
3297
3298         * UIProcess/mac/PageClientImpl.h:
3299         * UIProcess/mac/PageClientImpl.mm:
3300         (WebKit::PageClientImpl::refView): [m_wkView retain]
3301         (WebKit::PageClientImpl::derefView): [m_wkView release]
3302
3303         * UIProcess/ios/PageClientImplIOS.h:
3304         * UIProcess/ios/PageClientImplIOS.mm:
3305         (WebKit::PageClientImpl::refView): Retain all 3 views.
3306         (WebKit::PageClientImpl::derefView): Release all 3 views.
3307
3308         * UIProcess/WebPageProxy.cpp:
3309         (WebKit::PageClientProtector::PageClientProtector): Calls refView() on the PageClient.
3310         (WebKit::PageClientProtector::~PageClientProtector): Calls derefView() on the PageClient.
3311         (WebKit::WebPageProxy::didChangeBackForwardList): All methods that make m_loaderClient or
3312           m_pageClient callouts get a protector at their head.
3313         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3314         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
3315         (WebKit::WebPageProxy::findPlugin):
3316         (WebKit::WebPageProxy::didCreateMainFrame):
3317         (WebKit::WebPageProxy::didCreateSubframe):
3318         (WebKit::WebPageProxy::didStartProgress):
3319         (WebKit::WebPageProxy::didChangeProgress):
3320         (WebKit::WebPageProxy::didFinishProgress):
3321         (WebKit::WebPageProxy::didDestroyNavigation):
3322         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3323         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3324         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
3325         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3326         (WebKit::WebPageProxy::didCommitLoadForFrame):
3327         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3328         (WebKit::WebPageProxy::didFinishLoadForFrame):
3329         (WebKit::WebPageProxy::didFailLoadForFrame):
3330         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3331         (WebKit::WebPageProxy::didReceiveTitleForFrame):
3332         (WebKit::WebPageProxy::didFirstLayoutForFrame):
3333         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
3334         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
3335         (WebKit::WebPageProxy::didLayout):
3336         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
3337         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
3338         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
3339         (WebKit::WebPageProxy::didDetectXSSForFrame):
3340         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
3341         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3342         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3343         (WebKit::WebPageProxy::decidePolicyForResponse):
3344         (WebKit::WebPageProxy::decidePolicyForResponseSync):
3345         (WebKit::WebPageProxy::unableToImplementPolicy):
3346         (WebKit::WebPageProxy::didNavigateWithNavigationData):
3347         (WebKit::WebPageProxy::didPerformClientRedirect):
3348         (WebKit::WebPageProxy::didPerformServerRedirect):
3349         (WebKit::WebPageProxy::didUpdateHistoryTitle):
3350         (WebKit::WebPageProxy::wrapCryptoKey):
3351         (WebKit::WebPageProxy::unwrapCryptoKey):
3352         (WebKit::WebPageProxy::navigationGestureDidBegin):
3353         (WebKit::WebPageProxy::navigationGestureWillEnd):
3354         (WebKit::WebPageProxy::navigationGestureDidEnd):
3355         (WebKit::WebPageProxy::willRecordNavigationSnapshot):
3356
3357 2015-07-15  Sam Weinig  <sam@webkit.org>
3358
3359         Color match plug-ins
3360         <rdar://problem/21758722>
3361         https://bugs.webkit.org/show_bug.cgi?id=146987
3362
3363         Reviewed by Dean Jackson.
3364
3365         * Platform/mac/LayerHostingContext.h:
3366         * Platform/mac/LayerHostingContext.mm:
3367         (WebKit::LayerHostingContext::setColorMatchUntaggedContent):
3368         (WebKit::LayerHostingContext::colorMatchUntaggedContent):
3369         Add setter/getter for color matching untagged content.
3370
3371         * PluginProcess/mac/PluginControllerProxyMac.mm:
3372         (WebKit::PluginControllerProxy::updateLayerHostingContext):
3373         Have plug-ins CAContext's color match untagged colors into sRGB.
3374
3375 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3376
3377         [GTK] Rename PACKAGE_LOCALE_DIR to LOCALEDIR
3378         https://bugs.webkit.org/show_bug.cgi?id=146975
3379
3380         Reviewed by Martin Robinson.
3381
3382         * PlatformGTK.cmake:
3383         * UIProcess/API/gtk/WebKitWebContext.cpp:
3384         (webkit_web_context_class_init):
3385         * WebProcess/gtk/WebProcessMainGtk.cpp:
3386
3387 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3388
3389         [GTK] Rename LIBEXECDIR to PKGLIBEXECDIR
3390         https://bugs.webkit.org/show_bug.cgi?id=140070
3391
3392         Reviewed by Martin Robinson.
3393
3394         The path that's currently stored in LIBEXECDIR is one level lower than
3395         the real LIBEXECDIR, which we are going to need. Introduce PKGLIBEXECDIR
3396         so that we can use LIBEXECDIR for the real LIBEXECDIR in the future.
3397
3398         * PlatformGTK.cmake:
3399         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3400         (WebKit::findWebKitProcess):
3401
3402 2015-07-15  Daniel Bates  <dabates@apple.com>
3403
3404         [Mac][WK2] Videos should only have access to cookies when -[NSURLRequest HTTPShouldHandleCookies] is YES
3405         https://bugs.webkit.org/show_bug.cgi?id=146763
3406         <rdar://problem/21736994>
3407
3408         Reviewed by Darin Adler.
3409
3410         We should only fetch cookies from the Network process when -[NSURLRequest HTTPShouldHandleCookies] is YES.
3411         This makes us more closely match the behavior of the CFNetwork implementation of
3412         -[__NSURLSessionLocal {_copyCookiesForRequestUsingAllAppropriateStorageSemantics, _getCookieHeadersForTask:completionHandler}].
3413
3414         * Shared/mac/CookieStorageShim.mm:
3415         (-[WKNSURLSessionLocal _copyCookiesForRequestUsingAllAppropriateStorageSemantics:]):
3416         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
3417
3418 2015-07-14  Enrica Casucci  <enrica@apple.com>
3419
3420         [iOS] Add support for updateSelectionWithExtentPoint:withBoundary.
3421         https://bugs.webkit.org/show_bug.cgi?id=146951
3422         rdar://problem/20864286
3423
3424         Reviewed by Tim Horton.
3425
3426         Add implementation for new method used by text selection
3427         engine on iOS. The new function modifies the selection near the given point
3428         and snaps it at the boundary of the specified granularity.
3429
3430         * UIProcess/WebPageProxy.h:
3431         * UIProcess/ios/WKContentViewInteraction.mm:
3432         (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
3433         (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
3434         (-[WKContentView _characterBeforeCaretSelection]):
3435         * UIProcess/ios/WebPageProxyIOS.mm:
3436         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
3437         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
3438         (WebKit::WebPageProxy::requestDictationContext):
3439         * WebProcess/WebPage/WebPage.h:
3440         * WebProcess/WebPage/WebPage.messages.in:
3441         * WebProcess/WebPage/ios/WebPageIOS.mm:
3442         (WebKit::WebPage::rangeForGranularityAtPoint):
3443         (WebKit::WebPage::selectTextWithGranularityAtPoint):
3444         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
3445
3446 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3447
3448         [Linux] SeccompBrokerClient should cache arbitrary file descriptors
3449         https://bugs.webkit.org/show_bug.cgi?id=140068
3450
3451         Reviewed by Žan Doberšek.
3452
3453         If malloc() attempts to open /proc/sys/vm/overcommit_memory in a SIGSYS
3454         signal handler, the SeccompBroker will attempt to recursively broker the
3455         open() syscall. Generalize the existing code that already handles the
3456         similar case where malloc() opens /sys/devices/system/cpu/online to
3457         handle this situation as well.
3458
3459         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
3460         (WebKit::SIGSYSHandler):
3461         (WebKit::SeccompBrokerClient::SeccompBrokerClient):
3462         (WebKit::SeccompBrokerClient::~SeccompBrokerClient):
3463         (WebKit::SeccompBrokerClient::handleIfOpeningCachedFile):
3464         (WebKit::SeccompBrokerClient::cacheFile):
3465         (WebKit::SeccompBrokerClient::handleIfOpeningOnlineCPUCount): Deleted.
3466
3467 2015-07-15  ChangSeok Oh  <changseok.oh@collabora.com>
3468
3469         [GTK] Accelerated compositing is enabled by MiniBrowser in Wayland
3470         https://bugs.webkit.org/show_bug.cgi?id=146827
3471
3472         Reviewed by Žan Doberšek.
3473
3474         WebKit2Gtk+ does not currently support accelerated compositing. For the reason,
3475         we forcedly disable it in webkitWebViewBaseCreateWebPage. However, when we launch
3476         MiniBrowser in wayland, the unsupported feature is re-enabled since the existing
3477         setting is overwritten by a newly created