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