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