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