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