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