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