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