[WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-07-08  Tim Horton  <timothy_horton@apple.com>
2
3         [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
4         https://bugs.webkit.org/show_bug.cgi?id=134645
5
6         Reviewed by Dan Bernstein.
7
8         * UIProcess/API/Cocoa/WKPreferences.mm:
9         (-[WKPreferences _compositingBordersVisible]):
10         (-[WKPreferences _setCompositingBordersVisible:]):
11         (-[WKPreferences _compositingRepaintCountersVisible]):
12         (-[WKPreferences _setCompositingRepaintCountersVisible:]):
13         (-[WKPreferences _tiledScrollingIndicatorVisible]):
14         (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
15         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
16         Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
17
18 2014-07-08  Tim Horton  <timothy_horton@apple.com>
19
20         WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
21         https://bugs.webkit.org/show_bug.cgi?id=134711
22
23         Reviewed by Dan Bernstein.
24
25         * UIProcess/API/Cocoa/WKProcessPool.mm:
26         (-[WKProcessPool _initWithConfiguration:]):
27         Respect the maximumProcessCount.
28         Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
29
30 2014-07-08  Adrian Perez de Castro  <aperez@igalia.com>
31
32         [GTK] Move user style sheet API out of WebKitWebViewGroup
33         https://bugs.webkit.org/show_bug.cgi?id=134551
34
35         Reviewed by Carlos Garcia Campos.
36
37         * PlatformGTK.cmake: Include the new source files in the build.
38         * UIProcess/API/C/gtk/WKView.cpp:
39         (WKViewCreate):
40         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
41         * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
42         (toUserContentInjectedFrames):
43         (toUserStyleLevel):
44         (toStringVector):
45         (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
46         (webkit_user_style_sheet_ref):
47         (webkit_user_style_sheet_unref):
48         (webkit_user_style_sheet_new):
49         (webkitWebKitUserStyleSheetToUserStyleSheet):
50         * UIProcess/API/gtk/WebKitUserContent.h: Added.
51         * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
52         (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
53         (webkit_user_content_manager_class_init):
54         (webkit_user_content_manager_new):
55         (webkit_user_content_manager_add_style_sheet):
56         (webkit_user_content_manager_remove_all_style_sheets):
57         (webkitUserContentManagerGetUserContentControllerProxy):
58         * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
59         * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
60         * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
61         * UIProcess/API/gtk/WebKitWebContext.cpp:
62         (webkitWebContextCreatePageForWebView): Add a new parameter to allow
63         passing the WebKitUserContentManager that the web view will use.
64         * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
65         * UIProcess/API/gtk/WebKitWebView.cpp:
66         (webkitWebViewConstructed): Added handling of the
67         "user-content-manager" property on construction.
68         (webkitWebViewSetProperty): Added support for the
69         "user-content-manager" property.
70         (webkitWebViewGetProperty): Added support for the
71         "user-content-manager" property.
72         (webkit_web_view_class_init): Added the "user-content-manager"
73         property definition to the WebKitWebView class.
74         (webkit_web_view_new_with_related_view): Made related views share
75         the same WebKitUserContentManager used by the view they are
76         related to.
77         (webkit_web_view_new_with_user_content_manager): Added.
78         (webkit_web_view_get_user_content_manager): Added.
79         * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
80         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
81         (webkitWebViewBaseCreate): Added a parameter to pass the user
82         content manager.
83         (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
84         content manager.
85         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
86         * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
87         to user style sheet support from WebKitWebViewGroup.
88         (webkit_web_view_group_set_settings):
89         (toAPIArray): Deleted.
90         (webkit_web_view_group_add_user_style_sheet): Deleted.
91         (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
92         * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
93         for user style sheet handling.
94         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
95         functions and types, and removed the methods which are no longer
96         available in WebKitWebViewGroup.
97         * UIProcess/API/gtk/webkit2.h: Add the new headers.
98         * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
99         methods to add and remove user style sheets, alike those used for
100         user scripts.
101         (WebKit::WebUserContentControllerProxy::addProcess):
102         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
103         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
104         * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
105         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
106         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
107         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
108         * WebProcess/UserContent/WebUserContentController.cpp: Added methods
109         to add and remove user style sheets, alike those used for user scripts.
110         (WebKit::WebUserContentController::addUserStyleSheets):
111         (WebKit::WebUserContentController::removeAllUserStyleSheets):
112         * WebProcess/UserContent/WebUserContentController.h: Ditto.
113         * WebProcess/UserContent/WebUserContentController.messages.in:
114         Ditto.
115
116 2014-07-08  Zan Dobersek  <zdobersek@igalia.com>
117
118         [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
119         https://bugs.webkit.org/show_bug.cgi?id=133871
120
121         Reviewed by Martin Robinson.
122
123         Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
124         PLATFORM(X11) build guard. This is required to properly support building the GTK
125         port only for the Wayland target.
126
127         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
128         (webkitWebViewBaseConstructed):
129         (webkitWebViewRenderAcceleratedCompositingResults):
130         (resizeWebKitWebViewBaseFromAllocation):
131         (webkitWebViewBaseUpdatePreferences):
132         (webkitWebViewBaseCreateWebPage):
133
134 2014-07-07  Tim Horton  <timothy_horton@apple.com>
135
136         Turn on accelerated drawing for WebKit2 by default
137         https://bugs.webkit.org/show_bug.cgi?id=134708
138         <rdar://problem/17584642>
139
140         Reviewed by Simon Fraser.
141
142         * Shared/WebPreferencesDefinitions.h:
143         Make Mac match iOS, in that accelerated drawing is on by default.
144
145 2014-07-07  Timothy Horton  <timothy_horton@apple.com>
146
147         Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
148         https://bugs.webkit.org/show_bug.cgi?id=134703
149
150         Reviewed by Simon Fraser.
151
152         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
153         (-[WKBrowsingContextController _remoteObjectRegistry]):
154         Adoption is important!!
155
156 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
157
158         [UI-side compositing] Support reflections on custom layers like video
159         https://bugs.webkit.org/show_bug.cgi?id=134701
160
161         Reviewed by Tim Horton.
162         
163         For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
164         in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
165         which does the right gyrations to get AVPlayerLayers cloned, then makes a
166         new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
167         its own context hosting ID, allowing the clone to show in the UI process.
168         
169         Attempt to do the same for WebGL, but turn it off because it breaks.
170
171         * Shared/mac/RemoteLayerBackingStore.mm:
172         (WebKit::RemoteLayerBackingStore::drawInContext):
173         * Shared/mac/RemoteLayerTreeTransaction.mm:
174         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
175         the hostingContextID. It will be 0 for most layers.
176         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
177         (WebKit::RemoteLayerTreeTransaction::description):
178         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
179         (WebKit::RemoteLayerTreeHost::createLayer):
180         * UIProcess/mac/RemoteLayerTreeHost.mm:
181         (WebKit::RemoteLayerTreeHost::createLayer):
182         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
183         (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
184         creates a PlatformCALayerRemoteCustom.
185         (WebKit::PlatformCALayerRemote::clone): Factor some code.
186         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
187         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
188         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
189         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
190         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
191         (WebKit::PlatformCALayerRemoteCustom::create):
192         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
193         (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the 
194         correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
195         around it.
196         (WebKit::PlatformCALayerRemoteCustom::contents):
197         (WebKit::PlatformCALayerRemoteCustom::setContents):
198         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
199         (WebKit::RemoteLayerTreeContext::layerWasCreated):
200         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
201
202 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
203
204         [UI-side compositing] Crash when starting a filter transition on a reflected layer
205         https://bugs.webkit.org/show_bug.cgi?id=134694
206
207         Reviewed by Tim Horton.
208         
209         When cloned layers had animations, we would fire two animationDidStart callbacks,
210         but the second would pass an empty animationKey string to the web process, resulting
211         in a crash.
212         
213         Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
214         since the clone would include addedAnimations, and then get the same animations
215         added on top by the caller.
216         
217         Also protect against an empty animation key in the animationDidStart callback.
218
219         * UIProcess/mac/RemoteLayerTreeHost.mm:
220         (WebKit::RemoteLayerTreeHost::animationDidStart):
221         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
222         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
223         (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
224         them manually as PlatformCALayerMac does. Only copy the big things if they don't
225         have their default values.
226         (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
227         for clone() to call.
228
229 2014-07-07  Tim Horton  <timothy_horton@apple.com>
230
231         Nearly everything in the UIProcess "leaks" when WKWebView is torn down
232         https://bugs.webkit.org/show_bug.cgi?id=134699
233         <rdar://problem/17581777>
234
235         Reviewed by Simon Fraser.
236
237         * UIProcess/API/Cocoa/WKWebView.mm:
238         (-[WKWebView initWithFrame:configuration:]):
239         Adoption is important!
240
241 2014-07-07  Enrica Casucci  <enrica@apple.com>
242
243         REGRESSION(iOS WK2): arrow keys movements don't work.
244         https://bugs.webkit.org/show_bug.cgi?id=134561
245         <rdar://problem/16827629>
246
247         Reviewed by Benjamin Poulain.
248
249         This change add the implementations for cursor movement selectors.
250         It also provides a mechanism to ensure that every selection
251         change in WebKit is reflected in UIKit so that it can update the 
252         autocorrection data. This way we ensure that the autocorraction state
253         is consistent even when selection changes are originated by JavaScript.
254         WebPageProxy::editorStateChanged now notifies the page client when the
255         selection is about to change as well as when it actually changed.
256         
257         * UIProcess/PageClient.h:
258         * UIProcess/WebPageProxy.cpp:
259         (WebKit::WebPageProxy::editorStateChanged):
260         * UIProcess/WebPageProxy.h:
261         * UIProcess/ios/PageClientImplIOS.h:
262         * UIProcess/ios/PageClientImplIOS.mm:
263         (WebKit::PageClientImpl::selectionWillChange):
264         * UIProcess/ios/WKContentViewInteraction.h:
265         * UIProcess/ios/WKContentViewInteraction.mm:
266         (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
267         textDidChange.
268         (-[WKContentView paste:]):
269         (-[WKContentView _moveUp:withHistory:]):
270         (-[WKContentView _moveDown:withHistory:]):
271         (-[WKContentView _moveLeft:withHistory:]):
272         (-[WKContentView _moveRight:withHistory:]):
273         (-[WKContentView _moveToStartOfWord:withHistory:]):
274         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
275         (-[WKContentView _moveToStartOfLine:withHistory:]):
276         (-[WKContentView _moveToStartOfDocument:withHistory:]):
277         (-[WKContentView _moveToEndOfWord:withHistory:]):
278         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
279         (-[WKContentView _moveToEndOfLine:withHistory:]):
280         (-[WKContentView _moveToEndOfDocument:withHistory:]):
281         (-[WKContentView _selectionWillChange]):
282         (-[WKContentView _selectionChanged]):
283         * UIProcess/ios/WebPageProxyIOS.mm:
284         (WebKit::WebPageProxy::notifySelectionWillChange):
285
286 2014-07-07  Anders Carlsson  <andersca@apple.com>
287
288         Add SPI for saving and restoring a WKWebView's _WKSessionState
289         https://bugs.webkit.org/show_bug.cgi?id=134693
290
291         Reviewed by Dan Bernstein.
292
293         * UIProcess/API/C/WKPage.cpp:
294         (WKPageRestoreFromSessionState):
295         * UIProcess/API/Cocoa/WKWebView.mm:
296         (-[WKWebView _sessionState]):
297         (-[WKWebView _restoreFromSessionStateData:]):
298         (-[WKWebView _restoreFromSessionState:]):
299         (-[WKWebView _restoreSessionState:andNavigate:]):
300         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
301         * UIProcess/API/Cocoa/_WKSessionState.mm:
302         (-[_WKSessionState _initWithSessionState:]):
303         * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
304         * UIProcess/WebPageProxy.cpp:
305         (WebKit::WebPageProxy::restoreFromSessionState):
306         * UIProcess/WebPageProxy.h:
307
308 2014-07-07  Anders Carlsson  <andersca@apple.com>
309
310         Add a stubbed out _WKSessionState class
311         https://bugs.webkit.org/show_bug.cgi?id=134690
312
313         Reviewed by Geoffrey Garen.
314
315         * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
316         * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
317         (-[_WKSessionState initWithData:]):
318         (-[_WKSessionState data]):
319         * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
320         * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
321         * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
322         (WebKit::encodeSessionState):
323         (WebKit::decodeSessionState):
324         * UIProcess/LegacySessionStateCoding.h:
325         * WebKit2.xcodeproj/project.pbxproj:
326
327 2014-07-07  Anders Carlsson  <andersca@apple.com>
328
329         Some of the WKPreferences (API) property getters read like questions
330         https://bugs.webkit.org/show_bug.cgi?id=134678
331         <rdar://problem/17576847>
332
333         Reviewed by Dan Bernstein.
334
335         * UIProcess/API/Cocoa/WKPreferences.h:
336         * UIProcess/API/Cocoa/WKPreferences.mm:
337         (-[WKPreferences javaScriptIsEnabled]):
338         (-[WKPreferences javaIsEnabled]):
339         (-[WKPreferences plugInsAreEnabled]):
340         (-[WKPreferences isJavaScriptEnabled]): Deleted.
341         (-[WKPreferences isJavaEnabled]): Deleted.
342         (-[WKPreferences arePlugInsEnabled]): Deleted.
343
344 2014-07-07  Brady Eidson  <beidson@apple.com>
345
346         ServicesOverlayController menus show up in the wrong place.
347         <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
348
349         Reviewed by Tim Horton.
350
351         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
352         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
353           the telephone number is in a subframe.
354         (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
355           coordinates, so convert it to window coordinates using the main frame’s FrameView.
356
357 2014-07-07  Dan Bernstein  <mitz@apple.com>
358
359         [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
360         https://bugs.webkit.org/show_bug.cgi?id=134682
361
362         Reviewed by Tim Horton.
363
364         * UIProcess/Cocoa/NavigationState.mm:
365         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
366         assertion with a FIXME.
367         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
368         Ditto.
369         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
370         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
371         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
372         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
373         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
374
375 2014-07-07  KwangHyuk Kim  <hyuki.kim@samsung.com>
376
377         [EFL] Fix cursor artifacts on naver map site.
378         https://bugs.webkit.org/show_bug.cgi?id=134649
379
380         Reviewed by Gyuyoung Kim.
381
382         Old evas cursor and ecore x cursor are reset before new cursor is applied.
383
384         * UIProcess/API/efl/EwkView.cpp:
385         (EwkView::updateCursor):
386
387 2014-07-06  Benjamin Poulain  <bpoulain@apple.com>
388
389         [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
390         https://bugs.webkit.org/show_bug.cgi?id=134660
391
392         Reviewed by Darin Adler.
393
394         * UIProcess/ios/WKContentViewInteraction.mm:
395         (-[WKContentView _cancelInteraction]):
396         (-[WKContentView _finishInteraction]):
397         (cancelPotentialTapIfNecessary):
398         I messed that up in r170600. I only accounted for the web process being too fast.
399
400         If the web process is too slow, _cancelInteraction or _finishInteraction happen before
401         _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
402
403 2014-07-06  Tim Horton  <timothy_horton@apple.com>
404
405         [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
406         https://bugs.webkit.org/show_bug.cgi?id=134644
407
408         Reviewed by Darin Adler.
409
410         * UIProcess/DrawingAreaProxy.h:
411         (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
412         * UIProcess/WebPageProxy.cpp:
413         (WebKit::WebPageProxy::preferencesDidChange):
414         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
415         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
416         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
417         (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
418         (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
419         The indicator depends on the live layer tree commits coming in, including layer creation,
420         so it can't be turned on after the root layer is created. Even a refresh is insufficient
421         to get it working; the debug indicator really needs to exist from the first commit.
422         So, don't even attempt to dynamically enable the indicator; create it at
423         RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
424
425 2014-07-06  Yoav Weiss  <yoav@yoav.ws>
426
427         Turn on img@sizes compile flag
428         https://bugs.webkit.org/show_bug.cgi?id=134634
429
430         Reviewed by Benjamin Poulain.
431
432         * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
433
434 2014-07-06  Brady Eidson  <beidson@apple.com>
435
436         Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
437         https://bugs.webkit.org/show_bug.cgi?id=134666
438
439         Reviewed by Tim Horton.
440
441         * Shared/mac/SecItemRequestData.cpp:
442         (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
443         (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one. 
444
445         * UIProcess/mac/SecItemShimProxy.cpp:
446         (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking 
447           for a bug, and respond with an "invalid parameter" error.
448
449 2014-07-06  Antti Koivisto  <antti@apple.com>
450
451         Don't throttle layer flushes when the main resource is a GIF
452         https://bugs.webkit.org/show_bug.cgi?id=134650
453
454         Reviewed by Simon Fraser.
455
456         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
457         (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
458
459 2014-07-04  Rohit Kumar  <kumar.rohit@samsung.com>
460
461         [EFL][WK2]Fix build break in EFL WK2
462         https://bugs.webkit.org/show_bug.cgi?id=134629
463
464         Unreviewed build fix.
465
466         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
467         (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
468         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
469
470 2014-07-04  Dan Bernstein  <mitz@apple.com>
471
472         [Cocoa] -[WKWebView _reload] is unused
473         https://bugs.webkit.org/show_bug.cgi?id=134638
474
475         Reviewed by Sam Weinig.
476
477         * UIProcess/API/Cocoa/WKWebView.mm:
478         (-[WKWebView _reload]): Deleted.
479         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
480
481 2014-07-04  Tim Horton  <timothy_horton@apple.com>
482
483         [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
484         https://bugs.webkit.org/show_bug.cgi?id=134624
485         <rdar://problem/17222041>
486
487         Reviewed by Sam Weinig.
488
489         * WebProcess/Plugins/PDF/PDFPlugin.mm:
490         (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
491         Perform the same coordinate conversion we use for mouse events, which happens
492         to take the top content inset into account.
493
494 2014-07-04  Philippe Normand  <pnormand@igalia.com>
495
496         Unreviewed, GTK WK2 build fix after r170787.
497
498         * WebProcess/WebPage/DrawingAreaImpl.cpp:
499         (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
500         * WebProcess/WebPage/DrawingAreaImpl.h:
501
502 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
503
504         Unreviewed. Reverting the bad changes introduced in r170795.
505
506         * Platform/IPC/ArgumentDecoder.cpp:
507         (IPC::ArgumentDecoder::decode): Deleted.
508         * Platform/IPC/ArgumentDecoder.h:
509         * Platform/IPC/ArgumentEncoder.cpp:
510         (IPC::ArgumentEncoder::encode): Deleted.
511         * Platform/IPC/ArgumentEncoder.h:
512
513 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
514
515         Unreviewed. Fixing the build for ports on 64-bit Linux.
516
517         Add IPC encoding and decoding overloads for the long long type, needed
518         after r170755 started encoding and decoding long long variables in
519         FormDataElement.
520
521         * Platform/IPC/ArgumentDecoder.cpp:
522         (IPC::ArgumentDecoder::decode):
523         * Platform/IPC/ArgumentDecoder.h:
524         * Platform/IPC/ArgumentEncoder.cpp:
525         (IPC::ArgumentEncoder::encode):
526         * Platform/IPC/ArgumentEncoder.h:
527
528 2014-07-04  Timothy Horton  <timothy_horton@apple.com>
529
530         [iOS][WK2] Black web view after un-suspending process
531         https://bugs.webkit.org/show_bug.cgi?id=134623
532         <rdar://problem/17513223>
533
534         Reviewed by Simon Fraser.
535
536         * UIProcess/WebPageProxy.cpp:
537         (WebKit::WebPageProxy::viewStateDidChange):
538         Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
539         to force us to wait for a synchronous reply from the Web process after performing a view state change.
540
541         (WebKit::WebPageProxy::dispatchViewStateChange):
542         Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
543         Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
544
545         * UIProcess/WebPageProxy.h:
546         * UIProcess/ios/WKContentView.mm:
547         (-[WKContentView _applicationWillEnterForeground:]):
548         As previously mentioned, wait for a reply when foregrounding.
549
550         * WebProcess/WebPage/DrawingArea.h:
551         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
552         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
553         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
554         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
555         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
556         Make sure to schedule a commit immediately if the UI process is waiting for a reply.
557         Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
558         layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
559         all throttling in this case.
560
561         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
562         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
563         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
564
565 2014-07-03  Gavin Barraclough  <baraclough@apple.com>
566
567         Should not take background task assertion for NetworkProcess
568         https://bugs.webkit.org/show_bug.cgi?id=134622
569
570         Reviewed by Tim Horton.
571
572         When the WebContent wants to complete a task in the background we take a process assertion on the child process, and also need to prevent the UI process from suspending.
573         However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.
574
575         * Platform/IPC/mac/ConnectionMac.mm:
576         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
577             - ProcessAssertion -> ProcessAndUIAssertion
578         * UIProcess/ProcessAssertion.cpp:
579         (WebKit::ProcessAssertion::ProcessAssertion):
580             - assignment -> initializer list.
581         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
582         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
583         (WebKit::ProcessAndUIAssertion::setState):
584             - added no-op implementation.
585         (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
586         * UIProcess/ProcessAssertion.h:
587             - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
588         * UIProcess/ProcessThrottler.cpp:
589         (WebKit::ProcessThrottler::didConnnectToProcess):
590             - ProcessAssertion -> ProcessAndUIAssertion
591         * UIProcess/ProcessThrottler.h:
592             - ProcessAssertion -> ProcessAndUIAssertion
593         * UIProcess/ios/ProcessAssertionIOS.mm:
594         (WebKit::ProcessAssertion::ProcessAssertion):
595             - assignment -> initializer list.
596             - moved code to manage WKProcessAssertionBackgroundTaskManager
597         (WebKit::ProcessAssertion::setState):
598             - moved code to manage WKProcessAssertionBackgroundTaskManager
599         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
600         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
601         (WebKit::ProcessAndUIAssertion::setState):
602             - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
603         (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
604             - delete - moved code to manage WKProcessAssertionBackgroundTaskManager
605
606 2014-07-03  Simon Fraser  <simon.fraser@apple.com>
607
608         Clean up Brady's mess on iOS.
609
610         * Platform/mac/StringUtilities.h:
611         * Platform/mac/StringUtilities.mm:
612
613 2014-07-03  Simon Fraser  <simon.fraser@apple.com>
614
615         [iOS WK2] Compositing layers draw outside page bounds
616         https://bugs.webkit.org/show_bug.cgi?id=134619
617         <rdar://problem/16953222>
618
619         Reviewed by Benjamin Poulain.
620         
621         With the new rubber-banding behavior, we no longer have the root content layer clipping all
622         the web layers, but this resulted in web layers which were moved outside the viewport by CSS
623         transforms not being clipped.
624         
625         Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
626         normally has the same bounds as the content, but when rubber-banding or pinching,
627         it takes the union of the content bounds and the rect used for fixed positioning.
628         To make scrolling work as expected in this scenario, when it has non-zero offset, it
629         has to compensate by setting its bounds origin.
630
631         The bounds of the clipping layer are updated on scrolling/zooming, and when the
632         layer commit tells us that the content size changed.
633
634         * UIProcess/API/Cocoa/WKWebView.mm:
635         (-[WKWebView _updateScrollViewBackground]):
636         * UIProcess/ios/WKContentView.mm:
637         (-[WKContentView initWithFrame:context:configuration:webView:]):
638         (-[WKContentView updateFixedClippingView:]):
639         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
640         (-[WKContentView _didCommitLayerTree:]):
641
642 2014-07-03  Brady Eidson  <beidson@apple.com>
643
644         When showing the selection menu, include menu options for all selected phone numbers.
645         <rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613
646
647         Reviewed by Tim Horton.
648
649         Move some telephone number menu logic from WebKitSystemInterface here.
650         Also provide utility to get just the one menu item relevant to a telephone number.
651         * Platform/mac/MenuUtilities.h:
652         * Platform/mac/MenuUtilities.mm: Added.
653         (WebKit::menuItemForTelephoneNumber):
654         (WebKit::menuItemsForTelephoneNumber):
655
656         * Platform/mac/StringUtilities.h:
657         * Platform/mac/StringUtilities.mm:
658         (WebKit::formattedPhoneNumberString): Return a localized formatted phone number.
659
660         Add a member to track the selected phone numbers:
661         * Shared/ContextMenuContextData.h:
662         (WebKit::ContextMenuContextData::ContextMenuContextData):
663         (WebKit::ContextMenuContextData::selectedTelephoneNumbers):
664
665         * UIProcess/WebPageProxy.h:
666         * UIProcess/WebPageProxy.messages.in:
667
668         * UIProcess/mac/WebContextMenuProxyMac.mm:
669         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
670           in the selection.
671
672         Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
673         * UIProcess/mac/WebPageProxyMac.mm:
674         (WebKit::WebPageProxy::showTelephoneNumberMenu):
675         (WebKit::WebPageProxy::showSelectionServiceMenu):
676
677         * WebKit2.xcodeproj/project.pbxproj:
678
679         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
680         (WebKit::ServicesOverlayController::drawSelectionHighlight):
681         (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.
682
683         * WebProcess/WebPage/WebPage.h:
684         * WebProcess/WebPage/mac/WebPageMac.mm:
685         (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.
686
687 2014-07-03  Gavin Barraclough  <baraclough@apple.com>
688
689         WKProcessAssertionBackgroundTaskManager should clear member if task expires
690         https://bugs.webkit.org/show_bug.cgi?id=134618
691
692         Reviewed by Anders Carlson.
693
694         Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.
695
696         * UIProcess/ios/ProcessAssertionIOS.mm:
697         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
698             - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;
699
700 2014-07-03  Joseph Pecoraro  <pecoraro@apple.com>
701
702         Unreviewed iOS build fix for r170774.
703
704         Remove some unnecessary WTF::moves on iOS:
705         error: static_assert failed "T is not an lvalue reference; move() is unnecessary."
706
707         * WebProcess/WebPage/EventDispatcher.cpp:
708         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
709         (WebKit::EventDispatcher::touchEvent):
710
711 2014-07-03  Anders Carlsson  <andersca@apple.com>
712
713         Try to fix the iOS build.
714
715         Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
716
717         * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
718         (WebKit::autosaveKey):
719         (WebKit::WebPageProxy::saveRecentSearches):
720         (WebKit::WebPageProxy::loadRecentSearches):
721         * UIProcess/mac/WebPageProxyMac.mm:
722         * WebKit2.xcodeproj/project.pbxproj:
723
724 2014-07-03  Dan Bernstein  <mitz@apple.com>
725
726         <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
727         https://bugs.webkit.org/show_bug.cgi?id=134615
728
729         Reviewed by Anders Carlsson.
730
731         Added a _networkRequestsInProgress boolean property to WKWebView.
732
733         * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
734         PageLoadStateObserver member functions.
735
736         * UIProcess/API/Cocoa/WKWebView.mm:
737         (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
738         PageLoadState.
739         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
740
741         * UIProcess/Cocoa/NavigationState.h:
742         * UIProcess/Cocoa/NavigationState.mm:
743         (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
744         PageLoadState::Observer member function by sending the appropriate KVO change message to the
745         WKWebView.
746         (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
747
748         * UIProcess/PageLoadState.cpp:
749         (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
750         and call the observers if needed.
751         (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
752         (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
753         uncommitted state.
754         * UIProcess/PageLoadState.h:
755         (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
756         (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
757
758         * UIProcess/WebPageProxy.cpp:
759         (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
760         * UIProcess/WebPageProxy.h:
761         * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
762
763         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
764         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
765         WebPage::addResourceRequest.
766         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
767         WebPage::removeResourceRequest.
768         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
769
770         * WebProcess/WebPage/WebPage.cpp:
771         (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
772         add its identifier to the set of network resourece request identifiers. If the set was
773         previously empty, send the WebPageProxy a message.
774         (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
775         becomes empty, send the WebPageProxy a message.
776         * WebProcess/WebPage/WebPage.h:
777
778 2014-07-03  Anders Carlsson  <andersca@apple.com>
779
780         Remove two unused functions
781         https://bugs.webkit.org/show_bug.cgi?id=134614
782
783         Reviewed by Andreas Kling.
784
785         * UIProcess/LegacySessionStateCoding.h:
786         * UIProcess/mac/LegacySessionStateCoding.cpp:
787         (WebKit::encodeLegacySessionHistoryEntryData): Deleted.
788         (WebKit::decodeLegacySessionHistoryEntryData): Deleted.
789
790 2014-07-03  Daniel Bates  <dabates@apple.com>
791
792         Add WTF::move()
793         https://bugs.webkit.org/show_bug.cgi?id=134500
794
795         Rubber-stamped by Anders Carlsson.
796
797         Substitute WTF::move() for std::move().
798
799         * DatabaseProcess/DatabaseProcess.cpp:
800         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
801         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
802         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
803         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
804         * Platform/IPC/ArgumentCoders.h:
805         * Platform/IPC/ArgumentDecoder.cpp:
806         * Platform/IPC/Connection.cpp:
807         * Platform/IPC/Connection.h:
808         [...]
809
810 2014-07-03  Benjamin Poulain  <bpoulain@apple.com>
811
812         [iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target
813         https://bugs.webkit.org/show_bug.cgi?id=134582
814
815         Reviewed by Tim Horton.
816
817         This patch fixes two small bugs that were causing "jumpiness" on animated resize:
818         1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content.
819         2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more
820            than it should be.
821
822         The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale"
823         was almost never true.
824
825         The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was
826         impossible to determine accurately how much content is in the view.
827         The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed.
828
829         Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView
830         on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite
831         different from the received targetScale.
832
833         Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors.
834
835         For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely
836         valid to have an exposed rect outside the page bounds, that area is just under the obscured insets.
837
838         On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding
839         position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on
840         both rects.
841
842         * WebProcess/WebPage/ios/WebPageIOS.mm:
843         (WebKit::scaleAfterViewportWidthChange):
844         (WebKit::WebPage::dynamicViewportSizeUpdate):
845         (WebKit::WebPage::updateVisibleContentRects):
846
847 2014-07-03  Anders Carlsson  <andersca@apple.com>
848
849         Fix build.
850
851         * UIProcess/mac/WebPageProxyMac.mm:
852
853 2014-07-03  Anders Carlsson  <andersca@apple.com>
854
855         Get rid of WebPageProxyCF.cpp
856         https://bugs.webkit.org/show_bug.cgi?id=134609
857
858         Reviewed by Dan Bernstein.
859
860         * UIProcess/cf/WebPageProxyCF.cpp: Removed.
861         * UIProcess/mac/WebPageProxyMac.mm:
862         (WebKit::autosaveKey):
863         (WebKit::WebPageProxy::saveRecentSearches):
864         (WebKit::WebPageProxy::loadRecentSearches):
865         * WebKit2.xcodeproj/project.pbxproj:
866
867 2014-07-03  Tim Horton  <timothy_horton@apple.com>
868
869         [WK2] Revise the flat find indicator secondary highlight shadows
870         https://bugs.webkit.org/show_bug.cgi?id=134607
871         <rdar://problem/17554828>
872
873         Reviewed by Brady Eidson.
874
875         * WebProcess/WebPage/FindController.cpp:
876         (WebKit::FindController::drawRect):
877         Bring back the secondary highlight shadow, with new constants.
878
879 2014-07-03  Tim Horton  <timothy_horton@apple.com>
880
881         [iOS][WK2] Sometimes the swipe snapshot stays up too long
882         https://bugs.webkit.org/show_bug.cgi?id=134506
883         <rdar://problem/17496803>
884
885         Reviewed by Simon Fraser.
886
887         Implement a transaction callback mechanism.
888         The UI process can register a callback at any point, generally immediately after sending a message to the Web process.
889         It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction
890         (scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed.
891         This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered.
892         For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks.
893         
894         Make use of this to remove the ViewGestureControllerIOS snapshots at the right time.
895
896         * Shared/mac/RemoteLayerTreeTransaction.h:
897         (WebKit::RemoteLayerTreeTransaction::callbackIDs):
898         (WebKit::RemoteLayerTreeTransaction::setCallbackIDs):
899         * Shared/mac/RemoteLayerTreeTransaction.mm:
900         (WebKit::RemoteLayerTreeTransaction::encode):
901         (WebKit::RemoteLayerTreeTransaction::decode):
902         Add a vector of callback IDs to the transaction; encode and decode as appropriate.
903
904         * UIProcess/DrawingAreaProxy.h:
905         (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
906         (WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted.
907         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
908         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
909         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
910         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
911         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
912         Add dispatchAfterEnsuringDrawing, which takes a function.
913         When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message.
914         Perform callbacks listed in the incoming transaction's vector of callback IDs.
915
916         * WebProcess/WebPage/DrawingArea.h:
917         (WebKit::DrawingArea::addTransactionCallbackID):
918         * WebProcess/WebPage/DrawingArea.messages.in:
919         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
920         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
921         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
922         (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
923         Keep track of the pending callback IDs on the drawing area, and move them into the transaction.
924         We schedule a flush when installing a transaction callback on the premise that
925         sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred
926         and been committed by the time the Web process receives AddTransactionCallbackID, so we need
927         to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op.
928
929         * UIProcess/ios/ViewGestureControllerIOS.mm:
930         (allViewGestureControllers):
931         (WebKit::ViewGestureController::ViewGestureController):
932         (WebKit::ViewGestureController::~ViewGestureController):
933         (WebKit::ViewGestureController::endSwipeGesture):
934         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
935         (WebKit::ViewGestureController::setRenderTreeSize):
936         * UIProcess/mac/ViewGestureController.h:
937         Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to
938         our ViewGestureController from the callback.
939
940         When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit,
941         so that the commit (which is about to occur immediately after the callback returns) which calls
942         setRenderTreeSize will (perhaps) remove the snapshot.
943
944         If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed.
945
946 2014-07-03  Brady Eidson  <beidson@apple.com>
947
948         Followup to "rects sent to ServicesOverlayController are wrong"
949         https://bugs.webkit.org/show_bug.cgi?id=134568
950
951         Rubberstamped by Tim Horton.
952
953         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
954         (WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the
955           proposed rect intersects the dirty rect. We always need to include all rects that form
956           the selection when creating the DDHighlight.
957
958 2014-07-03  Tim Horton  <timothy_horton@apple.com>
959
960         [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
961         https://bugs.webkit.org/show_bug.cgi?id=134586
962
963         Reviewed by Benjamin Poulain.
964
965         * UIProcess/DrawingAreaProxy.h:
966         (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
967         (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
968         (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
969         * UIProcess/WebPageProxy.cpp:
970         (WebKit::WebPageProxy::preferencesDidChange):
971         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
972         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
973         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
974         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
975         (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
976         (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
977         Check the debug indicator pref at construction time, and update the state when it changes.
978         Checking it every commit was surprisingly expensive.
979
980 2014-07-03  Antti Koivisto  <antti@apple.com>
981
982         Ensure frame creation messages get through to UI process
983         https://bugs.webkit.org/show_bug.cgi?id=134591
984         <rdar://problem/16918218>
985
986         Reviewed by Anders Carlsson.
987
988         If we are middle of handling a synchronous message from UI process a frame creation message back gets delayed.
989         The subsequent synchronous DecidePolicyForNavigationAction message expects that the frame creation
990         message has arrived first and fails.
991
992         * WebProcess/WebPage/WebFrame.cpp:
993         (WebKit::WebFrame::createWithCoreMainFrame):
994         (WebKit::WebFrame::createSubframe):
995         
996             Send messages with DispatchMessageEvenWhenWaitingForSyncReply so they always go through in order.
997
998 2014-07-03  Anders Carlsson  <andersca@apple.com>
999
1000         Get rid of DecoderAdapter and EncoderAdapter
1001         https://bugs.webkit.org/show_bug.cgi?id=134598
1002
1003         Reviewed by Andreas Kling.
1004
1005         * CMakeLists.txt:
1006         * WebKit2.xcodeproj/project.pbxproj:
1007         * WebProcess/WebPage/DecoderAdapter.cpp: Removed.
1008         * WebProcess/WebPage/DecoderAdapter.h: Removed.
1009         * WebProcess/WebPage/EncoderAdapter.cpp: Removed.
1010         * WebProcess/WebPage/EncoderAdapter.h: Removed.
1011         * WebProcess/WebPage/WebPage.cpp:
1012
1013 2014-07-02  Anders Carlsson  <andersca@apple.com>
1014
1015         Stop using EncoderAdapter/DecoderAdapter for FormData
1016         https://bugs.webkit.org/show_bug.cgi?id=134571
1017
1018         Reviewed by Andreas Kling.
1019
1020         * Shared/Network/NetworkResourceLoadParameters.cpp:
1021         (WebKit::NetworkResourceLoadParameters::encode):
1022         (WebKit::NetworkResourceLoadParameters::decode):
1023
1024 2014-07-03  Brady Eidson  <beidson@apple.com>
1025
1026         Selection rects sent to ServicesOverlayController are wrong.
1027         <rdar://problem/16727796> and https://bugs.webkit.org/show_bug.cgi?id=134568
1028
1029         Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa).
1030
1031         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1032         (WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController.
1033         * WebProcess/WebCoreSupport/WebEditorClient.h:
1034
1035         * WebProcess/WebPage/ServicesOverlayController.h:
1036         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1037         (WebKit::expandForGap):
1038         (WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects.
1039         (WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list.
1040         (WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this.
1041         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this.
1042         (WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore.
1043
1044 2014-07-03  Brady Eidson  <beidson@apple.com>
1045
1046         Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread
1047         <rdar://problem/17437687> and https://bugs.webkit.org/show_bug.cgi?id=134517
1048
1049         Reviewed by Eric Carlson.
1050
1051         * UIProcess/WebContext.cpp:
1052         (WebKit::WebContext::~WebContext): Instead of directly deref’ing the WebIconDatabase, ask it to
1053           deref itself when appropriate.
1054
1055         * UIProcess/WebIconDatabase.cpp:
1056         (WebKit::WebIconDatabase::WebIconDatabase):
1057         (WebKit::WebIconDatabase::didClose): If this WebIconDatabase is supposed to deref itself when
1058           appropriate, do so now.
1059         (WebKit::WebIconDatabase::derefWhenAppropriate): If the WebCore::IconDatabase is still open then
1060           defer this deref.
1061         * UIProcess/WebIconDatabase.h:
1062
1063 2014-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1064
1065         REGRESSION(r170676): [GTK] UI process crashes when the Web Process crashes
1066         https://bugs.webkit.org/show_bug.cgi?id=134541
1067
1068         Reviewed by Gyuyoung Kim.
1069
1070         It happens when attaching a new web process, because it tries to
1071         encode a null SessionState.
1072
1073         * UIProcess/LegacySessionStateCodingNone.cpp:
1074         (WebKit::encodeLegacySessionState): Return an empty API::Data
1075         object instead of nullptr.
1076         (WebKit::encodeLegacySessionHistoryEntryData): Ditto.
1077
1078 2014-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1079
1080         REGRESSION(r170743): [GTK] [EFL] Build broken.
1081         https://bugs.webkit.org/show_bug.cgi?id=134585
1082
1083         Reviewed by Philippe Normand.
1084
1085         Add ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guards where needed.
1086
1087         * WebProcess/Plugins/PluginView.cpp:
1088         (WebKit::PluginView::initializePlugin):
1089         * WebProcess/WebPage/WebPage.cpp:
1090         (WebKit::WebPage::createPlugin):
1091
1092 2014-07-02  Benjamin Poulain  <benjamin@webkit.org>
1093
1094         [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
1095         https://bugs.webkit.org/show_bug.cgi?id=134570
1096
1097         Reviewed by Enrica Casucci.
1098
1099         Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
1100         forcing a relayout and can cause synchronous operations.
1101
1102         We should not force the caller of the API to maintain their own state tracking, we should do that for them.
1103
1104         With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.
1105
1106         * UIProcess/API/Cocoa/WKWebView.mm:
1107         (activeMinimumLayoutSize):
1108         (activeMinimumLayoutSizeForMinimalUI):
1109         (activeMaximumUnobscuredSize):
1110         (activeOrientation):
1111         This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
1112         to avoid having it in two places.
1113
1114         (-[WKWebView _didRelaunchProcess]):
1115
1116         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1117         The updates now goes like this:
1118         1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
1119         2) Get all the original values before calling the update block.
1120         3) Call the update block.
1121         4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
1122             We also need to update the visible content rect because the update block may have changed something unrelated
1123             to the view size (scale, scroll position, etc).
1124         4b) If we really need to resize, proceed as usual.
1125
1126         (-[WKWebView _endAnimatedResize]):
1127         With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
1128         bail out early if that flag isn't set.
1129
1130         The remaining code is unchanged, it is just not indented due to the removal of the if() branch.
1131
1132 2014-07-02  Roger Fong  <roger_fong@apple.com>
1133
1134         Improve handling of primary offscreen plugins.
1135         https://bugs.webkit.org/show_bug.cgi?id=134528.
1136         <rdar://problem/17471864>
1137
1138         Reviewed by Dean Jackson.
1139
1140         * WebProcess/Plugins/PluginView.cpp: 
1141         Determine whether or not the plugin starts offscreen when the plugin is initialized.
1142         (WebKit::PluginView::initializePlugin):
1143         (WebKit::PluginView::pluginSnapshotTimerFired):
1144         * WebProcess/WebPage/WebPage.cpp:
1145         (WebKit::WebPage::createPlugin):
1146         Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.
1147
1148 2014-07-02  Enrica Casucci  <enrica@apple.com>
1149
1150         REGRESSION(WK2): Undo does not work in text fields in Safari.
1151         https://bugs.webkit.org/show_bug.cgi?id=134572
1152         <rdar://problem/17542238>
1153
1154         Reviewed by Benjamin Poulain.
1155         
1156         This patch adds for iOS the same implementation we have already for OS X.
1157
1158         * UIProcess/ios/PageClientImplIOS.h:
1159         * UIProcess/ios/PageClientImplIOS.mm:
1160         (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
1161         (-[WKEditCommandObjC command]):
1162         (-[WKEditorUndoTargetObjC undoEditing:]):
1163         (-[WKEditorUndoTargetObjC redoEditing:]):
1164         (WebKit::PageClientImpl::PageClientImpl):
1165         (WebKit::PageClientImpl::registerEditCommand):
1166         (WebKit::PageClientImpl::clearAllEditCommands):
1167         (WebKit::PageClientImpl::canUndoRedo):
1168         (WebKit::PageClientImpl::executeUndoRedo):
1169
1170 2014-07-02  Gavin Barraclough  <baraclough@apple.com>
1171
1172         ProcessAssertion should also prevent UIApp suspension
1173         https://bugs.webkit.org/show_bug.cgi?id=134563
1174
1175         Reviewed by Dan Bernstein.
1176
1177         If the application suspends then the child processes will, too.
1178         Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable
1179         while waiting for background tasks to complete.
1180
1181         * UIProcess/ProcessAssertion.cpp:
1182         (WebKit::ProcessAssertion::~ProcessAssertion):
1183             - Added destructor.
1184         * UIProcess/ProcessAssertion.h:
1185             - Added destructor.
1186         * UIProcess/ios/ProcessAssertionIOS.mm:
1187         (+[WKProcessAssertionBackgroundTaskManager shared]):
1188             - singleton WKProcessAssertionBackgroundTaskManager.
1189         (-[WKProcessAssertionBackgroundTaskManager init]):
1190         (-[WKProcessAssertionBackgroundTaskManager dealloc]):
1191             - register/remove notification handlers.
1192         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
1193             - if we need to be runnable make sure we're holding a BackgroundTask, if not release it.
1194         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]):
1195             - detect when the app enters/leaves foreground; calls to _updateBackgroundTask.
1196         (-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]):
1197         (-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]):
1198             - interface to update the count; calls to _updateBackgroundTask.
1199         (WebKit::ProcessAssertion::ProcessAssertion):
1200         (WebKit::ProcessAssertion::~ProcessAssertion):
1201             - count ProcessAssertions in and out of existance.
1202         (WebKit::ProcessAssertion::setState):
1203             - count when the state changes.
1204
1205 2014-07-01  Mark Rowe  <mrowe@apple.com>
1206
1207         <https://webkit.org/b/134522> Remove duplication in code that prepares the user agent string on Mac and iOS
1208
1209         Reviewed by Simon Fraser.
1210
1211         * UIProcess/ios/WebPageProxyIOS.mm:
1212         (WebKit::webKitBundleVersionString): Return the entire CFBundleVersion now that WebCore handles formatting it.
1213         (WebKit::WebPageProxy::standardUserAgent):
1214         * UIProcess/mac/WebPageProxyMac.mm:
1215         (WebKit::webKitBundleVersionString): Ditto.
1216         (WebKit::WebPageProxy::standardUserAgent):
1217
1218 2014-06-28  Oliver Hunt  <oliver@apple.com>
1219
1220        Restrict network process sandbox
1221        https://bugs.webkit.org/show_bug.cgi?id=134360
1222
1223        Reviewed by Sam Weinig.
1224
1225        Add more restrictions to the network process sandbox.
1226
1227        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1228        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1229          Always use the cache directory provided in the initialization parameters,
1230          and make sure we consume the cookie directory extension.
1231        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1232          Make the sandbox profile much more restrictive.
1233        * Shared/Network/NetworkProcessCreationParameters.cpp:
1234        (WebKit::NetworkProcessCreationParameters::encode):
1235        (WebKit::NetworkProcessCreationParameters::decode):
1236        * Shared/Network/NetworkProcessCreationParameters.h:
1237          The network process now requires an extension to access
1238          its cookie storage.
1239        * Shared/mac/SandboxUtilities.cpp:
1240        (WebKit::pathForProcessContainer):
1241        * Shared/mac/SandboxUtilities.h:
1242          We need to be able to get hold of our container so
1243          that we can get the correct cookie storage directory.
1244        * UIProcess/WebContext.cpp:
1245        (WebKit::WebContext::ensureNetworkProcess):
1246          We have to pass in the an extension for the cookie storage directory when
1247        initalising the network process
1248        * UIProcess/mac/WebContextMac.mm:
1249        (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1250          Make sure we provide the correct location on IOS
1251        * WebProcess/cocoa/WebProcessCocoa.mm:
1252        (WebKit::WebProcess::platformInitializeWebProcess):
1253          Consume the cookie storage extension
1254
1255 2014-07-02  Csaba Osztrogonác  <ossy@webkit.org>
1256
1257         URTBF after r170725.
1258
1259         * CMakeLists.txt: Removed Shared/LegacySessionState.cpp.
1260
1261 2014-07-02  Csaba Osztrogonác  <ossy@webkit.org>
1262
1263         URTBF after r170719 for !CF platforms.
1264
1265         * UIProcess/WebPageProxy.cpp:
1266         (WebKit::WebPageProxy::sessionStateData): Deleted.
1267         (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
1268
1269 2014-07-02  Mark Rowe  <mrowe@apple.com>
1270
1271         <https://webkit.org/b/134521> iOS should use shared code to determine the system marketing version
1272
1273         Reviewed by Simon Fraser.
1274
1275         * Shared/ios/ChildProcessIOS.mm: Update #import.
1276         * Shared/mac/ChildProcessMac.mm: Ditto.
1277
1278 2014-07-02  Anders Carlsson  <andersca@apple.com>
1279
1280         Rip out more dead code
1281         https://bugs.webkit.org/show_bug.cgi?id=134562
1282
1283         Reviewed by Andreas Kling.
1284
1285         * Shared/LegacySessionState.cpp: Removed.
1286         * Shared/LegacySessionState.h: Removed.
1287         * Shared/WebBackForwardListItem.cpp:
1288         (WebKit::WebBackForwardListItem::WebBackForwardListItem): Deleted.
1289         (WebKit::WebBackForwardListItem::backForwardData): Deleted.
1290         (WebKit::WebBackForwardListItem::setBackForwardData): Deleted.
1291         (WebKit::WebBackForwardListItem::encode): Deleted.
1292         (WebKit::WebBackForwardListItem::decode): Deleted.
1293         * Shared/WebBackForwardListItem.h:
1294         (WebKit::WebBackForwardListItem::create): Deleted.
1295         (WebKit::WebBackForwardListItem::setOriginalURL): Deleted.
1296         (WebKit::WebBackForwardListItem::setURL): Deleted.
1297         (WebKit::WebBackForwardListItem::setTitle): Deleted.
1298         * UIProcess/WebPageProxy.cpp:
1299         * WebKit2.xcodeproj/project.pbxproj:
1300         * WebProcess/WebPage/WebPage.cpp:
1301
1302 2014-07-02  Anders Carlsson  <andersca@apple.com>
1303
1304         RestoreSession should take a vector of BackForwardListItemStates
1305         https://bugs.webkit.org/show_bug.cgi?id=134558
1306
1307         Reviewed by Tim Horton.
1308
1309         * Scripts/webkit2/messages.py:
1310         (struct_or_class):
1311         (headers_for_type):
1312         * Shared/WebPageCreationParameters.cpp:
1313         (WebKit::WebPageCreationParameters::encode):
1314         (WebKit::WebPageCreationParameters::decode):
1315         * Shared/WebPageCreationParameters.h:
1316         * UIProcess/WebBackForwardList.cpp:
1317         (WebKit::WebBackForwardList::itemStates):
1318         * UIProcess/WebBackForwardList.h:
1319         * UIProcess/WebPageProxy.cpp:
1320         (WebKit::WebPageProxy::restoreFromSessionState):
1321         (WebKit::WebPageProxy::creationParameters):
1322         * WebProcess/WebPage/WebPage.cpp:
1323         (WebKit::WebPage::WebPage):
1324         (WebKit::WebPage::restoreSession):
1325         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): Deleted.
1326         * WebProcess/WebPage/WebPage.h:
1327         * WebProcess/WebPage/WebPage.messages.in:
1328
1329 2014-07-02  Anders Carlsson  <andersca@apple.com>
1330
1331         Store the back forward list item id inside BackForwardListItemState
1332         https://bugs.webkit.org/show_bug.cgi?id=134557
1333
1334         Reviewed by Tim Horton.
1335
1336         * Shared/SessionState.cpp:
1337         (WebKit::BackForwardListItemState::encode):
1338         (WebKit::BackForwardListItemState::decode):
1339         * Shared/SessionState.h:
1340         * Shared/WebBackForwardListItem.cpp:
1341         (WebKit::WebBackForwardListItem::create):
1342         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1343         (WebKit::WebBackForwardListItem::encode):
1344         * Shared/WebBackForwardListItem.h:
1345         (WebKit::WebBackForwardListItem::itemID):
1346         * UIProcess/WebBackForwardList.cpp:
1347         (WebKit::WebBackForwardList::restoreFromState):
1348         * UIProcess/WebProcessProxy.cpp:
1349         (WebKit::WebProcessProxy::addBackForwardItem):
1350
1351 2014-07-02  Manuel Rego Casasnovas  <rego@igalia.com>
1352
1353         Unreviewed. EFL and GTK build fix after r170716.
1354
1355         * UIProcess/LegacySessionStateCodingNone.cpp:
1356         (WebKit::decodeLegacySessionState): Update method signature.
1357
1358 2014-07-02  Anders Carlsson  <andersca@apple.com>
1359
1360         Begin ripping out the old session state code
1361         https://bugs.webkit.org/show_bug.cgi?id=134556
1362
1363         Reviewed by Andreas Kling.
1364
1365         * UIProcess/WebBackForwardList.h:
1366         * UIProcess/WebPageProxy.h:
1367         * UIProcess/cf/WebBackForwardListCF.cpp: Removed.
1368         * UIProcess/cf/WebPageProxyCF.cpp:
1369         (WebKit::WebPageProxy::sessionStateData): Deleted.
1370         (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
1371         * WebKit2.xcodeproj/project.pbxproj:
1372
1373 2014-07-02  Anders Carlsson  <andersca@apple.com>
1374
1375         Use legacy state coding directly in WKWebView
1376         https://bugs.webkit.org/show_bug.cgi?id=134553
1377
1378         Reviewed by Dan Bernstein.
1379
1380         * UIProcess/API/C/WKPage.cpp:
1381         (WKPageRestoreFromSessionState):
1382         * UIProcess/API/C/WKSessionStateRef.cpp:
1383         (WKSessionStateCreateFromData):
1384         * UIProcess/API/Cocoa/WKWebView.mm:
1385         (-[WKWebView _sessionStateData]):
1386         (-[WKWebView _sessionState]):
1387         (-[WKWebView _restoreFromSessionStateData:]):
1388         (-[WKWebView _restoreFromSessionState:]):
1389         (releaseNSData): Deleted.
1390         * UIProcess/LegacySessionStateCoding.h:
1391         * UIProcess/WebPageProxy.cpp:
1392         (WebKit::WebPageProxy::restoreFromSessionState):
1393         (WebKit::WebPageProxy::restoreFromState): Deleted.
1394         * UIProcess/WebPageProxy.h:
1395         * UIProcess/mac/LegacySessionStateCoding.cpp:
1396         (WebKit::decodeLegacySessionState):
1397
1398 2014-07-02  Anders Carlsson  <andersca@apple.com>
1399
1400         Add -[WKWebView _sessionStateData] and -[WKWebView _restoreFromSessionStateData:]
1401         https://bugs.webkit.org/show_bug.cgi?id=134549
1402
1403         Reviewed by Dan Bernstein.
1404
1405         * UIProcess/API/Cocoa/WKWebView.mm:
1406         (-[WKWebView _sessionState]):
1407         (-[WKWebView _sessionStateData]):
1408         (-[WKWebView _restoreFromSessionState:]):
1409         (-[WKWebView _restoreFromSessionStateData:]):
1410         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1411
1412 2014-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1413
1414         [GTK] WebKitVersion.h should be shared between UI and Web Process APIs
1415         https://bugs.webkit.org/show_bug.cgi?id=134538
1416
1417         Reviewed by Martin Robinson.
1418
1419         To be able to check current version from web extensions too.
1420
1421         * UIProcess/API/gtk/WebKitVersion.h.in: Allow to include WebKitVersion.h also from webkit-web-extension.h.
1422         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: Include WebKitVersion.h.
1423
1424 2014-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1425
1426         [GTK] WebKitWebView::create should receive information about the navigation action
1427         https://bugs.webkit.org/show_bug.cgi?id=133680
1428
1429         Reviewed by Martin Robinson.
1430
1431         Add WebKitNavigationAction boxed type representing a navigation
1432         action to be passed as parameter of WebKitWebView::create
1433         signal. In the future it could be also for the
1434         WebKitNavigationPolicyDecision class. The class contains
1435         information about a navigation action like the navigation type,
1436         the request, the mouse button and key modifiers and whether it was
1437         started by a user gesture. This information is needed to be able
1438         to implement a proper popup blocker. Since all that information is
1439         not provided by the C API, we have switched the UI client to use a
1440         custom client derived from API::UIClient. This also avoids a lot
1441         of toAPI -> toImpl unneeded conversions.
1442
1443         * PlatformGTK.cmake: Add new files to compilation.
1444         * UIProcess/API/gtk/WebKitHitTestResult.cpp:
1445         (webkitHitTestResultCreate): Use a WebHitTestResult::Data const
1446         reference instead of a pointer to a WebHitTestResult.
1447         (webkitHitTestResultCompare): Ditto.
1448         * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
1449         * UIProcess/API/gtk/WebKitNavigationAction.cpp: Added.
1450         (webkitNavigationActionCreate): Create a WebKitNavigationAction
1451         for the given ResourceRequest and NavigationActionData.
1452         (webkit_navigation_action_copy):
1453         (webkit_navigation_action_free):
1454         (webkit_navigation_action_get_navigation_type):
1455         (webkit_navigation_action_get_mouse_button):
1456         (webkit_navigation_action_get_modifiers):
1457         (webkit_navigation_action_get_request):
1458         (webkit_navigation_action_is_user_gesture):
1459         * UIProcess/API/gtk/WebKitNavigationAction.h: Added.
1460         * UIProcess/API/gtk/WebKitNavigationActionPrivate.h: Added.
1461         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
1462         * UIProcess/API/gtk/WebKitPrivate.cpp:
1463         (toGdkModifiers):
1464         (toWebKitNavigationType):
1465         (toWebKitMouseButton):
1466         * UIProcess/API/gtk/WebKitPrivate.h:
1467         * UIProcess/API/gtk/WebKitUIClient.cpp:
1468         (UIClient::UIClient): Implement the UIClient using a custom class.
1469         (attachUIClientToView): Set the UIClient directly to the WebPageProxy.
1470         (createNewPage): Deleted.
1471         (showPage): Deleted.
1472         (closePage): Deleted.
1473         (runJavaScriptAlert): Deleted.
1474         (runJavaScriptConfirm): Deleted.
1475         (runJavaScriptPrompt): Deleted.
1476         (toolbarsAreVisible): Deleted.
1477         (setToolbarsAreVisible): Deleted.
1478         (menuBarIsVisible): Deleted.
1479         (setMenuBarIsVisible): Deleted.
1480         (statusBarIsVisible): Deleted.
1481         (setStatusBarIsVisible): Deleted.
1482         (isResizable): Deleted.
1483         (setIsResizable): Deleted.
1484         (getWindowFrame): Deleted.
1485         (setWindowFrame): Deleted.
1486         (mouseDidMoveOverElement): Deleted.
1487         (printFrame): Deleted.
1488         (runOpenPanel): Deleted.
1489         (decidePolicyForGeolocationPermissionRequest): Deleted.
1490         (runModal): Deleted.
1491         * UIProcess/API/gtk/WebKitWebView.cpp:
1492         (webkitWebViewCreate): Add WebKitNavigationAction parameter.
1493         (webkit_web_view_class_init): Add WebKitNavigationAction paramter
1494         to CREATE signal.
1495         (webkitWebViewCreateNewPage): Add WebKitNavigationAction parameter
1496         and pass it to the signal callbacks.
1497         (webkitWebViewMouseTargetChanged): Use a WebHitTestResult::Data
1498         const reference.
1499         (webkitWebViewPopulateContextMenu): Ditto.
1500         * UIProcess/API/gtk/WebKitWebView.h:
1501         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1502         * UIProcess/API/gtk/WebKitWindowProperties.cpp:
1503         (webkitWindowPropertiesUpdateFromWebWindowFeatures): Use a
1504         WebCore::WindowFeatures const reference.
1505         * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
1506         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
1507         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
1508         * UIProcess/API/gtk/webkit2.h: Include WebKitNavigationAction.h.
1509
1510 2014-07-01  KwangHyuk Kim  <hyuki.kim@samsung.com>
1511
1512         [EFL] Fix occurrence of two cursors on WK2 EFL.
1513         https://bugs.webkit.org/show_bug.cgi?id=134436
1514
1515         Reviewed by Anders Carlsson.
1516
1517         ecore_x_window_cursor is released when ecore_evas_object_cursor should be shown in order to avoid occurrence of two cursors.
1518
1519         * UIProcess/API/efl/EwkView.cpp:
1520         (EwkView::updateCursor):
1521
1522 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1523
1524         Fix build break on EFL and GTK ports since r170683
1525         https://bugs.webkit.org/show_bug.cgi?id=134536
1526
1527         Unreviewed, build fix.
1528
1529         * CMakeLists.txt:
1530
1531 2014-07-01  Dean Jackson  <dino@apple.com>
1532
1533         Make LogsPageMessagesToSystemConsoleEnabled a global debug preference
1534         https://bugs.webkit.org/show_bug.cgi?id=134534
1535
1536         Reviewed by Joseph Pecoraro.
1537
1538         * Shared/WebPreferencesDefinitions.h:
1539
1540 2014-07-01  Tim Horton  <timothy_horton@apple.com>
1541
1542         Handle invalid data more gracefully.
1543
1544         Reviewed by Anders Carlsson.
1545
1546         * UIProcess/mac/LegacySessionStateCoding.cpp:
1547         (WebKit::decodeFormData):
1548         (WebKit::decodeBackForwardTreeNode):
1549
1550 2014-07-01  Mark Rowe  <mrowe@apple.com>
1551
1552         Add a missing return statement in WKPageCopySessionState.
1553
1554         Reviewed by Anders Carlsson.
1555
1556         * UIProcess/API/C/WKPage.cpp:
1557         (WKPageCopySessionState):
1558
1559 2014-07-01  Anders Carlsson  <andersca@apple.com>
1560
1561         Don't encode/decode the snapshot UUID
1562         https://bugs.webkit.org/show_bug.cgi?id=134532
1563
1564         Reviewed by Sam Weinig.
1565
1566         * UIProcess/mac/LegacySessionStateCoding.cpp:
1567         (WebKit::encodeSessionHistory):
1568         (WebKit::decodeSessionHistoryEntry):
1569
1570 2014-07-01  Commit Queue  <commit-queue@webkit.org>
1571
1572         Unreviewed, rolling out r170608.
1573         https://bugs.webkit.org/show_bug.cgi?id=134533
1574
1575         Safari keeps crashing on device due to sandbox violation.
1576         (Requested by enrica on #webkit).
1577
1578         Reverted changeset:
1579
1580         "Restrict network process sandbox"
1581         https://bugs.webkit.org/show_bug.cgi?id=134360
1582         http://trac.webkit.org/changeset/170608
1583
1584 2014-07-01  Pratik Solanki  <psolanki@apple.com>
1585
1586         Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled
1587         https://bugs.webkit.org/show_bug.cgi?id=134454
1588         <rdar://problem/17510980>
1589
1590         Reviewed by Andreas Kling.
1591
1592         Use new helper methods to serialize/deserialize CFURLRequestRef directly so we can avoid
1593         creating NSURLRequest.
1594
1595         * Shared/mac/WebCoreArgumentCodersMac.mm:
1596         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1597         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1598
1599 2014-07-01  Benjamin Poulain  <benjamin@webkit.org>
1600
1601         [iOS][WK2] Fix a race between the short tap and long tap highlight
1602         https://bugs.webkit.org/show_bug.cgi?id=134530
1603
1604         Reviewed by Enrica Casucci.
1605
1606         There was a potential race of event that can theoretically cause WKContentViewInteraction
1607         to call [WKContentView _showTapHighlight] after all interactions have been cancelled.
1608
1609         The race would be like this:
1610         1) On a short tap, _singleTapRecognized: is called, a tap highlight ID is defined and
1611            _potentialTapInProgress is set to YES.
1612         2) For some reason, the gesture is cancelled. The method _singleTapDidReset is called, 
1613            setting _potentialTapInProgress but leaving the tap highlight ID as valid.
1614         3) The UIProcess receives the tap highlight information from the WebProcess, _didGetTapHighlightForRequest:
1615            has a valid ID, _potentialTapInProgress is false -> the highlight is shown right away as if a long tap
1616            was in progress.
1617
1618         The missing piece that causes this is _singleTapDidReset: must also invalidate the tap highlight ID. This is done
1619         in the new static function cancelPotentialTapIfNecessary().
1620
1621         Just invalidating the ID would create another race:
1622         1) Short tap gesture recognizer starts.
1623         2) The long press recognizer starts before (1) is commited.
1624         3) The long press recognizers sets up its own tap highlight ID.
1625         4) The short tap gesture recognizer resets, erasing the tap highlight ID defined in (3).
1626
1627         To avoid this, the long press gesture recognizers immediately cancels any potential tap in progress.
1628         If _singleTapDidReset: is called before (3), this does nothing. If the reset is called after (3),
1629         _singleTapDidReset does nothing.
1630
1631         * UIProcess/ios/WKContentViewInteraction.mm:
1632         (-[WKContentView _highlightLongPressRecognized:]):
1633         (cancelPotentialTapIfNecessary):
1634         (-[WKContentView _singleTapDidReset:]):
1635
1636 2014-07-01  Anders Carlsson  <andersca@apple.com>
1637
1638         Add ABI hacks to allow WKPageRef to use WKSessionStateRef
1639         https://bugs.webkit.org/show_bug.cgi?id=134529
1640
1641         Reviewed by Sam Weinig.
1642
1643         * UIProcess/API/APISessionState.h:
1644         Add a sessionState() getter.
1645         
1646         * UIProcess/API/C/WKPage.cpp:
1647         (WKPageCopySessionState):
1648         Add a hack where we return a WKSessionStateRef if the least significant bit of the context pointer
1649         is 1, and a WKDataRef otherwise.
1650
1651         (WKPageRestoreFromSessionState):
1652         Handle both WKDataRef and WKSessionStateref.
1653
1654         * UIProcess/API/C/WKPage.h:
1655         Use WKTypeRefs for state saving and restoration.
1656
1657         * UIProcess/API/C/WKSessionStateRef.cpp:
1658         (WKSessionStateCopyData):
1659         Add helper function.
1660
1661 2014-07-01  Anders Carlsson  <andersca@apple.com>
1662
1663         WKPageRestoreFromSessionState should use the new session state restore code path
1664         https://bugs.webkit.org/show_bug.cgi?id=134526
1665
1666         Reviewed by Tim Horton.
1667
1668         * UIProcess/API/C/WKPage.cpp:
1669         (WKPageRestoreFromSessionState):
1670         Use the new code path.
1671
1672         * UIProcess/WebPageProxy.cpp:
1673         (WebKit::WebPageProxy::restoreFromState):
1674         Only restore the back-forward state if we have a back-forward list.
1675
1676         * UIProcess/mac/LegacySessionStateCoding.cpp:
1677         (WebKit::encodeSessionHistory):
1678         Save the original URL string as well.
1679
1680         (WebKit::decodeV1SessionHistory):
1681         If we don't have a current index, set it to Nullopt instead of 0.
1682
1683 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1684
1685         Unreviewed. EFL and GTK build fix since r170654.
1686
1687         * UIProcess/LegacySessionStateCodingNone.cpp: Add a dummy encodeLegacySessionState(const SessionState&).
1688         (WebKit::encodeLegacySessionState):
1689
1690 2014-07-01  Dan Bernstein  <mitz@apple.com>
1691
1692         Crash in WebDocumentLoader::setNavigationID
1693         https://bugs.webkit.org/show_bug.cgi?id=134520
1694
1695         Reviewed by Anders Carlsson.
1696
1697         * WebProcess/WebPage/WebFrame.cpp:
1698         (WebKit::WebFrame::didReceivePolicyDecision): Null-check the policy document loader.
1699
1700 2014-07-01  Dan Bernstein  <mitz@apple.com>
1701
1702         Build fix.
1703
1704         * UIProcess/API/APILoaderClient.h:
1705         (API::LoaderClient::didDestroyNavigation):
1706
1707 2014-07-01  Anders Carlsson  <andersca@apple.com>
1708
1709         Use the new legacy session state coding in WKPageCopySessionState
1710         https://bugs.webkit.org/show_bug.cgi?id=134516
1711
1712         Reviewed by Tim Horton.
1713
1714         * UIProcess/API/C/WKPage.cpp:
1715         (WKPageCopySessionState):
1716         Call encodeLegacySessionState.
1717
1718         * UIProcess/mac/LegacySessionStateCoding.cpp:
1719         (WebKit::encodeSessionHistoryEntryData):
1720         Use leakPtr() so we won't attempt to double-free the buffer.
1721
1722         (WebKit::createDictionary):
1723         Fix a typo.
1724
1725         (WebKit::encodeLegacySessionState):
1726         Don't encode the provisional URL if it's empty.
1727
1728 2014-07-01  Chris Fleizach  <cfleizach@apple.com>
1729
1730         AX: [iOS WebKit2] Support for Speak selection
1731         https://bugs.webkit.org/show_bug.cgi?id=134512
1732
1733         Reviewed by Darin Adler.
1734
1735         Implement a method that Speak Selection can use to retrieve the selected content.
1736
1737         * UIProcess/ios/WKContentViewInteraction.mm:
1738         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
1739
1740 2014-07-01  Anders Carlsson  <andersca@apple.com>
1741
1742         Update the highest back-forward list item ID in the other WebBackForwardListItem constructor
1743         https://bugs.webkit.org/show_bug.cgi?id=134515
1744
1745         Reviewed by Tim Horton.
1746
1747         * Shared/WebBackForwardListItem.cpp:
1748         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1749
1750 2014-07-01  Brady Eidson  <beidson@apple.com>
1751
1752         Fix ServicesOverlayController teardown
1753         <rdar://problem/17523998> and https://bugs.webkit.org/show_bug.cgi?id=134510
1754
1755         Reviewed by Mark Rowe.
1756
1757         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1758         (WebKit::ServicesOverlayController::~ServicesOverlayController): Flipped logic on null-checking the overlay.
1759
1760 2014-07-01  Sam Weinig  <sam@webkit.org>
1761
1762         [Cocoa][Mac] WKWebView should automatically set topContentInset when beneath a toolbar
1763         <rdar://problem/17523159>
1764         https://bugs.webkit.org/show_bug.cgi?id=134496
1765
1766         Reviewed by Beth Dakin.
1767
1768         - Adds _automaticallyAdjustsContentInsets SPI to both WKView and WKWebView.
1769         - Defaults _automaticallyAdjustsContentInsets to NO for WKView to keep legacy clients working.
1770         - Defaults _automaticallyAdjustsContentInsets to YES for WKWebView.
1771
1772         * UIProcess/API/Cocoa/WKViewPrivate.h:
1773         Add _automaticallyAdjustsContentInsets SPI.
1774
1775         * UIProcess/API/Cocoa/WKWebView.mm:
1776         (-[WKWebView initWithFrame:configuration:]):
1777         Default _automaticallyAdjustsContentInsets to YES for WKWebView.
1778
1779         (-[WKWebView _setTopContentInset:]):
1780         (-[WKWebView _topContentInset]):
1781         Change to forward to the WKView, since we now do coalescing and caching there.
1782
1783         (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
1784         (-[WKWebView _automaticallyAdjustsContentInsets]):
1785         Forward to the WKView.
1786
1787         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1788         Add _automaticallyAdjustsContentInsets SPI.
1789
1790         * UIProcess/API/mac/WKView.mm:
1791         (-[WKView renewGState]):
1792         Ensure the contentInset is updated when the view changes, as its relative location to the toolbar may have changed.
1793
1794         (-[WKView addWindowObserversForWindow:]):
1795         (-[WKView removeWindowObservers]):
1796         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
1797         Add observers for the contentLayoutRect and titlebarAppearsTransparent properties on the window. If either of them
1798         change, we need to recalculate the content inset.
1799
1800         (-[WKView _updateContentInsetsIfAutomatic]):
1801         If _automaticallyAdjustsContentInsets is YES, follow the same rules as AppKit in setting the top content inset. Like
1802         AppKit this is only done when:
1803             - The window's style mask has the NSFullSizeContentViewWindowMask bit.
1804             - The window does not have titlebarAppearsTransparent set.
1805             - And we are not in an enclosing NSScrollView.
1806
1807         (-[WKView _setTopContentInset:]):
1808         (-[WKView _topContentInset]):
1809         Coalesce setting the topContentInset to avoid a visual lag when resizing the window that was caused by us sending
1810         multiple topContentInsets to the WebContentProcess per runloop cycle. The reason for the lag was that at the time
1811         we observe the contentLayoutRect changing, our view may not yet be in its final position yet, so the inset will be
1812         temporarily wrong. When the view is finally positioned correctly, we will get a renewGState, at which point we will
1813         again calculate the inset, which now will be correct. Since these both happen in the same runloop iteration, we can
1814         just defer sending the inset to the WebContentProcess.
1815
1816         (-[WKView _setAutomaticallyAdjustsContentInsets:]):
1817         (-[WKView _automaticallyAdjustsContentInsets]):
1818         Add the new SPI.
1819
1820 2014-07-01  Anders Carlsson  <andersca@apple.com>
1821
1822         Add a function for restoring page state given a SessionState object
1823         https://bugs.webkit.org/show_bug.cgi?id=134509
1824
1825         Reviewed by Tim Horton.
1826
1827         * Shared/WebBackForwardListItem.h:
1828         (WebKit::WebBackForwardListItem::itemState):
1829         * UIProcess/WebBackForwardList.cpp:
1830         (WebKit::WebBackForwardList::saveState):
1831         * UIProcess/WebBackForwardList.h:
1832         * UIProcess/WebPageProxy.cpp:
1833         (WebKit::WebPageProxy::saveState):
1834         * UIProcess/WebPageProxy.h:
1835
1836 2014-07-01  Dan Bernstein  <mitz@apple.com>
1837
1838         [Cocoa] Navigation parameter in navigation delegate messages is nil for navigations started by the Web Content process
1839         https://bugs.webkit.org/show_bug.cgi?id=134482
1840
1841         Reviewed by Tim Horton.
1842
1843         * UIProcess/API/APILoaderClient.h:
1844         (API::LoaderClient::didDestroyNavigation): New client function, called when a navigation ID
1845         is not going to be used anymore.
1846
1847         * UIProcess/API/Cocoa/WKWebView.mm:
1848         (-[WKWebView _restoreFromSessionState:]): If restoring triggered a navigation, create a
1849         WKNavigation for its ID.
1850
1851         * UIProcess/Cocoa/NavigationState.h:
1852         * UIProcess/Cocoa/NavigationState.mm:
1853         (WebKit::NavigationState::createLoadRequestNavigation): Removed FIXME, because we now remove
1854         navigations from the map in LoaderClient::didDestroyNavigation.
1855         (WebKit::NavigationState::createBackForwardNavigation): Ditto.
1856         (WebKit::NavigationState::createReloadNavigation): Ditto.
1857         (WebKit::NavigationState::createLoadDataNavigation): Ditto.
1858         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): If we are only
1859         getting a navigation ID now, create a WKNavigation for it. Also changed to create the
1860         NSURLRequest lazily.
1861         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Assert that
1862         navigationID is not zero and that it maps to an existing WKNavigation.
1863         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
1864         Ditto.
1865         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
1866         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
1867         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
1868         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
1869         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
1870         (WebKit::NavigationState::LoaderClient::didDestroyNavigation): Override the new client
1871         function to remove the navigation from the map.
1872         (WebKit::NavigationState::LoaderClient::processDidCrash): Clear the navigations map.
1873
1874         * UIProcess/WebFrameListenerProxy.cpp:
1875         (WebKit::WebFrameListenerProxy::WebFrameListenerProxy): Initialize new m_navigationID
1876         member variable.
1877         (WebKit::WebFrameListenerProxy::receivedPolicyDecision): Pass the navigation ID to
1878         WebFrame::receivedPolicyDecision.
1879         * UIProcess/WebFrameListenerProxy.h:
1880         (WebKit::WebFrameListenerProxy::navigationID): Added this accessor.
1881         (WebKit::WebFrameListenerProxy::setNavigationID): Ditto.
1882
1883         * UIProcess/WebFrameProxy.cpp:
1884         (WebKit::WebFrameProxy::receivedPolicyDecision): Added navigationID parameter, which is
1885         passed along to the WebPageProxy.
1886         * UIProcess/WebFrameProxy.h:
1887
1888         * UIProcess/WebPageProxy.cpp:
1889         (WebKit::WebPageProxy::receivedPolicyDecision): Added navigationID parameter, which is
1890         passed along in the message to the Web Content process.
1891         (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID of 0.
1892         (WebKit::WebPageProxy::restoreFromState): Changed to return a navigation ID if one was
1893         started.
1894         (WebKit::WebPageProxy::didDestroyNavigation): Added. Calls the new client function.
1895         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Added navigationID and
1896         newNavigationID parameters. If a main-frame navigation doesn’t already have an ID, assign it
1897         a new ID and return it in the newNavigationID parmeter as well as setting it on the listener
1898         for the asynchronous case.
1899         * UIProcess/WebPageProxy.h:
1900
1901         * UIProcess/WebPageProxy.messages.in: Added navigationID and newNavigationID parameters.
1902
1903         * UIProcess/cf/WebPageProxyCF.cpp:
1904         (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID if
1905         one was started.
1906
1907         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1908         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Updated for additional
1909         parameter.
1910         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the navigation
1911         ID to the UI process, get the new navigation ID from the reply, and set it on the document
1912         loader.
1913
1914         * WebProcess/WebPage/WebDocumentLoader.cpp:
1915         (WebKit::WebDocumentLoader::detachFromFrame): Override to let the UI process know that the
1916         navigation ID will not be used anymore.
1917         * WebProcess/WebPage/WebDocumentLoader.h:
1918
1919         * WebProcess/WebPage/WebFrame.cpp:
1920         (WebKit::WebFrame::didReceivePolicyDecision): Added navigationID parameter, set it on the
1921         document loader.
1922         (WebKit::WebFrame::documentLoaderDetached): Pass the message along to the UI process.
1923         * WebProcess/WebPage/WebFrame.h:
1924
1925         * WebProcess/WebPage/WebPage.cpp:
1926         (WebKit::WebPage::didReceivePolicyDecision): Pass new navigationID parameter along.
1927         * WebProcess/WebPage/WebPage.h:
1928
1929         * WebProcess/WebPage/WebPage.messages.in: Added navigationID parameter.
1930
1931 2014-07-01  Anders Carlsson  <andersca@apple.com>
1932
1933         Fix build.
1934
1935         * WebKit2.xcodeproj/project.pbxproj:
1936
1937 2014-07-01  Anders Carlsson  <andersca@apple.com>
1938
1939         Temporarily encode and decode the snapshot UUID
1940         https://bugs.webkit.org/show_bug.cgi?id=134507
1941
1942         Reviewed by Tim Horton.
1943
1944         * UIProcess/mac/LegacySessionStateCoding.cpp:
1945         (WebKit::encodeSessionHistory):
1946         (WebKit::decodeSessionHistoryEntry):
1947         (WebKit::decodeSessionHistoryEntries):
1948
1949 2014-07-01  Anders Carlsson  <andersca@apple.com>
1950
1951         Implement encodeSessionHistoryEntryData
1952         https://bugs.webkit.org/show_bug.cgi?id=134505
1953
1954         Reviewed by Tim Horton.
1955
1956         * UIProcess/API/C/WKPage.cpp:
1957         (WKPageCopySessionState):
1958         Add back a missing null check for the filter pointer.
1959
1960         * UIProcess/mac/LegacySessionStateCoding.cpp:
1961         (WebKit::encodeSessionHistoryEntryData):
1962
1963 2014-07-01  Simon Fraser  <simon.fraser@apple.com>
1964
1965         [UI-side compositing] Bad spinner on news.google.com: animations need to be ordered
1966         https://bugs.webkit.org/show_bug.cgi?id=134504
1967         <rdar://problem/17507892>
1968
1969         Reviewed by Tim Horton.
1970         
1971         The layer's addedAnimations property needs to maintain order, since the order
1972         in which transforms are applied is important.
1973
1974         * Shared/mac/RemoteLayerTreeTransaction.h: Use a Vector<pair<>> for addedAnimations.
1975         * Shared/mac/RemoteLayerTreeTransaction.mm:
1976         (WebKit::dumpChangedLayers):
1977         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
1978         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1979         (WebKit::PlatformCAAnimationRemote::updateLayerAnimations):
1980         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1981         (WebKit::PlatformCALayerRemote::addAnimationForKey): If this is a new entry, we
1982         can just append to addedAnimations, otherwise we have to find the existing one
1983         and update its properties.
1984         (WebKit::PlatformCALayerRemote::removeAnimationForKey): Do linear search to
1985         find the animation to remove (this list will normally be short).
1986
1987 2014-07-01  Anders Carlsson  <andersca@apple.com>
1988
1989         Add a encodeLegacySessionState function
1990         https://bugs.webkit.org/show_bug.cgi?id=134502
1991
1992         Reviewed by Tim Horton.
1993
1994         * UIProcess/LegacySessionStateCoding.h:
1995         * UIProcess/mac/LegacySessionStateCoding.cpp:
1996         (WebKit::encodeSessionHistoryEntryData):
1997         (WebKit::encodeLegacySessionHistoryEntryData):
1998         (WebKit::createDictionary):
1999         (WebKit::encodeSessionHistory):
2000         (WebKit::encodeLegacySessionState):
2001
2002 2014-07-01  Alexey Proskuryakov  <ap@apple.com>
2003
2004         [Cocoa] WebProcess doesn't follow localization of UI process when run as a service
2005         https://bugs.webkit.org/show_bug.cgi?id=133126
2006         <rdar://problem/13396515>
2007
2008         Patch by Alexey Proskuryakov.
2009         Reviewed by Tim Horton.
2010
2011         * Configurations/WebContentService.Development.xcconfig:
2012         * Configurations/WebContentService.xcconfig:
2013         Figure out which of the two keys to use. CFBundleAllowMixedLocalizations was
2014         a workaround before we got CFBundleFollowParentLocalization, and these cannot be
2015         used together.
2016
2017         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Set up
2018         XPC bootstrap for CFBundle to use.
2019
2020         * WebKit2.xcodeproj/project.pbxproj: Added a script that applies the key to Info.plist.
2021
2022         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist:
2023         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist:
2024         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
2025         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2026         Removed CFBundleAllowMixedLocalizations, we now add it programmatically.
2027
2028 2014-07-01  Alex Christensen  <achristensen@webkit.org>
2029
2030         [iOS] Unreviewed build fix after r170640.
2031
2032         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2033         (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
2034         (WebKit::WebEditorClient::selectionRectsDidChange):
2035         * WebProcess/WebCoreSupport/WebEditorClient.h:
2036         * WebProcess/WebPage/WebPage.h:
2037         Add ifdefs to make everything compile and link.
2038
2039 2014-07-01  Anders Carlsson  <andersca@apple.com>
2040
2041         Add WKSessionStateGetTypeID
2042         https://bugs.webkit.org/show_bug.cgi?id=134499
2043
2044         Reviewed by Tim Horton.
2045
2046         * UIProcess/API/C/WKSessionStateRef.cpp:
2047         (WKSessionStateGetTypeID):
2048         * UIProcess/API/C/WKSessionStateRef.h:
2049
2050 2014-07-01  Daniel Bates  <dabates@apple.com>
2051
2052         Remove unnecessary calls to std::move()
2053         https://bugs.webkit.org/show_bug.cgi?id=134493
2054
2055         Reviewed by Anders Carlsson.
2056
2057         * Shared/ShareableResource.cpp:
2058         (WebKit::ShareableResource::Handle::tryWrapInCFData):
2059         * WebProcess/WebPage/WebFrame.cpp:
2060         (WebKit::WebFrame::certificateInfo): Return a WebCore::CertificateInfo instead
2061         of const WebCore::CertificateInfo& to avoid returning a dangling reference to
2062         a local variable. Also, remove the unnecessary calls to std::move() as the compiler
2063         will invoke the move constructor for WebCore::CertificateInfo on return from the
2064         function.
2065         * WebProcess/WebPage/WebFrame.h:
2066
2067 2014-07-01  Anders Carlsson  <andersca@apple.com>
2068
2069         Add a BackForwardListItemState struct and put the snapshot UUID there
2070         https://bugs.webkit.org/show_bug.cgi?id=134497
2071
2072         Reviewed by Sam Weinig.
2073
2074         * Shared/SessionState.cpp:
2075         (WebKit::PageState::encode):
2076         (WebKit::PageState::decode):
2077         (WebKit::BackForwardListItemState::encode):
2078         (WebKit::BackForwardListItemState::decode):
2079         * Shared/SessionState.h:
2080         * Shared/WebBackForwardListItem.cpp:
2081         (WebKit::WebBackForwardListItem::create):
2082         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2083         (WebKit::WebBackForwardListItem::backForwardData):
2084         (WebKit::WebBackForwardListItem::setBackForwardData):
2085         (WebKit::WebBackForwardListItem::encode):
2086         * Shared/WebBackForwardListItem.h:
2087         (WebKit::WebBackForwardListItem::setPageState):
2088         (WebKit::WebBackForwardListItem::setOriginalURL):
2089         (WebKit::WebBackForwardListItem::originalURL):
2090         (WebKit::WebBackForwardListItem::setURL):
2091         (WebKit::WebBackForwardListItem::url):
2092         (WebKit::WebBackForwardListItem::setTitle):
2093         (WebKit::WebBackForwardListItem::title):
2094         (WebKit::WebBackForwardListItem::setSnapshotUUID):
2095         (WebKit::WebBackForwardListItem::snapshotUUID):
2096         * UIProcess/WebBackForwardList.cpp:
2097         (WebKit::WebBackForwardList::restoreFromState):
2098         * UIProcess/WebProcessProxy.cpp:
2099         (WebKit::WebProcessProxy::addBackForwardItem):
2100         * UIProcess/mac/LegacySessionStateCoding.cpp:
2101         (WebKit::decodeSessionHistoryEntries):
2102
2103 2014-07-01  Yongjun Zhang  <yongjun_zhang@apple.com>
2104
2105         Add encodeInteger and decodeInteger for remote object encoder and decoder.
2106         https://bugs.webkit.org/show_bug.cgi?id=134453
2107
2108         In 64bit system, encodeInteger/decodeInteger is by default mapped into encodeInt64/decodeInt64.  For
2109         32bit system, they are mapped to encodeInt32/decodeInt32.  However, since we don't have encodeInt32/decodeInt32
2110         implementation in WKRemoteObjectCoder, we could hit crash in 32bit systems.
2111
2112         Reviewed by Sam Weinig.
2113
2114         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2115         (-[WKRemoteObjectEncoder encodeInteger:forKey:]): Instead of creating a new number type UInt32, use encodeInt64 for
2116             encoding NSInteger.
2117         (-[WKRemoteObjectDecoder decodeIntegerForKey:]):
2118
2119 2014-06-30  Anders Carlsson  <andersca@apple.com>
2120
2121         Use an std::function for filtering session state data
2122         https://bugs.webkit.org/show_bug.cgi?id=134481
2123
2124         Reviewed by Sam Weinig.
2125
2126         * UIProcess/API/C/WKPage.cpp:
2127         (WKPageCopySessionState):
2128         * UIProcess/API/Cocoa/WKWebView.mm:
2129         (-[WKWebView _sessionState]):
2130         * UIProcess/WebBackForwardList.h:
2131         * UIProcess/WebPageProxy.cpp:
2132         (WebKit::WebPageProxy::sessionStateData):
2133         * UIProcess/WebPageProxy.h:
2134         * UIProcess/cf/WebBackForwardListCF.cpp:
2135         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
2136         * UIProcess/cf/WebPageProxyCF.cpp:
2137         (WebKit::WebPageProxy::sessionStateData):
2138
2139 2014-07-01  Rohit Kumar  <kumar.rohit@samsung.com>
2140
2141         Clean up the WebKit build from unused parameter warning in Webkit2/UIProcess module
2142         https://bugs.webkit.org/show_bug.cgi?id=134294
2143
2144         Reviewed by Darin Adler.
2145
2146         * UIProcess/API/APIUIClient.h:
2147         (API::UIClient::reachedApplicationCacheOriginQuota):
2148
2149 2014-07-01  Brady Eidson  <beidson@apple.com>
2150
2151         Followup for: Combine the Telephone and Selection overlay controllers, updating UI behavior.
2152         https://bugs.webkit.org/show_bug.cgi?id=134461
2153
2154         Rubberstamped by Tim Horton.
2155
2156         * WebProcess/WebPage/mac/ServicesOverlayController.mm: Include the correct constant.
2157
2158 2014-07-01  Brady Eidson  <beidson@apple.com>
2159
2160         Build fix.
2161
2162         Forgot to commit locally before pushing.
2163
2164         * WebProcess/WebPage/WebPage.cpp:
2165         (WebKit::WebPage::servicesOverlayController): s/this/*this/
2166
2167 2014-07-01  Brady Eidson  <beidson@apple.com>
2168
2169         Combine the Telephone and Selection overlay controllers, updating UI behavior.
2170         https://bugs.webkit.org/show_bug.cgi?id=134461
2171
2172         Reviewed by Tim Horton.
2173
2174         * WebKit2.xcodeproj/project.pbxproj:
2175
2176         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2177         (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
2178         (WebKit::WebEditorClient::selectionRectsDidChange):
2179
2180         Remove the separate Selection overlay controller:
2181         * WebProcess/WebPage/SelectionOverlayController.cpp: Removed.
2182         * WebProcess/WebPage/ServicesOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/SelectionOverlayController.h.
2183         (WebKit::ServicesOverlayController::create):
2184         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Removed.
2185
2186         Remove the separate TelephoneNumber overlay controller:
2187         * WebProcess/WebPage/TelephoneNumberOverlayController.cpp: Removed.
2188         * WebProcess/WebPage/TelephoneNumberOverlayController.h: Removed.
2189         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: Removed.
2190
2191         * WebProcess/WebPage/WebPage.cpp:
2192         (WebKit::WebPage::servicesOverlayController):
2193         (WebKit::WebPage::telephoneNumberOverlayController): Deleted.
2194         (WebKit::WebPage::selectionOverlayController): Deleted.
2195         (WebKit::WebPage::didChangeScrollOffsetForFrame): Deleted.
2196         * WebProcess/WebPage/WebPage.h:
2197         (WebKit::WebPage::serviceControlsEnabled): Deleted.
2198
2199         ServicesOverlayController is a combination of the old TelephoneNumber and Selection overlay controllers.
2200         A lot of code duplication is resolved, and things are generally easier to follow.
2201         It enforces displaying a telephone number highlight if precisely one telephone number is selected, or
2202         the selection highlight if the selection contains more than a single phone number
2203         * WebProcess/WebPage/mac/ServicesOverlayController.mm: Added.
2204         (WebKit::textQuadsToBoundingRectForRange):
2205         (WebKit::ServicesOverlayController::ServicesOverlayController):
2206         (WebKit::ServicesOverlayController::destroyOverlay):
2207         (WebKit::ServicesOverlayController::pageOverlayDestroyed):
2208         (WebKit::ServicesOverlayController::willMoveToWebPage):
2209         (WebKit::ServicesOverlayController::didMoveToWebPage):
2210         (WebKit::ServicesOverlayController::createOverlayIfNeeded):
2211         (WebKit::ServicesOverlayController::selectionRectsDidChange):
2212         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
2213         (WebKit::ServicesOverlayController::clearHighlightState):
2214         (WebKit::ServicesOverlayController::drawRect):
2215         (WebKit::ServicesOverlayController::drawSelectionHighlight):
2216         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight):
2217         (WebKit::ServicesOverlayController::drawCurrentHighlight):
2218         (WebKit::ServicesOverlayController::mouseEvent):
2219         (WebKit::ServicesOverlayController::handleClick):
2220
2221 2014-07-01  Zan Dobersek  <zdobersek@igalia.com>
2222
2223         [WK2] IPC messages' arguments() method returns const std::tuple<> copies
2224         https://bugs.webkit.org/show_bug.cgi?id=131975
2225
2226         Reviewed by Darin Adler.
2227
2228         The arguments() method of the different IPC message objects should return a const reference
2229         to the std::tuple<> containing the arguments, instead of a const value. This avoids copying
2230         the std::tuple<> every time the arguments are encoded, and works best with the
2231         ArgumentEncoder::encode<std::tuple<...>>(const std::tuple<...>&) template instantiation.
2232
2233         The unit test baselines are updated accordingly.
2234
2235         * Scripts/webkit2/LegacyMessages-expected.h:
2236         (Messages::WebPage::LoadURL::arguments):
2237         (Messages::WebPage::LoadSomething::arguments):
2238         (Messages::WebPage::TouchEvent::arguments):
2239         (Messages::WebPage::AddEvent::arguments):
2240         (Messages::WebPage::LoadSomethingElse::arguments):
2241         (Messages::WebPage::DidReceivePolicyDecision::arguments):
2242         (Messages::WebPage::Close::arguments):
2243         (Messages::WebPage::PreferencesDidChange::arguments):
2244         (Messages::WebPage::SendDoubleAndFloat::arguments):
2245         (Messages::WebPage::SendInts::arguments):
2246         (Messages::WebPage::CreatePlugin::arguments):
2247         (Messages::WebPage::RunJavaScriptAlert::arguments):
2248         (Messages::WebPage::GetPlugins::arguments):
2249         (Messages::WebPage::GetPluginProcessConnection::arguments):
2250         (Messages::WebPage::TestMultipleAttributes::arguments):
2251         (Messages::WebPage::TestParameterAttributes::arguments):
2252         (Messages::WebPage::TemplateTest::arguments):
2253         (Messages::WebPage::SetVideoLayerID::arguments):
2254         (Messages::WebPage::DidCreateWebProcessConnection::arguments):
2255         (Messages::WebPage::InterpretKeyEvent::arguments):
2256         (Messages::WebPage::DeprecatedOperation::arguments):
2257         (Messages::WebPage::ExperimentalOperation::arguments):
2258         * Scripts/webkit2/Messages-expected.h:
2259         (Messages::WebPage::LoadURL::arguments):
2260         (Messages::WebPage::LoadSomething::arguments):
2261         (Messages::WebPage::TouchEvent::arguments):
2262         (Messages::WebPage::AddEvent::arguments):
2263         (Messages::WebPage::LoadSomethingElse::arguments):
2264         (Messages::WebPage::DidReceivePolicyDecision::arguments):
2265         (Messages::WebPage::Close::arguments):
2266         (Messages::WebPage::PreferencesDidChange::arguments):
2267         (Messages::WebPage::SendDoubleAndFloat::arguments):
2268         (Messages::WebPage::SendInts::arguments):
2269         (Messages::WebPage::CreatePlugin::arguments):
2270         (Messages::WebPage::RunJavaScriptAlert::arguments):
2271         (Messages::WebPage::GetPlugins::arguments):
2272         (Messages::WebPage::GetPluginProcessConnection::arguments):
2273         (Messages::WebPage::TestMultipleAttributes::arguments):
2274         (Messages::WebPage::TestParameterAttributes::arguments):
2275         (Messages::WebPage::TemplateTest::arguments):
2276         (Messages::WebPage::SetVideoLayerID::arguments):
2277         (Messages::WebPage::DidCreateWebProcessConnection::arguments):
2278         (Messages::WebPage::InterpretKeyEvent::arguments):
2279         (Messages::WebPage::DeprecatedOperation::arguments):
2280         (Messages::WebPage::ExperimentalOperation::arguments):
2281         * Scripts/webkit2/MessagesSuperclass-expected.h:
2282         (Messages::WebPage::LoadURL::arguments):
2283         * Scripts/webkit2/messages.py:
2284         (message_to_struct_declaration):
2285
2286 2014-07-01  Evan Nemerson  <evan@nemerson.com>
2287
2288         [GTK] Annotations for WebResource.get_data produce wrong signature in Vala binding
2289         https://bugs.webkit.org/show_bug.cgi?id=134476
2290
2291         Reviewed by Carlos Garcia Campos.
2292
2293         * UIProcess/API/gtk/WebKitWebResource.cpp: Add array length and
2294         element-type annotations to return value of webkit_web_resource_get_data_finish().
2295
2296 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2297
2298         [WK2] Can not convert ‘sessionState.WebKit::SessionState::provisionalURL’ from ‘WebCore::URL’ to ‘bool’
2299         https://bugs.webkit.org/show_bug.cgi?id=134487
2300
2301         Rubber-stamped by Carlos Garcia Campos.
2302
2303         * UIProcess/WebPageProxy.cpp: Use isNull().
2304         (WebKit::WebPageProxy::restoreFromState):
2305
2306 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2307
2308         Fix build break on EFL and GTK ports since r170611 and r170614
2309         https://bugs.webkit.org/show_bug.cgi?id=134479
2310
2311         Reviewed by Carlos Garcia Campos.
2312
2313         Add LegacySessionStateCodingNone.cpp in order to fix build break on EFL and GTK ports. Additionally
2314         SessionStateConversion.cpp is added to CMakeLists.txt as well.
2315
2316         * CMakeLists.txt:
2317         * UIProcess/LegacySessionStateCoding.h: Copied from Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.h.
2318         * UIProcess/LegacySessionStateCodingNone.cpp: Renamed from Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.h.
2319         (WebKit::encodeLegacySessionHistoryEntryData):
2320         (WebKit::decodeLegacySessionState):
2321         (WebKit::decodeLegacySessionHistoryEntryData):
2322         * UIProcess/WebPageProxy.cpp:
2323         (WebKit::WebPageProxy::loadFile):
2324         (WebKit::WebPageProxy::restoreFromState):
2325         * WebKit2.xcodeproj/project.pbxproj:
2326
2327 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
2328
2329         [iOS][WK2] The long press gesture recognizers should not block the pinch gesture
2330         https://bugs.webkit.org/show_bug.cgi?id=134477
2331         <rdar://problem/17514936>
2332
2333         Reviewed by Tim Horton.
2334
2335         * UIProcess/ios/WKContentViewInteraction.mm:
2336         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
2337
2338 2014-06-30  Anders Carlsson  <andersca@apple.com>
2339
2340         Add WebPageProxy::restoreFromState
2341         https://bugs.webkit.org/show_bug.cgi?id=134480
2342
2343         Reviewed by Tim Horton.
2344
2345         * UIProcess/WebPageProxy.cpp:
2346         (WebKit::WebPageProxy::restoreFromState):
2347         * UIProcess/WebPageProxy.h:
2348
2349 2014-06-30  Anders Carlsson  <andersca@apple.com>
2350
2351         Add a function to restore a WebBackForwardList object from a BackForwardListState object
2352         https://bugs.webkit.org/show_bug.cgi?id=134478
2353
2354         Reviewed by Tim Horton.
2355
2356         * UIProcess/WebBackForwardList.cpp:
2357         (WebKit::generateWebBackForwardItemID):
2358         (WebKit::WebBackForwardList::restoreFromState):
2359         * UIProcess/WebBackForwardList.h:
2360         * UIProcess/cf/WebBackForwardListCF.cpp:
2361         (WebKit::generateWebBackForwardItemID): Deleted.
2362
2363 2014-06-30  Anders Carlsson  <andersca@apple.com>
2364
2365         Change the AddBackForwardItem message to take a page state object
2366         https://bugs.webkit.org/show_bug.cgi?id=134475
2367
2368         Reviewed by Andreas Kling.
2369
2370         * Scripts/webkit2/messages.py:
2371         (struct_or_class):
2372         (headers_for_type):
2373         * Shared/WebBackForwardListItem.cpp:
2374         (WebKit::WebBackForwardListItem::create):
2375         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2376         * Shared/WebBackForwardListItem.h:
2377         (WebKit::WebBackForwardListItem::setPageState):
2378         * UIProcess/WebProcessProxy.cpp:
2379         (WebKit::WebProcessProxy::addBackForwardItem):
2380         * UIProcess/WebProcessProxy.h:
2381         * UIProcess/WebProcessProxy.messages.in:
2382         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2383         (WebKit::updateBackForwardItem):
2384
2385 2014-06-30  Tim Horton  <timothy_horton@apple.com>
2386
2387         [WK2] Add a flatter find-in-page current match indicator style
2388         https://bugs.webkit.org/show_bug.cgi?id=134434
2389         <rdar://problem/16225673>
2390
2391         Reviewed by Simon Fraser.
2392
2393         * UIProcess/FindIndicator.cpp:
2394         (WebKit::findIndicatorsForTextRectsOverlap):
2395         (WebKit::FindIndicator::frameRect):
2396         (WebKit::flatHighlightColor):
2397         (WebKit::flatRimShadowColor):
2398         (WebKit::flatDropShadowColor):
2399         (WebKit::FindIndicator::draw):
2400         Add a flatter find indicator, with a bigger shadow.
2401
2402         * WebProcess/WebPage/FindController.cpp:
2403         (WebKit::FindController::updateFindUIAfterPageScroll):
2404         (WebKit::FindController::getFindIndicatorBitmapAndRect):
2405         (WebKit::FindController::hideFindIndicator):
2406         (WebKit::FindController::drawRect):
2407         Don't paint a shadow behind the secondary matches if we're using the new style.
2408
2409 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
2410
2411         [iOS][WK2] Improve double-tap-to-scroll on image documents
2412         https://bugs.webkit.org/show_bug.cgi?id=134474
2413         <rdar://problem/17496778>
2414
2415         Reviewed by Enrica Casucci.
2416
2417         On image document, we were always rendering the center of the image as the origin, which broke
2418         double tap to scroll.
2419
2420         This patch improves on this in two ways:
2421         1) If the hit testing already got the image, only change the type to replaced (to get the right
2422            scaling behavior for images since the type is block on iOS's image document).
2423         2) If the hit testing is outside the image, only center the axis that is not in the image.
2424            This way, we "fix" the component that is not valid, and keep the vali component.
2425            This works great for viewing comics on iPad.
2426
2427         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2428         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
2429
2430 2014-06-30  Enrica Casucci  <enrica@apple.com>
2431
2432         REGRESSION (WK2): Weird selection behavior on autos.yahoo.com, en.wikipedia.org.
2433         https://bugs.webkit.org/show_bug.cgi?id=134466
2434         <rdar://problem/16817263>
2435
2436         Reviewed by Benjamin Poulain.
2437
2438         Avoid selecting blocks across frame boundaries and skip non-selectable
2439         blocks. If the only block we find is almost the same height as the
2440         visible area, we should not select at all.
2441         This patch also fixes the logic to compute the next block when
2442         shrinking the selection. When calculating the new range after shrinking,
2443         we should not include the block that corresponds to the current handle position.
2444
2445         * WebProcess/WebPage/ios/WebPageIOS.mm:
2446         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2447         (WebKit::WebPage::expandedRangeFromHandle):
2448         (WebKit::WebPage::contractedRangeFromHandle):
2449         (WebKit::WebPage::updateSelectionWithTouches):
2450
2451 2014-06-30  Anders Carlsson  <andersca@apple.com>
2452
2453         WebBackForwardListItem should not store back-forward data
2454         https://bugs.webkit.org/show_bug.cgi?id=134469
2455
2456         Reviewed by Darin Adler.
2457
2458         Change WebBackForwardListItem::backForwardData to encode the main frame state lazily,
2459         and change WebBackForwardListItem::setBackForwardData to decode it into the main frame state.
2460
2461         * Shared/WebBackForwardListItem.cpp:
2462         (WebKit::WebBackForwardListItem::backForwardData):
2463         (WebKit::WebBackForwardListItem::setBackForwardData):
2464         (WebKit::WebBackForwardListItem::encode):
2465         * Shared/WebBackForwardListItem.h:
2466         (WebKit::WebBackForwardListItem::backForwardData): Deleted.
2467         * UIProcess/cf/WebBackForwardListCF.cpp:
2468         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
2469         * WebProcess/WebPage/WebPage.cpp:
2470         (WebKit::WebPage::restoreSession):
2471
2472 2014-06-30  Anders Carlsson  <andersca@apple.com>
2473
2474         WebBackForwardListItems should hold on to PageState objects
2475         https://bugs.webkit.org/show_bug.cgi?id=134467
2476
2477         Reviewed by Darin Adler.
2478
2479         * Shared/WebBackForwardListItem.cpp:
2480         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2481         (WebKit::WebBackForwardListItem::encode):
2482         * Shared/WebBackForwardListItem.h:
2483         (WebKit::WebBackForwardListItem::setOriginalURL):
2484         (WebKit::WebBackForwardListItem::originalURL):
2485         (WebKit::WebBackForwardListItem::setURL):
2486         (WebKit::WebBackForwardListItem::url):
2487         (WebKit::WebBackForwardListItem::setTitle):
2488         (WebKit::WebBackForwardListItem::title):
2489
2490 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
2491
2492         Add a missing semicolon in WKContentViewInteraction
2493
2494         * UIProcess/ios/WKContentViewInteraction.mm:
2495         (nsSizeForTapHighlightBorderRadius):
2496         I messed up this when fixing the patch on landing.
2497
2498 2014-06-30  Anders Carlsson  <andersca@apple.com>
2499
2500         Adopt the legacy session decoding inside WebPage::restoreSession for now
2501         https://bugs.webkit.org/show_bug.cgi?id=134465
2502
2503         Reviewed by Sam Weinig.
2504
2505         * UIProcess/mac/LegacySessionStateCoding.cpp:
2506         (WebKit::decodeLegacySessionHistoryEntryData):
2507         * UIProcess/mac/LegacySessionStateCoding.h:
2508         * WebProcess/WebPage/WebPage.cpp:
2509         (WebKit::WebPage::restoreSession):
2510
2511 2014-06-30  Simon Fraser  <simon.fraser@apple.com>
2512
2513         [iOS WK2] Don't crash on status bar tap with overflow scroll views
2514         https://bugs.webkit.org/show_bug.cgi?id=134459
2515
2516         Reviewed by Tim Horton.
2517         
2518         The tiled scrolling indicator parents UIViews under CALayers, but that causes
2519         those views to miss -willMoveToWindow:nil notifications on teardown. This can leave
2520         deleted UIScrollViews in UIKit's "scroll to top" list.
2521         
2522         Fix by not making UIScrollViews in the debug layer tree host.
2523
2524         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2525         (WebKit::RemoteLayerTreeHost::createLayer):
2526
2527 2014-06-28  Oliver Hunt  <oliver@apple.com>
2528
2529        Restrict network process sandbox
2530        https://bugs.webkit.org/show_bug.cgi?id=134360
2531
2532        Reviewed by Sam Weinig.
2533
2534        Add more restrictions to the network process sandbox.
2535
2536        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2537        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2538          Always use the cache directory provided in the initialization parameters,
2539          and make sure we consume the cookie directory extension.
2540        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2541          Make the sandbox profile much more restrictive.
2542        * Shared/Network/NetworkProcessCreationParameters.cpp:
2543        (WebKit::NetworkProcessCreationParameters::encode):
2544        (WebKit::NetworkProcessCreationParameters::decode):
2545        * Shared/Network/NetworkProcessCreationParameters.h:
2546          The network process now requires an extension to access
2547          its cookie storage.
2548        * Shared/mac/SandboxUtilities.cpp:
2549        (WebKit::pathForProcessContainer):
2550        * Shared/mac/SandboxUtilities.h:
2551          We need to be able to get hold of our container so
2552          that we can get the correct cookie storage directory.
2553        * UIProcess/WebContext.cpp:
2554        (WebKit::WebContext::ensureNetworkProcess):
2555          We have to pass in the an extension for the cookie storage directory when
2556        initalising the network process
2557        * UIProcess/mac/WebContextMac.mm:
2558        (WebKit::WebContext::platformDefaultCookieStorageDirectory):
2559          Make sure we provide the correct location on IOS
2560        * WebProcess/cocoa/WebProcessCocoa.mm:
2561        (WebKit::WebProcess::platformInitializeWebProcess):
2562          Consume the cookie storage extension
2563
2564 2014-06-30  Simon Fraser  <simon.fraser@apple.com>
2565
2566         [iOS WK2] Turn off scrollsToTop on overflow UIScrollViews
2567         https://bugs.webkit.org/show_bug.cgi?id=134456
2568
2569         Reviewed by Tim Horton.
2570         
2571         Set scrollsToTop to NO on our UIScrollViews created for overflow scrolling, since
2572         we don't have a good strategy for when to allow it, and doing so would also require
2573         some smarts in the main UIScrollView.
2574
2575         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2576         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
2577
2578 2014-06-30  Enrica Casucci  <enrica@apple.com>
2579
2580         REGRESSION (Okemo): The contextual menu on tap and hold does not cancel the other gestures.
2581         https://bugs.webkit.org/show_bug.cgi?id=134463
2582         <rdar://problem/17388907>
2583
2584         Reviewed by Benjamin Poulain.
2585
2586         * UIProcess/ios/WKContentViewInteraction.mm:
2587         (-[WKContentView _longPressRecognized:]):
2588
2589 2014-06-30  Anders Carlsson  <andersca@apple.com>
2590
2591         Implement the last pieces of encodeFrameStateNode
2592         https://bugs.webkit.org/show_bug.cgi?id=134460
2593
2594         Reviewed by Andreas Kling.
2595
2596         * UIProcess/mac/LegacySessionStateCoding.cpp:
2597         (WebKit::HistoryEntryDataEncoder::operator<<):
2598         (WebKit::isValidEnum):
2599         (WebKit::encodeFormDataElement):
2600         (WebKit::encodeFormData):
2601         (WebKit::encodeFrameStateNode):
2602
2603 2014-06-30  Benjamin Poulain  <bpoulain@apple.com>
2604
2605         [iOS][WK2] Move tap highlight to the inverseScaleRootView
2606         https://bugs.webkit.org/show_bug.cgi?id=134424
2607         <rdar://problem/17480880>
2608
2609         Reviewed by Tim Horton.
2610
2611         Enrica introduced the inverseScaleRootView that is a dynamic version of _highlightRootView.
2612
2613         This patch moves the tap highlight from its own inverse root to inverseScaleRootView. This provides better handling
2614         of scale, better behavior on crash, and remove one extra view from the hierarchy.
2615
2616         The code is pretty much the same, just moved around. Some of the changes:
2617
2618         Now the code needs to handle repainting live when the view scale. To do that, _showTapHighlightXXX was split in two:
2619         -_showTapHighlight to setup the view.
2620         -_updateTapHighlight to update the view based on the current scale.
2621
2622         Since the view updates live on scaling, we need to recompute the coordinates for each update. To do that, the _potentialTapHighlightInformation
2623         was generalized to handle all cases of highlight.
2624
2625         Since we can no longer test for the nullity of _potentialTapHighlightInformation,
2626         a new attribute is introduced for that: _hasTapHighlightForPotentialTap.
2627
2628         The last bit of change concern reentering the tap highlight. This becomes quite simple:
2629         1) _isTapHighlightIDValid is updated before the animation starts
2630            so that it can be set again during an animation.
2631         2) The animation checks the "finished" flags before removing the view from its superview
2632            to avoid breaking the new animation.
2633
2634         * UIProcess/API/Cocoa/WKWebView.mm:
2635         (withinEpsilon): Deleted.
2636         * UIProcess/ios/WKContentView.mm:
2637         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2638         Make _updateUnscaledView conditional to scale changes, that thing isn't cheap!
2639
2640         * UIProcess/ios/WKContentViewInteraction.h:
2641         (withinEpsilon):
2642         Move withinEpsilon() from WKContentView to use it from both classes.
2643
2644         * UIProcess/ios/WKContentViewInteraction.mm:
2645         (-[WKContentView cleanupInteraction]):
2646         (-[WKContentView _updateUnscaledView]):
2647         (-[WKContentView _updateTapHighlight]):
2648         (-[WKContentView _showTapHighlight]):
2649         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
2650         (-[WKContentView _cancelInteraction]):
2651         (-[WKContentView _finishInteraction]):
2652         (-[WKContentView _singleTapDidReset:]):
2653         (-[WKContentView _singleTapCommited:]):
2654         (-[WKContentView _showTapHighlightWithColor:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
2655
2656 2014-06-30  Anders Carlsson  <andersca@apple.com>
2657
2658         Add code for encoding legacy session history entries
2659         https://bugs.webkit.org/show_bug.cgi?id=134452
2660
2661         Reviewed by Andreas Kling.
2662
2663         * UIProcess/mac/LegacySessionStateCoding.cpp:
2664         (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder):
2665         (WebKit::HistoryEntryDataEncoder::operator<<):
2666         (WebKit::HistoryEntryDataEncoder::finishEncoding):
2667         (WebKit::HistoryEntryDataEncoder::encodeArithmeticType):
2668         (WebKit::HistoryEntryDataEncoder::encodeFixedLengthData):
2669         (WebKit::HistoryEntryDataEncoder::grow):
2670         (WebKit::HistoryEntryDataEncoder::growCapacity):
2671         (WebKit::encodeFrameStateNode):
2672         (WebKit::encodeLegacySessionHistoryEntryData):
2673         (WebKit::decodeSessionHistoryEntryData):
2674         (WebKit::decodeLegacySessionHistoryEntryData):
2675         * UIProcess/mac/LegacySessionStateCoding.h:
2676
2677 2014-06-29  Yoav Weiss  <yoav@yoav.ws>
2678
2679         Add support for HTMLImageElement's sizes attribute
2680         https://bugs.webkit.org/show_bug.cgi?id=133620
2681
2682         Reviewed by Dean Jackson.
2683
2684         Added an ENABLE_PICTURE_SIZES compile flag.
2685
2686         * Configurations/FeatureDefines.xcconfig:
2687
2688 2014-06-28  Tim Horton  <timothy_horton@apple.com>
2689
2690         [iOS][WK2] PDFs never load inline again after the Web process crashes
2691         https://bugs.webkit.org/show_bug.cgi?id=134432
2692         <rdar://problem/17484205>
2693
2694         Reviewed by Dan Bernstein.
2695
2696         After a crash, the WebPage never gets mimeTypesWithCustomContentProviders filled back in.
2697
2698         * Shared/WebPageCreationParameters.cpp:
2699         (WebKit::WebPageCreationParameters::encode):
2700         (WebKit::WebPageCreationParameters::decode):
2701         * Shared/WebPageCreationParameters.h:
2702         * UIProcess/WebPageProxy.cpp:
2703         (WebKit::WebPageProxy::creationParameters):
2704         * WebProcess/WebPage/WebPage.cpp:
2705         (WebKit::WebPage::WebPage):
2706         Add mimeTypesWithCustomContentProviders to WebPageCreationParameters.
2707
2708         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
2709         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2710         (-[WKWebViewContentProviderRegistry addPage:]):
2711         We don't need to send the MIME types across when a page is added, because it already got them in its creation parameters.
2712
2713         (-[WKWebViewContentProviderRegistry removePage:]):
2714         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
2715         Return a vector of all registered MIME types.
2716
2717         * UIProcess/ios/PageClientImplIOS.h:
2718         * UIProcess/ios/PageClientImplIOS.mm:
2719         (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
2720         * UIProcess/PageClient.h:
2721         Add (iOS only for now) mimeTypesWithCustomContentProviders to PageClient.
2722
2723 2014-06-28  Dan Bernstein  <mitz@apple.com>
2724
2725         REGRESSION: WebPageProxy::attributedSubstringForCharacterRangeAsync never calls its callback function
2726         https://bugs.webkit.org/show_bug.cgi?id=134429
2727
2728         Reviewed by Tim Horton.
2729
2730         * UIProcess/mac/WebPageProxyMac.mm:
2731         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
2732
2733 2014-06-27  Simon Fraser  <simon.fraser@apple.com>
2734
2735         [iOS WK2] position:fixed inside accelerated overflow:scroll is jumpy
2736         https://bugs.webkit.org/show_bug.cgi?id=134426
2737         <rdar://problem/17474523>
2738
2739         Reviewed by Tim Horton.
2740
2741         After committing a new layer tree (with possibly stale position:fixed layer
2742         positions), we need the scrolling tree to update those positions based on
2743         the current scroll offset.
2744         
2745         To achieve that, implement ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange()
2746         and have it add to the cumulative delta the difference between the last committed scroll
2747         position and the current scroll position.
2748         
2749         Also make sure that ScrollingTreeOverflowScrollingNodeIOS doesn't call back to scrollViewDidScroll()
2750         when we're updating its scroll position inside a scrolling tree commit.
2751
2752         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2753         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2754         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
2755         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
2756         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
2757         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
2758
2759 2014-06-27  Antti Koivisto  <antti@apple.com>
2760
2761         Flush throttling with remote layers
2762         https://bugs.webkit.org/show_bug.cgi?id=134398
2763
2764         Reviewed by Darin Adler.
2765
2766         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2767         (WebKit::WebChromeClient::adjustLayerFlushThrottling):
2768         * WebProcess/WebCoreSupport/WebChromeClient.h:
2769         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2770         * WebProcess/WebPage/DrawingArea.h:
2771         (WebKit::DrawingArea::adjustLayerFlushThrottling):
2772         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2773         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2774         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2775         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
2776         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2777
2778             Delay layer flushes during page loading.
2779             If use interacts with the page the next flush in unthrottled even if loading is in progress.
2780
2781         (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
2782         
2783             Compute the new delay. The first visual flush uses a shorter delay.
2784             Flush immediately when we are no longer throttling.
2785
2786         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2787         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
2788
2789 2014-06-27  Joseph Pecoraro  <pecoraro@apple.com>
2790
2791         [iOS][WK2] <select> tapping "next" does not save new picker value
2792         https://bugs.webkit.org/show_bug.cgi?id=134409
2793
2794         Reviewed by Enrica Casucci.
2795
2796         * UIProcess/ios/WKContentViewInteraction.mm:
2797         (-[WKContentView accessoryTab:]):
2798         We know the assisted node will change, so call endEditing
2799         before the assisted node changes in the WebProcess.
2800
2801         (-[WKContentView _stopAssistingNode]):
2802         Ensure we call endEditing to trigger controlEndEditing.
2803
2804         * UIProcess/ios/forms/WKFormSelectPicker.mm:
2805         (-[WKMultipleSelectPicker initWithView:]):
2806         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
2807         (-[WKSelectSinglePicker dealloc]):
2808         Style fixes.
2809
2810 2014-06-27  Peyton Randolph  <prandolph@apple.com>
2811
2812          Add feature flag for link long-press gesture.                                                                   
2813          https://bugs.webkit.org/show_bug.cgi?id=134262                                                                  
2814                                                                                                                          
2815          Reviewed by Enrica Casucci.                                                                                     
2816                                                                                                                          
2817          * Configurations/FeatureDefines.xcconfig:                                                                       
2818          Add ENABLE_LINK_LONG_PRESS. 
2819
2820 2014-06-26  Simon Fraser  <simon.fraser@apple.com>
2821
2822         [iOS WK2] Fix touch-scrollable elements with overflow:scroll on just one axis, and RTL scrolling
2823         https://bugs.webkit.org/show_bug.cgi?id=134377
2824         <rdar://problem/16762224>
2825
2826         Reviewed by Tim Horton.
2827
2828         Make -webkit-overflow-scrolling:touch scrolling work correctly when one axis
2829         has overflow:scroll and the other overflow:hidden. Also fix scrolling in RTL
2830         contexts.
2831         
2832         An RTL scroller with overflow-x:hidden will have a non-zero scroll origin,
2833         and needs to truncate the scrolled content on the left side. To pass the
2834         correct geometry to the UI process, we need to introduce the concept of
2835         "reachable" size as well as total content size; normally these are the same,
2836         but will differ when scrolling is only allowed on one axis but there is overflow
2837         on both axes.
2838         
2839         ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() uses the total and
2840         reachable content sizes to set a negative edge inset on the left (for RTL) or top
2841         (for bottom-to-top) so prevent scrolling into these areas.
2842
2843         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2844         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2845         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2846         (WebKit::RemoteScrollingTreeTextStream::dump):
2847         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2848         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): 
2849
2850 2014-06-27  Joseph Pecoraro  <pecoraro@apple.com>
2851
2852         Fix various leaks, RetainPtrs should adopt allocs
2853         https://bugs.webkit.org/show_bug.cgi?id=134308
2854
2855         Reviewed by Alexey Proskuryakov.
2856
2857         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2858         (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):
2859
2860 2014-06-27  Dan Bernstein  <mitz@apple.com>
2861
2862         Remove unused definitions that were mistakenly added back in r170323 and then again in r170329
2863         https://bugs.webkit.org/show_bug.cgi?id=134397
2864
2865         Reviewed by Geoff Garen.
2866
2867         * UIProcess/API/Cocoa/WKBackForwardList.mm:
2868
2869 2014-06-26  Daniel Bates  <dabates@apple.com>
2870
2871         [iOS][WK2] Distant focusable element may not be scrolled into view when focused using keyboard
2872         https://bugs.webkit.org/show_bug.cgi?id=134309
2873         <rdar://problem/17427385>
2874
2875         Reviewed by Darin Adler.
2876
2877         Fixes an issue where the focusable element may not be scrolled into view when it's focused by
2878         using the keyboard accessory (i.e. the < and > buttons). In particular, we don't scroll a
2879         keyboard focused text field into view when it's positioned significantly outside the visible region.
2880
2881         * UIProcess/ios/WKContentViewInteraction.h: Added an instance variable called _didAccessoryTabInitiateFocus
2882         to track whether an accessory tab initiated the focus of the focusable element.
2883         * UIProcess/ios/WKContentViewInteraction.mm:
2884         (-[WKContentView cleanupInteraction]): Clear _didAccessoryTabInitiateFocus so that we're in a good state
2885         should the WebProcess crash between the time the UIProcess receives the accessory tab request and the
2886         WebProcess calls back to the UIProcess to zoom/scroll to the newly focused element.
2887         (-[WKContentView _displayFormNodeInputView]): Modified to pass an empty rectangle for the selection
2888         rectangle to -_zoomToFocusRect to avoid constraining the scroll to the newly focused element when it
2889         was focused using the keyboard accessory tab buttons
2890         (-[WKContentView accessoryTab:]): Modified to set _didAccessoryTabInitiateFocus to YES. We'll set
2891         this boolean to NO in -_displayFormNodeInputView.
2892
2893 2014-06-26  Timothy Horton  <timothy_horton@apple.com>
2894
2895         [iOS][WK2] Implement WKPDFView smart magnification
2896         https://bugs.webkit.org/show_bug.cgi?id=134269
2897         <rdar://problem/17272825>
2898
2899         Reviewed by Dan Bernstein.
2900
2901         * UIProcess/API/Cocoa/WKWebView.mm:
2902         (-[WKWebView _currentContentView]):
2903         (contentZoomScale):
2904         Factor _currentContentView out of contentZoomScale.
2905
2906         (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
2907         (-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]):
2908         (-[WKWebView _contentRectForUserInteraction]):
2909         Use it in a bunch more places so we query the right view when zooming/scrolling for smart magnification.
2910
2911         * UIProcess/ios/WKPDFView.h:
2912         * UIProcess/ios/WKPDFView.mm:
2913         (-[WKPDFView scrollViewDidScroll:]):
2914         (-[WKPDFView _revalidateViews]):
2915         (-[WKPDFView zoom:to:atPoint:kind:]):
2916         (-[WKPDFView resetZoom:]):
2917         Implement zoom:to:atPoint:kind: and resetZoom: UIPDFPageViewDelegate methods.
2918         Convert the rects/points and forward them on to the WKWebView to do the zoom.
2919         resetZoom: doesn't provide the gesture origin, so we zoom out using the view center as our origin.
2920         Avoid parenting new UIPDFPageViews while starting a zoom; they'll end up with a bizarre
2921         animation on them and go flying across the screen (even before _isAnimatingZoom is set).
2922
2923 2014-06-26  Tim Horton  <timothy_horton@apple.com>
2924
2925         [WK2] Pinch-zoom shadows can overlap headers and footers
2926         https://bugs.webkit.org/show_bug.cgi?id=134372
2927         <rdar://problem/16004095>
2928
2929         Reviewed by Simon Fraser.
2930
2931         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2932         (WebKit::shadowLayerPositionForFrame):
2933         (WebKit::shadowLayerBoundsForFrame):
2934         Compute the initial shadow layer and shadow bounds exactly as RenderLayerCompositor does
2935         (in updateRootLayerPosition and friends). Also, clip the shadow layer to the old document rect,
2936         otherwise it can extend over top of the header/footers. The content is automatically clipped to
2937         this rect by the root content layer, but the shadow is outside of that.
2938
2939         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
2940         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
2941         Pass all of the arguments to constrainScrollPositionForOverhang, not just half of them.
2942         There's still a bug where we constrain incorrectly with header/footer layers, but that
2943         will be addressed elsewhere.
2944
2945         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
2946         Make use of the new helpers.
2947
2948 2014-06-26  Tim Horton  <timothy_horton@apple.com>
2949
2950         Don't leak WKBrowsingContextControllers
2951         https://bugs.webkit.org/show_bug.cgi?id=134368
2952         <rdar://problem/17476582>
2953
2954         Reviewed by Sam Weinig.
2955
2956         * UIProcess/API/mac/WKView.mm:
2957         (-[WKView browsingContextController]):
2958         Adoption is important.
2959
2960 2014-06-26  Alexey Proskuryakov  <ap@apple.com>
2961
2962         REGRESSION: Mountain Lion: Gmail's "in new window" view of mail threads is very slow to load its content
2963         https://bugs.webkit.org/show_bug.cgi?id=133882
2964         <rdar://problem/17271965>
2965
2966         Reviewed by Brady Eidson.
2967
2968         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
2969         (WebKit::NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost):
2970         Same fix as in WebCore.
2971
2972 2014-06-26  Brady Eidson  <beidson@apple.com>
2973
2974         Remove use of PlatformStrategies for Gamepad API.
2975         https://bugs.webkit.org/show_bug.cgi?id=134348
2976
2977 https://bugs.webkit.org/show_bug.cgi?id=134348
2978         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2979         (WebKit::NetworkProcessPlatformStrategies::createGamepadStrategy): Deleted.
2980         * NetworkProcess/NetworkProcessPlatformStrategies.h:
2981
2982         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2983         (WebKit::WebPlatformStrategies::createGamepadStrategy): Deleted.
2984         (WebKit::WebPlatformStrategies::startMonitoringGamepads): Deleted.
2985         (WebKit::WebPlatformStrategies::stopMonitoringGamepads): Deleted.
2986         (WebKit::WebPlatformStrategies::platformGamepads): Deleted.
2987         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2988
2989 2014-06-26  Dan Bernstein  <mitz@apple.com>
2990
2991         [iOS] Add API for opting into character selection granularity
2992         https://bugs.webkit.org/show_bug.cgi?id=134354
2993
2994         Reviewed by Geoff Garen.
2995
2996         * Shared/API/Cocoa/WKFoundation.h: Added a definition of WK_ENUM_AVAILABLE_IOS.
2997         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2998         (WKSelectionGranularity): Added this enum with two values, one representing dynamic
2999         granularity( the current, default behavior) and one representing character granularity.
3000         Delcared new selectionGranularity property.
3001         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3002         (-[WKWebViewConfiguration copyWithZone:]): Copy the _selectionGranularity ivar.
3003
3004         * UIProcess/ios/WKContentViewInteraction.mm:
3005         (toUIWebSelectionMode): Added this helper function for mapping WKSelectionGranularity values
3006         to UIWebSelectionMode values.
3007         (-[WKContentView setupInteraction]): Use a selection assistant with the mode specified in
3008         the configuration.
3009         (-[WKContentView _stopAssistingKeyboard]): Ditto.
3010
3011         * WebProcess/WebPage/ios/WebPageIOS.mm:
3012         (WebKit::WebPage::selectWithGesture): Changed the behavior of the loupe gesture type in
3013         non-editable text to select a word, rather than an empty range, matching the UITextView
3014         behavior.
3015
3016 2014-06-26  Ada Chan  <adachan@apple.com>
3017
3018         Change the target membership of WKBackForwardListPrivate.h from WebKit2 to WebKit.
3019
3020         Rubber-stamped by Dan Bernstein.
3021
3022         * WebKit2.xcodeproj/project.pbxproj:
3023
3024 2014-06-26  Benjamin Poulain  <bpoulain@apple.com>
3025
3026         Remove a useless return in WebPageProxyIOS
3027
3028         * UIProcess/ios/WebPageProxyIOS.mm:
3029         (WebKit::WebPageProxy::updateVisibleContentRects):
3030         Darin caught this mistake in r170460.
3031
3032 2014-06-26  Chris Fleizach  <cfleizach@apple.com>
3033
3034         Add an undo group for each dictated utterance in WebKit
3035         https://bugs.webkit.org/show_bug.cgi?id=134086
3036
3037         Applied review comments from Sam Weinig.
3038
3039         Move the associated USE #define into Platform.h.
3040
3041         * UIProcess/PageClient.h:
3042
3043 2014-06-24  Roger Fong  <roger_fong@apple.com>
3044
3045         Don't allow sudden termination while writing to local storage.
3046         https://bugs.webkit.org/show_bug.cgi?id=134254.
3047         <rdar://problem/15093854>.
3048
3049         Reviewed by Darin Adler.
3050
3051         * UIProcess/Storage/LocalStorageDatabase.cpp:
3052         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
3053         Disable sudden termination when a database update is scheduled.
3054         (WebKit::LocalStorageDatabase::updateDatabase):
3055         Re-enable sudden termination when the update completes.
3056         * UIProcess/Storage/LocalStorageDatabase.h:
3057
3058 2014-06-25  Benjamin Poulain  <bpoulain@apple.com>
3059
3060         [iOS][WK2] Update the long press interactions correctly when an overflow scroll view scrolls
3061         https://bugs.webkit.org/show_bug.cgi?id=134334
3062
3063         Reviewed by Simon Fraser.
3064
3065         * UIProcess/PageClient.h:
3066         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3067         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
3068         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3069         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3070         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
3071         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture):
3072         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture): Deleted.
3073         * UIProcess/WebPageProxy.h:
3074         * UIProcess/ios/PageClientImplIOS.h:
3075         * UIProcess/ios/PageClientImplIOS.mm:
3076         (WebKit::PageClientImpl::overflowScrollViewWillStartPanGesture):
3077         (WebKit::PageClientImpl::overflowScrollViewDidScroll):
3078         (WebKit::PageClientImpl::scrollViewWillStartPanGesture): Deleted.
3079         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3080         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
3081         * UIProcess/ios/WKContentViewInteraction.h:
3082         * UIProcess/ios/WebPageProxyIOS.mm:
3083         (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
3084         (WebKit::WebPageProxy::overflowScrollViewDidScroll):
3085         (WebKit::WebPageProxy::scrollViewWillStartPanGesture): Deleted.
3086
3087 2014-06-25  Simon Fraser  <simon.fraser@apple.com>
3088
3089         [iOS WK2] Page jumps when rubber-banding on azuremagazine.com 
3090         https://bugs.webkit.org/show_bug.cgi?id=134238
3091         <rdar://problem/16918228>
3092
3093         Reviewed by Benjamin Poulain.
3094         
3095         If the scroll view is in the process of rubber-banding when -setContentSize: is called,
3096         it clamps the scroll offsets between zero and the max value, which visibly interrupts the
3097         rubberband. This can easily happen now that we continually send scroll events to the page
3098         on scrolling, especially when pages like azuremagazine.com do fake sticky by toggling
3099         in-flow elements into position:fixed.
3100         
3101         Fix by computing the amount of rubber-band before calling -setContentSize:, and then
3102         restoring the contentOffset with the same amount of rubber-band even when the content size
3103         is different, for top/left rubberbands.
3104         
3105         * UIProcess/API/Cocoa/WKWebView.mm:
3106         (-[WKWebView _didCommitLayerTree:WebKit::]):
3107         * UIProcess/ios/WKScrollView.h:
3108         * UIProcess/ios/WKScrollView.mm:
3109         (-[WKScrollView _currentTopLeftRubberbandAmount]):
3110         (-[WKScrollView _restoreContentOffsetWithRubberbandAmount:]):
3111         (-[WKScrollView _setContentSizePreservingContentOffsetDuringRubberband:]):
3112
3113 2014-06-25  Simon Fraser  <simon.fraser@apple.com>
3114
3115         [iOS WK2] Fixed position elements jump around when zooming
3116         https://bugs.webkit.org/show_bug.cgi?id=134328
3117         <rdar://problem/17447048>
3118
3119         Reviewed by Zalan Bujtas.
3120
3121         If a given remote layer tree commit contains changes of layers for viewport-constrained
3122         objects, then the associated scrolling tree also needs to show that the layers changed,
3123         since we need to re-run the "viewport changed" logic in the UI process to get the
3124         layers correctly positioned for the current zoom level.
3125         
3126         The bug was that page scale changes resulted in small "pixel alignment" position
3127         changes which touched layers, but we didn't commit any scrolling tree changes. So
3128         the scrolling tree commit would result in visibly stale layer positions, with no scrolling tree
3129         update to adjust them for the current transient zoom.
3130
3131         Fix by making use of the existing "alignment offset" field in the ViewportConstraints
3132         data, and having RemoteScrollingCoordinatorProxy::connectStateNodeLayers() note that
3133         fixed or sticky layers changed if any properties of fixed or sticky scrolling tree
3134         nodes were updated.
3135
3136         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3137         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3138
3139 2014-06-25  Benjamin Poulain  <bpoulain@apple.com>
3140
3141         REGRESSION (r170325): UI process crashes in lastCommittedLayerTreeTransactionID() when the Web Content process crashes
3142         https://bugs.webkit.org/show_bug.cgi?id=134284
3143
3144         Reviewed by Simon Fraser.
3145
3146         The crash was caused by the access to the Drawing Area after the crash.
3147         This lead to discovering another bug: m_lastVisibleContentRectUpdate could have been updated after WebPageProxy::resetState(),
3148         which in turn would prevent valid updates when a new WebProcess is created.
3149
3150         This patch fixes both issues by moving the VisibleContentRectUpdateInfo to be internal to WebPageProxy,
3151         then early return if we get there in an invalid state.
3152
3153         * UIProcess/WebPageProxy.h:
3154         * UIProcess/ios/WKContentView.mm:
3155         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
3156         * UIProcess/ios/WebPageProxyIOS.mm:
3157         (WebKit::WebPageProxy::updateVisibleContentRects):
3158
3159 2014-06-25  Brady Eidson  <beidson@apple.com>
3160
3161         Add new platform gamepad abstractions
3162         https://bugs.webkit.org/show_bug.cgi?id=134325
3163
3164         Reviewed by Dean Jackson.
3165
3166         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
3167         (WebKit::NetworkProcessPlatformStrategies::createGamepadStrategy):
3168         * NetworkProcess/NetworkProcessPlatformStrategies.h:
3169
3170         Actually return a GamepadStrategy in WK2 with no implementation for now:
3171         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3172         (WebKit::WebPlatformStrategies::createGamepadStrategy):
3173         (WebKit::WebPlatformStrategies::startMonitoringGamepads):
3174         (WebKit::WebPlatformStrategies::stopMonitoringGamepads):
3175         (WebKit::WebPlatformStrategies::platformGamepads):
3176         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3177
3178 2014-06-25  Jaehun Lim  <ljaehun.lim@samsung.com>
3179
3180         Unreviewed, CMake build fix after r170450
3181
3182         * CMakeLists.txt: Add ProcessAssertion.cpp and ProcessThrottler.cpp.
3183         * UIProcess/ProcessAssertion.cpp: Replace #import with #include.
3184
3185 2014-06-25  Tim Horton  <timothy_horton@apple.com>
3186
3187         [WK2] Shadow layer is in the wrong place while pinch-zooming
3188         https://bugs.webkit.org/show_bug.cgi?id=134321
3189
3190         Reviewed by Dan Bernstein.
3191
3192         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3193         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
3194         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
3195         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
3196         The anchor point of the shadow layer changed, so we no longer need to shift our position to the center.
3197
3198 2014-06-25  Dan Bernstein  <mitz@apple.com>
3199
3200         Fixed crashes after r170450.
3201
3202         Reviewed by Tim Horton.
3203
3204         * UIProcess/WebProcessProxy.cpp:
3205         (WebKit::WebProcessProxy::WebProcessProxy): Removed iOS platform #ifdef around
3206         initialization of m_throttler.
3207
3208 2014-06-25  Beth Dakin  <bdakin@apple.com>
3209
3210         Crash in ScrollingTree::isRubberBandInProgress()
3211         https://bugs.webkit.org/show_bug.cgi?id=134316
3212         -and corresponding-
3213         <rdar://problem/16247911>
3214
3215         Reviewed by Geoffrey Garen.
3216
3217         Move all ScrollingTreeNode creation from ScrollingCoordinator subclasses into 
3218         ScrollingTree subclasses.
3219
3220         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3221         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
3222         (WebKit::RemoteScrollingTree::createNode): Deleted.
3223         * UIProcess/Scrolling/RemoteScrollingTree.h:
3224         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3225         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3226         (WebKit::RemoteScrollingCoordinator::createScrollingTreeNode): Deleted.
3227
3228 2014-06-25  Dan Bernstein  <mitz@apple.com>
3229
3230         Web process should become active when sent a message that requires a callback
3231         https://bugs.webkit.org/show_bug.cgi?id=134315
3232
3233         Reviewed by Tim Horton.
3234
3235         * UIProcess/API/Cocoa/WKWebView.mm:
3236         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Removed one-off code to
3237         acquire an activity token, now that WebPageProxy::takeSnapshot does it automatically for us.
3238
3239         * UIProcess/GenericCallback.h:
3240         (WebKit::CallbackBase::CallbackBase): Made this constructor take and adopt an activity
3241         token.
3242         (WebKit::GenericCallback::create): Added an optional activity token parameter.
3243         (WebKit::GenericCallback::GenericCallback): Pass the activity token to the CallbackBase
3244         constructor.
3245         (WebKit::CallbackMap::put): Added an activity token parameter, which is passed along to
3246         GenericCallback::create.
3247
3248         * UIProcess/ProcessAssertion.cpp: Moved from Source/WebKit2/UIProcess/ios/ProcessAssertion.mm.
3249         This copy includes generic no-op implementations for platforms that don’t have assertions.
3250         (WebKit::ProcessAssertion::ProcessAssertion):
3251         (WebKit::ProcessAssertion::setState):
3252         * UIProcess/ProcessAssertion.h: Moved from Source/WebKit2/UIProcess/ios/ProcessAssertion.h.
3253         Changed platform #ifdefs to make this usable by all platforms.
3254
3255         * UIProcess/ProcessThrottler.cpp: Moved from Source/WebKit2/UIProcess/ios/ProcessThrottler.mm.
3256         Removed iOS platform #ifdef.
3257         * UIProcess/ProcessThrottler.h: Moved from Source/WebKit2/UIProcess/ios/ProcessThrottler.h.
3258         Ditto.
3259
3260         * UIProcess/WebPageProxy.cpp:
3261         (WebKit::WebPageProxy::validateCommand): Create a background activity token and pass it
3262         along to CallbackMap::put.
3263         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Ditto.
3264         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): Ditto.
3265         (WebKit::WebPageProxy::getSourceForFrame): Ditto.
3266         (WebKit::WebPageProxy::getContentsAsString): Ditto.
3267         (WebKit::WebPageProxy::getBytecodeProfile): Ditto.
3268         (WebKit::WebPageProxy::getSelectionOrContentsAsString): Ditto.
3269         (WebKit::WebPageProxy::getSelectionAsWebArchiveData): Ditto.
3270         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Ditto.
3271         (WebKit::WebPageProxy::getResourceDataFromFrame): Ditto.
3272         (WebKit::WebPageProxy::getWebArchiveOfFrame): Ditto.
3273         (WebKit::WebPageProxy::getMarkedRangeAsync): Ditto.
3274         (WebKit::WebPageProxy::getSelectedRangeAsync): Ditto.
3275         (WebKit::WebPageProxy::characterIndexForPointAsync): Ditto.
3276         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): Ditto.
3277         (WebKit::WebPageProxy::takeSnapshot): Ditto.
3278
3279         * UIProcess/WebProcessProxy.cpp:
3280         (WebKit::WebProcessProxy::sendProcessWillSuspend): Moved from WebProcessProxyIOS.mm.
3281         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Ditto.
3282         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
3283         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
3284         * UIProcess/WebProcessProxy.h: Removed iOS platform #ifdef.
3285         * UIProcess/WebProcessProxy.messages.in: Ditto.
3286
3287         * UIProcess/ios/ProcessAssertionIOS.mm: Renamed from Source/WebKit2/UIProcess/ios/ProcessAssertion.mm.
3288
3289         * UIProcess/ios/WebPageProxyIOS.mm:
3290         (WebKit::WebPageProxy::selectWithGesture): Changed to pass the function directly to
3291         CallbackMap::put, along with a background activity token.
3292         (WebKit::WebPageProxy::updateSelectionWithTouches): Ditto.
3293         (WebKit::WebPageProxy::requestAutocorrectionData): Ditto.
3294         (WebKit::WebPageProxy::applyAutocorrection): Ditto.
3295         (WebKit::WebPageProxy::requestDictationContext): Ditto.
3296         (WebKit::WebPageProxy::requestAutocorrectionContext): Ditto.
3297         (WebKit::WebPageProxy::selectWithTwoTouches): Ditto.
3298
3299         * UIProcess/ios/WebProcessProxyIOS.mm:
3300         (WebKit::WebProcessProxy::sendProcessWillSuspend): Moved to WebProcessProxy.cpp.
3301         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Ditto.
3302         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
3303         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
3304
3305         * UIProcess/mac/WebPageProxyMac.mm:
3306         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): Create a background
3307         activity token and pass it along to CallbackMap::put.
3308
3309         * WebKit2.xcodeproj/project.pbxproj: Updated for moves and copies.
3310
3311         * WebProcess/WebProcess.cpp:
3312         (WebKit::WebProcess::WebProcess): Moved iOS platform #ifdef.
3313         * WebProcess/WebProcess.h: Ditto.
3314         * WebProcess/WebProcess.messages.in: Ditto.
3315
3316 2014-06-25  Chris Fleizach  <cfleizach@apple.com>
3317
3318         Add an undo group for each dictated utterance in WebKit
3319         https://bugs.webkit.org/show_bug.cgi?id=134086
3320
3321         Reviewed by Enrica Casucci.
3322
3323         * UIProcess/API/mac/WKView.mm:
3324         (-[WKView insertText:replacementRange:]):
3325         (-[WKView validAttributesForMarkedText]):
3326         * UIProcess/PageClient.h:
3327         * UIProcess/WebPageProxy.cpp:
3328         (WebKit::WebPageProxy::registerInsertionUndoGrouping):
3329         (WebKit::WebPageProxy::insertTextAsync):
3330         * UIProcess/WebPageProxy.h:
3331         * UIProcess/WebPageProxy.messages.in:
3332         * UIProcess/ios/PageClientImplIOS.mm:
3333         (WebKit::PageClientImpl::registerInsertionUndoGrouping):
3334         * UIProcess/mac/PageClientImpl.h:
3335         * UIProcess/mac/PageClientImpl.mm:
3336         (WebKit::PageClientImpl::registerInsertionUndoGrouping):
3337         * UIProcess/mac/WebPageProxyMac.mm:
3338         (WebKit::WebPageProxy::insertDictatedTextAsync):
3339         * WebProcess/WebPage/WebPage.cpp:
3340         (WebKit::WebPage::insertTextAsync):
3341         * WebProcess/WebPage/WebPage.h:
3342         * WebProcess/WebPage/WebPage.messages.in:
3343         * WebProcess/WebPage/mac/WebPageMac.mm:
3344         (WebKit::WebPage::insertDictatedTextAsync):
3345
3346 2014-06-25  Joseph Pecoraro  <pecoraro@apple.com>
3347
3348         [iOS]: WK2 Inspector Node Search
3349         https://bugs.webkit.org/show_bug.cgi?id=134279
3350
3351         Reviewed by Benjamin Poulain.
3352
3353         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h: Added.
3354         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm: Added.
3355         (-[WKInspectorNodeSearchGestureRecognizer locationInView:]):
3356         (-[WKInspectorNodeSearchGestureRecognizer _processTouches:state:]):
3357         (-[WKInspectorNodeSearchGestureRecognizer touchesBegan:withEvent:]):
3358         (-[WKInspectorNodeSearchGestureRecognizer touchesMoved:withEvent:]):
3359         (-[WKInspectorNodeSearchGestureRecognizer touchesEnded:withEvent:]):
3360         (-[WKInspectorNodeSearchGestureRecognizer touchesCancelled:withEvent:]):
3361         (-[WKInspectorNodeSearchGestureRecognizer reset]):
3362         Gesture recognizer that tracks a single touch, updates as that touch
3363         moves, and ends when that touch is cancelled or ends. The location
3364         of the gesture recognizer is the location of the touch it was tracking.
3365
3366         * UIProcess/ios/WKContentViewInteraction.h:
3367         * UIProcess/ios/WKContentViewInteraction.mm:
3368         (-[WKContentView cleanupInteraction]):
3369         Handle the inspector node search gesture recognizer if needed.
3370
3371         (-[WKContentView _removeDefaultGestureRecognizers]):
3372         (-[WKContentView _addDefaultGestureRecognizers]):
3373         Helpers to add and remove the default gestures.
3374
3375         (-[WKContentView _enableInspectorNodeSearch]):
3376         (-[WKContentView _disableInspectorNodeSearch]):
3377         When node search is enabled, remove all gesture recognizers and
3378         replace with a single inspector node search gesture recognizer.
3379         Likewise, inverse that when disabled.
3380
3381         (-[WKContentView _inspectorNodeSearchRecognized:]):
3382         Notify the WebProcess of new touch positions during node search.
3383
3384         (-[WKContentView hasSelectablePositionAtPoint:]):
3385         When inspector node search is enabled, disable selection.
3386
3387         * WebProcess/WebPage/ios/WebPageIOS.mm:
3388         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
3389         Send a mouse move to the new location. WebCore will update the highlight.
3390
3391         (WebKit::WebPage::inspectorNodeSearchEndedAtPosition):
3392         Inspect the node at the location.
3393
3394         * UIProcess/API/Cocoa/WKWebView.mm:
3395         (-[WKWebView _enableInspectorNodeSearch]):
3396         (-[WKWebView _disableInspectorNodeSearch]):
3397         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3398         * UIProcess/PageClient.h:
3399         * UIProcess/WebPageProxy.h:
3400         * UIProcess/WebPageProxy.messages.in:
3401         * UIProcess/ios/PageClientImplIOS.h:
3402         * UIProcess/ios/PageClientImplIOS.mm:
3403         (WebKit::PageClientImpl::enableInspectorNodeSearch):
3404         (WebKit::PageClientImpl::disableInspectorNodeSearch):
3405         * UIProcess/ios/WebPageProxyIOS.mm:
3406         (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
3407         (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
3408         (WebKit::WebPageProxy::enableInspectorNodeSearch):
3409         (WebKit::WebPageProxy::disableInspectorNodeSearch):
3410         * WebKit2.xcodeproj/project.pbxproj:
3411         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3412         (WebKit::WebInspectorClient::didSetSearchingForNode):
3413         * WebProcess/WebCoreSupport/WebInspectorClient.h:
3414         * WebProcess/WebPage/WebPage.h:
3415         * WebProcess/WebPage/WebPage.messages.in:
3416         * WebProcess/WebPage/ios/WebPageIOS.mm:
3417         (WebKit::WebPage::enableInspectorNodeSearch):
3418         (WebKit::WebPage::disableInspectorNodeSearch):
3419         Pass the inspector node search state up from the WebProcess
3420         to the WKContentView in the UIProcess. Likewise some messages
3421         in the reverse direction.
3422
3423 2014-06-25  Dana Burkart  <dburkart@apple.com>
3424
3425         Add support for 5-tuple versioning.
3426
3427         Reviewed by David Farler.
3428
3429         * Configurations/Version.xcconfig:
3430