b2fb672719546824a18d17f36af71ad0b23e80b2
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-07-29  Csaba Osztrogonác  <ossy@webkit.org>
2
3         URTBF for !ENABLE(DATABASE_PROCESS) platforms.
4
5         * WebProcess/OriginData/WebOriginDataManager.cpp:
6         (WebKit::WebOriginDataManager::getOrigins):
7         (WebKit::WebOriginDataManager::deleteEntriesForOrigin):
8         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates):
9         (WebKit::WebOriginDataManager::deleteAllEntries):
10
11 2014-07-29  Brady Eidson  <beidson@apple.com>
12
13         Make WKOriginDataManager actually operate on IndexedDatabases.
14         https://bugs.webkit.org/show_bug.cgi?id=135346
15
16         Reviewed by Sam Weinig (and David Kilzer and Alex Christensen)
17
18         * DatabaseProcess/DatabaseProcess.cpp:
19         (WebKit::DatabaseProcess::DatabaseProcess):
20         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): 
21         (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins):
22         (WebKit::removeAllDatabasesForOriginPath): Utility to delete all database files for the given origin path
23             that have been modified between the given dates.
24         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
25         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin):
26         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
27         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates):
28         (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
29         (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries):
30         * DatabaseProcess/DatabaseProcess.h:
31
32         * Shared/WebCrossThreadCopier.cpp:
33         (WebCore::SecurityOriginData>::copy):
34         * Shared/WebCrossThreadCopier.h:
35
36         * UIProcess/WebOriginDataManagerProxy.cpp:
37         (WebKit::WebOriginDataManagerProxy::getOrigins):
38         (WebKit::WebOriginDataManagerProxy::didGetOrigins):
39         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
40         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates):
41         (WebKit::WebOriginDataManagerProxy::deleteAllEntries):
42
43         * WebProcess/OriginData/WebOriginDataManager.cpp:
44         (WebKit::WebOriginDataManager::getOrigins): Pipe IDB requests through to the DatabaseProcess.
45         (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Ditto.
46         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Ditto.
47         (WebKit::WebOriginDataManager::deleteAllEntries): Ditto.
48
49 2014-07-29  Commit Queue  <commit-queue@webkit.org>
50
51         Unreviewed, rolling out r171704.
52         https://bugs.webkit.org/show_bug.cgi?id=135389
53
54         Broke two IndexedDB tests (Requested by ap on #webkit).
55
56         Reverted changeset:
57
58         "IDB transactions never reset if the Web Process ends before
59         cleaning up"
60         https://bugs.webkit.org/show_bug.cgi?id=135218
61         http://trac.webkit.org/changeset/171704
62
63 2014-07-29  Daniel Bates  <dabates@apple.com>
64
65         Use WTF::move() instead of std::move() to help ensure move semantics
66         https://bugs.webkit.org/show_bug.cgi?id=135351
67
68         Reviewed by Alexey Proskuryakov.
69
70         * UIProcess/API/Cocoa/_WKSessionState.mm:
71         (-[_WKSessionState _initWithSessionState:]):
72         * UIProcess/API/gtk/WebKitUserContent.cpp:
73         (toStringVector): Remove use of std::move(). It's unnecessary to call std::move() on an rvalue.
74         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
75         (WebKit::ServicesOverlayController::mouseEvent):
76
77 2014-07-28  Pratik Solanki  <psolanki@apple.com>
78
79         Get SharedBuffer.h out of ResourceBuffer.h (and a few other places)
80         https://bugs.webkit.org/show_bug.cgi?id=131782
81
82         Original patch by Tim Horton.
83         Reviewed by Darin Adler.
84
85         * NetworkProcess/NetworkResourceLoader.cpp:
86         * WebProcess/Network/NetworkProcessConnection.cpp:
87         Include SharedBuffer.h in implementation files.
88
89         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
90         Un-indent namespace and remove SharedBuffer forward-declaration.
91
92 2014-07-29  Adrian Perez de Castro  <aperez@igalia.com>
93
94         [GTK] Remove WebKitWebViewGroup from WebKit2 GTK+ API
95         https://bugs.webkit.org/show_bug.cgi?id=133729
96
97         Reviewed by Carlos Garcia Campos.
98
99         Removes WebKitWebViewGroup, effectively reverting the changes
100         introduced by r149117. The motivation for WebKitWebViewGroup
101         was using the user style sheet injection API, which has been
102         moved into WebKitUserContentManager, rendering it unneeded.
103
104         * PlatformGTK.cmake: Remove WebKitWebViewGroup source files
105         from the build.
106         * UIProcess/API/C/gtk/WKView.cpp:
107         (WKViewCreate): Accomodate for changes in the signature of
108         webkitWebViewBaseCreate().
109         * UIProcess/API/gtk/WebKitSettings.cpp: Update API documentation.
110         * UIProcess/API/gtk/WebKitWebContext.cpp: Remove the default web
111         view group from WebKitWebContext.
112         (webkitWebContextCreatePageForWebView): Allow passing a
113         WebPreferences object at construction.
114         (webkitWebContextGetDefaultWebViewGroup): Deleted.
115         * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
116         * UIProcess/API/gtk/WebKitWebView.cpp:
117         (webkitWebViewUpdateSettings): Use WebPageProxy::setPreferences()
118         directly. Handle the case when webkit_web_view_set_settings()
119         is called on construction by doing an early-return.
120         (webkitWebViewConstructed): Call webkitWebViewUpdateSettings()
121         after creating the internal WebPageProxy object.
122         (webkitWebViewSetProperty): Removed "group" property, added
123         "settings" property.
124         (webkitWebViewGetProperty): Ditto.
125         (webkitWebViewDispose): Do not disconnect signal handler for
126         the (now unexistant) WebKitWebViewGroup.
127         (webkit_web_view_class_init): Removed "group" property, added
128         "settings" property.
129         (webkitWebViewHandleAuthenticationChallenge): Access the
130         WebKitWebSettings directly.
131         (webkit_web_view_new_with_related_view): Make new views share
132         settings with their related view.
133         (webkit_web_view_new_with_settings): Added.
134         (webkit_web_view_set_settings): Access the settings directly in
135         the WebKitWebView.
136         (webkit_web_view_get_settings): Ditto.
137         (webkit_web_view_set_zoom_level): Ditto.
138         (webkit_web_view_get_zoom_level): Ditto.
139         (webkitWebViewSettingsChanged): Deleted.
140         (webkitWebViewDisconnectSettingsChangedSignalHandler): Deleted.
141         (webkit_web_view_new_with_group): Deleted.
142         (webkit_web_view_get_group): Deleted.
143         * UIProcess/API/gtk/WebKitWebView.h: Removed API methods related
144         to WebKitWebViewGroup.
145         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
146         (webkitWebViewBaseCreate): Allow passing a WebPreferences object
147         for constructing the WebPageProxy.
148         (webkitWebViewBaseUpdatePreferences): Instead of going through
149         the page group, use WebPageProxy::preferences() directly.
150         (webkitWebViewBaseCreateWebPage): Allow passing a WebPreferences
151         object for constructing the WebPageProxy.
152         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Update the
153         prototypes of the internal functions.
154         * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed.
155         * UIProcess/API/gtk/WebKitWebViewGroup.h: Removed.
156         * UIProcess/API/gtk/WebKitWebViewGroupPrivate.h: Removed.
157         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Change public API
158         bits in the documentation.
159         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Ditto.
160         * UIProcess/API/gtk/docs/webkit2gtk.types: Ditto.
161         * UIProcess/API/gtk/webkit2.h: Removed WebKitWebViewGroup.h header.
162         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
163         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
164         Accomodate for changes in the signature of
165         webkitWebViewBaseCreate().
166
167 2014-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>
168
169         Implement webkit_web_view_load_string() in WebKit2
170         https://bugs.webkit.org/show_bug.cgi?id=134735
171
172         Reviewed by Sergio Villar Senin.
173
174         Add webkit_web_view_load_bytes() that receives a GBytes to load
175         random data in the web view using the given MIME-Type, encoding
176         and base URL.
177
178         * UIProcess/API/gtk/WebKitWebView.cpp:
179         (releaseGBytes):
180         (webkit_web_view_load_bytes):
181         * UIProcess/API/gtk/WebKitWebView.h:
182         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
183         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
184
185 2014-07-29  Ryuan Choi  <ryuan.choi@samsung.com>
186
187         [EFL] Alpha value of ewk_view_bg_color_set is not working
188         https://bugs.webkit.org/show_bug.cgi?id=135333
189
190         Reviewed by Gyuyoung Kim.
191
192         evas_object_image_alpha_set should be called for the transparent evas object.
193
194         * UIProcess/API/efl/EwkView.cpp:
195         (EwkView::handleEvasObjectColorSet):
196         (EwkView::setBackgroundColor): Checked the alpha value of object and called evas_object_image_alpha_set.
197         * UIProcess/API/efl/EwkView.h:
198         * UIProcess/API/efl/ewk_view.cpp:
199         (ewk_view_bg_color_set): Moved the logic to EwkView.
200
201 2014-07-28  Mark Rowe  <mrowe@apple.com>
202
203         Web process crash causes UI process to die with an assertion failure in Connection::exceptionSourceEventHandler
204         https://bugs.webkit.org/show_bug.cgi?id=135366
205
206         Reviewed by Dan Bernstein.
207
208         * Platform/IPC/mac/ConnectionMac.mm:
209         (IPC::Connection::exceptionSourceEventHandler): Remove the assertion since it frequently fires during
210         normal development with debug builds.
211
212 2014-07-28  Benjamin Poulain  <bpoulain@apple.com>
213
214         [iOS WK2] WKWebView sometime tries to change the size of a null DrawingAreaProxy
215         https://bugs.webkit.org/show_bug.cgi?id=135368
216         <rdar://problem/16988887>
217
218         Reviewed by Simon Fraser.
219
220         We should never assume DrawingAreaProxy exists in the API invoked by the clients
221         of WKWebView. There are at least two cases where the DrawingAreaProxy is null:
222         -In some path on initialization.
223         -After a crash.
224
225         * UIProcess/API/Cocoa/WKWebView.mm:
226         (-[WKWebView _frameOrBoundsChanged]):
227         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
228         We can safely null check and skip setting the size. If the call was skipped,
229         the size is set on DrawingAreaProxy initialization by querying the current
230         size through the page client.
231
232 2014-07-28  Roger Fong  <roger_fong@apple.com>
233
234         Disable tagged strings for the plugin process.
235         https://bugs.webkit.org/show_bug.cgi?id=135354
236         <rdar://problem/17295639>.
237
238         Patch by Alexey Proskuryakov and Roger Fong.
239
240         Reviewed by Anders Carlsson.
241
242         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
243         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
244         (WebKit::connectToReExecService):
245
246 2014-07-25  Jeffrey Pfau  <jpfau@apple.com>
247
248         IDB transactions never reset if the Web Process ends before cleaning up
249         https://bugs.webkit.org/show_bug.cgi?id=135218
250
251         Reviewed by Darin Adler.
252
253         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
254         (WebKit::DatabaseToWebProcessConnection::didClose):
255         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
256         (WebKit::UniqueIDBDatabase::unregisterConnection):
257         (WebKit::UniqueIDBDatabase::didCompleteTransactionOperation):
258         (WebKit::UniqueIDBDatabase::openBackingStoreTransaction):
259         (WebKit::UniqueIDBDatabase::resetBackingStoreTransaction):
260         (WebKit::UniqueIDBDatabase::didEstablishTransaction):
261         (WebKit::UniqueIDBDatabase::didResetTransaction):
262         (WebKit::UniqueIDBDatabase::resetAllTransactions):
263         (WebKit::UniqueIDBDatabase::finalizeRollback):
264         (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory):
265         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
266         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
267         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::rollbackTransaction):
268
269 2014-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
270
271         [GTK] Keep non-DATABASE_PROCESS build
272         https://bugs.webkit.org/show_bug.cgi?id=135321
273
274         Reviewed by Gyuyoung Kim.
275
276         This is the patch for r171622 in non-DATABASE_PROCESS builds.
277         Change sendToDatabaseProcessRelaunchingIfNecessary to support non-DATABASE_PROCESS implementation.
278
279         * CMakeLists.txt:
280         * UIProcess/WebContext.h:
281         (WebKit::WebContext::sendToDatabaseProcessRelaunchingIfNecessary):
282
283 2014-07-27  Gavin Barraclough  <baraclough@apple.com>
284
285         Don't rely on reading applicationState from within DidEnterBackground/WillEnterForeground
286         https://bugs.webkit.org/show_bug.cgi?id=135329
287         rdar://problem/17818308
288
289         Reviewed by Sam Weinig.
290
291         API may not be stable.
292
293         * UIProcess/ios/PageClientImplIOS.mm:
294         (WebKit::PageClientImpl::isViewVisible):
295             - changed to use -[WKContentView isBackground]
296         * UIProcess/ios/ProcessAssertionIOS.mm:
297         (-[WKProcessAssertionBackgroundTaskManager init]):
298             - split notification handlers
299         (-[WKProcessAssertionBackgroundTaskManager _applicationWillEnterForeground:]):
300         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackground:]):
301         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]): Deleted.
302             - Assume application is background is after DidEnterBackground, and not after WillEnterForeground
303         * UIProcess/ios/WKContentView.h:
304             - added isBackground.
305         * UIProcess/ios/WKContentView.mm:
306         (-[WKContentView initWithFrame:context:configuration:webView:]):
307             - check applicationState at init.
308         (-[WKContentView isBackground]):
309             - accessor
310         (-[WKContentView _applicationDidEnterBackground:]):
311         (-[WKContentView _applicationWillEnterForeground:]):
312             - update isBackground
313
314 2014-07-26  Enrica Casucci  <enrica@apple.com>
315
316         [WebKit2 iOS]Add support for caret movement for the 3rd party keyboard protocol.
317         https://bugs.webkit.org/show_bug.cgi?id=135325
318         <rdar://problem/17682120>
319
320         Reviewed by Sam Weinig.
321
322         WKContentView now implements moveByOffset to support the
323         protocol for 3rd party keyboards.
324
325         * UIProcess/WebPageProxy.h:
326         * UIProcess/ios/WKContentViewInteraction.mm:
327         (-[WKContentView moveByOffset:]):
328         * UIProcess/ios/WebPageProxyIOS.mm:
329         (WebKit::WebPageProxy::moveSelectionByOffset):
330         * WebProcess/WebPage/WebPage.h:
331         * WebProcess/WebPage/WebPage.messages.in:
332         * WebProcess/WebPage/ios/WebPageIOS.mm:
333         (WebKit::WebPage::moveSelectionByOffset):
334
335 2014-07-26  Timothy Horton  <timothy_horton@apple.com>
336
337         Crash in Web Content Process under ~PDFDocument under clearTouchEventListeners at topDocument()
338         https://bugs.webkit.org/show_bug.cgi?id=135319
339         <rdar://problem/17315168>
340
341         Reviewed by Darin Adler and Antti Koivisto.
342
343         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
344         (WebKit::WebFrameLoaderClient::committedLoad):
345         Allow data through to WebCore for frames with custom content providers;
346         the only custom content provider currently implemented is main frame PDF
347         on iOS, which will end up creating a PDFDocument in WebCore, which drops all
348         data on the floor immediately, so this won't result in WebCore doing anything
349         with the data, but makes sure that more of the normal document lifecycle is maintained.
350
351         In the future, we might want to consider ensuring that all custom content providers
352         end up creating a SinkDocument or something similarly generic to ensure that
353         WebCore doesn't try to do anything with their data, but for now, the only client is covered.
354
355 2014-07-25  Jeremy Jones  <jeremyj@apple.com>
356
357         Parent fullscreen from window instead of view
358         https://bugs.webkit.org/show_bug.cgi?id=135310
359
360         Reviewed by Jer Noble.
361
362         Parenting in the view causes an incorrect animation to fullscreen, and can cause 
363         fullscreen to only expand to the size of the view instead of the whole window.
364
365         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
366         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): pass view's window.
367         * WebProcess/ios/WebVideoFullscreenManager.mm: screenRect instead of clientRect
368         (WebKit::screenRectForNode): was clientRectForNode
369         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): use screenRectForNode
370         (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): ditto
371         (WebKit::clientRectForNode): Deleted.
372
373 2014-07-25  Oliver Hunt  <oliver@apple.com>
374
375         Creating incorrect sandbox extension for hsts plist due to missing /
376         https://bugs.webkit.org/show_bug.cgi?id=135309
377
378         Reviewed by Sam Weinig.
379
380         So it turns out that you do actually need /'s in paths...
381         Now we actually create the correct extension.
382
383         * UIProcess/mac/WebContextMac.mm:
384         (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath):
385
386 2014-07-24  Anders Carlsson  <andersca@apple.com>
387
388         WKNavigation's properties are either always nil or don't behave as documented
389         https://bugs.webkit.org/show_bug.cgi?id=135267
390         <rdar://problem/17730536>
391
392         Reviewed by Andreas Kling.
393
394         Remove the properties from WKNavigation and introduce -[WKNavigation _request] as SPI for now.
395
396         * Shared/API/Cocoa/WebKitPrivate.h:
397         * UIProcess/API/Cocoa/WKNavigation.h:
398         * UIProcess/API/Cocoa/WKNavigation.mm:
399         (-[WKNavigation _request]):
400         (-[WKNavigation initialRequest]): Deleted.
401         (-[WKNavigation request]): Deleted.
402         (-[WKNavigation setRequest:]): Deleted.
403         (-[WKNavigation response]): Deleted.
404         (-[WKNavigation error]): Deleted.
405         * UIProcess/API/Cocoa/WKNavigationInternal.h:
406         * UIProcess/API/Cocoa/WKNavigationPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h.
407         * UIProcess/Cocoa/NavigationState.mm:
408         (WebKit::NavigationState::createLoadRequestNavigation):
409         * WebKit2.xcodeproj/project.pbxproj:
410
411 2014-07-25  Brady Eidson  <beidson@apple.com>
412
413         Clean up WKOriginDataManager and get it messaging to the DatabaseProcess
414         https://bugs.webkit.org/show_bug.cgi?id=135035
415
416         Reviewed by Sam Weinig.
417
418         * DatabaseProcess/DatabaseProcess.cpp:
419         (WebKit::DatabaseProcess::DatabaseProcess): Instantiate the WebOriginDataManager, installing its message handler.
420         (WebKit::DatabaseProcess::didReceiveMessage): Try the message receiver map, which will try the WebOriginDataManager.
421         * DatabaseProcess/DatabaseProcess.h:
422         * DatabaseProcess/DatabaseProcess.messages.in:
423
424         * UIProcess/API/C/WKOriginDataManager.cpp:
425         (WKOriginDataManagerDeleteEntriesForOrigin): Updated to also take a callback.
426         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates): Added.
427         (WKOriginDataManagerDeleteAllEntries): Updated to also take a callback.
428         (WKOriginDataManagerStartObservingChanges): Deleted.
429         (WKOriginDataManagerStopObservingChanges): Deleted.
430         (WKOriginDataManagerSetChangeClient): Deleted.
431         * UIProcess/API/C/WKOriginDataManager.h:
432
433         * UIProcess/Databases/DatabaseProcessProxy.cpp:
434         (WebKit::DatabaseProcessProxy::didReceiveMessage): Send messages to the WebOriginDataManagerProxy supplement if appropriate.
435         * UIProcess/Databases/DatabaseProcessProxy.h:
436         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
437
438         * UIProcess/WebContext.cpp:
439         (WebKit::WebContext::WebContext): Instantiate the WebOriginDataManagerProxy supplement.
440         * UIProcess/WebContext.h:
441         (WebKit::WebContext::sendToDatabaseProcessRelaunchingIfNecessary):
442
443         * UIProcess/WebOriginDataManagerProxy.cpp:
444         (WebKit::WebOriginDataManagerProxy::contextDestroyed):
445         (WebKit::WebOriginDataManagerProxy::processDidClose):
446         (WebKit::WebOriginDataManagerProxy::getOrigins):
447         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): Setup a callback with the message.
448         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates): Added
449         (WebKit::WebOriginDataManagerProxy::didDeleteEntries): Call the callback.
450         (WebKit::WebOriginDataManagerProxy::deleteAllEntries): Setup a callback with the message.
451         (WebKit::WebOriginDataManagerProxy::didDeleteAllEntries): Call the callback.
452         (WebKit::WebOriginDataManagerProxy::startObservingChanges): Deleted.
453         (WebKit::WebOriginDataManagerProxy::stopObservingChanges): Deleted.
454         (WebKit::WebOriginDataManagerProxy::setChangeClient): Deleted.
455         (WebKit::WebOriginDataManagerProxy::didChange): Deleted.
456         * UIProcess/WebOriginDataManagerProxy.h:
457         * UIProcess/WebOriginDataManagerProxy.messages.in:
458
459         * UIProcess/WebOriginDataManagerProxyChangeClient.cpp: Removed.
460         * UIProcess/WebOriginDataManagerProxyChangeClient.h: Removed.
461
462         * WebKit2.xcodeproj/project.pbxproj:
463
464         * WebProcess/OriginData/WebOriginDataManager.cpp:
465         (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Send the callback reply.
466         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Added.
467         (WebKit::WebOriginDataManager::deleteAllEntries): Send the callback reply.
468         (WebKit::WebOriginDataManager::startObservingChanges): Deleted.
469         (WebKit::WebOriginDataManager::stopObservingChanges): Deleted.
470         * WebProcess/OriginData/WebOriginDataManager.h:
471         * WebProcess/OriginData/WebOriginDataManager.messages.in:
472
473 2014-07-25  Gavin Barraclough  <baraclough@apple.com>
474
475         Yosemite version number is 101000
476         https://bugs.webkit.org/show_bug.cgi?id=135301
477
478         Reviewed by Sam Weinig.
479
480         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
481         (WebKit::connectToService):
482         * WebProcess/com.apple.WebProcess.sb.in:
483
484 2014-07-24  Benjamin Poulain  <bpoulain@apple.com>
485
486         [iOS][WK2] Do not try to hit test a null mainFrameRenderView on dynamicViewportSizeUpdate()
487         https://bugs.webkit.org/show_bug.cgi?id=135277
488         <rdar://problem/17804891>
489
490         Reviewed by Tim Horton.
491
492         * WebProcess/WebPage/ios/WebPageIOS.mm:
493         (WebKit::WebPage::dynamicViewportSizeUpdate):
494         There is no guarantee that the main frame have its root view when performing a dynamicViewportSizeUpdate(),
495         we should not attempt to use the layer without null checking it first.
496
497         The odd part for me is <rdar://problem/17804891> is a little too frequent. In the vast majority of cases,
498         there is a RenderView, it seems actually pretty hard not to have one on dynamicViewportSizeUpdate().
499
500         Skipping hit testing is safe because it is a completely optional part of this algorithm.
501         When the hit test is not done, the new position is computed based on the relative position prior to
502         the size change.
503
504 2014-07-24  Dan Bernstein  <mitz@apple.com>
505
506         WebKit2 part of <rdar://problem/17593701> Assertion failure in WebPage::reload (!m_pendingNavigationID) when reloading after a same-document back navigation
507         https://bugs.webkit.org/show_bug.cgi?id=135129
508
509         Reviewed by Darin Adler.
510
511         * Shared/WebBackForwardListItem.cpp:
512         (WebKit::childItemWithDocumentSequenceNumber): New helper function based on
513         WebCore::HistoryItem::childItemWithDocumentSequenceNumber.
514         (WebKit::documentTreesAreEqual): New helper function based on
515         WebCore::HistoryItem::hasSameDocumentTree.
516         (WebKit::WebBackForwardListItem::itemIsInSameDocument): Added. Based on
517         WebCore::HistoryItem::shouldDoSameDocumentNavigationTo.
518         * Shared/WebBackForwardListItem.h:
519
520         * UIProcess/WebPageProxy.cpp:
521         (WebKit::WebPageProxy::goForward): Don’t assign a new navigation ID if the back-forward
522         navigation is a same-document navigation.
523         (WebKit::WebPageProxy::goBack): Ditto.
524         (WebKit::WebPageProxy::goToBackForwardItem): Ditto.
525
526 2014-07-24  Tim Horton  <timothy_horton@apple.com>
527
528         Sometimes WKWebView is blank after resuming the app, until you scroll
529         https://bugs.webkit.org/show_bug.cgi?id=135275
530         <rdar://problem/17803170>
531
532         Reviewed by Benjamin Poulain.
533
534         * UIProcess/WebPageProxy.cpp:
535         (WebKit::WebPageProxy::dispatchViewStateChange):
536         If the UI process is waiting for a didUpdateViewState, we need to *always*
537         get a reply from the Web Process, so dispatchViewStateChange should *always*
538         send SetViewState even if nothing changed (so that we get the reply).
539
540 2014-07-24  Simon Fraser  <simon.fraser@apple.com>
541
542         [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
543         https://bugs.webkit.org/show_bug.cgi?id=135221
544         <rdar://problem/17542454>
545
546         Reviewed by Benjamin Poulain.
547         
548         The call to didCommitLayerTree() can cause one or two visible rect updates,
549         via changes to the UIScrollView contentSize and contentOffset. As a result, we
550         would notify the scrolling tree about a viewport change, but using the old
551         scrolling tree rather than the new one, so we could move layers around for
552         nodes which are about to be removed from the tree.
553         
554         However, we also have to ensure that programmatic scrolls are applied after
555         didCommitLayerTree() has updated the view size, so have RemoteScrollingCoordinatorProxy
556         store data about programmatic scrolls and return them to the caller, which
557         can apply them after didCommitLayerTree().
558
559         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: Store a pointer to a RequestedScrollInfo
560         for the duration of the tree update, so that we can store requested scroll info in it.
561         (WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy):
562         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree):
563         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll):
564         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
565         * UIProcess/WebPageProxy.cpp:
566         (WebKit::WebPageProxy::didCommitLayerTree): Give Mac a stub implementation.
567         * UIProcess/WebPageProxy.h: Group some editing-related functions together.
568         (WebKit::WebPageProxy::editorState):
569         (WebKit::WebPageProxy::canDelete):
570         (WebKit::WebPageProxy::hasSelectedRange):
571         (WebKit::WebPageProxy::isContentEditable):
572         (WebKit::WebPageProxy::maintainsInactiveSelection):
573         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
574         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): Ordering change: update
575         the layer tree, then call didCommitLayerTree(), then do the viewport update, followed
576         by any programmatic scroll.
577
578 2014-07-24  Peyton Randolph  <prandolph@apple.com>
579
580         Rename feature flag for long-press gesture on Mac.                                                                   
581         https://bugs.webkit.org/show_bug.cgi?id=135259                                                                  
582
583         Reviewed by Beth Dakin.
584
585         * Configurations/FeatureDefines.xcconfig:
586         Rename LINK_LONG_PRESS to MAC_LONG_PRESS.
587
588 2014-07-24  Dan Bernstein  <mitz@apple.com>
589
590         WebKit2 part of <rdar://problem/17766348> [Cocoa] WebCore::ProtectionSpace doesn’t preserve all NSURLProtectionSpace properties, such as the distinguishedNames array
591         https://bugs.webkit.org/show_bug.cgi?id=135229
592
593         Reviewed by Alexey Proskuryakov.
594
595         * Shared/Cocoa/WKNSURLProtectionSpace.mm: Changed to use ProtectionSpace::nsSpace.
596
597         * Shared/WebCoreArgumentCoders.cpp:
598         (IPC::ArgumentCoder<ProtectionSpace>::encode): If encoding the space requires encoding the
599         platform data, do that.
600         (IPC::ArgumentCoder<ProtectionSpace>::decode): If platform data was encoded, decode it.
601         * Shared/WebCoreArgumentCoders.h:
602
603         * Shared/mac/WebCoreArgumentCodersMac.mm:
604         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Archive the NSURLProtectionSpace.
605         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Unarchive it.
606
607         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
608         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Added.
609         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Added.
610
611 2014-07-24  Benjamin Poulain  <benjamin@webkit.org>
612
613         [WK2] Fixed/Sticky layers can get mispositioned when the layer tree commit change their position or size
614         https://bugs.webkit.org/show_bug.cgi?id=135227
615         <rdar://problem/17279500>
616
617         Reviewed by Simon Fraser.
618
619         In some cases, a fixed or sticky positioned layer would end up at its position corresponding to the WebProcess
620         instead of sticking the to real viewport in the UIProcess.
621
622         The sequence of event is:
623         1) A layer becomes fixed in some ScrollingTree transaction.
624         2) Later, some change in the WebProcess causes a LayerTree update for that exact same layer, but no corresponding
625            ScrollingTree update is made.
626         3) In the UIProcess, the position of the fixed layer is changed due to the LayerTree update.
627            But! There is no ScrollingTree change, updateScrollingTree() never sets fixedOrStickyLayerChanged to true,
628            and the position is not corrected.
629         -> The layer is now at the wrong position until the next VisibleContentRectUpdate.
630
631         Ideally, we should have fixedOrStickyLayerChanged track if either the position or size of a fixed layer changed
632         in the layer tree. This is tricky since the layer tree does not keep track of the fixed nodes of the scrolling tree.
633
634         Since this complexity seems risky at this point, I went for something simpler but with more overhead:
635         any time the scrolling tree contains either a fixed or sticky layer, viewportChangedViaDelegatedScrolling()
636         is called to "fix" the position.
637
638         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
639         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree):
640         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
641         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
642         (WebKit::RemoteScrollingCoordinatorProxy::hasFixedOrSticky):
643         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
644         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
645         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
646         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
647
648 2014-07-24  Oliver Hunt  <oliver@apple.com>
649
650         Need to explicitly support location services in webcontent profile
651         https://bugs.webkit.org/show_bug.cgi?id=135251
652         <rdar://17798346>
653
654         Reviewed by Dan Bernstein.
655
656         Switching to uikit-app means that we remove the implicit support
657         for location services. This makes us explicitly opt-in.
658
659         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
660
661 2014-07-24  Tim Horton  <timothy_horton@apple.com>
662
663         Crash at [WKContentView _applicationWillEnterForeground:] + 28
664         <rdar://problem/17797103>
665
666         Reviewed by Sam Weinig.
667
668         * UIProcess/ios/WKContentView.mm:
669         (-[WKContentView _applicationWillEnterForeground:]):
670         Drawing area can be null; null check it!
671         It's ok if we don't hide the content in this case, because if the drawing area is null,
672         it doesn't have any layers in the tree anyway.
673
674 2014-07-23  Simon Fraser  <simon.fraser@apple.com>
675
676         [iOS WK2] Some help.apple.com pages not scrollable
677         https://bugs.webkit.org/show_bug.cgi?id=135228
678         <rdar://problem/17790792>
679
680         Reviewed by Benjamin Poulain.
681         
682         On pages which size their document to the device size, the WKContentView size
683         never changes after it's created. In this situation, we never set a bounds
684         on the _rootContentView, so it remains zero-sized which breaks hit testing
685         on all enclosed UIScrollViews for overflow:scroll.
686         
687         Fix by making the _rootContentView and the _inspectorIndicationView use autosizing
688         so they are always the size of their parent view, and remove the explicit setting
689         of their bounds.
690
691         * UIProcess/ios/WKContentView.mm:
692         (-[WKContentView initWithFrame:context:configuration:webView:]):
693         (-[WKContentView setShowingInspectorIndication:]):
694         (-[WKContentView _didCommitLayerTree:]):
695
696 2014-07-23  Benjamin Poulain  <bpoulain@apple.com>
697
698         [iOS][WK2] r171124 is incorrect when the virtual keyboard is up
699         https://bugs.webkit.org/show_bug.cgi?id=135187
700
701         Reviewed by Simon Fraser.
702
703         Unfortunately, restricting the input into the document rect does not work.
704         When the keyboard is up, the keyboard bounds can overlap the WKWebView, and
705         the valid range should account for that.
706
707         Instead of playing with the keyboard rect, we can limit the scroll position
708         inside the valid range of UIScrollView. The keyboard always adjusts the UIScrollView
709         range as needed to give access to the content. Using that range is a bit more permissive
710         because the page could scroll to reveal content in the content inset defined by the client
711         of the API (this could actually be quite useful for hybrid apps).
712
713         There was already a function to change the content offset in the valid scrollview
714         range: changeContentOffsetBoundedInValidRange(), I extracted the range check
715         to contentOffsetBoundedInValidRange() for the needs of -[WKWebView _scrollToContentOffset:].
716
717         So...contentOffsetBoundedInValidRange() is cool, but it is not in the right coordinate
718         system. The scroll position we get from the WebProcess is in document coordinates, while
719         contentOffsetBoundedInValidRange() works with the UIScrollView coordinates.
720         To fix that, we scale the input position to get to the same scale as UIScrollView, then
721         apply the insets with the weirdly named [WKWebView _adjustedContentOffset:].
722
723         * UIProcess/API/Cocoa/WKWebView.mm:
724         (contentOffsetBoundedInValidRange):
725         (changeContentOffsetBoundedInValidRange):
726         (-[WKWebView _scrollToContentOffset:]):
727
728 2014-07-23  Commit Queue  <commit-queue@webkit.org>
729
730         Unreviewed, rolling out r171498.
731         https://bugs.webkit.org/show_bug.cgi?id=135223
732
733         It will regress some scroll position restoration on navigation
734         (r167916). (Requested by smfr on #webkit).
735
736         Reverted changeset:
737
738         "[iOS WK2] Header bar on nytimes articles lands in the wrong
739         place after rubberbanding"
740         https://bugs.webkit.org/show_bug.cgi?id=135221
741         http://trac.webkit.org/changeset/171498
742
743 2014-07-23  Simon Fraser  <simon.fraser@apple.com>
744
745         [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
746         https://bugs.webkit.org/show_bug.cgi?id=135221
747
748         Reviewed by Tim Horton.
749         
750         The call to didCommitLayerTree() can cause one or two visible rect updates,
751         via changes to the UIScrollView contentSize and contentOffset. As a result, we
752         would notify the scrolling tree about a viewport change, but using the old
753         scrolling tree rather than the new one, so we could move layers around for
754         nodes which are about to be removed from the tree.
755         
756         Fix by m_webPageProxy->didCommitLayerTree() after the scrolling tree has been
757         committed.
758
759         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
760         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
761
762 2014-07-23  Oliver Hunt  <oliver@apple.com>
763
764         Add a pseudo target to create sandbox override roots
765         https://bugs.webkit.org/show_bug.cgi?id=135216
766         <rdar://17785560>
767
768         Reviewed by Alexey Proskuryakov.
769
770         Just a duplicate of the standard ios sandbox target, targetting
771         the profile overrides directory.  This means we can make roots
772         that "Just Work".
773
774         * WebKit2.xcodeproj/project.pbxproj:
775
776 2014-07-23  Oliver Hunt  <oliver@apple.com>
777
778         Incorrect commit for sandbox profile
779         https://bugs.webkit.org/show_bug.cgi?id=135214
780         <rdar://17739108>
781
782         Reviewed by Anders Carlsson.
783
784         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
785
786 2014-07-23  Dan Bernstein  <mitz@apple.com>
787
788         <rdar://problem/17782623> [iOS] Client-certificate authentication isn’t working with some certificates
789         https://bugs.webkit.org/show_bug.cgi?id=135206
790
791         Reviewed by Anders Carlsson.
792
793         * Shared/cf/ArgumentCodersCF.cpp:
794         (IPC::copyPersistentRef): Added this helper function. It differs from
795         SecKeyCopyPersistentRef in that if multiple copies of the key exist in the keychain, it
796         ensures that we get a reference to the copy that is in the keychain access group that the
797         Networking process can use.
798         (IPC::encode): Use copyPersistentRef.
799
800 2014-07-23  Bem Jones-Bey  <bjonesbe@adobe.com>
801
802         Remove CSS_EXCLUSIONS compile flag and leftover code
803         https://bugs.webkit.org/show_bug.cgi?id=135175
804
805         Reviewed by Zoltan Horvath.
806
807         At this point, the CSS_EXCLUSIONS flag guards nothing but some useless
808         stubs. This removes the flag and the useless code.
809
810         * Configurations/FeatureDefines.xcconfig:
811
812 2014-07-23  Timothy Horton  <timothy_horton@apple.com>
813
814         REGRESSION (r171239): Much more time spent taking snapshots during the PLT
815         https://bugs.webkit.org/show_bug.cgi?id=135177
816         <rdar://problem/17764847>
817
818         Reviewed by Dan Bernstein.
819
820         * UIProcess/WebPageProxy.cpp:
821         (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame):
822         (WebKit::WebPageProxy::willChangeCurrentHistoryItem): Deleted.
823         * UIProcess/WebPageProxy.h:
824         * UIProcess/WebPageProxy.messages.in:
825         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
826         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
827         * WebProcess/WebPage/WebPage.cpp:
828         (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame):
829         (WebKit::WebPage::willChangeCurrentHistoryItem): Deleted.
830         * WebProcess/WebPage/WebPage.h:
831         Rename WillChangeCurrentHistoryItem to WillChangeCurrentHistoryItemForMainFrame.
832         Only send it when the current history item for the main frame changes.
833
834 2014-07-23  Ryuan Choi  <ryuan.choi@samsung.com>
835
836         [EFL] EWebKit2.h should contain version information
837         https://bugs.webkit.org/show_bug.cgi?id=135189
838
839         Reviewed by Gyuyoung Kim.
840
841         Generate EWebKit2.h to contain the version information.
842
843         * PlatformEfl.cmake:
844         * UIProcess/API/efl/EWebKit2.h.in: Renamed from Source/WebKit2/UIProcess/API/efl/EWebKit2.h.
845
846 2014-07-23  Ryuan Choi  <ryuan.choi@samsung.com>
847
848         [EFL] Do not generate forwarding header for ewk headers
849         https://bugs.webkit.org/show_bug.cgi?id=135147
850
851         Reviewed by Gyuyoung Kim.
852
853         Only EWebKit2.h and ewk_text_checker.h are generated as forwarding header.
854         This is unnecessary.
855
856         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
857         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
858         * UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:
859         * UIProcess/API/efl/tests/test_ewk2_window_features.cpp:
860         * UIProcess/efl/TextCheckerClientEfl.h:
861
862 2014-07-22  Commit Queue  <commit-queue@webkit.org>
863
864         Unreviewed, rolling out r171366.
865         https://bugs.webkit.org/show_bug.cgi?id=135190
866
867         Broke three API tests (Requested by ap on #webkit).
868
869         Reverted changeset:
870
871         "REGRESSION (r171239): Much more time spent taking snapshots
872         during the PLT"
873         https://bugs.webkit.org/show_bug.cgi?id=135177
874         http://trac.webkit.org/changeset/171366
875
876 2014-07-22  Oliver Hunt  <oliver@apple.com>
877
878         Reduce the size of the root WebContent sandbox profile
879         https://bugs.webkit.org/show_bug.cgi?id=135182
880         <rdar://problem/17739108>
881
882         Reviewed by Alexey Proskuryakov.
883
884         Switch from apple-ui-app to uikit-app as the root of the webcontent
885         profile.
886
887         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
888
889 2014-07-22  Jinwoo Song  <jinwoo7.song@samsung.com>
890
891         Unreviewed build fix on EFL port after r171356.
892
893         Implement a dummy platformMediaCacheDirectory() to avoid undefined reference error.
894
895         * UIProcess/efl/WebContextEfl.cpp:
896         (WebKit::WebContext::platformMediaCacheDirectory):
897
898 2014-07-22  Enrica Casucci  <enrica@apple.com>
899
900         REGRESSION (WebKit2): Selection inside accelerated overflow:scroll doesn't track scrolling.
901         https://bugs.webkit.org/show_bug.cgi?id=135180
902         <rdar://problem/16721055>
903
904         Reviewed by Simon Fraser.
905
906         Adds notifications to the WKContentView to know when scrolling starts and ends
907         in an overflow scroll. When scrolling starts, we hide the selection and we restore
908         it when scrolling ends, though not before the selection information in the editor
909         state has been updated.
910         It also adds a new method to the EditorClient class to force the
911         selection update when scrolling is completed.
912         
913         * UIProcess/PageClient.h:
914         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
915         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
916         (WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartScroll):
917         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndScroll):
918         * UIProcess/Scrolling/RemoteScrollingTree.h:
919         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
920         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
921         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
922         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
923         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
924         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart):
925         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd):
926         * UIProcess/WebPageProxy.h:
927         * UIProcess/ios/PageClientImplIOS.h:
928         * UIProcess/ios/PageClientImplIOS.mm:
929         (WebKit::PageClientImpl::overflowScrollWillStartScroll):
930         (WebKit::PageClientImpl::overflowScrollDidEndScroll):
931         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
932         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll):
933         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll):
934         * UIProcess/ios/WKContentViewInteraction.h:
935         * UIProcess/ios/WKContentViewInteraction.mm:
936         (-[WKContentView _overflowScrollingWillBegin]):
937         (-[WKContentView _overflowScrollingDidEnd]):
938         (-[WKContentView _updateChangedSelection]):
939         * UIProcess/ios/WebPageProxyIOS.mm:
940         (WebKit::WebPageProxy::overflowScrollWillStartScroll):
941         (WebKit::WebPageProxy::overflowScrollDidEndScroll):
942         * WebProcess/WebCoreSupport/WebEditorClient.h:
943         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
944         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
945         (WebKit::WebEditorClient::updateSelection):
946
947 2014-07-22  Benjamin Poulain  <bpoulain@apple.com>
948
949         [iOS][WK2] WebPageProxy should not do anything when responding to an animated resize is the page is not in a valid state
950         https://bugs.webkit.org/show_bug.cgi?id=135169
951         <rdar://problem/17740149>
952
953         Reviewed by Tim Horton.
954
955         * UIProcess/ios/WebPageProxyIOS.mm:
956         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
957         Neither m_dynamicViewportSizeUpdateWaitingForTarget nor m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit should
958         be modified if there is not WebProcess to respond to DynamicViewportSizeUpdate.
959
960         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
961         We should not attempt to synchronize anything if the page was closed before the end of the dynamic viewport
962         update.
963
964 2014-07-22  Timothy Horton  <timothy_horton@apple.com>
965
966         REGRESSION (r171239): Much more time spent taking snapshots during the PLT
967         https://bugs.webkit.org/show_bug.cgi?id=135177
968         <rdar://problem/17764847>
969
970         Reviewed by Dan Bernstein.
971
972         * UIProcess/WebPageProxy.cpp:
973         (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame):
974         (WebKit::WebPageProxy::willChangeCurrentHistoryItem): Deleted.
975         * UIProcess/WebPageProxy.h:
976         * UIProcess/WebPageProxy.messages.in:
977         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
978         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
979         * WebProcess/WebPage/WebPage.cpp:
980         (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame):
981         (WebKit::WebPage::willChangeCurrentHistoryItem): Deleted.
982         * WebProcess/WebPage/WebPage.h:
983         Rename WillChangeCurrentHistoryItem to WillChangeCurrentHistoryItemForMainFrame.
984         Only send it when the current history item for the main frame changes.
985
986 2014-07-22  Oliver Hunt  <oliver@apple.com>
987
988         Add accountsd access to network sandbox profile
989         https://bugs.webkit.org/show_bug.cgi?id=135176
990         <rdar://17656487>
991
992         Reviewed by Anders Carlsson.
993
994         This is available to the webcontent process already, but is also
995         needed for the networking process.
996
997         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
998
999 2014-07-22  Oliver Hunt  <oliver@apple.com>
1000
1001         Remove unused com.apple.webkit.* rules from profiles
1002         https://bugs.webkit.org/show_bug.cgi?id=135174
1003         <rdar://17755931>
1004
1005         Reviewed by Anders Carlsson.
1006
1007         We never send these rules so we should just remove use of them
1008         from the profiles.
1009
1010         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1011         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1012
1013 2014-07-22  Oliver Hunt  <oliver@apple.com>
1014
1015         Provide networking process with access to its HSTS db
1016         https://bugs.webkit.org/show_bug.cgi?id=135121
1017         <rdar://17654369>
1018
1019         Reviewed by Alexey Proskuryakov.
1020
1021         Add an extension parameter to pass the hsts database file.
1022         This requires us to create the Caches/com.apple.WebKit.Networking
1023         directory in the UI process, as the network sandbox
1024         does not allow it to create the containing directory.
1025
1026         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1027         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1028         * Shared/Network/NetworkProcessCreationParameters.cpp:
1029         (WebKit::NetworkProcessCreationParameters::encode):
1030         (WebKit::NetworkProcessCreationParameters::decode):
1031         * Shared/Network/NetworkProcessCreationParameters.h:
1032         * UIProcess/WebContext.cpp:
1033         (WebKit::WebContext::ensureNetworkProcess):
1034         (WebKit::WebContext::networkingHSTSDatabasePath):
1035         * UIProcess/WebContext.h:
1036         * UIProcess/mac/WebContextMac.mm:
1037         (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath):
1038
1039 2014-07-22  Benjamin Poulain  <bpoulain@apple.com>
1040
1041         [iOS][WK2] UI helpers that zoom on an element ignore the viewport's allowsUserScaling
1042         https://bugs.webkit.org/show_bug.cgi?id=135140
1043         <rdar://problem/17754921>
1044
1045         Reviewed by Tim Horton.
1046
1047         UIScrollView makes a difference between min/max zoom and allowUserScaling. To express that,
1048         everything is set up on the LayerTransaction.
1049
1050         For zooming related helpers (find on page, double tap to zoom, etc), the min and max zoom
1051         should be the actual min/max for the current page state.
1052
1053         This patch split the two explicitely.
1054         For layer transactions, the values are taken from the viewport configuration directly.
1055         For everything else, we should use minimumPageScaleFactor/maximumPageScaleFactor. Those two methods
1056         have been updated to take into account allowsUserScaling.
1057
1058         * WebProcess/WebPage/WebPage.cpp:
1059         (WebKit::WebPage::willCommitLayerTree):
1060         * WebProcess/WebPage/ios/WebPageIOS.mm:
1061         (WebKit::WebPage::minimumPageScaleFactor):
1062         (WebKit::WebPage::maximumPageScaleFactor):
1063         (WebKit::WebPage::getAssistedNodeInformation):
1064
1065 2014-07-22  Shivakumar JM  <shiva.jm@samsung.com>
1066
1067         Web Inspector: Fix unused parameter build warning
1068         https://bugs.webkit.org/show_bug.cgi?id=135151
1069
1070         Reviewed by Joseph Pecoraro.
1071
1072         Fix unused parameter build warning by removing the parameter name 
1073
1074         * WebProcess/WebPage/WebInspector.cpp:
1075         (WebKit::WebInspector::setJavaScriptProfilingEnabled):
1076
1077 2014-07-22  Shivakumar JM  <shiva.jm@samsung.com>
1078
1079         Fix unused parameter build warning in UIProcess module
1080         https://bugs.webkit.org/show_bug.cgi?id=135154
1081
1082         Reviewed by Alexey Proskuryakov.
1083
1084         Fix unused parameter build warning in UIProcess module by using UNUSED_PARAM macro.
1085
1086         * UIProcess/WebPageProxy.cpp:
1087         (WebKit::WebPageProxy::viewStateDidChange):
1088
1089 2014-07-22  Jeremy Jones  <jeremyj@apple.com>
1090
1091         Don't create new UIWindow for video fullscreen.
1092         https://bugs.webkit.org/show_bug.cgi?id=135038
1093
1094         Reviewed by Darin Adler.
1095
1096         Use root UIView to parent fullscreen interface.
1097
1098         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1099         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): pass parent UIView
1100         * WebProcess/ios/WebVideoFullscreenManager.mm:
1101         (WebKit::screenRectForNode): Use client rect instead of screen rect.
1102
1103 2014-07-21  Ryuan Choi  <ryuan.choi@samsung.com>
1104
1105         [EFL] Add Ewk prefix to enums of ewk_navigation_policy
1106         https://bugs.webkit.org/show_bug.cgi?id=135144
1107
1108         Reviewed by Gyuyoung Kim.
1109
1110         All public enums of ewebkit should start with Ewk prefix.
1111         This patch added Ewk prefix to Ewk_Event_Mouse_Button and Ewk_Event_Modifiers.
1112         In addition, added missing description and default value for Ewk_Event_Modifier.
1113
1114         * UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
1115         (toEwkEventMouseButton):
1116         (toEwkEventModifiers):
1117         (EwkNavigationPolicyDecision::mouseButton):
1118         (EwkNavigationPolicyDecision::modifiers):
1119         (ewk_navigation_policy_mouse_button_get):
1120         (ewk_navigation_policy_modifiers_get):
1121         (toEventMouseButton): Deleted.
1122         (toEventModifierKeys): Deleted.
1123         * UIProcess/API/efl/ewk_navigation_policy_decision.h:
1124         * UIProcess/API/efl/ewk_navigation_policy_decision_private.h:
1125
1126 2014-07-21  Benjamin Poulain  <bpoulain@apple.com>
1127
1128         [iOS][WK2] Improve event throttling for Scroll Events
1129         https://bugs.webkit.org/show_bug.cgi?id=135082
1130         <rdar://problem/17445266>
1131
1132         Reviewed by Simon Fraser.
1133
1134         In the WebKit layer, we want a measure that is representative of the responsiveness.
1135
1136         In this patch, I use the total delay between a VisibleContentRectUpdate being dispatched
1137         by the UIProcess, and the time RemoteLayerTreeDrawingArea flushes the layer tree.
1138
1139         The value used for eventThrottlingDelay() is computed by averaging the new value with
1140         the old values with a 80/20 split, favoring the old data. Favoring historical data
1141         over the last timing avoid excessively throttling for a single slow frame.
1142
1143         The computation of m_estimatedMainThreadLatency can be improved in the future, this is
1144         a first cut keeping things simple.
1145
1146         With m_estimatedMainThreadLatency in our hands, we can compute our eventThrottlingDelay().
1147         If m_estimatedMainThreadLatency is smaller than a single frame timespan, we have a fast page
1148         and nothing is throttled.
1149
1150         If is it more than a frame, we throttle such that we can at least render two frames
1151         per event dispatch based on the historical data.
1152
1153         The exact values will need some tweaking, but this set ensures well written pages get
1154         60 events per seconds, while slow pages do not waste too much time on events.
1155
1156         * WebProcess/WebCoreSupport/WebChromeClient.h:
1157         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1158         (WebKit::WebChromeClient::eventThrottlingDelay):
1159         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
1160         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
1161         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
1162         * WebProcess/WebPage/ViewUpdateDispatcher.h:
1163         * WebProcess/WebPage/WebPage.cpp:
1164         (WebKit::WebPage::WebPage):
1165         (WebKit::WebPage::didFlushLayerTreeAtTime):
1166         (WebKit::WebPage::didCommitLoad):
1167         * WebProcess/WebPage/WebPage.h:
1168         * WebProcess/WebPage/ios/WebPageIOS.mm:
1169         (WebKit::WebPage::eventThrottlingDelay):
1170         (WebKit::WebPage::updateVisibleContentRects):
1171         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1172         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1173
1174 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
1175
1176         REGRESSION (r170361): In landscape with UI hidden, fixed position elements at top of screen are too low
1177         https://bugs.webkit.org/show_bug.cgi?id=135141
1178         <rdar://problem/17627525>
1179
1180         Reviewed by Benjamin Poulain.
1181         
1182         We can't use the WKWebView's UIScrollView contentInsets to determine the unobscured rect
1183         in MobileSafari, because contentInsets can't be changed dynamically while scrolling.
1184         To get around this, MobileSafari sets obscured insets instead (but also sets a fixed
1185         contentInset).
1186         
1187         So if the client calls _setObscuredInsets:, always use _obscuredInsets to compute the 
1188         content insets.
1189
1190         * UIProcess/API/Cocoa/WKWebView.mm:
1191         (-[WKWebView _computedContentInset]):
1192         (-[WKWebView _setObscuredInsets:]):
1193
1194 2014-07-21  Oliver Hunt  <oliver@apple.com>
1195
1196         Remove global cookie workaround from sandbox profiles
1197         https://bugs.webkit.org/show_bug.cgi?id=135138
1198         <rdar://17513375>
1199
1200         Reviewed by Alexey Proskuryakov.
1201
1202         Remove the workaround needed for global cookie access, and silencing
1203         of the associated sandbox violation.
1204
1205         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1206         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1207         * UIProcess/mac/WebContextMac.mm:
1208         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1209
1210 2014-07-21  Oliver Hunt  <oliver@apple.com>
1211
1212         Correct sandbox profiles to fix some excess privileges
1213         https://bugs.webkit.org/show_bug.cgi?id=135134
1214         <rdar://problem/17741886>
1215         <rdar://problem/17739080>
1216
1217         Reviewed by Alexey Proskuryakov.
1218
1219         This cleans up our sandbox profiles to fix a few issues - the profiles
1220         no longer allow us to issue file extension we have the ability to consume,
1221         and tightens some of the other file access rules.
1222
1223         This means we have to addd some rules to allow us to access things
1224         that we previously had access to due to lax file system restrictions.
1225
1226         Some of the features were fixable simply by using entitlements on the
1227         process rather than custom rules.
1228
1229         * Configurations/WebContent-iOS.entitlements:
1230         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
1231         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1232         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1233
1234 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
1235
1236         [iOS WK2] Turn off position:fixed behavior when the keyboard is up
1237         https://bugs.webkit.org/show_bug.cgi?id=132537
1238
1239         Reviewed by Benjamin Poulain.
1240         
1241         Make interaction with form elements inside position:fixed less terrible by re-laying out
1242         fixed elements relative to the document while we have an assisted node. This ensures
1243         that all parts of a position:fixed are accessible (e.g. inputs on the right side
1244         of a fixed-width top bar).
1245         
1246         * Shared/AssistedNodeInformation.cpp: Add a flag for being inside postion:fixed,
1247         and encode/decode it.
1248         (WebKit::AssistedNodeInformation::encode):
1249         (WebKit::AssistedNodeInformation::decode):
1250         * Shared/AssistedNodeInformation.h:
1251         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
1252         * UIProcess/PageClient.h: Add isAssistingNode().
1253         * UIProcess/ios/PageClientImplIOS.h:
1254         * UIProcess/ios/PageClientImplIOS.mm:
1255         (WebKit::PageClientImpl::isAssistingNode):
1256         * UIProcess/ios/WebPageProxyIOS.mm:
1257         (WebKit::WebPageProxy::computeCustomFixedPositionRect): If we have an assisted
1258         node, just use the document rect as the custom fixed position rect.
1259         * WebProcess/WebPage/ios/WebPageIOS.mm:
1260         (WebKit::WebPage::getAssistedNodeInformation): Get the selection rect first,
1261         since we have to fix it up for position:fixed. If the element is inside fixed
1262         position in the main frame, re-set the fixed position rect to the document rect
1263         (which forces a layout), re-fetch elementRect, then set it back. This ensures
1264         that the UI process gets an elementRect which it can zoom to correctly.
1265
1266 2014-07-21  Timothy Horton  <timothy_horton@apple.com>
1267
1268         Random crashes on the Web Thread due to Timers firing on the wrong thread in the UI process
1269         https://bugs.webkit.org/show_bug.cgi?id=135132
1270         <rdar://problem/17719832>
1271
1272         Reviewed by Simon Fraser.
1273
1274         * UIProcess/ProcessThrottler.cpp:
1275         (WebKit::ProcessThrottler::ProcessThrottler):
1276         (WebKit::ProcessThrottler::suspendTimerFired):
1277         * UIProcess/ProcessThrottler.h:
1278         * UIProcess/ios/ViewGestureControllerIOS.mm:
1279         (WebKit::ViewGestureController::ViewGestureController):
1280         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
1281         * UIProcess/mac/ViewGestureController.h:
1282         * UIProcess/mac/ViewGestureControllerMac.mm:
1283         (WebKit::ViewGestureController::ViewGestureController):
1284         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
1285         We can't use WebCore timers in the UI process because of coexistence concerns
1286         (they fire on the Web Thread if there is one!), so use RunLoop::Timer instead.
1287
1288 2014-07-21  Andy Estes  <aestes@apple.com>
1289
1290         [iOS] Handle QuickLook ResourceLoaders in the web process
1291         https://bugs.webkit.org/show_bug.cgi?id=135113
1292
1293         Reviewed by David Kilzer.
1294
1295         The QuickLook framework registers a NSURLProtocol to handle loading subresources of the HTML documents it
1296         generates. In order for these loads to succeed, we need to start them in the same process in which QuickLook
1297         generated the main resource.
1298
1299         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1300         (WebKit::WebResourceLoadScheduler::scheduleLoad):
1301
1302 2014-07-21  Brady Eidson  <beidson@apple.com>
1303
1304         DatabaseProcess doesn't relaunch after crashing.
1305         <rdar://problem/17717343> and https://bugs.webkit.org/show_bug.cgi?id=135117
1306
1307         Reviewed by Alexey Proskuryakov.
1308
1309         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1310         (WebKit::DatabaseProcessProxy::didClose): Tell the WebContext.
1311
1312         * UIProcess/WebContext.cpp:
1313         (WebKit::WebContext::databaseProcessCrashed): Notify supplements, then clear the DatabaseProcessProxy pointer.
1314         * UIProcess/WebContext.h:
1315
1316         * UIProcess/WebContextSupplement.h:
1317         (WebKit::WebContextSupplement::processDidClose): Added. No users right now, but the patch in bug 135035 will need this.
1318
1319 2014-07-20  KwangHyuk Kim  <hyuki.kim@samsung.com>
1320
1321         Fix warnings caused by unused parameter.
1322         https://bugs.webkit.org/show_bug.cgi?id=134975
1323
1324         Reviewed by Gyuyoung Kim.
1325
1326         Fix warnings on EwkView.cpp and LegacySessionStateCodingNone.cpp that are caused by unused parameter data.
1327
1328         * UIProcess/API/efl/EwkView.cpp:
1329         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
1330         * UIProcess/LegacySessionStateCodingNone.cpp:
1331         (WebKit::decodeLegacySessionState):
1332
1333 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
1334
1335         Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
1336         https://bugs.webkit.org/show_bug.cgi?id=134894
1337
1338         Reviewed by Darin Adler.
1339
1340         Add setCanPlayFastReverse
1341
1342         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
1343         * WebProcess/ios/WebVideoFullscreenManager.h: ditto
1344         * WebProcess/ios/WebVideoFullscreenManager.mm: ditto
1345         (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): ditto
1346
1347 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
1348
1349         Decrease flicker when enter and exit fullscreen.
1350         https://bugs.webkit.org/show_bug.cgi?id=134919
1351
1352         Reviewed by Simon Fraser.
1353
1354         Change the sequence of tear down and use transparency to prevent flicker when entering and exiting fullscreen.
1355
1356         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: wait to remove layerHost until didCleanupFullscreen
1357         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): removed from here
1358         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): added here
1359         * WebProcess/ios/WebVideoFullscreenManager.mm:
1360         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): use transparent background during transition
1361
1362 2014-07-20  Dan Bernstein  <mitz@apple.com>
1363
1364         <rdar://problem/17739526> REGRESSION (r171057): Crash in WebPage::getPositionInformation()
1365         https://bugs.webkit.org/show_bug.cgi?id=135099
1366
1367         Reviewed by David Kilzer.
1368
1369         * WebProcess/WebPage/ios/WebPageIOS.mm:
1370         (WebKit::WebPage::getPositionInformation): Added a null check.
1371
1372 2014-07-19  Zan Dobersek  <zdobersek@igalia.com>
1373
1374         Consistently use uint64_t as the handle parameter type for the SetAcceleratedCompositingWindowId message
1375         https://bugs.webkit.org/show_bug.cgi?id=135047
1376
1377         Reviewed by Darin Adler.
1378
1379         UIProcess' WebPageProxy is handling this parameter as an uint64_t, it should be handled as such
1380         in WebProcess as well.
1381
1382         * WebProcess/WebPage/WebPage.h:
1383         * WebProcess/WebPage/WebPage.messages.in: Also changed the parameter name to match other places.
1384         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1385         (WebKit::WebPage::setAcceleratedCompositingWindowId):
1386
1387 2014-07-18  Oliver Hunt  <oliver@apple.com>
1388
1389         We don't provide an extension to the temp file used for uploads
1390         https://bugs.webkit.org/show_bug.cgi?id=135079
1391
1392         Reviewed by Sam Weinig.
1393
1394         Make sure didChooseFilesForOpenPanelWithDisplayStringAndIcon vends
1395         extensions for the files passed to the content process.
1396
1397         * UIProcess/WebPageProxy.cpp:
1398         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
1399
1400 2014-07-18  Tim Horton  <timothy_horton@apple.com>
1401
1402         ASSERTion failures in ViewGestureController indicating that we're copying WebBackForwardList
1403         https://bugs.webkit.org/show_bug.cgi?id=135080
1404         <rdar://problem/17734714>
1405
1406         Reviewed by Sam Weinig.
1407
1408         * UIProcess/ios/ViewGestureControllerIOS.mm:
1409         (WebKit::ViewGestureController::beginSwipeGesture):
1410         (WebKit::ViewGestureController::canSwipeInDirection):
1411
1412 2014-07-18  Yongjun Zhang  <yongjun_zhang@apple.com>
1413
1414         _WKActivatedElementInfo.title should fallback to innerText if the link doesn't have title attribute.
1415         https://bugs.webkit.org/show_bug.cgi?id=135077
1416
1417         When populate InteractionInformationAtPosition's title value, use a link element's innerText if it
1418         doesn't have title attribute.
1419
1420         Reviewed by Dan Bernstein.
1421
1422         * WebProcess/WebPage/ios/WebPageIOS.mm:
1423         (WebKit::WebPage::getPositionInformation):
1424
1425 2014-07-18  Andy Estes  <aestes@apple.com>
1426
1427         [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
1428         https://bugs.webkit.org/show_bug.cgi?id=135072
1429         <rdar://problem/17528188>
1430
1431         Reviewed by David Kilzer.
1432
1433         * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter.
1434         * Shared/mac/WebCoreArgumentCodersMac.mm:
1435         (IPC::ArgumentCoder<ContentFilter>::encode): Encoded the ContentFilter using a NSKeyedArchiver.
1436         (IPC::ArgumentCoder<ContentFilter>::decode): Decoded the ContentFilter using a NSKeyedUnarchiver.
1437         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1438         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::setContentFilterForBlockedLoad().
1439         * UIProcess/WebFrameProxy.cpp:
1440         (WebKit::WebFrameProxy::didStartProvisionalLoad): Reset m_contentFilterForBlockedLoad to nullptr.
1441         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful().
1442         If the unblock is successful, reload the WebPageProxy.
1443         * UIProcess/WebFrameProxy.h:
1444         (WebKit::WebFrameProxy::setContentFilterForBlockedLoad):
1445         * UIProcess/WebPageProxy.cpp:
1446         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check if this is navigation represents an unblock
1447         request and ignore if so.
1448         * UIProcess/WebPageProxy.h:
1449         * UIProcess/WebPageProxy.messages.in: Defined ContentFilterDidBlockLoadForFrame.
1450         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1451         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): Sent ContentFilterDidBlockLoadForFrame to the WebPageProxy.
1452         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1453
1454 2014-07-18  Simon Fraser  <simon.fraser@apple.com>
1455
1456         [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
1457         https://bugs.webkit.org/show_bug.cgi?id=135078
1458         <rdar://problem/17401823>
1459
1460         Reviewed by Tim Horton.
1461         
1462         Fix the logging of requested scroll position and frame scale factor.
1463
1464         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1465         (WebKit::RemoteScrollingTreeTextStream::dump):
1466
1467 2014-07-18  Joseph Pecoraro  <pecoraro@apple.com>
1468
1469         [Cocoa] Use RetainPtr in _WKRemoteObjectInterface
1470         https://bugs.webkit.org/show_bug.cgi?id=135062
1471
1472         Reviewed by Anders Carlsson.
1473
1474         Switch to RetainPtr instead of manual memory management of ivars.
1475
1476         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
1477         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
1478         (-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
1479         (-[_WKRemoteObjectInterface identifier]):
1480         (-[_WKRemoteObjectInterface description]):
1481         (-[_WKRemoteObjectInterface dealloc]): Deleted.
1482
1483 2014-07-18  Tim Horton  <timothy_horton@apple.com>
1484
1485         Take navigation snapshots whenever the current back-forward item is going to change
1486         https://bugs.webkit.org/show_bug.cgi?id=135058
1487         <rdar://problem/17464515>
1488
1489         Reviewed by Dan Bernstein.
1490
1491         Instead of trying to have the UI process figure out when to take navigation snapshots by itself,
1492         snapshot whenever the Web process says that the current back-forward item is going to change.
1493         This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to
1494         just two places instead of 5.
1495
1496         * UIProcess/WebPageProxy.cpp:
1497         (WebKit::WebPageProxy::goForward):
1498         (WebKit::WebPageProxy::goBack):
1499         (WebKit::WebPageProxy::goToBackForwardItem):
1500         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1501         We no longer need to special-case taking navigation snapshots
1502         when the UI process changes the back forward item or upon
1503         didStartProvisionalLoadForFrame, because we'll always snapshot
1504         in willChangeCurrentHistoryItem in all of these cases.
1505
1506         * UIProcess/WebPageProxy.cpp:
1507         (WebKit::WebPageProxy::willChangeCurrentHistoryItem):
1508         * UIProcess/WebPageProxy.h:
1509         * UIProcess/WebPageProxy.messages.in:
1510         Add willChangeCurrentHistoryItem message, which comes from the Web process.
1511         When it arrives, take a navigation snapshot.
1512
1513         * UIProcess/ios/ViewGestureControllerIOS.mm:
1514         (WebKit::ViewGestureController::beginSwipeGesture):
1515         Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe,
1516         so that it doesn't bail from taking the snapshot because we have a snapshot up.
1517
1518         (WebKit::ViewGestureController::endSwipeGesture):
1519         We no longer need to explicitly disable snapshotting while navigating, because
1520         we will avoid taking the snapshot if there's a snapshot being displayed.
1521
1522         * UIProcess/mac/ViewGestureControllerMac.mm:
1523         (WebKit::ViewGestureController::~ViewGestureController):
1524         Remove the snapshot if it's still up when ViewGestureController is destroyed.
1525         The Mac version of ViewGestureController is destroyed on Web process crashes
1526         because it is a message receiver, so it is not guaranteed to have the same
1527         lifetime as the WebPageProxy and friends.
1528
1529         (WebKit::ViewGestureController::trackSwipeGesture):
1530         Make use of recordNavigationSnapshot.
1531
1532         (WebKit::ViewGestureController::endSwipeGesture):
1533         Ditto from the Mac version.
1534
1535         * UIProcess/mac/ViewSnapshotStore.h:
1536         (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted.
1537         (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted.
1538         * UIProcess/mac/ViewSnapshotStore.mm:
1539         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
1540         (WebKit::ViewSnapshotStore::recordSnapshot):
1541         Remove the snapshot disabling mechanism and bail from snapshotting if we're
1542         showing a snapshot, as mentioned above.
1543
1544         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1545         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
1546         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1547         * WebProcess/WebPage/WebPage.cpp:
1548         (WebKit::WebPage::willChangeCurrentHistoryItem):
1549         * WebProcess/WebPage/WebPage.h:
1550         Proxy willChangeCurrentHistoryItem from HistoryController to the UI process.
1551
1552 2014-07-18  Jon Honeycutt  <jhoneycutt@apple.com>
1553
1554         REGRESSION: Crash when typing into text field that clears itself on iOS
1555
1556         <https://bugs.webkit.org/show_bug.cgi?id=135044>
1557         <rdar://problem/17640443>
1558
1559         Reviewed by Darin Adler.
1560
1561         * WebProcess/WebPage/ios/WebPageIOS.mm:
1562         (WebKit::WebPage::requestAutocorrectionData):
1563         wordRangeFromPosition() returns null in some cases; null check range
1564         before dereferencing it. Moved some variable declarations around to
1565         better match our style.
1566
1567 2014-07-18  Tim Horton  <timothy_horton@apple.com>
1568
1569         [WK2] Provide a mechanism to grab the back-forward list for gesture navigation purposes from another WKWebView
1570         https://bugs.webkit.org/show_bug.cgi?id=134999
1571         <rdar://problem/17238025>
1572
1573         Reviewed by Sam Weinig.
1574
1575         In some cases, clients may need to throw a WKWebView with no back-forward list over
1576         another WKWebView, and want to participate in gesture swipe as if they were actually
1577         the page being overlaid.
1578
1579         * UIProcess/API/Cocoa/WKWebView.mm:
1580         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
1581         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1582         (-[WKWebViewConfiguration copyWithZone:]):
1583         (-[WKWebViewConfiguration _alternateWebViewForNavigationGestures]):
1584         (-[WKWebViewConfiguration _setAlternateWebViewForNavigationGestures:]):
1585         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1586         Keep an "alternate" WKWebView "for navigation gestures", which ViewGestureController
1587         will use as the real source of back-forward items, and the destination of the swipe navigation.
1588         All swipe delegate callbacks will also fire from the alternate view, because it owns the items
1589         and will be doing the navigation.
1590
1591         * UIProcess/ios/ViewGestureControllerIOS.mm:
1592         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView):
1593         (WebKit::ViewGestureController::beginSwipeGesture):
1594         Send navigationGestureDidBegin via the alternate view's WebPageProxy if it exists.
1595         Record a new snapshot on the current page, but copy it to the alternate view if necessary,
1596         so that when swiping forward from the alternate view, it will have the "right" snapshot.
1597         Get the target back forward item from the alternate view.
1598         Send navigationGestureWillEnd via the alternate view's WebPageProxy if it exists.
1599
1600         (WebKit::ViewGestureController::canSwipeInDirection):
1601         Determine if we can swipe in a direction by looking at the alternate view's back-forward list if necessary.
1602
1603         (WebKit::ViewGestureController::endSwipeGesture):
1604         Send navigationGestureDidEnd via the alternate view's WebPageProxy if it exists.
1605         Perform the navigation on the alternate view if necessary.
1606
1607         (WebKit::ViewGestureController::removeSwipeSnapshot):
1608         Send navigationGestureSnapshotWasRemoved via the alternate view's WebPageProxy if it exists.
1609
1610         * UIProcess/mac/ViewGestureController.h:
1611
1612 2014-07-17  David Kilzer  <ddkilzer@apple.com>
1613
1614         SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
1615         <http://webkit.org/b/135006>
1616
1617         Reviewed by Darin Adler.
1618
1619         * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
1620         WebKit.xcconfig.
1621         * Configurations/DebugRelease.xcconfig: Remove empty
1622         SECTORDER_FLAGS definition.
1623         * Configurations/WebKit.xcconfig: Use $(CONFIGURATION) so
1624         SECTORDER_FLAGS is only set on Production builds.
1625
1626 2014-07-17  Alexey Proskuryakov  <ap@apple.com>
1627
1628         REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes
1629         https://bugs.webkit.org/show_bug.cgi?id=135032
1630         <rdar://problem/17716602>
1631
1632         Reviewed by Dan Bernstein.
1633
1634         * UIProcess/WebPageProxy.cpp:
1635         (WebKit::WebPageProxy::processDidCrash): Create a transaction, so that the nested
1636         transaction in resetStateAfterProcessExited() wouldn't be committed.
1637         (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't use auto - it was hiding
1638         the most important fact that this is a stack object that can't be simply moved to
1639         a different function.
1640
1641 2014-07-17  Benjamin Poulain  <bpoulain@apple.com>
1642
1643         [iOS][WK2] Fix the updateVisibleContentRects synchronization for load after r171154
1644         https://bugs.webkit.org/show_bug.cgi?id=135036
1645
1646         Reviewed by Dan Bernstein.
1647
1648         * WebProcess/WebPage/ios/WebPageIOS.mm:
1649         (WebKit::WebPage::updateVisibleContentRects):
1650         I forgot to update one of the condition after changing from lastTransaction to next transaction
1651         in r171154.
1652
1653 2014-07-17  Enrica Casucci  <enrica@apple.com>
1654
1655         [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
1656         https://bugs.webkit.org/show_bug.cgi?id=135023
1657         <rdar://problem/17617282>
1658
1659         Reviewed by Benjamin Poulain and Ryosuke Niwa.
1660
1661         WKContentView needs to implement hasContent to correctly show
1662         the appropriate menu bar content. The patch adds this information
1663         to the EditorState.
1664
1665         * Shared/EditorState.cpp:
1666         (WebKit::EditorState::encode):
1667         (WebKit::EditorState::decode):
1668         * Shared/EditorState.h:
1669         (WebKit::EditorState::EditorState):
1670         * UIProcess/ios/WKContentViewInteraction.mm:
1671         (-[WKContentView hasContent]):
1672         * WebProcess/WebPage/WebPage.cpp:
1673         (WebKit::WebPage::editorState):
1674
1675 2014-07-17  Benjamin Poulain  <benjamin@webkit.org>
1676
1677         [iOS][WK2] Add SPI to do a dynamic viewport update without showing any content
1678         https://bugs.webkit.org/show_bug.cgi?id=135010
1679
1680         Reviewed by Darin Adler.
1681
1682         This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work
1683         of a dynamic viewport size update, but instead of animating the old content, it is hidden.
1684
1685         The patch is built on top of the animated resize mechanism. Instead of having an animation driving
1686         the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as
1687         the WebProcess needs, and it ends when first layer tree commit with the new content is processed.
1688
1689         The attribute "_isAnimatingResize" is generalized to support two modes of resizing: animated and
1690         hiding content.
1691
1692         The attribute "_hasCommittedLoadForMainFrame" is rather silly. It is only needed because
1693         [WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page
1694         is initialized, and doing an animated resize would trash the WebProcess state.
1695         I wish I had a better solution, this is not great.
1696
1697         * UIProcess/API/Cocoa/WKWebView.mm:
1698         (-[WKWebView _processDidExit]):
1699         (-[WKWebView _didCommitLoadForMainFrame]):
1700         (-[WKWebView _didCommitLayerTree:]):
1701         This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave
1702         exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using
1703         _resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct
1704         view state.
1705
1706         Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit
1707         the synchronization path or we would be blocked there for a while, which is what we are trying to avoid.
1708
1709         After r171154, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are
1710         executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have
1711         everything we need and does not use any synchronous messages.
1712
1713         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
1714         (-[WKWebView _restorePageStateToExposedRect:scale:]):
1715         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
1716         (-[WKWebView _scrollToContentOffset:]):
1717         (-[WKWebView _frameOrBoundsChanged]):
1718         (-[WKWebView _updateVisibleContentRects]):
1719         (-[WKWebView _setMinimumLayoutSizeOverride:]):
1720         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
1721         (-[WKWebView _setInterfaceOrientationOverride:]):
1722         (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
1723         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1724         (-[WKWebView _endAnimatedResize]):
1725         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
1726         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1727
1728 2014-07-17  Brent Fulgham  <bfulgham@apple.com>
1729
1730         [Mac] Full screen video not always animating in the correct Space
1731         https://bugs.webkit.org/show_bug.cgi?id=135020
1732         <rdar://problem/17542310>
1733
1734         Reviewed by Dean Jackson.
1735
1736        The fullscreen window can "remember" the Space it was part of the first time you enter fullscreen
1737        mode. Subsequent fullscreen transitions will always start from this Space, even if you move
1738        the WebKit-hosted application to a different Space.
1739
1740        We can help the display system know when we've moved to a new Space by calling NSWindow's
1741        'orderBack' method on the fullscreen window prior to starting the transition to fullscreen mode.
1742        This method call hooks the window into the current Space so everything works properly.
1743
1744         * UIProcess/mac/WKFullScreenWindowController.mm:
1745         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): Add the
1746         new fullscreen window to the current Space before starting transition to fullscreen.
1747
1748 2014-07-17  Timothy Hatcher  <timothy@apple.com>
1749
1750         Make console.profile record to the Timeline.
1751
1752         https://bugs.webkit.org/show_bug.cgi?id=134643
1753
1754         Reviewed by Joseph Pecoraro.
1755
1756         * WebProcess/WebPage/WebInspector.cpp:
1757         (WebKit::WebInspector::setJavaScriptProfilingEnabled):
1758         (WebKit::WebInspector::startJavaScriptProfiling):
1759         (WebKit::WebInspector::stopJavaScriptProfiling):
1760
1761 2014-07-17  Brady Eidson  <beidson@apple.com>
1762
1763         Crash in ServicesOverlayController::~ServicesOverlayController.
1764         <rdar://problem/17622172> and https://bugs.webkit.org/show_bug.cgi?id=135022
1765
1766         Reviewed by Tim Horton.
1767
1768         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1769         (WebKit::ServicesOverlayController::~ServicesOverlayController): Don’t need to uninstall the
1770             PageOverlay as it has already been destroyed by this point in WebPage::~WebPage.
1771
1772 2014-07-17  Tim Horton  <timothy_horton@apple.com>
1773
1774         Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
1775         https://bugs.webkit.org/show_bug.cgi?id=135018
1776         <rdar://problem/17615038>
1777
1778         Reviewed by Simon Fraser.
1779
1780         * UIProcess/DrawingAreaProxy.h:
1781         (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):
1782         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1783         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1784         (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):
1785         * UIProcess/mac/RemoteLayerTreeHost.h:
1786         * UIProcess/mac/RemoteLayerTreeHost.mm:
1787         (WebKit::RemoteLayerTreeHost::detachRootLayer):
1788         Add a mechanism to "hide" drawing area content until the next commit,
1789         by detaching the root layer. RemoteLayerTreeHost will automatically reattach
1790         it at the next commit.
1791
1792         * UIProcess/WebPageProxy.cpp:
1793         (WebKit::WebPageProxy::viewStateDidChange):
1794         * UIProcess/WebPageProxy.h:
1795         Add a parameter to viewStateDidChange specifying whether dispatching the change
1796         to the Web process is deferrable or not. We will also automatically use "Immediate" if
1797         the view is coming in-window, like we did before.
1798
1799         * UIProcess/ios/WKContentView.mm:
1800         (-[WKContentView _applicationWillEnterForeground:]):
1801         Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
1802         view state changes when coming into the foreground, and will have removed the root layer
1803         if a commit didn't come in while waitForDidUpdateViewState blocks.
1804         
1805 2014-07-17  Sanghyup Lee  <sh53.lee@samsung.com>
1806
1807         [EFL][WK2] Add a "focus,notfound" signal.
1808         https://bugs.webkit.org/show_bug.cgi?id=134674
1809
1810         Reviewed by Gyuyoung Kim.
1811
1812         Add a "focus,notfound" signal to handover focus control to application
1813         because there are no elements of webview to focus on the given direction.
1814
1815         Application can decide to move the focus to next widget of ewk_view or something else
1816         by using this signal.
1817
1818         * UIProcess/API/efl/EwkViewCallbacks.h:
1819         * UIProcess/API/efl/ewk_view.h:
1820         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Added keyDown and keyUp function.
1821         (EWK2UnitTest::EWK2UnitTestBase::waitUntilDirectionChanged):
1822         (EWK2UnitTest::EWK2UnitTestBase::keyDown):
1823         (EWK2UnitTest::EWK2UnitTestBase::keyUp):
1824         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
1825         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1826         (EWK2ViewTest::FocusNotFoundCallback):
1827         (TEST_F):
1828         * UIProcess/efl/PageUIClientEfl.cpp: Removed unnecessary calls to evas_object_focus_set().
1829         (WebKit::PageUIClientEfl::takeFocus):
1830
1831 2014-07-16  Brady Eidson  <beidson@apple.com>
1832
1833         Reintroduce the SPI _websiteDataURLForContainerWithURL: that was removed in r171160
1834         https://bugs.webkit.org/show_bug.cgi?id=134984
1835
1836         Reviewed by David Kilzer.
1837
1838         * UIProcess/API/Cocoa/WKProcessPool.mm:
1839         (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
1840         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1841
1842 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
1843
1844         A test that hangs at cleanup stage confuses webkitpy hugely
1845         https://bugs.webkit.org/show_bug.cgi?id=122475
1846         <rdar://problem/17184354>
1847
1848         Reviewed by Anders Carlsson.
1849
1850         Reset m_pageLoadState when the process exits cleanly - otherwise messages from a
1851         new process for the same WebPageProxy would hit assertions.
1852
1853         * UIProcess/WebPageProxy.cpp:
1854         (WebKit::WebPageProxy::processDidCrash):
1855         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1856
1857 2014-07-16  David Kilzer  <ddkilzer@apple.com>
1858
1859         [iOS] Update order file paths for WebKit and WebKit2
1860         <http://webkit.org/b/134993>
1861         <rdar://problem/17557776>
1862
1863         Reviewed by Darin Adler.
1864
1865         * Configurations/Base.xcconfig: Add order file for iOS
1866         named WebKit.order.
1867
1868 2014-07-16  Brady Eidson  <beidson@apple.com>
1869
1870         Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
1871         <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
1872
1873         Reviewed by Dan Bernstein.
1874
1875         Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
1876         * UIProcess/API/Cocoa/WKProcessPool.mm:
1877         (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
1878         (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
1879         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1880
1881         Add a big shiny comment in a few key places:
1882         * DatabaseProcess/DatabaseProcess.cpp:
1883         (WebKit::DatabaseProcess::initializeDatabaseProcess):
1884         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1885         (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
1886         * UIProcess/WebContext.cpp:
1887         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
1888         (WebKit::WebContext::ensureDatabaseProcess):
1889
1890 2014-07-16  Enrica Casucci  <enrica@apple.com>
1891
1892         REGRESSION (iOS WebKit2): Cannot scroll while dragging a selection.
1893         https://bugs.webkit.org/show_bug.cgi?id=134992
1894         <rdar://problem/17528020>
1895
1896         Reviewed by Benjamin Poulain.
1897
1898         This patch exposes the scroller and the visible content rect so that
1899         UIKit can implement autoscroll when dragging the selections.
1900         It also changes that way we do hit testing to allow hit test outside
1901         the clipping region and fixes the way we compute the selection rectangle
1902         for the block selection, ensuring that we consider also non text elements
1903         like images.
1904
1905         * UIProcess/ios/WKContentViewInteraction.mm:
1906         (-[WKContentView scroller]):
1907         (-[WKContentView visibleRect]):
1908         * WebProcess/WebPage/ios/WebPageIOS.mm:
1909         (WebKit::selectionBoxForRange):
1910         (WebKit::WebPage::rangeForWebSelectionAtPosition):
1911         (WebKit::WebPage::rangeForBlockAtPoint):
1912         (WebKit::WebPage::expandedRangeFromHandle):
1913         (WebKit::WebPage::contractedRangeFromHandle):
1914         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
1915         (WebKit::WebPage::changeBlockSelection):
1916
1917 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
1918
1919         <rdar://problem/17669097> REGRESSION (r170155): Sandbox violations using a wrong
1920         CFNetwork cache path in WebContent process
1921
1922         Rubber-stamped by Sam Weinig.
1923
1924         Before r170155, we incorrectly checked usesNetworkProcess(), which always returns
1925         false at this point in initialization sequence. But we did the right thing, as we
1926         always need to set the cache path, even when network process is used for most loading.
1927
1928         * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess):
1929
1930 2014-07-16  Timothy Horton  <timothy_horton@apple.com>
1931
1932         Dispatch top content inset changes immediately if synchronously waiting for view state changes
1933         ​https://bugs.webkit.org/show_bug.cgi?id=134942
1934         <rdar://problem/17666800>
1935
1936         Reviewed by Simon Fraser.
1937
1938         * UIProcess/API/mac/WKView.mm:
1939         (-[WKView _dispatchSetTopContentInset]):
1940         (-[WKView _setTopContentInset:]):
1941         Move the check from _setTopContentInset: to _dispatchSetTopContentInset
1942         that ensures that we only send the message if the top content inset changed.
1943
1944 2014-07-16  Benjamin Poulain  <bpoulain@apple.com>
1945
1946         [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit
1947         https://bugs.webkit.org/show_bug.cgi?id=134965
1948         Related to <rdar://problem/17082607>
1949
1950         Reviewed by Tim Horton.
1951
1952         Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied
1953         to the page at the new size during the transition.
1954
1955         Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform
1956         can be applied to the wrong set of tiles.
1957         This is mostly a problem for unresponsive WebProcess or when the synchronization is done
1958         immediately.
1959
1960         There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate()
1961         completely fails to get the new page, the UIProcess is in a somewhat messy state.
1962         I will look into that separately than the layer tree synchronization.
1963
1964         * UIProcess/API/Cocoa/WKWebView.mm:
1965         (-[WKWebView _didCommitLayerTree:]):
1966         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
1967         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted.
1968         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1969         * UIProcess/PageClient.h:
1970         * UIProcess/WebPageProxy.cpp:
1971         (WebKit::WebPageProxy::WebPageProxy):
1972         (WebKit::WebPageProxy::resetState):
1973         * UIProcess/WebPageProxy.h:
1974         * UIProcess/ios/PageClientImplIOS.h:
1975         * UIProcess/ios/PageClientImplIOS.mm:
1976         (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
1977         * UIProcess/ios/WebPageProxyIOS.mm:
1978         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1979         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
1980         (WebKit::WebPageProxy::didCommitLayerTree):
1981         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
1982         * WebProcess/WebPage/WebPage.cpp:
1983         (WebKit::WebPage::WebPage):
1984         (WebKit::WebPage::didCommitLoad):
1985         * WebProcess/WebPage/WebPage.h:
1986         * WebProcess/WebPage/WebPage.messages.in:
1987         * WebProcess/WebPage/ios/WebPageIOS.mm:
1988         (WebKit::WebPage::synchronizeDynamicViewportUpdate):
1989         (WebKit::WebPage::updateVisibleContentRects):
1990         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1991         (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID):
1992         (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted.
1993
1994 2014-07-16  Dan Bernstein  <mitz@apple.com>
1995
1996         REGRESSION (r170653): Web Content service’s Info.plist has wrong format
1997         https://bugs.webkit.org/show_bug.cgi?id=134973
1998
1999         Reviewed by Alexey Proskuryakov.
2000
2001         * WebKit2.xcodeproj/project.pbxproj: Updated the Add CFBundle Localization Info.plist Key
2002         script build phases to convert Info.plist back to binary format if the
2003         PLIST_FILE_OUTPUT_FORMAT build setting requires it.
2004
2005 2014-07-15  Benjamin Poulain  <bpoulain@apple.com>
2006
2007         Fix r171124
2008
2009         * UIProcess/API/Cocoa/WKWebView.mm:
2010         (-[WKWebView _scrollToContentOffset:]):
2011         On landing, I changed the min/max branches to shrunkTo/expandedTo, but the return value
2012         of those was ignored.
2013
2014 2014-07-15  Dan Bernstein  <mitz@apple.com>
2015
2016         WKWebView’s FormClient::willSubmitForm should use CompletionHandlerCallChecker
2017         https://bugs.webkit.org/show_bug.cgi?id=134951
2018
2019         Reviewed by Tim Horton.
2020
2021         * UIProcess/API/Cocoa/WKWebView.mm:
2022         (-[WKWebView _setFormDelegate:]):
2023
2024 2014-07-15  Benjamin Poulain  <benjamin@webkit.org>
2025
2026         [iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document
2027         https://bugs.webkit.org/show_bug.cgi?id=134952
2028         <rdar://problem/17647116>
2029
2030         Reviewed by Enrica Casucci.
2031
2032         When we received a scroll request, we were taking that offset directly to set the UIScrollView
2033         scroll position. This is a problem if a page request scrolling to an invalid position, we were
2034         still doing it.
2035
2036         This patch limits the position to be inside the document.
2037
2038         -- Why not limit the scroll offset in the WebProcess when we receive the scroll request? --
2039
2040         Some pages rely on the page scale factor changing instantly, because that is how it worked
2041         on WebKit1.
2042
2043         On WebKit2, the WebProcess cannot know the valid range because the obscured insets are changing
2044         dynamically, and the page scale factor can change in response to WebProcess events (the focus
2045         changing for example). To make the page works, the WebProcess does not restrict the scroll position.
2046
2047         In that architecture, the UIProcess has to sanitize the input, which was not done before this patch.
2048
2049         -- Why not use changeContentOffsetBoundedInValidRange()?
2050
2051         The scroll offset as seen by the page is relative to the unobscured rect. While the position used
2052         for history item is a visual position. All we need in this case is a position in the view.
2053
2054         * UIProcess/API/Cocoa/WKWebView.mm:
2055         (-[WKWebView _scrollToContentOffset:]):
2056         * UIProcess/WebPageProxy.h:
2057         * UIProcess/ios/WebPageProxyIOS.mm:
2058         (WebKit::WebPageProxy::resendLastVisibleContentRects):
2059
2060 2014-07-15  Timothy Horton  <timothy_horton@apple.com>
2061
2062         Dispatch top content inset changes immediately if synchronously waiting for view state changes
2063         https://bugs.webkit.org/show_bug.cgi?id=134942
2064         <rdar://problem/17666800>
2065
2066         Reviewed by Simon Fraser.
2067
2068         * UIProcess/API/mac/WKView.mm:
2069         (-[WKView endDeferringViewInWindowChanges]):
2070         (-[WKView endDeferringViewInWindowChangesSync]):
2071         (-[WKView _dispatchSetTopContentInset]):
2072         (-[WKView _setTopContentInset:]):
2073         Send top content inset changes immediately before sync-waiting for new tiles from the Web Process.
2074         This will ensure that the incoming contents have the right top content inset, and we don't
2075         flash between the wrong inset and the right one.
2076
2077 2014-07-15  Enrica Casucci  <enrica@apple.com>
2078
2079         REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key.
2080         https://bugs.webkit.org/show_bug.cgi?id=134934
2081         <rdar://problem/17224638>
2082
2083         Reviewed by Tim Horton.
2084
2085         * UIProcess/ios/WKContentViewInteraction.mm:
2086         
2087         Tab and back tab should be handled as special keys that have
2088         a command associated. The command specifies for each key the relevant
2089         action. This patch implements the commands property to create the association
2090         between key and command and the relevant actions that will execute the same
2091         code executed when the used taps on the < > buttons in the accessory bar.
2092         
2093         (-[WKContentView keyCommands]):
2094         (-[WKContentView _nextAccessoryTab:]):
2095         (-[WKContentView _prevAccessoryTab:]):
2096
2097 2014-07-15  Oliver Hunt  <oliver@apple.com>
2098
2099         More tidying of the webcontent sandbox profile
2100         https://bugs.webkit.org/show_bug.cgi?id=134938
2101
2102         Reviewed by Alexey Proskuryakov.
2103
2104         Remove some excessive abilities from the profile and make
2105         the required ones explicit.
2106
2107         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2108
2109 2014-07-14  Andreas Kling  <akling@apple.com>
2110
2111         [iOS] Don't progressively re-render tiles while pinch-zooming under memory pressure.
2112         <https://webkit.org/b/134915>
2113
2114         When we're under memory pressure, the last thing we want to be doing is
2115         creating gratuitous new IOSurfaces. Just wait for the gesture to end before
2116         rendering at the new scale.
2117
2118         Reviewed by Tim Horton.
2119
2120         * WebProcess/WebPage/ios/WebPageIOS.mm:
2121         (WebKit::WebPage::updateVisibleContentRects):
2122
2123 2014-07-14  Joseph Pecoraro  <pecoraro@apple.com>
2124
2125         [Cocoa] _WKRemoteObjectInterface leaks NSString ivar
2126         https://bugs.webkit.org/show_bug.cgi?id=134914
2127
2128         Reviewed by Simon Fraser.
2129
2130         Release our copied NSString in dealloc.
2131
2132         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
2133         (-[_WKRemoteObjectInterface dealloc]):
2134
2135 2014-07-14  Dean Jackson  <dino@apple.com>
2136
2137         [PlugIns] Check for a non-null snapshot image before trying to decode it
2138         https://bugs.webkit.org/show_bug.cgi?id=134913
2139         <rdar://problem/17606033>
2140
2141         Reviewed by Tim Horton.
2142
2143         Changeset r169820 introduced a bug where we could examine the pixels of
2144         an image (looking for solid colors) before checking if the image actually
2145         existed.
2146
2147         I added a null check, and moved the code around a bit to avoid checking
2148         for existence three times.
2149
2150         * WebProcess/Plugins/PluginView.cpp:
2151         (WebKit::PluginView::pluginSnapshotTimerFired): Check that snapshotImage exists
2152         before trying to look at it.
2153
2154 2014-07-14  Anders Carlsson  <andersca@apple.com>
2155
2156         Fix 32-bit build.
2157
2158         * UIProcess/Cocoa/SessionStateCoding.mm:
2159         (WebKit::encodeSessionState):
2160
2161 2014-07-14  Anders Carlsson  <andersca@apple.com>
2162
2163         Use the legacy session coder for encoding/decoding session state
2164         https://bugs.webkit.org/show_bug.cgi?id=134910
2165
2166         Reviewed by Beth Dakin.
2167
2168         * UIProcess/Cocoa/SessionStateCoding.mm:
2169         (WebKit::encodeSessionState):
2170         (WebKit::decodeSessionState):
2171
2172 2014-07-14  Oliver Hunt  <oliver@apple.com>
2173
2174         Restrict network process to remote connections
2175         https://bugs.webkit.org/show_bug.cgi?id=134908
2176
2177         Reviewed by Geoffrey Garen.
2178
2179         Further restrict network client
2180
2181         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2182
2183 2014-07-14  Tim Horton  <timothy_horton@apple.com>
2184
2185         ASSERT(isMainThread()) under OneShotDisplayLinkHandler
2186         https://bugs.webkit.org/show_bug.cgi?id=134900
2187
2188         Reviewed by Simon Fraser.
2189
2190         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2191         (-[OneShotDisplayLinkHandler displayLinkFired:]):
2192         isMainThread means the Web thread sometimes.
2193
2194 2014-07-14  Tim Horton  <timothy_horton@apple.com>
2195
2196         Fix the build.
2197
2198         * UIProcess/API/Cocoa/WKWebView.mm:
2199         (-[WKWebView _frameOrBoundsChanged]):
2200         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2201         * UIProcess/API/ios/WKViewIOS.mm:
2202         (-[WKView _frameOrBoundsChanged]):
2203
2204 2014-07-14  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2205
2206         [UNIX] Log error description when failing to create shared memory file.
2207         https://bugs.webkit.org/show_bug.cgi?id=134892
2208
2209         Reviewed by Darin Adler.
2210
2211         * Platform/unix/SharedMemoryUnix.cpp:
2212         (WebKit::SharedMemory::create): Print the string describing the error number (errno).
2213
2214 2014-07-14  Benjamin Poulain  <benjamin@webkit.org>
2215
2216         [iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
2217         https://bugs.webkit.org/show_bug.cgi?id=134875
2218
2219         Reviewed by Tim Horton.
2220
2221         On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
2222         changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
2223         at the wrong orientation.
2224
2225         This patch fixes the issue by making a special case for animated resize:
2226         -While starting animated resize, _frameOrBoundsChanged can be called several times in response to
2227          the API's client changing the WKWebView. In that case, we do not update the drawing area.
2228         -After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
2229          is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
2230          DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
2231          order, and the updateGeometry() is always done after the viewport configuration has been updated.
2232
2233         * UIProcess/API/Cocoa/WKWebView.mm:
2234         (-[WKWebView _frameOrBoundsChanged]):
2235         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2236         * UIProcess/ios/WKContentView.h:
2237         * UIProcess/ios/WKContentView.mm:
2238         (-[WKContentView setMinimumSize:]): Deleted.
2239
2240 2014-07-14  Benjamin Poulain  <bpoulain@apple.com>
2241
2242         [iOS][WK2] Fix withinEpsilon()
2243         https://bugs.webkit.org/show_bug.cgi?id=134798
2244
2245         Reviewed by Darin Adler.
2246
2247         Move the function back to WKWebView, it is no longer needed in WKContentView.
2248
2249         Use the real types as input to properly verify that the two inputs are within
2250         a small value of the 32bit floating point.
2251
2252         The epsilon we use is always on 32 bits float because we want to avoid doing work for changes
2253         that would not make any difference on float.
2254
2255         The source of those small changes comes from the fact UIProcess does a lot of processing
2256         on CGFloat, which are double on 64bits architecture, while the WebProcess use 32bits floating point
2257         for scale. When we are getting updates from the WebProcess, we should ignore any small differences
2258         caused by the computations done with less precision.
2259
2260         * UIProcess/API/Cocoa/WKWebView.mm:
2261         (withinEpsilon):
2262         * UIProcess/ios/WKContentViewInteraction.h:
2263         (withinEpsilon): Deleted.
2264
2265 2014-07-14  Bear Travis  <betravis@adobe.com>
2266
2267         [Feature Queries] Enable Feature Queries on Mac
2268         https://bugs.webkit.org/show_bug.cgi?id=134404
2269
2270         Reviewed by Antti Koivisto.
2271
2272         Enable Feature Queries on Mac and resume running the
2273         feature tests.
2274
2275         * Configurations/FeatureDefines.xcconfig: Turn on
2276         ENABLE_CSS3_CONDITIONAL_RULES.
2277
2278 2014-07-14  Anders Carlsson  <andersca@apple.com>
2279
2280         Make shouldKeepCurrentBackForwardListItemInList part of WKPageLoaderClientV5 to avoid breaking ABI
2281         https://bugs.webkit.org/show_bug.cgi?id=134889
2282
2283         Reviewed by Beth Dakin.
2284
2285         * UIProcess/API/C/WKPage.cpp:
2286         * UIProcess/API/C/WKPageLoaderClient.h:
2287
2288 2014-07-14  Dan Bernstein  <mitz@apple.com>
2289
2290         REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordNavigationSnapshot
2291         https://bugs.webkit.org/show_bug.cgi?id=134887
2292
2293         Reviewed by Tim Horton.
2294
2295         * UIProcess/mac/PageClientImpl.mm:
2296         (WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when
2297         the client is using WKView directly.
2298         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
2299         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
2300         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
2301
2302 2014-07-14  Eric Carlson  <eric.carlson@apple.com>
2303
2304         [Mac] don't enable low power audio mode on external output devices
2305         https://bugs.webkit.org/show_bug.cgi?id=134877
2306
2307         Reviewed by Sam Weinig.
2308
2309         * PluginProcess/PluginProcess.h: Add an empty implementation of 
2310             AudioHardwareListener::audioOutputDeviceChanged.
2311
2312 2014-07-14  Tim Horton  <timothy_horton@apple.com>
2313
2314         [iOS] Throttle painting using a UI-process-side CADisplayLink
2315         https://bugs.webkit.org/show_bug.cgi?id=134879
2316         <rdar://problem/17641699>
2317
2318         Reviewed by Simon Fraser.
2319
2320         Just waiting for CA to commit is insufficient to actually throttle to 60fps,
2321         because nothing will block the main runloop from spinning.
2322
2323         Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess
2324         the first time it fires after we commit. This is not a guarantee that
2325         our content is on the screen, but we don't have any way to make that guarantee yet.
2326
2327         This will throttle painting, rAF, etc. to the display refresh rate.
2328
2329         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2330         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2331         (-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
2332         (-[OneShotDisplayLinkHandler dealloc]):
2333         (-[OneShotDisplayLinkHandler displayLinkFired:]):
2334         (-[OneShotDisplayLinkHandler invalidate]):
2335         (-[OneShotDisplayLinkHandler schedule]):
2336         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2337         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2338         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2339         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2340         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
2341
2342 2014-07-14  Dan Bernstein  <mitz@apple.com>
2343
2344         <rdar://problem/17657391> [iOS] Networking process writes persistent credentials to the keychain
2345         https://bugs.webkit.org/show_bug.cgi?id=134878
2346
2347         Reviewed by Sam Weinig.
2348
2349         Route CFNetwork’s calls to Security API through to the UI process.
2350
2351         * NetworkProcess/ios/NetworkProcessIOS.mm:
2352         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Initialize SecItemShim.
2353
2354         * Shared/mac/SecItemShim.cpp:
2355         (WebKit::SecItemShim::initialize): On iOS, rather than using a shim library, supply
2356         CFNetwork with alternate functions to call.
2357
2358         * Shared/mac/SecItemShim.messages.in: Removed #if !PLATFORM(IOS).
2359         * UIProcess/mac/SecItemShimProxy.messages.in: Ditto.
2360
2361         * config.h: Define ENABLE_SEC_ITEM_SHIM to 1 on iOS as well.
2362
2363 2014-07-14  Dan Bernstein  <mitz@apple.com>
2364
2365         <rdar://problem/17398060> NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
2366         https://bugs.webkit.org/show_bug.cgi?id=134666
2367
2368         Reviewed by Tim Horton.
2369
2370         A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
2371         by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
2372         unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
2373         only decoding fails, in this case silently, simply not delivering the
2374         SecItemShim::secItemResponse message.
2375
2376         The fix is to teach ArgumentCodersCF about SecAccessControlRef.
2377
2378         * Shared/cf/ArgumentCodersCF.cpp:
2379         (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
2380         (IPC::encode): Encode the SecAccessControl serialized into CFData.
2381         (IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
2382         * Shared/cf/ArgumentCodersCF.h:
2383         * config.h: Defined HAVE_SEC_ACCESS_CONTROL.
2384
2385 2014-07-13  Dan Bernstein  <mitz@apple.com>
2386
2387         <rdar://problem/17295636> [Cocoa] Include element snapshot in _WKActivatedElementInfo
2388         https://bugs.webkit.org/show_bug.cgi?id=134872
2389
2390         Reviewed by Sam Weinig.
2391
2392         * Shared/InteractionInformationAtPosition.cpp:
2393         (WebKit::InteractionInformationAtPosition::encode): Encode the image if there is one.
2394         (WebKit::InteractionInformationAtPosition::decode): Decode the image if there is one.
2395         * Shared/InteractionInformationAtPosition.h: Added an image member to the struct.
2396
2397         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Exposed the boundingRect property and added
2398         an image property.
2399         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
2400         (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Added an image
2401         parameter, which is stored in a new ivar.
2402         (-[_WKActivatedElementInfo image]): Added this getter, which converts the ShareableBitmap
2403         into a cached Cocoa image and returns it.
2404         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added image parameter to the
2405         initializer, removed _boundingRect property declaration from here.
2406
2407         * UIProcess/ios/WKActionSheetAssistant.mm:
2408         (-[WKActionSheetAssistant showImageSheet]): Pass the image from the position information
2409         into the _WKActivatedElementInfo initializer.
2410         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
2411
2412         * WebProcess/WebPage/WebPage.cpp:
2413         (WebKit::WebPage::snapshotNode): Added.
2414         * WebProcess/WebPage/WebPage.h:
2415
2416         * WebProcess/WebPage/ios/WebPageIOS.mm:
2417         (WebKit::WebPage::getPositionInformation): If the element is a link or an image, store a
2418         snapshot of it in the image member of the InteractionInformationAtPosition.
2419
2420 2014-07-13  Dan Bernstein  <mitz@apple.com>
2421
2422         [Cocoa] Clean up session state API a little
2423         https://bugs.webkit.org/show_bug.cgi?id=134871
2424
2425         Reviewed by Darin Adler.
2426
2427         * UIProcess/API/Cocoa/WKWebView.mm:
2428         (-[WKWebView _sessionState]):
2429         (-[WKWebView _restoreFromSessionState:]): Deleted.
2430         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2431
2432 2014-07-13  Javier Fernandez  <jfernandez@igalia.com>
2433
2434         REGRESSION(r171045) [GTK] Build broken.
2435         https://bugs.webkit.org/show_bug.cgi?id=134867
2436
2437         Unreviewed GTK build fix after r171045.
2438
2439         * UIProcess/API/gtk/PageClientImpl.cpp:
2440         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
2441         * UIProcess/API/gtk/PageClientImpl.h:
2442
2443 2014-07-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2444
2445         Unreviewed, EFL build fix since r171045.
2446
2447         * UIProcess/CoordinatedGraphics/WebView.h:
2448
2449 2014-07-12  Dan Bernstein  <mitz@apple.com>
2450
2451         [Cocoa] Notify the client when a navigation snapshot is taken
2452         https://bugs.webkit.org/show_bug.cgi?id=134865
2453
2454         Reviewed by Sam Weinig.
2455
2456         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
2457
2458         * UIProcess/Cocoa/NavigationState.h:
2459         * UIProcess/Cocoa/NavigationState.mm:
2460         (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in
2461         m_navigationDelegateMethods.
2462         (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new
2463         WKNavigationDelegate method.
2464
2465         * UIProcess/PageClient.h: Declared new client function.
2466
2467         * UIProcess/WebPageProxy.cpp:
2468         (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function.
2469         * UIProcess/WebPageProxy.h:
2470
2471         * UIProcess/ios/PageClientImplIOS.h:
2472         * UIProcess/ios/PageClientImplIOS.mm:
2473         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls
2474         NavigationState::willRecordNavigationSnapshot.
2475
2476         * UIProcess/mac/PageClientImpl.h:
2477         * UIProcess/mac/PageClientImpl.mm:
2478         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
2479
2480         * UIProcess/mac/ViewSnapshotStore.mm:
2481         (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to
2482         WebPageProxy::willRecordNavigationSnapshot.
2483
2484 2014-07-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2485
2486         Unreviewed, fix EFL build break since r171034.
2487
2488         * UIProcess/CoordinatedGraphics/WebView.h:
2489         * UIProcess/efl/WebContextEfl.cpp:
2490         (WebKit::WebContext::platformMediaCacheDirectory):
2491
2492 2014-07-12  Darin Adler  <darin@apple.com>
2493
2494         Try to fix 32-bit Mac build.
2495
2496         * UIProcess/mac/PageClientImpl.mm:
2497         (WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional.
2498         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
2499         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
2500
2501 2014-07-12  Javier Fernandez  <jfernandez@igalia.com>
2502
2503         REGRESSION(r171034) [GTK] Build broken.
2504         https://bugs.webkit.org/show_bug.cgi?id=134861
2505
2506         Unreviewed GTK build fix.
2507
2508         * UIProcess/API/gtk/PageClientImpl.cpp:
2509         (WebKit::PageClientImpl::navigationGestureDidBegin):
2510         (WebKit::PageClientImpl::navigationGestureWillEnd):
2511         (WebKit::PageClientImpl::navigationGestureDidEnd):
2512         * UIProcess/API/gtk/PageClientImpl.h:
2513
2514 2014-07-12  Javier Fernandez  <jfernandez@igalia.com>
2515
2516         REGRESSION(r171024) [GTK] Build broken.
2517         https://bugs.webkit.org/show_bug.cgi?id=134859
2518
2519         Unreviewed GTK build fix.
2520
2521         * UIProcess/gtk/WebContextGtk.cpp:
2522         (WebKit::WebContext::platformMediaCacheDirectory):
2523
2524 2014-07-12  Dan Bernstein  <mitz@apple.com>
2525
2526         <rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation gestures begin and end
2527         https://bugs.webkit.org/show_bug.cgi?id=134853
2528
2529         Reviewed by Sam Weinig.
2530
2531         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate
2532         methods.
2533
2534         * UIProcess/API/Cocoa/WKWebView.mm:
2535         (-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter.
2536
2537         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property
2538         _isShowingNavigationGestureSnapshot.
2539
2540         * UIProcess/Cocoa/NavigationState.h:
2541         * UIProcess/Cocoa/NavigationState.mm:
2542         (WebKit::NavigationState::setNavigationDelegate): Initialize new flags in
2543         m_navigationDelegateMethods.
2544         (WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new
2545         WKNavigationDelegate method.
2546         (WebKit::NavigationState::navigationGestureWillEnd): Ditto.
2547         (WebKit::NavigationState::navigationGestureDidEnd): Ditto.
2548
2549         * UIProcess/PageClient.h: Declared new client functions.
2550
2551         * UIProcess/WebPageProxy.cpp:
2552         (WebKit::WebPageProxy::WebPageProxy): Initialize new member variable.
2553         (WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot
2554         and call the new client function.
2555         (WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function.
2556         (WebKit::WebPageProxy::navigationGestureDidEnd): Ditto.
2557         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear
2558         m_isShowingNavigationGestureSnapshot.
2559         * UIProcess/WebPageProxy.h:
2560         (WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter.
2561
2562         * UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions.
2563         * UIProcess/ios/PageClientImplIOS.mm:
2564         (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
2565         NavigationState function.
2566         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
2567         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
2568
2569         * UIProcess/ios/ViewGestureControllerIOS.mm:
2570         (WebKit::ViewGestureController::beginSwipeGesture): Added calls to
2571         WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd.
2572         (WebKit::ViewGestureController::endSwipeGesture): Added calls to
2573         WebPageProxy::navigationGestureDidEnd.
2574         (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
2575         WebPageProxy::navigationGestureSnapshotWasRemoved.
2576
2577         * UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions.
2578         * UIProcess/mac/PageClientImpl.mm:
2579         (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
2580         NavigationState function.
2581         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
2582         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
2583
2584         * UIProcess/mac/ViewGestureControllerMac.mm:
2585         (WebKit::ViewGestureController::beginSwipeGesture): Added call to
2586         WebPageProxy::navigationGestureDidBegin.
2587         (WebKit::ViewGestureController::endSwipeGesture): Added calls to
2588         WebPageProxy::navigationGestureDidEnd.
2589         (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
2590         WebPageProxy::navigationGestureSnapshotWasRemoved.
2591
2592 2014-07-12  Oliver Hunt  <oliver@apple.com>
2593
2594         Fix typo in prior patch
2595         https://bugs.webkit.org/show_bug.cgi?id=134858
2596
2597         Reviewed by Sam Weinig.
2598
2599         Fix typo
2600
2601         * UIProcess/mac/WebContextMac.mm:
2602         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
2603
2604 2014-07-12  Dan Bernstein  <mitz@apple.com>
2605
2606         [Cocoa] Client is not notified of same-document navigations
2607         https://bugs.webkit.org/show_bug.cgi?id=134855
2608
2609         Reviewed by Sam Weinig.
2610
2611         * UIProcess/API/APILoaderClient.h:
2612         (API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter.
2613
2614         * UIProcess/API/C/WKPage.cpp:
2615         (WKPageSetPageLoaderClient): Ditto.
2616
2617         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method.
2618
2619         * UIProcess/Cocoa/NavigationState.h: Declare override of
2620         API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in
2621         m_navigationDelegateMethods struct.
2622         * UIProcess/Cocoa/NavigationState.mm:
2623         (WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods
2624         flag.
2625         (WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API
2626         values.
2627         (WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call
2628         the delegate method, if implemented.
2629
2630         * UIProcess/WebPageProxy.cpp:
2631         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter,
2632         which is forwarded to the client.
2633         * UIProcess/WebPageProxy.h: Added navigationID parameter.
2634         * UIProcess/WebPageProxy.messages.in: Ditto.
2635
2636         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2637         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID.
2638         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto.
2639         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto.
2640         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto.
2641
2642 2014-07-12  Oliver Hunt  <oliver@apple.com>
2643
2644         Extend WebContent sandbox to allow some extra access for frameworks
2645         https://bugs.webkit.org/show_bug.cgi?id=134844
2646
2647         Reviewed by Sam Weinig.
2648
2649         Open up the webcontent sandbox a bit so that some external frameworks
2650         can work correctly.
2651
2652         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2653         * Shared/WebProcessCreationParameters.cpp:
2654         (WebKit::WebProcessCreationParameters::encode):
2655         (WebKit::WebProcessCreationParameters::decode):
2656         * Shared/WebProcessCreationParameters.h:
2657         * UIProcess/WebContext.cpp:
2658         (WebKit::WebContext::createNewWebProcess):
2659         (WebKit::WebContext::mediaCacheDirectory):
2660         * UIProcess/WebContext.h:
2661         * UIProcess/mac/WebContextMac.mm:
2662         (WebKit::WebContext::platformMediaCacheDirectory):
2663         * WebProcess/cocoa/WebProcessCocoa.mm:
2664         (WebKit::WebProcess::platformInitializeWebProcess):
2665
2666 2014-07-12  Oliver Hunt  <oliver@apple.com>
2667
2668         Temporary work around for <rdar://<rdar://problem/17513375>
2669         https://bugs.webkit.org/show_bug.cgi?id=134848
2670
2671         Reviewed by Sam Weinig.
2672
2673         Temporarily work around <rdar://<rdar://problem/17513375> by
2674         dropping the explicit cookie storage if it points out of the
2675         container.
2676
2677         * UIProcess/mac/WebContextMac.mm:
2678         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
2679
2680 2014-07-11  Enrica Casucci  <enrica@apple.com>
2681
2682         Implement textStylingAtPosition in WK2.
2683         https://bugs.webkit.org/show_bug.cgi?id=134843
2684         <rdar://problem/17614981>
2685
2686         Reviewed by Benjamin Poulain.
2687
2688         Adding information about typing attributes to EditorState so
2689         that we can implement textStylingAtPosition.
2690
2691         * Shared/EditorState.cpp:
2692         (WebKit::EditorState::encode):
2693         (WebKit::EditorState::decode):
2694         * Shared/EditorState.h:
2695         (WebKit::EditorState::EditorState):
2696         * UIProcess/ios/WKContentViewInteraction.mm:
2697         (-[WKContentView textStylingAtPosition:inDirection:]):
2698         (-[WKContentView canPerformAction:withSender:]):
2699         (-[WKContentView toggleBoldface:]):
2700         (-[WKContentView toggleItalics:]):
2701         (-[WKContentView toggleUnderline:]):
2702         * WebProcess/WebPage/WebPage.cpp:
2703         (WebKit::WebPage::editorState):
2704
2705 2014-07-11  Oliver Hunt  <oliver@apple.com>
2706
2707         Tighten WebContent sandbox
2708         https://bugs.webkit.org/show_bug.cgi?id=134834
2709
2710         Reviewed by Sam Weinig.
2711
2712         Define a much tighter sandbox profile for the WebContent process
2713
2714         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2715
2716 2014-07-11  Antti Koivisto  <antti@apple.com>
2717
2718         REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F
2719         https://bugs.webkit.org/show_bug.cgi?id=134833
2720         <rdar://problem/17580021>
2721
2722         Reviewed by Zalan Bujtas.
2723         
2724         Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac.
2725
2726         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2727         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
2728
2729 2014-07-11  Zalan Bujtas  <zalan@apple.com>
2730
2731         Subpixel layout: return integral results for offset*, client*, scroll* by default.
2732         https://bugs.webkit.org/show_bug.cgi?id=134651
2733
2734         Reviewed by Simon Fraser.
2735
2736         Revert to returning integral values for Element.offset* client* scroll* by default.
2737         Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
2738
2739         Since snapped dimension depends on both the original point and the width/height of the box,
2740         we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
2741
2742         Covered by existing tests
2743
2744         * Shared/WebPreferencesDefinitions.h:
2745         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2746
2747 2014-07-10  Jinwoo Song  <jinwoo7.song@samsung.com>
2748
2749         Unreviewed EFL build fix after r170970.
2750
2751         * UIProcess/efl/WebContextEfl.cpp:
2752         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
2753
2754 2014-07-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2755
2756         REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
2757         https://bugs.webkit.org/show_bug.cgi?id=134825
2758
2759         Unreviewed GTK build fix.
2760
2761         * Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port.
2762         * Shared/WebBackForwardListItem.h: Idem.
2763         * UIProcess/gtk/WebContextGtk.cpp:
2764         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton.
2765
2766 2014-07-10  Benjamin Poulain  <bpoulain@apple.com>
2767
2768         [iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times
2769         https://bugs.webkit.org/show_bug.cgi?id=134820
2770
2771         Reviewed by Andreas Kling.
2772
2773         If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash,
2774         once on dealloc.
2775
2776         The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe
2777         to remove the observer if we are not already observing on that view.
2778
2779         To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup
2780         are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because
2781         the view is already nil.
2782
2783         * UIProcess/ios/WKContentViewInteraction.mm:
2784         (-[WKContentView setupInteraction]):
2785         (-[WKContentView cleanupInteraction]):
2786
2787 2014-07-10  Simon Fraser  <simon.fraser@apple.com>
2788
2789         [iOS WK2] Move WKInspectorHighlightView to its own file
2790         https://bugs.webkit.org/show_bug.cgi?id=134819
2791
2792         Reviewed by Joseph Pecoraro.
2793         
2794         WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm,
2795         so move it into its own file.
2796
2797         * UIProcess/WKInspectorHighlightView.h: Added.
2798         * UIProcess/WKInspectorHighlightView.mm: Added.
2799         (-[WKInspectorHighlightView dealloc]):
2800         (-[WKInspectorHighlightView _removeAllLayers]):
2801         (-[WKInspectorHighlightView _createLayers:]):
2802         (findIntersectionOnLineBetweenPoints):
2803         (quadIntersection):
2804         (layerPathWithHole):
2805         (layerPath):
2806         (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
2807         (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
2808         (-[WKInspectorHighlightView update:]):
2809         * UIProcess/ios/WKContentView.mm:
2810         (-[WKInspectorHighlightView initWithFrame:]): Deleted.
2811         (-[WKInspectorHighlightView dealloc]): Deleted.
2812         (-[WKInspectorHighlightView _removeAllLayers]): Deleted.
2813         (-[WKInspectorHighlightView _createLayers:]): Deleted.
2814         (findIntersectionOnLineBetweenPoints): Deleted.
2815         (quadIntersection): Deleted.
2816         (layerPathWithHole): Deleted.
2817         (layerPath): Deleted.
2818         (-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted.
2819         (-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted.
2820         (-[WKInspectorHighlightView update:]): Deleted.
2821         * WebKit2.xcodeproj/project.pbxproj:
2822
2823 2014-07-10  Tim Horton  <timothy_horton@apple.com>
2824
2825         REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit
2826         https://bugs.webkit.org/show_bug.cgi?id=134818
2827         <rdar://problem/17632468>
2828
2829         Reviewed by Anders Carlsson.
2830
2831         * UIProcess/API/Cocoa/WKWebView.mm:
2832         (scrollViewBackgroundColor):
2833         r170935 made it so that we would initialize the scroll view background color to an
2834         invalid color until the first layer tree commit. We should go with white instead.
2835
2836 2014-07-10  Enrica Casucci  <enrica@apple.com>
2837
2838         Add a mechanism to notify the UIProcess when an editing command is done executing.
2839         https://bugs.webkit.org/show_bug.cgi?id=134807
2840
2841         Reviewed by Tim Horton.
2842
2843         Some editing commands have an effect on some parts of the system that
2844         run inside the UIProcess. A good example are the cursor movement commands
2845         that require an update of the autocorrection/autosuggestion machinery.
2846         This patch adds a way to reliably know when the command has been executed
2847         in the WebProcess. A previous attempt at solving this problem was added in
2848         r170858 and was partially reverted in r170948.
2849         The change also removes the selectionWillChange notification added in r170858.
2850
2851         * UIProcess/PageClient.h:
2852         * UIProcess/WebPageProxy.cpp:
2853         (WebKit::WebPageProxy::editorStateChanged):
2854         * UIProcess/WebPageProxy.h:
2855         * UIProcess/ios/PageClientImplIOS.h:
2856         * UIProcess/ios/PageClientImplIOS.mm:
2857         (WebKit::PageClientImpl::selectionWillChange): Deleted.
2858         * UIProcess/ios/WKContentViewInteraction.h:
2859         * UIProcess/ios/WKContentViewInteraction.mm:
2860         (-[WKContentView executeEditCommandWithCallback:]):
2861         (-[WKContentView _moveUp:withHistory:]):
2862         (-[WKContentView _moveDown:withHistory:]):
2863         (-[WKContentView _moveLeft:withHistory:]):
2864         (-[WKContentView _moveRight:withHistory:]):
2865         (-[WKContentView _moveToStartOfWord:withHistory:]):
2866         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2867         (-[WKContentView _moveToStartOfLine:withHistory:]):
2868         (-[WKContentView _moveToStartOfDocument:withHistory:]):
2869         (-[WKContentView _moveToEndOfWord:withHistory:]):
2870         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2871         (-[WKContentView _moveToEndOfLine:withHistory:]):
2872         (-[WKContentView _moveToEndOfDocument:withHistory:]):
2873         (-[WKContentView _selectionWillChange]): Deleted.
2874         * UIProcess/ios/WebPageProxyIOS.mm:
2875         (WebKit::WebPageProxy::executeEditCommand):
2876         (WebKit::WebPageProxy::notifySelectionWillChange): Deleted.
2877         * WebProcess/WebPage/WebPage.h:
2878         * WebProcess/WebPage/WebPage.messages.in:
2879         * WebProcess/WebPage/ios/WebPageIOS.mm:
2880         (WebKit::WebPage::executeEditCommandWithCallback):
2881
2882 2014-07-10  Joseph Pecoraro  <pecoraro@apple.com>
2883
2884         [Mac] NSWindow warning: adding an unknown subview opening detached Inspector
2885         https://bugs.webkit.org/show_bug.cgi?id=134813
2886
2887         Reviewed by Timothy Hatcher.
2888
2889         * UIProcess/mac/WebInspectorProxyMac.mm:
2890         (WebKit::WebInspectorProxy::createInspectorWindow):
2891         Use a selector that will avoid the warning message.
2892
2893 2014-07-10  Oliver Hunt  <oliver@apple.com>
2894
2895         Remove use of container relative restrictions in the network process sandbox
2896         https://bugs.webkit.org/show_bug.cgi?id=134816
2897
2898         Reviewed by Anders Carlsson.
2899
2900         As i'm tidying up the various sandboxes and that's meaning we
2901         need to reduce some file restrictions in the network process.
2902
2903         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2904
2905 2014-07-10  Pratik Solanki  <psolanki@apple.com>
2906
2907         Unreviewed iOS build fix after r170974. Define id if building a non ObjC file.
2908
2909         * UIProcess/mac/ViewSnapshotStore.h:
2910
2911 2014-07-10  Tim Horton  <timothy_horton@apple.com>
2912
2913         Store ViewSnapshots directly on the WebBackForwardListItem
2914         https://bugs.webkit.org/show_bug.cgi?id=134667
2915         <rdar://problem/17082639>
2916
2917         Reviewed by Dan Bernstein.
2918
2919         Make ViewSnapshot a refcounted class. Store it directly on the back-forward item
2920         instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now.
2921         This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots
2922         in the page that was actively being interacted with *first* when evicting snapshots, instead of
2923         preferring older snapshots. Additionally, we would not throw away snapshots when back forward items
2924         became unreachable.
2925
2926         There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation.
2927
2928         * Shared/SessionState.h:
2929         Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState.
2930
2931         * Shared/WebBackForwardListItem.h:
2932         Fix some indented namespace contents.
2933
2934         (WebKit::WebBackForwardListItem::snapshot):
2935         (WebKit::WebBackForwardListItem::setSnapshot):
2936         (WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted.
2937         (WebKit::WebBackForwardListItem::snapshotUUID): Deleted.
2938         Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs.
2939
2940         * UIProcess/API/Cocoa/WKWebView.mm:
2941         (-[WKWebView _takeViewSnapshot]):
2942         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2943         * UIProcess/API/mac/WKView.mm:
2944         (-[WKView _takeViewSnapshot]):
2945         * UIProcess/API/mac/WKViewInternal.h:
2946         * UIProcess/PageClient.h:
2947         * UIProcess/WebPageProxy.cpp:
2948         (WebKit::WebPageProxy::takeViewSnapshot):
2949         * UIProcess/WebPageProxy.h:
2950         * UIProcess/ios/PageClientImplIOS.h:
2951         * UIProcess/ios/PageClientImplIOS.mm:
2952         (WebKit::PageClientImpl::takeViewSnapshot):
2953         * UIProcess/mac/PageClientImpl.h:
2954         * UIProcess/mac/PageClientImpl.mm:
2955         (WebKit::PageClientImpl::takeViewSnapshot):
2956         Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot.
2957
2958         * UIProcess/ios/ViewGestureControllerIOS.mm:
2959         (WebKit::ViewGestureController::beginSwipeGesture):
2960         (WebKit::ViewGestureController::endSwipeGesture):
2961         * UIProcess/mac/ViewGestureController.h:
2962         * UIProcess/mac/ViewGestureControllerMac.mm:
2963         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
2964         (WebKit::ViewGestureController::beginSwipeGesture):
2965         (WebKit::ViewGestureController::endSwipeGesture):
2966         Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions.
2967
2968         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
2969         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
2970         Rename discardSnapshots to discardSnapshotImages, because we're really only discarding
2971         the images; the render tree size/background color "snapshot" remains and is useful.
2972
2973         * UIProcess/mac/ViewSnapshotStore.h:
2974         (WebKit::ViewSnapshot::setRenderTreeSize):
2975         (WebKit::ViewSnapshot::renderTreeSize):
2976         (WebKit::ViewSnapshot::setBackgroundColor):
2977         (WebKit::ViewSnapshot::backgroundColor):
2978         (WebKit::ViewSnapshot::setDeviceScaleFactor):
2979         (WebKit::ViewSnapshot::deviceScaleFactor):
2980         (WebKit::ViewSnapshot::imageSizeInBytes):
2981         (WebKit::ViewSnapshot::surface):
2982         (WebKit::ViewSnapshot::size):
2983         (WebKit::ViewSnapshot::creationTime):
2984         Make ViewSnapshot a refcounted class.
2985         Add create functions which take an image (or slot ID), and relevant sizes.
2986         It is expected that a ViewSnapshot is created with an image, and it is only possible
2987         to remove that image, never to replace it. A new ViewSnapshot is required in that case.
2988         Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient
2989         retrieves it from the view. Add getters for things that the ViewGestureControllers need.
2990
2991         Remove removeSnapshotImage, getSnapshot, and the snapshot map.
2992
2993         * UIProcess/mac/ViewSnapshotStore.mm:
2994         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2995         (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
2996         (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
2997         Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot.
2998         willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed.
2999
3000         (WebKit::ViewSnapshotStore::pruneSnapshots):
3001         Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but
3002         this is much less broken than the previous implementation.
3003
3004         (WebKit::ViewSnapshotStore::recordSnapshot):
3005         (WebKit::ViewSnapshotStore::discardSnapshotImages):
3006         (WebKit::ViewSnapshot::create):
3007         (WebKit::ViewSnapshot::ViewSnapshot):
3008         (WebKit::ViewSnapshot::~ViewSnapshot):
3009         (WebKit::ViewSnapshot::hasImage):
3010         (WebKit::ViewSnapshot::clearImage):
3011         (WebKit::ViewSnapshot::asLayerContents):
3012         If a surface is Empty when it comes back from being volatile, throw away the surface
3013         and notify the Store to remove it from m_snapshotCacheSize (via clearImage()).
3014
3015         (WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted.
3016         (WebKit::ViewSnapshotStore::getSnapshot): Deleted.
3017         (WebKit::ViewSnapshotStore::discardSnapshots): Deleted.
3018
3019 2014-07-10  Beth Dakin  <bdakin@apple.com>
3020
3021         Need Setting/WKPreference that allows clients to prevent scrollbars from drawing 
3022         on a secondary thread
3023         https://bugs.webkit.org/show_bug.cgi?id=134778
3024         -and corresponding-
3025         <rdar://problem/17595333>
3026
3027         Reviewed by Tim Horton.
3028
3029         This is a requirement for some types of performance tests.
3030
3031         New pref.
3032         * Shared/WebPreferencesDefinitions.h:
3033
3034         PDFPlugin has to implement this new ScrollableArea virtual function to indicate 
3035         the Setting’s value.
3036         * WebProcess/Plugins/PDF/PDFPlugin.h:
3037         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3038         (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
3039
3040         New pref.
3041         * WebProcess/WebPage/WebPage.cpp:
3042         (WebKit::WebPage::updatePreferences):
3043
3044 2014-07-10  Tim Horton  <timothy_horton@apple.com>
3045
3046         [iOS] Frequent assertion failures when swiping back
3047
3048         Reviewed by Dan Bernstein.
3049
3050         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3051         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3052         Don't create an unused VoidCallback. It will assert when destroyed without being called.
3053
3054 2014-07-10  Oliver Hunt  <oliver@apple.com>
3055
3056         Pass sandbox extension for GL cache over to webprocess
3057         https://bugs.webkit.org/show_bug.cgi?id=134806
3058
3059         Reviewed by Anders Carlsson.
3060
3061         Add additional WebProcess parameters to pass an extension
3062         that allows access to the opengl cache directory in the
3063         host application's container.
3064
3065         * Shared/WebProcessCreationParameters.cpp:
3066         (WebKit::WebProcessCreationParameters::encode):
3067         (WebKit::WebProcessCreationParameters::decode):
3068         * Shared/WebProcessCreationParameters.h:
3069         * UIProcess/WebContext.cpp:
3070         (WebKit::WebContext::createNewWebProcess):
3071         (WebKit::WebContext::openGLCacheDirectory):
3072         * UIProcess/WebContext.h:
3073         * UIProcess/mac/WebContextMac.mm:
3074         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
3075         * WebProcess/cocoa/WebProcessCocoa.mm:
3076         (WebKit::WebProcess::platformInitializeWebProcess):
3077
3078 2014-07-10  Dan Bernstein  <mitz@apple.com>
3079
3080         iOS build fix.
3081
3082         * WebProcess/WebPage/ServicesOverlayController.h:
3083
3084 2014-07-09  Brady Eidson  <beidson@apple.com>
3085
3086         Phone number highlights should always be visible if the mouse hovers over.
3087         <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
3088
3089         Reviewed by Tim Horton.
3090
3091         This is a fairly extensive rewrite of ServicesOverlayController.
3092         It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
3093         If a telephone number highlight is hovered over, it wins and is painted.
3094         If no telephone number highlight is hovered but the selection highlight is, then it is painted.
3095        
3096         The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.
3097
3098         The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.
3099         
3100         * Platform/Logging.h: Add a Services logging channel.
3101
3102         * WebProcess/WebPage/ServicesOverlayController.h:
3103         (WebKit::TelephoneNumberData::TelephoneNumberData):
3104
3105         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3106         (WebKit::ServicesOverlayController::ServicesOverlayController):
3107         (WebKit::ServicesOverlayController::selectionRectsDidChange):
3108         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
3109         (WebKit::ServicesOverlayController::clearHighlightState):
3110         (WebKit::ServicesOverlayController::drawRect):
3111         (WebKit::ServicesOverlayController::drawSelectionHighlight):
3112         (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
3113         (WebKit::ServicesOverlayController::drawHighlight):
3114         (WebKit::ServicesOverlayController::clearSelectionHighlight):
3115         (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
3116         (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
3117             creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
3118             the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
3119         (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
3120         (WebKit::ServicesOverlayController::mouseEvent):
3121         (WebKit::ServicesOverlayController::handleClick):
3122         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
3123         (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.
3124
3125 2014-07-10  Timothy Horton  <timothy_horton@apple.com>
3126
3127         Assertions or crashes under _takeViewSnapshot when restoring windows
3128         https://bugs.webkit.org/show_bug.cgi?id=134792
3129
3130         Reviewed by Simon Fraser.
3131
3132         * UIProcess/API/mac/WKView.mm:
3133         (-[WKView _takeViewSnapshot]):
3134         Taking a window-server snapshot of a non-visible window tends to not succeed.
3135
3136 2014-07-09  Pratik Solanki  <psolanki@apple.com>
3137
3138         Buffer CSS and JS resources in network process before sending over to web process
3139         https://bugs.webkit.org/show_bug.cgi?id=134560
3140         <rdar://problem/16737186>
3141
3142         Reviewed by Antti Koivisto.
3143
3144         For CSS and JS resources, ask the network process to buffer the entire resource instead of
3145         sending it to web process in chunks since the web process can't do anything with a partial
3146         css or js file.
3147
3148         * NetworkProcess/NetworkResourceLoader.cpp:
3149         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
3150         * Shared/Network/NetworkResourceLoadParameters.cpp:
3151         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
3152         (WebKit::NetworkResourceLoadParameters::encode):
3153         (WebKit::NetworkResourceLoadParameters::decode):
3154         * Shared/Network/NetworkResourceLoadParameters.h:
3155         * WebProcess/Network/WebResourceLoadScheduler.cpp:
3156         (WebKit::WebResourceLoadScheduler::scheduleLoad):
3157
3158 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
3159
3160         [iOS][WK2] Disable text quantization while actively changing the page's scale factor
3161         https://bugs.webkit.org/show_bug.cgi?id=134781
3162
3163         Reviewed by Tim Horton and Myles C. Maxfield.
3164
3165         While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
3166         boundary for the current scale factor.
3167
3168         We do not want this to happen while dynamically changing the scale factor because the effect
3169         is visible. To avoid this, we disable text quantization if the page's scale factor changes
3170         in response to a non-stable contentRect update.
3171
3172         * WebProcess/WebCoreSupport/WebChromeClient.h:
3173         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3174         (WebKit::WebChromeClient::hasStablePageScaleFactor):
3175         * WebProcess/WebPage/WebPage.cpp:
3176         (WebKit::WebPage::WebPage):
3177         * WebProcess/WebPage/WebPage.h:
3178         (WebKit::WebPage::hasStablePageScaleFactor):
3179         * WebProcess/WebPage/ios/WebPageIOS.mm:
3180         (WebKit::WebPage::updateVisibleContentRects):
3181
3182 2014-07-09  Joseph Pecoraro  <pecoraro@apple.com>
3183
3184         [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
3185         https://bugs.webkit.org/show_bug.cgi?id=134777
3186
3187         Reviewed by Sam Weinig.
3188
3189         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3190         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
3191
3192 2014-07-09  Shivakumar JM  <shiva.jm@samsung.com>
3193
3194         [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
3195         https://bugs.webkit.org/show_bug.cgi?id=134759
3196
3197         Reviewed by Gyuyoung Kim.
3198
3199         Add new API in ewk_download_job.h to get size of the data already downloaded.
3200
3201         * UIProcess/API/efl/ewk_download_job.cpp:
3202         (ewk_download_job_received_data_length_get):
3203         (EwkDownloadJob::receivedData):
3204         * UIProcess/API/efl/ewk_download_job.h:
3205         * UIProcess/API/efl/ewk_download_job_private.h:
3206         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
3207         (EWK2DownloadJobTest::on_download_requested):
3208         (EWK2DownloadJobTest::on_download_finished):
3209
3210 2014-07-09  Enrica Casucci  <enrica@apple.com>
3211
3212         REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
3213         https://bugs.webkit.org/show_bug.cgi?id=134791
3214         <rdar://problem/17616971>
3215
3216         Reviewed by Benjamin Poulain.
3217
3218         After r170858 we notify the keyboard too often about
3219         the changed selection. This patch removes the notification
3220         until we find a better way to do it that doesn't cause
3221         deadlocks.
3222
3223         * UIProcess/ios/WKContentViewInteraction.mm:
3224         (-[WKContentView _selectionWillChange]):
3225         (-[WKContentView _selectionChanged]):
3226
3227 2014-07-09  Anders Carlsson  <andersca@apple.com>
3228
3229         Safari showing blank pages
3230         https://bugs.webkit.org/show_bug.cgi?id=134790
3231         <rdar://problem/17617166>
3232
3233         Reviewed by Simon Fraser.
3234
3235         * UIProcess/API/Cocoa/WKWebView.mm:
3236         (-[WKWebView initWithFrame:configuration:]):
3237         Make sure to add the content view to the scroll view.
3238
3239 2014-07-09  Anders Carlsson  <andersca@apple.com>
3240
3241         Closed web views should never create new web processes
3242         https://bugs.webkit.org/show_bug.cgi?id=134787
3243         <rdar://problem/16892526>
3244
3245         Reviewed by Simon Fraser.
3246
3247         * UIProcess/API/Cocoa/WKWebView.mm:
3248         (-[WKWebView loadHTMLString:baseURL:]):
3249         (-[WKWebView reload]):
3250         (-[WKWebView reloadFromOrigin]):
3251         Return nil if the returned navigation ID is 0.
3252
3253         * UIProcess/WebPageProxy.cpp:
3254         (WebKit::WebPageProxy::reattachToWebProcess):
3255         Assert that the page is not closed.
3256
3257         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3258         (WebKit::WebPageProxy::loadRequest):
3259         (WebKit::WebPageProxy::loadFile):
3260         (WebKit::WebPageProxy::loadData):
3261         (WebKit::WebPageProxy::loadHTMLString):
3262         (WebKit::WebPageProxy::loadAlternateHTMLString):
3263         (WebKit::WebPageProxy::loadPlainTextString):
3264         (WebKit::WebPageProxy::loadWebArchiveData):
3265         Add early returns if the page is closed.
3266
3267         * UIProcess/WebPageProxy.h:
3268
3269 2014-07-09  Anders Carlsson  <andersca@apple.com>
3270
3271         Support transparent WKWebViews
3272         https://bugs.webkit.org/show_bug.cgi?id=134779
3273         <rdar://problem/17351058>
3274
3275         Reviewed by Tim Horton.
3276
3277         * UIProcess/API/Cocoa/WKWebView.mm:
3278         (-[WKWebView initWithFrame:configuration:]):
3279         Call _updateScrollViewBackground instead of setting the background color.
3280
3281         (contentZoomScale):
3282         Use dot notation.
3283
3284         (scrollViewBackgroundColor):
3285         Helper function that returns the scroll view background color. 
3286         If the web view isn't opaque, we want the scroll view to be transparent.
3287
3288         (-[WKWebView _updateScrollViewBackground]):
3289         Call scrollViewBackgroundColor.
3290
3291         (-[WKWebView setOpaque:]):
3292         Call WebPageProxy::setDrawsBackground and update the scroll view background.
3293
3294         (-[WKWebView setBackgroundColor:]):
3295         Call setBackgroundColor on the content view.
3296
3297 2014-07-09  Andy Estes  <aestes@apple.com>
3298
3299         [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
3300         https://bugs.webkit.org/show_bug.cgi?id=134780
3301
3302         Reviewed by Tim Horton.
3303
3304         Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
3305         will match or exceed that of the CFDataRef. Copy the data instead.
3306
3307         * WebProcess/Network/WebResourceLoader.cpp:
3308         (WebKit::WebResourceLoader::didReceiveData):
3309
3310 2014-07-09  Pratik Solanki  <psolanki@apple.com>
3311
3312         Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
3313         https://bugs.webkit.org/show_bug.cgi?id=134732
3314
3315         Reviewed by Darin Adler.
3316
3317         Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
3318         is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
3319         that uses AsynchronousNetworkLoaderClient.
3320
3321         * NetworkProcess/NetworkResourceLoader.cpp:
3322         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
3323         (WebKit::NetworkResourceLoader::didReceiveBuffer):
3324         (WebKit::NetworkResourceLoader::didFinishLoading):
3325         * NetworkProcess/NetworkResourceLoader.h:
3326         (WebKit::NetworkResourceLoader::bufferedData):
3327         * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
3328         (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
3329         (WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
3330         (WebKit::SynchronousNetworkLoaderClient::didFail):
3331         (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
3332         * NetworkProcess/SynchronousNetworkLoaderClient.h:
3333
3334 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
3335
3336         [iOS][WK2] subviews of the unscaled view drift out during CA animations
3337         https://bugs.webkit.org/show_bug.cgi?id=134751
3338
3339         Reviewed by Enrica Casucci.
3340
3341         It is not possible to animate the WKContentView and the inverse view in such a way
3342         that the combined matrix remain the identity for every frame of the animation.
3343
3344         This patch solves the issue by moving the unscaled view as a sibling of WKContentView
3345         instead of a child so that we do not need to update two scales simultaneously.
3346
3347         * UIProcess/API/Cocoa/WKWebView.mm:
3348         (-[WKWebView initWithFrame:configuration:]):
3349         (-[WKWebView _processDidExit]):
3350         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
3351         Set the z scale to 1 or no coordinate transform will work with this view.
3352
3353         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3354         (-[WKWebView _endAnimatedResize]):
3355         * UIProcess/ios/WKContentView.mm:
3356         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
3357         * UIProcess/ios/WKContentViewInteraction.h:
3358         * UIProcess/ios/WKContentViewInteraction.mm:
3359         (-[WKContentView setupInteraction]):
3360         Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale.
3361
3362         (-[WKContentView cleanupInteraction]):
3363         (-[WKContentView unscaledView]):
3364         (-[WKContentView inverseScale]):
3365         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
3366         We update the utility views as usual. The extra bits here are to deal with views coming in during an animation.
3367
3368         If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve
3369         to end up at the right place. To avoid any issue, we just hide the view until the animation is finished.
3370
3371         (-[WKContentView hitTest:withEvent:]):
3372         (-[WKContentView _showTapHighlight]):
3373         (-[WKContentView _updateUnscaledView]): Deleted.
3374
3375 2014-07-09  Tim Horton  <timothy_horton@apple.com>
3376
3377         Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
3378         https://bugs.webkit.org/show_bug.cgi?id=134773
3379
3380         Reviewed by Anders Carlsson.
3381
3382         * UIProcess/API/mac/WKView.mm:
3383         (-[WKView _takeViewSnapshot]):
3384         * UIProcess/mac/ViewSnapshotStore.h:
3385         * UIProcess/mac/ViewSnapshotStore.mm:
3386         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
3387         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
3388         (WebKit::ViewSnapshotStore::recordSnapshot):
3389         (WebKit::ViewSnapshot::clearImage):
3390         (WebKit::ViewSnapshot::asLayerContents):
3391         (WebKit::createIOSurfaceFromImage): Deleted.
3392         (WebKit::compressImageAsJPEG): Deleted.
3393         (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
3394         (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
3395         Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
3396         Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
3397         Adopt WebCore::IOSurface::createFromImage to make that happen.
3398         Add a comment noting that if a snapshot comes back empty, we should throw it away completely.
3399
3400 2014-07-09  Anders Carlsson  <andersca@apple.com>
3401
3402         RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn
3403         https://bugs.webkit.org/show_bug.cgi?id=134772
3404
3405         Reviewed by Tim Horton.
3406
3407         * Shared/mac/RemoteLayerBackingStore.h:
3408         (WebKit::RemoteLayerBackingStore::Buffer::operator bool):
3409         * Shared/mac/RemoteLayerBackingStore.mm:
3410         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
3411
3412 2014-07-09  KwangHyuk Kim  <hyuki.kim@samsung.com>
3413
3414         [EFL] Fix crash caused by invalid cursor image.
3415         https://bugs.webkit.org/show_bug.cgi?id=134663
3416
3417         Reviewed by Gyuyoung Kim.
3418
3419         Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview.
3420
3421         * UIProcess/API/efl/EwkView.cpp:
3422         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
3423
3424 2014-07-08  Tim Horton  <timothy_horton@apple.com>
3425
3426         Remove WebBackForwardListItems when their owning page goes away
3427         https://bugs.webkit.org/show_bug.cgi?id=134709
3428         <rdar://problem/17584645>
3429
3430         Reviewed by Dan Bernstein.
3431
3432         * Shared/WebBackForwardListItem.cpp:
3433         (WebKit::WebBackForwardListItem::create):
3434         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
3435         * Shared/WebBackForwardListItem.h:
3436         (WebKit::WebBackForwardListItem::pageID):
3437         Add the associated PageID to the WebBackForwardListItem.
3438
3439         * UIProcess/WebBackForwardList.cpp:
3440         (WebKit::WebBackForwardList::restoreFromState):
3441         Push the current PageID onto the WebBackForwardListItem.
3442
3443         * UIProcess/WebProcessProxy.cpp:
3444         (WebKit::WebProcessProxy::removeWebPage):
3445         Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
3446         the page they are associated with is removed.
3447
3448         (WebKit::WebProcessProxy::addBackForwardItem):
3449         Push the PageID from the WebProcess onto the WebBackForwardListItem.
3450
3451         * UIProcess/WebProcessProxy.h:
3452         * UIProcess/WebProcessProxy.messages.in:
3453         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3454         (WebKit::idToHistoryItemMap):
3455         (WebKit::historyItemToIDMap):
3456         (WebKit::updateBackForwardItem):
3457         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
3458         (WebKit::WK2NotifyHistoryItemChanged):
3459         (WebKit::WebBackForwardListProxy::idForItem):
3460         (WebKit::WebBackForwardListProxy::addItem):
3461         (WebKit::WebBackForwardListProxy::goToItem):
3462         (WebKit::WebBackForwardListProxy::close):
3463         * WebProcess/WebPage/WebBackForwardListProxy.h:
3464         * WebProcess/WebPage/WebPage.cpp:
3465         (WebKit::WebPage::restoreSession):
3466         Keep track of the PageID that back-forward items were created by.
3467         Pass the PageID along when registering WebBackForwardListItems.
3468
3469 2014-07-08  Tim Horton  <timothy_horton@apple.com>
3470
3471         [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
3472         https://bugs.webkit.org/show_bug.cgi?id=134645
3473
3474         Reviewed by Dan Bernstein.
3475
3476         * UIProcess/API/Cocoa/WKPreferences.mm:
3477         (-[WKPreferences _compositingBordersVisible]):
3478         (-[WKPreferences _setCompositingBordersVisible:]):
3479         (-[WKPreferences _compositingRepaintCountersVisible]):
3480         (-[WKPreferences _setCompositingRepaintCountersVisible:]):
3481         (-[WKPreferences _tiledScrollingIndicatorVisible]):
3482         (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
3483         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3484         Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
3485
3486 2014-07-08  Tim Horton  <timothy_horton@apple.com>
3487
3488         WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
3489         https://bugs.webkit.org/show_bug.cgi?id=134711
3490
3491         Reviewed by Dan Bernstein.
3492
3493         * UIProcess/API/Cocoa/WKProcessPool.mm:
3494         (-[WKProcessPool _initWithConfiguration:]):
3495         Respect the maximumProcessCount.
3496         Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
3497
3498 2014-07-08  Adrian Perez de Castro  <aperez@igalia.com>
3499
3500         [GTK] Move user style sheet API out of WebKitWebViewGroup
3501         https://bugs.webkit.org/show_bug.cgi?id=134551
3502
3503         Reviewed by Carlos Garcia Campos.
3504
3505         * PlatformGTK.cmake: Include the new source files in the build.
3506         * UIProcess/API/C/gtk/WKView.cpp:
3507         (WKViewCreate):
3508         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
3509         * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
3510         (toUserContentInjectedFrames):
3511         (toUserStyleLevel):
3512         (toStringVector):
3513         (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
3514         (webkit_user_style_sheet_ref):
3515         (webkit_user_style_sheet_unref):
3516         (webkit_user_style_sheet_new):
3517         (webkitWebKitUserStyleSheetToUserStyleSheet):
3518         * UIProcess/API/gtk/WebKitUserContent.h: Added.
3519         * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
3520         (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
3521         (webkit_user_content_manager_class_init):
3522         (webkit_user_content_manager_new):
3523         (webkit_user_content_manager_add_style_sheet):
3524         (webkit_user_content_manager_remove_all_style_sheets):
3525         (webkitUserContentManagerGetUserContentControllerProxy):
3526         * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
3527         * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
3528         * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
3529         * UIProcess/API/gtk/WebKitWebContext.cpp:
3530         (webkitWebContextCreatePageForWebView): Add a new parameter to allow
3531         passing the WebKitUserContentManager that the web view will use.
3532         * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
3533         * UIProcess/API/gtk/WebKitWebView.cpp:
3534         (webkitWebViewConstructed): Added handling of the
3535         "user-content-manager" property on construction.
3536         (webkitWebViewSetProperty): Added support for the
3537         "user-content-manager" property.
3538         (webkitWebViewGetProperty): Added support for the
3539         "user-content-manager" property.
3540         (webkit_web_view_class_init): Added the "user-content-manager"
3541         property definition to the WebKitWebView class.
3542         (webkit_web_view_new_with_related_view): Made related views share
3543         the same WebKitUserContentManager used by the view they are
3544         related to.
3545         (webkit_web_view_new_with_user_content_manager): Added.
3546         (webkit_web_view_get_user_content_manager): Added.
3547         * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
3548         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3549         (webkitWebViewBaseCreate): Added a parameter to pass the user
3550         content manager.
3551         (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
3552         content manager.
3553         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
3554         * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
3555         to user style sheet support from WebKitWebViewGroup.
3556         (webkit_web_view_group_set_settings):
3557         (toAPIArray): Deleted.
3558         (webkit_web_view_group_add_user_style_sheet): Deleted.
3559         (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
3560         * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
3561         for user style sheet handling.
3562         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
3563         functions and types, and removed the methods which are no longer
3564         available in WebKitWebViewGroup.
3565         * UIProcess/API/gtk/webkit2.h: Add the new headers.
3566         * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
3567         methods to add and remove user style sheets, alike those used for
3568         user scripts.
3569         (WebKit::WebUserContentControllerProxy::addProcess):
3570         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
3571         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
3572         * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
3573         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3574         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3575         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
3576         * WebProcess/UserContent/WebUserContentController.cpp: Added methods
3577         to add and remove user style sheets, alike those used for user scripts.
3578         (WebKit::WebUserContentController::addUserStyleSheets):
3579         (WebKit::WebUserContentController::removeAllUserStyleSheets):
3580         * WebProcess/UserContent/WebUserContentController.h: Ditto.
3581         * WebProcess/UserContent/WebUserContentController.messages.in:
3582         Ditto.
3583
3584 2014-07-08  Zan Dobersek  <zdobersek@igalia.com>
3585
3586         [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
3587         https://bugs.webkit.org/show_bug.cgi?id=133871
3588
3589         Reviewed by Martin Robinson.
3590
3591         Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
3592         PLATFORM(X11) build guard. This is required to properly support building the GTK
3593         port only for the Wayland target.
3594
3595         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3596         (webkitWebViewBaseConstructed):
3597         (webkitWebViewRenderAcceleratedCompositingResults):
3598         (resizeWebKitWebViewBaseFromAllocation):
3599         (webkitWebViewBaseUpdatePreferences):
3600         (webkitWebViewBaseCreateWebPage):
3601
3602 2014-07-07  Tim Horton  <timothy_horton@apple.com>
3603
3604         Turn on accelerated drawing for WebKit2 by default
3605         https://bugs.webkit.org/show_bug.cgi?id=134708
3606         <rdar://problem/17584642>
3607
3608         Reviewed by Simon Fraser.
3609
3610         * Shared/WebPreferencesDefinitions.h:
3611         Make Mac match iOS, in that accelerated drawing is on by default.
3612
3613 2014-07-07  Timothy Horton  <timothy_horton@apple.com>
3614
3615         Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
3616         https://bugs.webkit.org/show_bug.cgi?id=134703
3617
3618         Reviewed by Simon Fraser.
3619
3620         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3621         (-[WKBrowsingContextController _remoteObjectRegistry]):
3622         Adoption is important!!
3623
3624 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
3625
3626         [UI-side compositing] Support reflections on custom layers like video
3627         https://bugs.webkit.org/show_bug.cgi?id=134701
3628
3629         Reviewed by Tim Horton.
3630         
3631         For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
3632         in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
3633         which does the right gyrations to get AVPlayerLayers cloned, then makes a
3634         new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
3635         its own context hosting ID, allowing the clone to show in the UI process.
3636         
3637         Attempt to do the same for WebGL, but turn it off because it breaks.
3638
3639         * Shared/mac/RemoteLayerBackingStore.mm:
3640         (WebKit::RemoteLayerBackingStore::drawInContext):
3641         * Shared/mac/RemoteLayerTreeTransaction.mm:
3642         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
3643         the hostingContextID. It will be 0 for most layers.
3644         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
3645         (WebKit::RemoteLayerTreeTransaction::description):
3646         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
3647         (WebKit::RemoteLayerTreeHost::createLayer):
3648         * UIProcess/mac/RemoteLayerTreeHost.mm:
3649         (WebKit::RemoteLayerTreeHost::createLayer):
3650         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3651         (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
3652         creates a PlatformCALayerRemoteCustom.
3653         (WebKit::PlatformCALayerRemote::clone): Factor some code.
3654         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
3655         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
3656         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3657         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
3658         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
3659         (WebKit::PlatformCALayerRemoteCustom::create):
3660         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
3661         (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the 
3662         correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
3663         around it.
3664         (WebKit::PlatformCALayerRemoteCustom::contents):
3665         (WebKit::PlatformCALayerRemoteCustom::setContents):
3666         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3667         (WebKit::RemoteLayerTreeContext::layerWasCreated):
3668         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
3669
3670 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
3671
3672         [UI-side compositing] Crash when starting a filter transition on a reflected layer
3673         https://bugs.webkit.org/show_bug.cgi?id=134694
3674
3675         Reviewed by Tim Horton.
3676         
3677         When cloned layers had animations, we would fire two animationDidStart callbacks,
3678         but the second would pass an empty animationKey string to the web process, resulting
3679         in a crash.
3680         
3681         Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
3682         since the clone would include addedAnimations, and then get the same animations
3683         added on top by the caller.
3684         
3685         Also protect against an empty animation key in the animationDidStart callback.
3686
3687         * UIProcess/mac/RemoteLayerTreeHost.mm:
3688         (WebKit::RemoteLayerTreeHost::animationDidStart):
3689         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3690         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
3691         (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
3692         them manually as PlatformCALayerMac does. Only copy the big things if they don't
3693         have their default values.
3694         (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
3695         for clone() to call.
3696
3697 2014-07-07  Tim Horton  <timothy_horton@apple.com>
3698
3699         Nearly everything in the UIProcess "leaks" when WKWebView is torn down
3700         https://bugs.webkit.org/show_bug.cgi?id=134699
3701         <rdar://problem/17581777>
3702
3703         Reviewed by Simon Fraser.
3704
3705         * UIProcess/API/Cocoa/WKWebView.mm:
3706         (-[WKWebView initWithFrame:configuration:]):
3707         Adoption is important!
3708
3709 2014-07-07  Enrica Casucci  <enrica@apple.com>
3710
3711         REGRESSION(iOS WK2): arrow keys movements don't work.
3712         https://bugs.webkit.org/show_bug.cgi?id=134561
3713         <rdar://problem/16827629>
3714
3715         Reviewed by Benjamin Poulain.
3716
3717         This change add the implementations for cursor movement selectors.
3718         It also provides a mechanism to ensure that every selection
3719         change in WebKit is reflected in UIKit so that it can update the 
3720         autocorrection data. This way we ensure that the autocorraction state
3721         is consistent even when selection changes are originated by JavaScript.
3722         WebPageProxy::editorStateChanged now notifies the page client when the
3723         selection is about to change as well as when it actually changed.
3724         
3725         * UIProcess/PageClient.h:
3726         * UIProcess/WebPageProxy.cpp:
3727         (WebKit::WebPageProxy::editorStateChanged):
3728         * UIProcess/WebPageProxy.h:
3729         * UIProcess/ios/PageClientImplIOS.h:
3730         * UIProcess/ios/PageClientImplIOS.mm:
3731         (WebKit::PageClientImpl::selectionWillChange):
3732         * UIProcess/ios/WKContentViewInteraction.h:
3733         * UIProcess/ios/WKContentViewInteraction.mm:
3734         (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
3735         textDidChange.
3736         (-[WKContentView paste:]):
3737         (-[WKContentView _moveUp:withHistory:]):
3738         (-[WKContentView _moveDown:withHistory:]):
3739         (-[WKContentView _moveLeft:withHistory:]):
3740         (-[WKContentView _moveRight:withHistory:]):
3741         (-[WKContentView _moveToStartOfWord:withHistory:]):
3742         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
3743         (-[WKContentView _moveToStartOfLine:withHistory:]):
3744         (-[WKContentView _moveToStartOfDocument:withHistory:]):
3745         (-[WKContentView _moveToEndOfWord:withHistory:]):
3746         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
3747         (-[WKContentView _moveToEndOfLine:withHistory:]):
3748         (-[WKContentView _moveToEndOfDocument:withHistory:]):
3749         (-[WKContentView _selectionWillChange]):
3750         (-[WKContentView _selectionChanged]):
3751         * UIProcess/ios/WebPageProxyIOS.mm:
3752         (WebKit::WebPageProxy::notifySelectionWillChange):
3753
3754 2014-07-07  Anders Carlsson  <andersca@apple.com>
3755
3756         Add SPI for saving and restoring a WKWebView's _WKSessionState
3757         https://bugs.webkit.org/show_bug.cgi?id=134693
3758
3759         Reviewed by Dan Bernstein.
3760
3761         * UIProcess/API/C/WKPage.cpp:
3762         (WKPageRestoreFromSessionState):
3763         * UIProcess/API/Cocoa/WKWebView.mm:
3764         (-[WKWebView _sessionState]):
3765         (-[WKWebView _restoreFromSessionStateData:]):
3766         (-[WKWebView _restoreFromSessionState:]):
3767         (-[WKWebView _restoreSessionState:andNavigate:]):
3768         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3769         * UIProcess/API/Cocoa/_WKSessionState.mm:
3770         (-[_WKSessionState _initWithSessionState:]):
3771         * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
3772         * UIProcess/WebPageProxy.cpp:
3773         (WebKit::WebPageProxy::restoreFromSessionState):
3774         * UIProcess/WebPageProxy.h:
3775
3776 2014-07-07  Anders Carlsson  <andersca@apple.com>
3777
3778         Add a stubbed out _WKSessionState class
3779         https://bugs.webkit.org/show_bug.cgi?id=134690
3780
3781         Reviewed by Geoffrey Garen.
3782
3783         * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
3784         * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
3785         (-[_WKSessionState initWithData:]):
3786         (-[_WKSessionState data]):
3787         * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
3788         * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
3789         * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
3790         (WebKit::encodeSessionState):
3791         (WebKit::decodeSessionState):
3792         * UIProcess/LegacySessionStateCoding.h:
3793         * WebKit2.xcodeproj/project.pbxproj:
3794
3795 2014-07-07  Anders Carlsson  <andersca@apple.com>
3796
3797         Some of the WKPreferences (API) property getters read like questions
3798         https://bugs.webkit.org/show_bug.cgi?id=134678
3799         <rdar://problem/17576847>
3800
3801         Reviewed by Dan Bernstein.
3802
3803         * UIProcess/API/Cocoa/WKPreferences.h:
3804         * UIProcess/API/Cocoa/WKPreferences.mm:
3805         (-[WKPreferences javaScriptIsEnabled]):
3806         (-[WKPreferences javaIsEnabled]):
3807         (-[WKPreferences plugInsAreEnabled]):
3808         (-[WKPreferences isJavaScriptEnabled]): Deleted.
3809         (-[WKPreferences isJavaEnabled]): Deleted.
3810         (-[WKPreferences arePlugInsEnabled]): Deleted.
3811
3812 2014-07-07  Brady Eidson  <beidson@apple.com>
3813
3814         ServicesOverlayController menus show up in the wrong place.
3815         <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
3816
3817         Reviewed by Tim Horton.
3818
3819         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3820         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
3821           the telephone number is in a subframe.
3822         (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
3823           coordinates, so convert it to window coordinates using the main frame’s FrameView.
3824
3825 2014-07-07  Dan Bernstein  <mitz@apple.com>
3826
3827         [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
3828         https://bugs.webkit.org/show_bug.cgi?id=134682
3829
3830         Reviewed by Tim Horton.
3831
3832         * UIProcess/Cocoa/NavigationState.mm:
3833         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
3834         assertion with a FIXME.
3835         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
3836         Ditto.
3837         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
3838         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
3839         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
3840         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
3841         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
3842
3843 2014-07-07  KwangHyuk Kim  <hyuki.kim@samsung.com>
3844
3845         [EFL] Fix cursor artifacts on naver map site.
3846         https://bugs.webkit.org/show_bug.cgi?id=134649
3847
3848         Reviewed by Gyuyoung Kim.
3849
3850         Old evas cursor and ecore x cursor are reset before new cursor is applied.
3851
3852         * UIProcess/API/efl/EwkView.cpp:
3853         (EwkView::updateCursor):
3854
3855 2014-07-06  Benjamin Poulain  <bpoulain@apple.com>
3856
3857         [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
3858         https://bugs.webkit.org/show_bug.cgi?id=134660
3859
3860         Reviewed by Darin Adler.
3861
3862         * UIProcess/ios/WKContentViewInteraction.mm:
3863         (-[WKContentView _cancelInteraction]):
3864         (-[WKContentView _finishInteraction]):
3865         (cancelPotentialTapIfNecessary):
3866         I messed that up in r170600. I only accounted for the web process being too fast.
3867
3868         If the web process is too slow, _cancelInteraction or _finishInteraction happen before
3869         _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
3870
3871 2014-07-06  Tim Horton  <timothy_horton@apple.com>
3872
3873         [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
3874         https://bugs.webkit.org/show_bug.cgi?id=134644
3875
3876         Reviewed by Darin Adler.
3877
3878         * UIProcess/DrawingAreaProxy.h:
3879         (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
3880         * UIProcess/WebPageProxy.cpp:
3881         (WebKit::WebPageProxy::preferencesDidChange):
3882         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3883         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3884         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3885         (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
3886         (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
3887         The indicator depends on the live layer tree commits coming in, including layer creation,
3888         so it can't be turned on after the root layer is created. Even a refresh is insufficient
3889         to get it working; the debug indicator really needs to exist from the first commit.
3890         So, don't even attempt to dynamically enable the indicator; create it at
3891         RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
3892
3893 2014-07-06  Yoav Weiss  <yoav@yoav.ws>
3894
3895         Turn on img@sizes compile flag
3896         https://bugs.webkit.org/show_bug.cgi?id=134634
3897
3898         Reviewed by Benjamin Poulain.
3899
3900         * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
3901
3902 2014-07-06  Brady Eidson  <beidson@apple.com>
3903
3904         Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
3905         https://bugs.webkit.org/show_bug.cgi?id=134666
3906
3907         Reviewed by Tim Horton.
3908
3909         * Shared/mac/SecItemRequestData.cpp:
3910         (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
3911         (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one. 
3912
3913         * UIProcess/mac/SecItemShimProxy.cpp:
3914         (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking 
3915           for a bug, and respond with an "invalid parameter" error.
3916
3917 2014-07-06  Antti Koivisto  <antti@apple.com>
3918
3919         Don't throttle layer flushes when the main resource is a GIF
3920         https://bugs.webkit.org/show_bug.cgi?id=134650
3921
3922         Reviewed by Simon Fraser.
3923
3924         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3925         (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
3926
3927 2014-07-04  Rohit Kumar  <kumar.rohit@samsung.com>
3928
3929         [EFL][WK2]Fix build break in EFL WK2
3930         https://bugs.webkit.org/show_bug.cgi?id=134629
3931
3932         Unreviewed build fix.
3933
3934         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
3935         (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
3936         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
3937
3938 2014-07-04  Dan Bernstein  <mitz@apple.com>
3939
3940         [Cocoa] -[WKWebView _reload] is unused
3941         https://bugs.webkit.org/show_bug.cgi?id=134638
3942
3943         Reviewed by Sam Weinig.
3944
3945         * UIProcess/API/Cocoa/WKWebView.mm:
3946         (-[WKWebView _reload]): Deleted.
3947         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3948
3949 2014-07-04  Tim Horton  <timothy_horton@apple.com>
3950
3951         [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
3952         https://bugs.webkit.org/show_bug.cgi?id=134624
3953         <rdar://problem/17222041>
3954
3955         Reviewed by Sam Weinig.
3956
3957         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3958         (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
3959         Perform the same coordinate conversion we use for mouse events, which happens
3960         to take the top content inset into account.
3961
3962 2014-07-04  Philippe Normand  <pnormand@igalia.com>
3963
3964         Unreviewed, GTK WK2 build fix after r170787.
3965
3966         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3967         (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
3968         * WebProcess/WebPage/DrawingAreaImpl.h:
3969
3970 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
3971
3972         Unreviewed. Reverting the bad changes introduced in r170795.
3973
3974         * Platform/IPC/ArgumentDecoder.cpp:
3975         (IPC::ArgumentDecoder::decode): Deleted.
3976         * Platform/IPC/ArgumentDecoder.h:
3977         * Platform/IPC/ArgumentEncoder.cpp:
3978         (IPC::ArgumentEncoder::encode): Deleted.
3979         * Platform/IPC/ArgumentEncoder.h:
3980
3981 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
3982
3983         Unreviewed. Fixing the build for ports on 64-bit Linux.
3984
3985         Add IPC encoding and decoding overloads for the long long type, needed
3986         after r170755 started encoding and decoding long long variables in
3987         FormDataElement.
3988
3989         * Platform/IPC/ArgumentDecoder.cpp:
3990         (IPC::ArgumentDecoder::decode):
3991         * Platform/IPC/ArgumentDecoder.h:
3992         * Platform/IPC/ArgumentEncoder.cpp:
3993         (IPC::ArgumentEncoder::encode):
3994         * Platform/IPC/ArgumentEncoder.h:
3995
3996 2014-07-04  Timothy Horton  <timothy_horton@apple.com>
3997
3998         [iOS][WK2] Black web view after un-suspending process
3999         https://bugs.webkit.org/show_bug.cgi?id=134623
4000         <rdar://problem/17513223>
4001
4002         Reviewed by Simon Fraser.
4003
4004         * UIProcess/WebPageProxy.cpp:
4005         (WebKit::WebPageProxy::viewStateDidChange):
4006         Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
4007         to force us to wait for a synchronous reply from the Web process after performing a view state change.
4008
4009         (WebKit::WebPageProxy::dispatchViewStateChange):
4010         Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
4011         Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
4012
4013         * UIProcess/WebPageProxy.h:
4014         * UIProcess/ios/WKContentView.mm:
4015         (-[WKContentView _applicationWillEnterForeground:]):
4016         As previously mentioned, wait for a reply when foregrounding.
4017
4018         * WebProcess/WebPage/DrawingArea.h:
4019         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
4020         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
4021         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
4022         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
4023         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
4024         Make sure to schedule a commit immediately if the UI process is waiting for a reply.
4025         Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
4026         layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
4027         all throttling in this case.
4028
4029         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
4030         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
4031         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):