[iOS WK2] Page jumps when rubber-banding on azuremagazine.com
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-06-25  Simon Fraser  <simon.fraser@apple.com>
2
3         [iOS WK2] Page jumps when rubber-banding on azuremagazine.com 
4         https://bugs.webkit.org/show_bug.cgi?id=134238
5         <rdar://problem/16918228>
6
7         Reviewed by Benjamin Poulain.
8         
9         If the scroll view is in the process of rubber-banding when -setContentSize: is called,
10         it clamps the scroll offsets between zero and the max value, which visibly interrupts the
11         rubberband. This can easily happen now that we continually send scroll events to the page
12         on scrolling, especially when pages like azuremagazine.com do fake sticky by toggling
13         in-flow elements into position:fixed.
14         
15         Fix by computing the amount of rubber-band before calling -setContentSize:, and then
16         restoring the contentOffset with the same amount of rubber-band even when the content size
17         is different, for top/left rubberbands.
18         
19         * UIProcess/API/Cocoa/WKWebView.mm:
20         (-[WKWebView _didCommitLayerTree:WebKit::]):
21         * UIProcess/ios/WKScrollView.h:
22         * UIProcess/ios/WKScrollView.mm:
23         (-[WKScrollView _currentTopLeftRubberbandAmount]):
24         (-[WKScrollView _restoreContentOffsetWithRubberbandAmount:]):
25         (-[WKScrollView _setContentSizePreservingContentOffsetDuringRubberband:]):
26
27 2014-06-25  Simon Fraser  <simon.fraser@apple.com>
28
29         [iOS WK2] Fixed position elements jump around when zooming
30         https://bugs.webkit.org/show_bug.cgi?id=134328
31         <rdar://problem/17447048>
32
33         Reviewed by Zalan Bujtas.
34
35         If a given remote layer tree commit contains changes of layers for viewport-constrained
36         objects, then the associated scrolling tree also needs to show that the layers changed,
37         since we need to re-run the "viewport changed" logic in the UI process to get the
38         layers correctly positioned for the current zoom level.
39         
40         The bug was that page scale changes resulted in small "pixel alignment" position
41         changes which touched layers, but we didn't commit any scrolling tree changes. So
42         the scrolling tree commit would result in visibly stale layer positions, with no scrolling tree
43         update to adjust them for the current transient zoom.
44
45         Fix by making use of the existing "alignment offset" field in the ViewportConstraints
46         data, and having RemoteScrollingCoordinatorProxy::connectStateNodeLayers() note that
47         fixed or sticky layers changed if any properties of fixed or sticky scrolling tree
48         nodes were updated.
49
50         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
51         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
52
53 2014-06-25  Benjamin Poulain  <bpoulain@apple.com>
54
55         REGRESSION (r170325): UI process crashes in lastCommittedLayerTreeTransactionID() when the Web Content process crashes
56         https://bugs.webkit.org/show_bug.cgi?id=134284
57
58         Reviewed by Simon Fraser.
59
60         The crash was caused by the access to the Drawing Area after the crash.
61         This lead to discovering another bug: m_lastVisibleContentRectUpdate could have been updated after WebPageProxy::resetState(),
62         which in turn would prevent valid updates when a new WebProcess is created.
63
64         This patch fixes both issues by moving the VisibleContentRectUpdateInfo to be internal to WebPageProxy,
65         then early return if we get there in an invalid state.
66
67         * UIProcess/WebPageProxy.h:
68         * UIProcess/ios/WKContentView.mm:
69         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
70         * UIProcess/ios/WebPageProxyIOS.mm:
71         (WebKit::WebPageProxy::updateVisibleContentRects):
72
73 2014-06-25  Brady Eidson  <beidson@apple.com>
74
75         Add new platform gamepad abstractions
76         https://bugs.webkit.org/show_bug.cgi?id=134325
77
78         Reviewed by Dean Jackson.
79
80         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
81         (WebKit::NetworkProcessPlatformStrategies::createGamepadStrategy):
82         * NetworkProcess/NetworkProcessPlatformStrategies.h:
83
84         Actually return a GamepadStrategy in WK2 with no implementation for now:
85         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
86         (WebKit::WebPlatformStrategies::createGamepadStrategy):
87         (WebKit::WebPlatformStrategies::startMonitoringGamepads):
88         (WebKit::WebPlatformStrategies::stopMonitoringGamepads):
89         (WebKit::WebPlatformStrategies::platformGamepads):
90         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
91
92 2014-06-25  Jaehun Lim  <ljaehun.lim@samsung.com>
93
94         Unreviewed, CMake build fix after r170450
95
96         * CMakeLists.txt: Add ProcessAssertion.cpp and ProcessThrottler.cpp.
97         * UIProcess/ProcessAssertion.cpp: Replace #import with #include.
98
99 2014-06-25  Tim Horton  <timothy_horton@apple.com>
100
101         [WK2] Shadow layer is in the wrong place while pinch-zooming
102         https://bugs.webkit.org/show_bug.cgi?id=134321
103
104         Reviewed by Dan Bernstein.
105
106         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
107         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
108         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
109         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
110         The anchor point of the shadow layer changed, so we no longer need to shift our position to the center.
111
112 2014-06-25  Dan Bernstein  <mitz@apple.com>
113
114         Fixed crashes after r170450.
115
116         Reviewed by Tim Horton.
117
118         * UIProcess/WebProcessProxy.cpp:
119         (WebKit::WebProcessProxy::WebProcessProxy): Removed iOS platform #ifdef around
120         initialization of m_throttler.
121
122 2014-06-25  Beth Dakin  <bdakin@apple.com>
123
124         Crash in ScrollingTree::isRubberBandInProgress()
125         https://bugs.webkit.org/show_bug.cgi?id=134316
126         -and corresponding-
127         <rdar://problem/16247911>
128
129         Reviewed by Geoffrey Garen.
130
131         Move all ScrollingTreeNode creation from ScrollingCoordinator subclasses into 
132         ScrollingTree subclasses.
133
134         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
135         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
136         (WebKit::RemoteScrollingTree::createNode): Deleted.
137         * UIProcess/Scrolling/RemoteScrollingTree.h:
138         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
139         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
140         (WebKit::RemoteScrollingCoordinator::createScrollingTreeNode): Deleted.
141
142 2014-06-25  Dan Bernstein  <mitz@apple.com>
143
144         Web process should become active when sent a message that requires a callback
145         https://bugs.webkit.org/show_bug.cgi?id=134315
146
147         Reviewed by Tim Horton.
148
149         * UIProcess/API/Cocoa/WKWebView.mm:
150         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Removed one-off code to
151         acquire an activity token, now that WebPageProxy::takeSnapshot does it automatically for us.
152
153         * UIProcess/GenericCallback.h:
154         (WebKit::CallbackBase::CallbackBase): Made this constructor take and adopt an activity
155         token.
156         (WebKit::GenericCallback::create): Added an optional activity token parameter.
157         (WebKit::GenericCallback::GenericCallback): Pass the activity token to the CallbackBase
158         constructor.
159         (WebKit::CallbackMap::put): Added an activity token parameter, which is passed along to
160         GenericCallback::create.
161
162         * UIProcess/ProcessAssertion.cpp: Moved from Source/WebKit2/UIProcess/ios/ProcessAssertion.mm.
163         This copy includes generic no-op implementations for platforms that don’t have assertions.
164         (WebKit::ProcessAssertion::ProcessAssertion):
165         (WebKit::ProcessAssertion::setState):
166         * UIProcess/ProcessAssertion.h: Moved from Source/WebKit2/UIProcess/ios/ProcessAssertion.h.
167         Changed platform #ifdefs to make this usable by all platforms.
168
169         * UIProcess/ProcessThrottler.cpp: Moved from Source/WebKit2/UIProcess/ios/ProcessThrottler.mm.
170         Removed iOS platform #ifdef.
171         * UIProcess/ProcessThrottler.h: Moved from Source/WebKit2/UIProcess/ios/ProcessThrottler.h.
172         Ditto.
173
174         * UIProcess/WebPageProxy.cpp:
175         (WebKit::WebPageProxy::validateCommand): Create a background activity token and pass it
176         along to CallbackMap::put.
177         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Ditto.
178         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): Ditto.
179         (WebKit::WebPageProxy::getSourceForFrame): Ditto.
180         (WebKit::WebPageProxy::getContentsAsString): Ditto.
181         (WebKit::WebPageProxy::getBytecodeProfile): Ditto.
182         (WebKit::WebPageProxy::getSelectionOrContentsAsString): Ditto.
183         (WebKit::WebPageProxy::getSelectionAsWebArchiveData): Ditto.
184         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Ditto.
185         (WebKit::WebPageProxy::getResourceDataFromFrame): Ditto.
186         (WebKit::WebPageProxy::getWebArchiveOfFrame): Ditto.
187         (WebKit::WebPageProxy::getMarkedRangeAsync): Ditto.
188         (WebKit::WebPageProxy::getSelectedRangeAsync): Ditto.
189         (WebKit::WebPageProxy::characterIndexForPointAsync): Ditto.
190         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): Ditto.
191         (WebKit::WebPageProxy::takeSnapshot): Ditto.
192
193         * UIProcess/WebProcessProxy.cpp:
194         (WebKit::WebProcessProxy::sendProcessWillSuspend): Moved from WebProcessProxyIOS.mm.
195         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Ditto.
196         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
197         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
198         * UIProcess/WebProcessProxy.h: Removed iOS platform #ifdef.
199         * UIProcess/WebProcessProxy.messages.in: Ditto.
200
201         * UIProcess/ios/ProcessAssertionIOS.mm: Renamed from Source/WebKit2/UIProcess/ios/ProcessAssertion.mm.
202
203         * UIProcess/ios/WebPageProxyIOS.mm:
204         (WebKit::WebPageProxy::selectWithGesture): Changed to pass the function directly to
205         CallbackMap::put, along with a background activity token.
206         (WebKit::WebPageProxy::updateSelectionWithTouches): Ditto.
207         (WebKit::WebPageProxy::requestAutocorrectionData): Ditto.
208         (WebKit::WebPageProxy::applyAutocorrection): Ditto.
209         (WebKit::WebPageProxy::requestDictationContext): Ditto.
210         (WebKit::WebPageProxy::requestAutocorrectionContext): Ditto.
211         (WebKit::WebPageProxy::selectWithTwoTouches): Ditto.
212
213         * UIProcess/ios/WebProcessProxyIOS.mm:
214         (WebKit::WebProcessProxy::sendProcessWillSuspend): Moved to WebProcessProxy.cpp.
215         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Ditto.
216         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
217         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
218
219         * UIProcess/mac/WebPageProxyMac.mm:
220         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): Create a background
221         activity token and pass it along to CallbackMap::put.
222
223         * WebKit2.xcodeproj/project.pbxproj: Updated for moves and copies.
224
225         * WebProcess/WebProcess.cpp:
226         (WebKit::WebProcess::WebProcess): Moved iOS platform #ifdef.
227         * WebProcess/WebProcess.h: Ditto.
228         * WebProcess/WebProcess.messages.in: Ditto.
229
230 2014-06-25  Chris Fleizach  <cfleizach@apple.com>
231
232         Add an undo group for each dictated utterance in WebKit
233         https://bugs.webkit.org/show_bug.cgi?id=134086
234
235         Reviewed by Enrica Casucci.
236
237         * UIProcess/API/mac/WKView.mm:
238         (-[WKView insertText:replacementRange:]):
239         (-[WKView validAttributesForMarkedText]):
240         * UIProcess/PageClient.h:
241         * UIProcess/WebPageProxy.cpp:
242         (WebKit::WebPageProxy::registerInsertionUndoGrouping):
243         (WebKit::WebPageProxy::insertTextAsync):
244         * UIProcess/WebPageProxy.h:
245         * UIProcess/WebPageProxy.messages.in:
246         * UIProcess/ios/PageClientImplIOS.mm:
247         (WebKit::PageClientImpl::registerInsertionUndoGrouping):
248         * UIProcess/mac/PageClientImpl.h:
249         * UIProcess/mac/PageClientImpl.mm:
250         (WebKit::PageClientImpl::registerInsertionUndoGrouping):
251         * UIProcess/mac/WebPageProxyMac.mm:
252         (WebKit::WebPageProxy::insertDictatedTextAsync):
253         * WebProcess/WebPage/WebPage.cpp:
254         (WebKit::WebPage::insertTextAsync):
255         * WebProcess/WebPage/WebPage.h:
256         * WebProcess/WebPage/WebPage.messages.in:
257         * WebProcess/WebPage/mac/WebPageMac.mm:
258         (WebKit::WebPage::insertDictatedTextAsync):
259
260 2014-06-25  Joseph Pecoraro  <pecoraro@apple.com>
261
262         [iOS]: WK2 Inspector Node Search
263         https://bugs.webkit.org/show_bug.cgi?id=134279
264
265         Reviewed by Benjamin Poulain.
266
267         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h: Added.
268         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm: Added.
269         (-[WKInspectorNodeSearchGestureRecognizer locationInView:]):
270         (-[WKInspectorNodeSearchGestureRecognizer _processTouches:state:]):
271         (-[WKInspectorNodeSearchGestureRecognizer touchesBegan:withEvent:]):
272         (-[WKInspectorNodeSearchGestureRecognizer touchesMoved:withEvent:]):
273         (-[WKInspectorNodeSearchGestureRecognizer touchesEnded:withEvent:]):
274         (-[WKInspectorNodeSearchGestureRecognizer touchesCancelled:withEvent:]):
275         (-[WKInspectorNodeSearchGestureRecognizer reset]):
276         Gesture recognizer that tracks a single touch, updates as that touch
277         moves, and ends when that touch is cancelled or ends. The location
278         of the gesture recognizer is the location of the touch it was tracking.
279
280         * UIProcess/ios/WKContentViewInteraction.h:
281         * UIProcess/ios/WKContentViewInteraction.mm:
282         (-[WKContentView cleanupInteraction]):
283         Handle the inspector node search gesture recognizer if needed.
284
285         (-[WKContentView _removeDefaultGestureRecognizers]):
286         (-[WKContentView _addDefaultGestureRecognizers]):
287         Helpers to add and remove the default gestures.
288
289         (-[WKContentView _enableInspectorNodeSearch]):
290         (-[WKContentView _disableInspectorNodeSearch]):
291         When node search is enabled, remove all gesture recognizers and
292         replace with a single inspector node search gesture recognizer.
293         Likewise, inverse that when disabled.
294
295         (-[WKContentView _inspectorNodeSearchRecognized:]):
296         Notify the WebProcess of new touch positions during node search.
297
298         (-[WKContentView hasSelectablePositionAtPoint:]):
299         When inspector node search is enabled, disable selection.
300
301         * WebProcess/WebPage/ios/WebPageIOS.mm:
302         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
303         Send a mouse move to the new location. WebCore will update the highlight.
304
305         (WebKit::WebPage::inspectorNodeSearchEndedAtPosition):
306         Inspect the node at the location.
307
308         * UIProcess/API/Cocoa/WKWebView.mm:
309         (-[WKWebView _enableInspectorNodeSearch]):
310         (-[WKWebView _disableInspectorNodeSearch]):
311         * UIProcess/API/Cocoa/WKWebViewInternal.h:
312         * UIProcess/PageClient.h:
313         * UIProcess/WebPageProxy.h:
314         * UIProcess/WebPageProxy.messages.in:
315         * UIProcess/ios/PageClientImplIOS.h:
316         * UIProcess/ios/PageClientImplIOS.mm:
317         (WebKit::PageClientImpl::enableInspectorNodeSearch):
318         (WebKit::PageClientImpl::disableInspectorNodeSearch):
319         * UIProcess/ios/WebPageProxyIOS.mm:
320         (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
321         (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
322         (WebKit::WebPageProxy::enableInspectorNodeSearch):
323         (WebKit::WebPageProxy::disableInspectorNodeSearch):
324         * WebKit2.xcodeproj/project.pbxproj:
325         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
326         (WebKit::WebInspectorClient::didSetSearchingForNode):
327         * WebProcess/WebCoreSupport/WebInspectorClient.h:
328         * WebProcess/WebPage/WebPage.h:
329         * WebProcess/WebPage/WebPage.messages.in:
330         * WebProcess/WebPage/ios/WebPageIOS.mm:
331         (WebKit::WebPage::enableInspectorNodeSearch):
332         (WebKit::WebPage::disableInspectorNodeSearch):
333         Pass the inspector node search state up from the WebProcess
334         to the WKContentView in the UIProcess. Likewise some messages
335         in the reverse direction.
336
337 2014-06-25  Dana Burkart  <dburkart@apple.com>
338
339         Add support for 5-tuple versioning.
340
341         Reviewed by David Farler.
342
343         * Configurations/Version.xcconfig:
344
345 2014-06-25  Dan Bernstein  <mitz@apple.com>
346
347         <rdar://problem/17448049> REGRESSION (r170254): Input methods don’t work
348         https://bugs.webkit.org/show_bug.cgi?id=134311
349
350         Reviewed by Tim Horton.
351
352         * UIProcess/WebPageProxy.cpp:
353         (WebKit::WebPageProxy::getSelectedRangeAsync): Removed code that accidentally put the
354         callback function into a throwaway EditingRangeCallback.
355
356 2014-06-25  Timothy Horton  <timothy_horton@apple.com>
357
358         [iOS][WK2] Rotating a zoomed PDF leads to weird scrolling behavior
359         https://bugs.webkit.org/show_bug.cgi?id=134286
360
361         Reviewed by Benjamin Poulain.
362
363         * UIProcess/ios/WKPDFView.mm:
364         (-[WKPDFView _computePageAndDocumentFrames]):
365         The WKPDFView frame and scroll view content size need to be scaled.
366
367         (-[WKPDFView web_setScrollView:]): Deleted.
368
369         (-[WKPDFView web_initWithFrame:webView:]):
370         Get rid of _documentFrame, and don't set it at initWithFrame: time (it's not useful yet).
371
372 2014-06-25  Laszlo Gombos  <l.gombos@samsung.com>
373
374         Remove build guard for progress element
375         https://bugs.webkit.org/show_bug.cgi?id=134292
376
377         Reviewed by Benjamin Poulain.
378
379         * Configurations/FeatureDefines.xcconfig:
380
381 2014-06-24  Carlos Garcia Campos  <cgarcia@igalia.com>
382
383         [GTK] Windowed plugins visibility doesn't work
384         https://bugs.webkit.org/show_bug.cgi?id=131487
385
386         Reviewed by Anders Carlsson.
387
388         Implement plugins visibility changes and add a new message to
389         notify the UI process when a windowed plugin is shown/hidden to
390         show/hide the plugin widget.
391
392         * PluginProcess/PluginControllerProxy.cpp:
393         (WebKit::PluginControllerProxy::visibilityDidChange): Add
394         implementation to notify the plugin about visibility change.
395         (WebKit::PluginControllerProxy::windowedPluginVisibilityDidChange):
396         Send WindowedPluginVisibilityDidChange to the plugin proxy.
397         * PluginProcess/PluginControllerProxy.h:
398         * PluginProcess/PluginControllerProxy.messages.in: Add VisibilityDidChange message.
399         * UIProcess/WebPageProxy.h: Add windowedPluginVisibilityDidChange
400         to handle WindowedPluginVisibilityDidChange message.
401         * UIProcess/WebPageProxy.messages.in: Add WindowedPluginVisibilityDidChange message.
402         * UIProcess/efl/WebPageProxyEfl.cpp:
403         (WebKit::WebPageProxy::windowedPluginVisibilityDidChange):
404         * UIProcess/gtk/WebPageProxyGtk.cpp:
405         (WebKit::WebPageProxy::createPluginContainer): Do not show the
406         plugins by default.
407         (WebKit::WebPageProxy::windowedPluginVisibilityDidChange): Show or hide the plugin widget.
408         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
409         (WebKit::NetscapePlugin::NetscapePlugin): Initialize m_isVisible.
410         (WebKit::NetscapePlugin::visibilityDidChange): Add visible parameter and save it in m_isVisible
411         member, calling platformVisibilityDidChange() only when it has actually changed.
412         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
413         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
414         (WebKit::NetscapePlugin::platformVisibilityDidChange): Notify the controller about visibility change.
415         * WebProcess/Plugins/PDF/PDFPlugin.h:
416         * WebProcess/Plugins/Plugin.h:
417         * WebProcess/Plugins/PluginController.h:
418         * WebProcess/Plugins/PluginProxy.cpp:
419         (WebKit::PluginProxy::visibilityDidChange): Send VisibilityDidChange message to the plugin controller proxy.
420         (WebKit::PluginProxy::windowedPluginVisibilityDidChange): Notify the controller about visibility change.
421         * WebProcess/Plugins/PluginProxy.h:
422         * WebProcess/Plugins/PluginProxy.messages.in: Add WindowedPluginVisibilityDidChange message.
423         * WebProcess/Plugins/PluginView.cpp:
424         (WebKit::PluginView::didInitializePlugin): Also call viewVisibilityDidChange() when the plugin is initialized.
425         (WebKit::PluginView::setParentVisible): Override this Widget method to update the plugin visibility when parent
426         widget is shown/hidden.
427         (WebKit::PluginView::viewVisibilityDidChange): Pass visible parameter to visibilityDidChange().
428         (WebKit::PluginView::windowedPluginVisibilityDidChange): Send WindowedPluginVisibilityDidChange message to the UI process.
429         * WebProcess/Plugins/PluginView.h:
430
431 2014-06-24  Benjamin Poulain  <bpoulain@apple.com>
432
433         [iOS][WK2] We should not start potential tap activation unless the tap gesture recognizer succeed
434         https://bugs.webkit.org/show_bug.cgi?id=134277
435         <rdar://problem/17439973>
436
437         Reviewed by Anders Carlsson.
438
439         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m:
440         (-[WKSyntheticClickTapGestureRecognizer setState:]):
441         We were calling the _gestureRecognizedAction even for failure states. The potential activation work
442         is not light on the Web Process, we should not start if we don't care about the result.
443
444 2014-06-24  Benjamin Poulain  <bpoulain@apple.com>
445
446         [iOS][WK2] Adopt the C API of UIWebTouchEventsGestureRecognizer for touch event mapping
447         https://bugs.webkit.org/show_bug.cgi?id=134234
448
449         Reviewed by Tim Horton.
450
451         The C API is more efficient and expose properties we will need for other patches. This patch moves from
452         getting each value independently on UIWebTouchEventsGestureRecognizer to the single structure exposed
453         by _UIWebTouchEvent.
454
455         * Shared/NativeWebTouchEvent.h:
456         * Shared/ios/NativeWebTouchEventIOS.mm:
457         (WebKit::convertTouchPhase):
458         (WebKit::extractWebTouchPoint):
459         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
460         * UIProcess/ios/WKContentViewInteraction.mm:
461         (-[WKContentView _webTouchEventsRecognized:]):
462
463 2014-06-24  Joseph Pecoraro  <pecoraro@apple.com>
464
465         [iOS]: WK2 Inspector Node Highlighting
466         https://bugs.webkit.org/show_bug.cgi?id=134257
467
468         Reviewed by Timothy Hatcher.
469
470         * Scripts/webkit2/messages.py:
471         (struct_or_class):
472         (headers_for_type):
473         * Shared/WebCoreArgumentCoders.h:
474         * Shared/WebCoreArgumentCoders.cpp:
475         (IPC::ArgumentCoder<Highlight>::encode):
476         (IPC::ArgumentCoder<Highlight>::decode):
477         Add a way to encode a WebCore::Highlight struct.
478
479         * UIProcess/API/Cocoa/WKWebViewInternal.h:
480         * UIProcess/API/Cocoa/WKWebView.mm:
481         (-[WKWebView _showInspectorHighlight:WebCore::]):
482         (-[WKWebView _hideInspectorHighlight]):
483         * UIProcess/PageClient.h:
484         * UIProcess/WebPageProxy.h:
485         * UIProcess/WebPageProxy.messages.in:
486         * UIProcess/ios/PageClientImplIOS.h:
487         * UIProcess/ios/PageClientImplIOS.mm:
488         (WebKit::PageClientImpl::showInspectorHighlight):
489         (WebKit::PageClientImpl::hideInspectorHighlight):
490         * UIProcess/ios/WebPageProxyIOS.mm:
491         (WebKit::WebPageProxy::showInspectorHighlight):
492         (WebKit::WebPageProxy::hideInspectorHighlight):
493         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
494         (WebKit::WebInspectorClient::highlight):
495         (WebKit::WebInspectorClient::hideHighlight):
496         * WebProcess/WebPage/WebPage.h:
497         * WebProcess/WebPage/ios/WebPageIOS.mm:
498         (WebKit::WebPage::showInspectorHighlight):
499         (WebKit::WebPage::hideInspectorHighlight):
500         Send web process highlight / hideHighlight messages up to
501         the UIProcess so it can highlight in the WKContentView.
502         Pass up a WebCore::Highlight in Document coordinates.
503
504         * UIProcess/ios/WKContentView.h:
505         * UIProcess/ios/WKContentView.mm:
506         (-[WKInspectorHighlightView initWithFrame:]):
507         (-[WKInspectorHighlightView dealloc]):
508         (-[WKInspectorHighlightView _removeAllLayers]):
509         (-[WKInspectorHighlightView _createLayers:]):
510         (findIntersectionOnLineBetweenPoints):
511         (quadIntersection):
512         (layerPathWithHole):
513         (layerPath):
514         (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
515         (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
516         (-[WKInspectorHighlightView update:]):
517         Reuse the WebKit1 code to turn highlight float quads into CAShapeLayers.
518
519         (-[WKContentView _showInspectorHighlight:WebCore::]):
520         (-[WKContentView _hideInspectorHighlight]):
521         Show and hide the highlight view with the respective WebCore::Highlight.
522
523 2014-06-24  Anders Carlsson  <andersca@apple.com>
524
525         Simplify decodeLegacySessionState
526         https://bugs.webkit.org/show_bug.cgi?id=134280
527
528         Reviewed by Andreas Kling.
529
530         There's no need to use a LegacySessionStateDecoder object with a single member,
531         just make all functions static and only export a single entry point; decodeLegacySessionState.
532
533         No functionality change, just moving code around.
534
535         * UIProcess/API/C/WKSessionStateRef.cpp:
536         (WKSessionStateCreateFromData):
537         * UIProcess/mac/LegacySessionStateCoding.cpp:
538         (WebKit::decodeSessionHistoryEntryData):
539         (WebKit::decodeSessionHistoryEntry):
540         (WebKit::decodeSessionHistoryEntries):
541         (WebKit::decodeV0SessionHistory):
542         (WebKit::decodeV1SessionHistory):
543         (WebKit::decodeSessionHistory):
544         (WebKit::decodeLegacySessionState):
545         (WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder): Deleted.
546         (WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder): Deleted.
547         (WebKit::LegacySessionStateDecoder::decodeSessionState): Deleted.
548         (WebKit::LegacySessionStateDecoder::decodeSessionHistory): Deleted.
549         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory): Deleted.
550         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory): Deleted.
551         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries): Deleted.
552         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry): Deleted.
553         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData): Deleted.
554         * UIProcess/mac/LegacySessionStateCoding.h:
555
556 2014-06-24  Brady Eidson  <beidson@apple.com>
557
558         Enable GAMEPAD in the Mac build, but disabled at runtime.
559         https://bugs.webkit.org/show_bug.cgi?id=134255
560
561         Reviewed by Dean Jackson.
562
563         * Configurations/FeatureDefines.xcconfig:
564
565         * Shared/WebPreferencesDefinitions.h:
566         * UIProcess/API/C/WKPreferences.cpp:
567         (WKPreferencesSetGamepadsEnabled):
568         (WKPreferencesGetGamepadsEnabled):
569         * UIProcess/API/C/WKPreferencesRefPrivate.h:
570
571         * WebProcess/WebPage/WebPage.cpp:
572         (WebKit::WebPage::updatePreferences):
573
574 2014-06-24  Anders Carlsson  <andersca@apple.com>
575
576         Add support for v0 legacy decoding
577         https://bugs.webkit.org/show_bug.cgi?id=134275
578
579         Reviewed by Andreas Kling.
580
581         * Shared/SessionState.h:
582         * UIProcess/mac/LegacySessionStateCoding.cpp:
583         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory):
584         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory):
585
586 2014-06-24  Anders Carlsson  <andersca@apple.com>
587
588         Add SPI for clearing an entire back-forward list
589         https://bugs.webkit.org/show_bug.cgi?id=134274
590
591         Reviewed by Dan Bernstein.
592
593         Add -[WKBackForwardList _clear] which only clears the back-forward items, and
594         change -[WKBackForwardList _removeAllItems] to remove all items including the current one.
595
596         * UIProcess/API/Cocoa/WKBackForwardList.mm:
597         (-[WKBackForwardList _removeAllItems]):
598         (-[WKBackForwardList _clear]):
599         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h:
600         * UIProcess/WebBackForwardList.cpp:
601         (WebKit::WebBackForwardList::removeAllItems):
602         * UIProcess/WebBackForwardList.h:
603
604 2014-06-24  Anders Carlsson  <andersca@apple.com>
605
606         Add iOS specific frame state member variables
607         https://bugs.webkit.org/show_bug.cgi?id=134268
608
609         Reviewed by Andreas Kling.
610
611         * Shared/SessionState.cpp:
612         (WebKit::FrameState::encode):
613         (WebKit::FrameState::decode):
614         * Shared/SessionState.h:
615         * UIProcess/mac/LegacySessionStateCoding.cpp:
616         (WebKit::HistoryEntryDataDecoder::operator>>):
617         (WebKit::decodeBackForwardTreeNode):
618         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
619         (WebKit::toFrameState):
620         (WebKit::applyFrameState):
621
622 2014-06-24  Enrica Casucci  <enrica@apple.com>
623
624         iOS WebKit2: block selection tends to prefer block to single words even when the page is zoomed.
625         https://bugs.webkit.org/show_bug.cgi?id=134267
626         <rdar://problem/17138059>
627
628         Reviewed by Benjamin Poulain.
629
630         When trying to find the best selection match for the position where the tap occurs,
631         we need to take into account the page scale. This patch applies the scale factor
632         to the selection rect before comparing it with the desired size.
633
634         * WebProcess/WebPage/ios/WebPageIOS.mm:
635         (WebKit::WebPage::rangeForWebSelectionAtPosition):
636
637 2014-06-24  Anders Carlsson  <andersca@apple.com>
638
639         Add code to convert HistoryItem to PageState
640         https://bugs.webkit.org/show_bug.cgi?id=134263
641
642         Reviewed by Andreas Kling.
643
644         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
645         (WebKit::toHTTPBody):
646         (WebKit::toFrameState):
647         (WebKit::toPageState):
648         * WebProcess/WebCoreSupport/SessionStateConversion.h:
649
650 2014-06-24  Andreas Kling  <akling@apple.com>
651
652         [iOS WebKit2] Disable screen font substitution by default.
653         <https://webkit.org/b/134266>
654         <rdar://problem/17427740>
655
656         Just like OS X >= 10.9, screen font substitution should be disabled
657         by default in WebKit2 for iOS.
658
659         Reviewed by Anders Carlsson.
660
661         * Shared/WebPreferencesDefinitions.h:
662
663 2014-06-24  Anders Carlsson  <andersca@apple.com>
664
665         Add PageState to HistoryItem conversion code
666         https://bugs.webkit.org/show_bug.cgi?id=134259
667
668         Reviewed by Andreas Kling.
669
670         * Shared/SessionState.h:
671         * UIProcess/mac/LegacySessionStateCoding.cpp:
672         (WebKit::decodeBackForwardTreeNode):
673         * WebKit2.xcodeproj/project.pbxproj:
674         * WebProcess/WebCoreSupport/SessionStateConversion.cpp: Added.
675         (WebKit::toFormData):
676         (WebKit::applyFrameState):
677         (WebKit::toHistoryItem):
678         * WebProcess/WebCoreSupport/SessionStateConversion.h: Added.
679
680 2014-06-24  Antti Koivisto  <antti@apple.com>
681
682         Only flush layers when the exposed rect actually changes
683         https://bugs.webkit.org/show_bug.cgi?id=134248
684
685         Reviewed by Anders Carlsson.
686
687         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
688         (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
689
690 2014-06-24  Martin Hock  <mhock@apple.com>
691
692         [iOS] DOMWindow::outerWidth and outerHeight don't return useful values, so return 0.
693         Also, revert r169281.
694         https://bugs.webkit.org/show_bug.cgi?id=134233
695         <rdar://problem/17060183>
696
697         Reviewed by Benjamin Poulain.
698
699         * UIProcess/Cocoa/UIDelegate.h:
700         * UIProcess/Cocoa/UIDelegate.mm:
701         (WebKit::UIDelegate::UIClient::windowFrame): Deleted.
702         * UIProcess/ios/PageClientImplIOS.mm:
703         (WebKit::PageClientImpl::convertToUserSpace):
704
705 2014-06-24  Jeremy Jones  <jeremyj@apple.com>
706
707         Initialize WKWebViewConfiguration properties to their default values.
708         https://bugs.webkit.org/show_bug.cgi?id=134216
709
710         Reviewed by Anders Carlsson.
711
712         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
713         (-[WKWebViewConfiguration init]):
714         add -init method to initialize _mediaPlaybackRequiresUserAction and _mediaPlaybackAllowsAirPlay.
715
716 2014-06-24  Anders Carlsson  <andersca@apple.com>
717
718         Add missing semicolon.
719
720         * UIProcess/API/Cocoa/WKWebView.mm:
721         (-[WKWebView _updateVisibleContentRects]):
722
723 2014-06-24  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
724
725         Fix unused parameter warnings if inspector is disabled
726         https://bugs.webkit.org/show_bug.cgi?id=134244
727
728         Reviewed by Zalan Bujtas.
729
730         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
731         (WKBundleInspectorShow):
732         (WKBundleInspectorClose):
733         (WKBundleInspectorEvaluateScriptForTest):
734         (WKBundleInspectorSetPageProfilingEnabled):
735
736 2014-06-24  Anders Carlsson  <andersca@apple.com>
737
738         WKWebView doesn't respect -[UIScrollView contentInset]
739         https://bugs.webkit.org/show_bug.cgi?id=134230
740         <rdar://problem/17429107>
741
742         Reviewed by Tim Horton.
743
744         * UIProcess/API/Cocoa/WKWebView.mm:
745         (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]):
746         Call initWithFrame and pass the WKWebView along.
747
748         (-[WKWebView _adjustedContentOffset:]):
749         New helper method that takes a content offset as a CGPoint and offsets it by the computed content inset.
750
751         (-[WKWebView _computedContentInset]):
752         New helper method that returns the _obscuredInsets, or if it's zero, the scroll view's content inset.
753
754         (-[WKWebView _processDidExit]):
755         Use _computedContentInset.
756
757         (-[WKWebView _didCommitLayerTree:WebKit::]):
758         use _computedContentInset.
759
760         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
761         Use _computedContentInset.
762
763         (-[WKWebView _scrollToContentOffset:WebCore::]):
764         Use _computedContentInset.
765
766         (-[WKWebView _updateVisibleContentRects]):
767         If we have a custom content view, call web_computedContentInsetDidChange.
768
769         (-[WKWebView _setObscuredInsets:]):
770         Don't call web_setObscuredInsets: if we have a custom content view.
771
772         * UIProcess/API/Cocoa/WKWebViewInternal.h:
773         Add new methods.
774
775         * UIProcess/Cocoa/WKWebViewContentProvider.h:
776         Add new methods.
777
778         * UIProcess/ios/WKPDFView.mm:
779         (-[WKPDFView web_initWithFrame:webView:]):
780         Set the _webView and _scrollView ivars.
781
782         (-[WKPDFView _offsetForPageNumberIndicator]):
783         Get the computed content offset from the WKWebView.
784
785         (-[WKPDFView web_computedContentInsetDidChange]):
786         Update the page indicator.
787         
788         (-[WKPDFView initWithFrame:]): Deleted.
789         (-[WKPDFView web_setObscuredInsets:]): Deleted.
790
791         * UIProcess/ios/WKScrollView.mm:
792         (-[WKScrollView setContentInset:]):
793         Call _updateVisibleContentRects.
794
795 2014-06-23  Jaehun Lim  <ljaehun.lim@samsung.com>
796
797         Unreviewed, fix build warning.
798
799         Source/WebKit2/WebProcess/WebPage/DrawingArea.h:117:18: warning: unused parameter ‘wantsDidUpdateViewState’ [-Wunused-parameter]
800
801         * WebProcess/WebPage/DrawingArea.h:
802         (WebKit::DrawingArea::viewStateDidChange):
803
804 2014-06-23  Ryuan Choi  <ryuan.choi@samsung.com>
805
806         [EFL] Replace RefPtr<Evas_Object> with UniquePtrEfl
807         https://bugs.webkit.org/show_bug.cgi?id=134236
808
809         Reviewed by Gyuyoung Kim.
810
811         * PlatformEfl.cmake:
812         * UIProcess/API/efl/EwkView.cpp:
813         (EwkView::updateCursor):
814         * UIProcess/API/efl/EwkView.h:
815         * UIProcess/API/efl/SnapshotImageGL.cpp:
816         * UIProcess/API/efl/ewk_favicon_database.cpp:
817         (ewk_favicon_database_icon_get):
818         * UIProcess/API/efl/tests/test_ewk2_refptr_evas_object.cpp: Removed.
819
820 2014-06-23  Daniel Bates  <dabates@apple.com>
821
822         [iOS][WK2] REGRESSION (r169324): Page jumps to top when you type into a text field
823         https://bugs.webkit.org/show_bug.cgi?id=134219
824         <rdar://problem/17279113>
825
826         Reviewed by Benjamin Poulain.
827
828         Fixes an issue where typing into a text field may cause a noticeable jump to the top of
829         the page.
830
831         Currently when updating the visual content rectangles we always constrain the scroll offset
832         (s_x, s_y) such that 0 <= s_x <= "content width" - "visible width" and 0 <= s_y <= "content height" - "visible height".
833         However the UIProcess may want to scroll the page by an offset outside of this range to
834         create a visually pleasing result. In particular, on iOS we may scroll the page slightly
835         outside of this range (e.g. s_y > 0 = "content height" - "visible height") when a form
836         control is focused so as to be consistent with platform convention.
837
838         * WebProcess/WebPage/ios/WebPageIOS.mm:
839         (WebKit::WebPage::updateVisibleContentRects): Temporarily disable content edge constraint when
840         updating scroll offset.
841
842 2014-06-23  Dan Bernstein  <mitz@apple.com>
843
844         <rdar://problem/17413374> [iOS] Application cache size per origin is not limited
845         https://bugs.webkit.org/show_bug.cgi?id=134229
846
847         Reviewed by Anders Carlsson.
848
849         * UIProcess/WebContext.cpp:
850         (WebKit::WebContext::createNewWebProcess): Set the default quota per origin to the same
851         value it is set in Legacy WebKit.
852
853 2014-06-23  Ryuan Choi  <ryuan.choi@samsung.com>
854
855         Unreviewed, EFL build fix after r170330.
856
857         * WebProcess/WebPage/WebPage.cpp: Guard WKStringCF.h with PLATFORM(COCOA) macro.
858
859 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
860
861         [WK2] Use the page background color instead of white when swipe snapshots were purged (134218)
862         https://bugs.webkit.org/show_bug.cgi?id=134218
863         <rdar://problem/17426454>
864
865         Reviewed by Benjamin Poulain.
866
867         * UIProcess/API/Cocoa/WKWebView.mm:
868         (-[WKWebView _updateScrollViewBackground]):
869         (-[WKWebView WebKit::]):
870         * UIProcess/API/mac/WKView.mm:
871         (-[WKView _takeViewSnapshot]):
872         * UIProcess/ios/ViewGestureControllerIOS.mm:
873         (WebKit::ViewGestureController::beginSwipeGesture):
874         * UIProcess/mac/ViewGestureControllerMac.mm:
875         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
876         (WebKit::ViewGestureController::beginSwipeGesture):
877         (WebKit::ViewGestureController::retrieveSnapshotForItem): Deleted.
878         * UIProcess/mac/ViewSnapshotStore.h:
879         Store a color along with each snapshot.
880         Set the background color of the swipe snapshot layer accordingly.
881
882 2014-06-23  Anders Carlsson  <andersca@apple.com>
883
884         Add -[WKBackForwardList _removeAllItems]
885         https://bugs.webkit.org/show_bug.cgi?id=134227
886         <rdar://problem/17291623>
887
888         Reviewed by Tim Horton.
889
890         * UIProcess/API/Cocoa/WKBackForwardList.mm:
891         (-[WKBackForwardList _removeAllItems]):
892         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Added.
893         * WebKit2.xcodeproj/project.pbxproj:
894
895 2014-06-23  Dan Bernstein  <mitz@apple.com>
896
897         <rdar://problem/17413498> [Cocoa] Expose WebPreferences::offlineWebApplicationCacheEnabled
898         https://bugs.webkit.org/show_bug.cgi?id=134217
899
900         Reviewed by Anders Carlsson.
901
902         * UIProcess/API/Cocoa/WKPreferences.mm:
903         (-[WKPreferences _offlineApplicationCacheIsEnabled]):
904         (-[WKPreferences _setOfflineApplicationCacheIsEnabled:]):
905         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added _offlineWebApplicationCacheIsEnabled
906         property.
907
908 2014-06-23  Grant Kennell  <gkennell@apple.com>
909
910         Add SPI for Injected Bundle to provide user agent for a given URL.
911         https://bugs.webkit.org/show_bug.cgi?id=133562
912
913         Reviewed by Sam Weinig.
914
915         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: 
916           Added delegate method to WebProcess PluIn protocol to provide UserAgent per URL.
917         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
918           Added new typedef for function pointer for this new delegate call.
919           Added new version (V8) of bundle loader client struct containing
920           a function pointer of that new type.
921         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
922         (userAgentForURL): Makes delegate call with the new method.
923         (setUpPageLoaderClient): Sets the struct's new function pointer to the new method.
924         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
925         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL):
926         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
927         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
928         (WebKit::WebFrameLoaderClient::userAgent):
929         * WebProcess/WebPage/WebPage.cpp:
930         (WebKit::WebPage::userAgent): Began using the new API to ask for user agent
931           instead of simply returning what had been stored.
932         * WebProcess/WebPage/WebPage.h:
933         (WebKit::WebPage::userAgent): Deleted.
934
935 2014-06-23  Commit Queue  <commit-queue@webkit.org>
936
937         Unreviewed, rolling out r170324.
938         https://bugs.webkit.org/show_bug.cgi?id=134223
939
940         lots of build breakage (Requested by bradeeoh on #webkit).
941
942         Reverted changeset:
943
944         "Unreviewed, revert an unintentional change committed with
945         r170323."
946         http://trac.webkit.org/changeset/170324
947
948 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
949
950         [iOS][wk2] Don't use view snapshots if the destination layer is a different size
951         https://bugs.webkit.org/show_bug.cgi?id=134210
952         <rdar://problem/17369463>
953
954         Reviewed by Benjamin Poulain.
955
956         * UIProcess/ios/ViewGestureControllerIOS.mm:
957         (WebKit::ViewGestureController::beginSwipeGesture):
958         Only use the view snapshot if the snapshot is the same (in device space) size
959         as the layer it's going to be put into, and only if the device scale factor is
960         the same as it was when the snapshot was taken.
961
962 2014-06-23  Benjamin Poulain  <bpoulain@apple.com>
963
964         [iOS][WK2] Make the state restore from HistoryItem more precise and reliable
965         https://bugs.webkit.org/show_bug.cgi?id=134150
966
967         Reviewed by Tim Horton.
968
969         This patch make several little improvements to improve how we restore the visible content rect and scale
970         from the HistoryItem.
971
972         The biggest architectural change is that the exposed rect is now restored on the UIProcess instead of the WebProcess,
973         this ensure we restore the same position regardless of any modification of obscured areas.
974
975         * Shared/VisibleContentRectUpdateInfo.cpp:
976         (WebKit::VisibleContentRectUpdateInfo::encode):
977         (WebKit::VisibleContentRectUpdateInfo::decode):
978         * Shared/VisibleContentRectUpdateInfo.h:
979         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
980         (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionId):
981         (WebKit::WebPage::updateVisibleContentRects):
982         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
983         A race between the UIProcess and the WebProcess could cause the viewport of the next page to be influenced by updates
984         of the previous page. To avoid that, VisibleContentRectUpdateInfo keeps track of the last transaction seen at the time
985         of the update.
986
987         The WebProcess updates the size and scale of the content through layer tree updates. If an update was generated for a layer tree
988         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,
989         the WebProcess was updating the scale of the current page based on incorrect information.
990
991         To avoid the problems, we save the layer tree transaction ID when we commit a new page. Only updates after that transaction are useful
992         for the current page.
993
994         * UIProcess/API/Cocoa/WKWebView.mm:
995         (-[WKWebView _processDidExit]):
996         (withinEpsilon):
997         (changeContentOffsetBoundedInValidRange):
998         (-[WKWebView _didCommitLayerTree:WebKit::]):
999         (-[WKWebView _restorePageStateToExposedRect:WebCore::scale:]):
1000         (-[WKWebView _restorePageStateToUnobscuredCenter:WebCore::scale:]):
1001         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1002         * UIProcess/PageClient.h:
1003         * UIProcess/WebPageProxy.h:
1004         * UIProcess/WebPageProxy.messages.in:
1005         * UIProcess/ios/PageClientImplIOS.h:
1006         * UIProcess/ios/PageClientImplIOS.mm:
1007         (WebKit::PageClientImpl::restorePageState):
1008         (WebKit::PageClientImpl::restorePageCenterAndScale):
1009         Restoring the state is now done by WKWebView. The state is only updated on the next layer tree commit,
1010         this is done to avoid any jumping if the page has scrolled since we tried to restore its state.
1011
1012         Both update path end up calling _updateVisibleContentRects. This is because the update on the WebProcess
1013         never sets the ScrollPosition (because it does not know the current state of the obscured insets). Pushing
1014         a new VisibleContentRect will nicely udpates the exposed rect, scroll position, fixed elements, etc.
1015
1016         * UIProcess/ios/WKContentView.mm:
1017         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1018         * UIProcess/ios/WebPageProxyIOS.mm:
1019         (WebKit::WebPageProxy::restorePageState):
1020         (WebKit::WebPageProxy::restorePageCenterAndScale):
1021         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1022         (WebKit::RemoteLayerTreeDrawingAreaProxy::lastCommittedLayerTreeTransactionID):
1023         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1024         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1025         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
1026         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
1027         (WebKit::WebFrameLoaderClient::restoreViewState):
1028         * WebProcess/WebPage/WebPage.cpp:
1029         (WebKit::WebPage::WebPage):
1030         (WebKit::WebPage::didCommitLoad):
1031         * WebProcess/WebPage/WebPage.h:
1032         Get rid of m_obscuredTopInset. It was a bad idea. The UIProcess updates the obscured insets a lot during
1033         page load, the value we used to restore the scroll position was frequently stale.
1034
1035         (WebKit::WebPage::userHasChangedPageScaleFactor): Deleted.
1036         * WebProcess/WebPage/ios/WebPageIOS.mm:
1037         (WebKit::WebPage::savePageState):
1038         (WebKit::scaleAfterViewportWidthChange):
1039         (WebKit::relativeCenterAfterContentSizeChange):
1040         (WebKit::adjustExposedRectForNewScale):
1041         Extract this out of dynamicViewportSizeUpdate(). It is useful to adjust the exposed rect when restoring a HistoryItem
1042         to a ViewportConfiguration that is different from when it was saved.
1043
1044         (WebKit::WebPage::restorePageState):
1045         There are two variations of restorePage:
1046         1) If the viewport configuration is compatible, restore the exact scale and position of the page.
1047         2) Otherwise, restore the scale and position similarily to dynamicViewportSizeUpdate().
1048
1049         (WebKit::WebPage::dynamicViewportSizeUpdate):
1050         (WebKit::WebPage::viewportConfigurationChanged):
1051         (WebKit::adjustExposedRectForBoundedScale):
1052         (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID):
1053         Expose the transactionID for the race issue on VisibleRectUpdate.
1054
1055         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1056         (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
1057         Store the exposed rect in floating point coordinates. This makes it possible to restore that exact
1058         position when needed.
1059
1060 2014-06-23  Eric Carlson  <eric.carlson@apple.com>
1061
1062         Unreviewed, revert an unintentional change committed with r170323.
1063
1064         * UIProcess/API/Cocoa/WKBackForwardList.mm:
1065
1066 2014-06-23  Anders Carlsson  <andersca@apple.com>
1067
1068         Policy delegate methods should use CompletionHandlerCallChecker
1069         https://bugs.webkit.org/show_bug.cgi?id=134215
1070
1071         Reviewed by Dan Bernstein.
1072
1073         * UIProcess/Cocoa/NavigationState.mm:
1074         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
1075         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
1076
1077 2014-06-23  Anders Carlsson  <andersca@apple.com>
1078
1079         Don't use the WK prefix for internal C++ types
1080         https://bugs.webkit.org/show_bug.cgi?id=134214
1081
1082         Reviewed by Dan Bernstein.
1083
1084         * Shared/AssistedNodeInformation.cpp:
1085         (WebKit::OptionItem::encode):
1086         (WebKit::OptionItem::decode):
1087         (WebKit::WKOptionItem::encode): Deleted.
1088         (WebKit::WKOptionItem::decode): Deleted.
1089         * Shared/AssistedNodeInformation.h:
1090         (WebKit::OptionItem::OptionItem):
1091         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
1092         (WebKit::WKOptionItem::WKOptionItem): Deleted.
1093         * UIProcess/ios/WKContentViewInteraction.h:
1094         * UIProcess/ios/WKContentViewInteraction.mm:
1095         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
1096         (-[WKContentView inputView]):
1097         (-[WKContentView requiresAccessoryView]):
1098         (-[WKContentView _updateAccessory]):
1099         (-[WKContentView textInputTraits]):
1100         (-[WKContentView assistedNodeSelectOptions]):
1101         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
1102         (-[WKContentView _stopAssistingNode]):
1103         * UIProcess/ios/forms/WKFormInputControl.mm:
1104         (-[WKDateTimePicker initWithView:datePickerMode:]):
1105         (-[WKFormInputControl initWithView:]):
1106         * UIProcess/ios/forms/WKFormSelectControl.h:
1107         * UIProcess/ios/forms/WKFormSelectControl.mm:
1108         (adjustedFontSize):
1109         * UIProcess/ios/forms/WKFormSelectPicker.mm:
1110         (-[WKOptionPickerCell initWithOptionItem:]):
1111         (-[WKOptionGroupPickerCell initWithOptionItem:]):
1112         (-[WKMultipleSelectPicker initWithView:]):
1113         (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
1114         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
1115         (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
1116         (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
1117         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1118         (-[WKSelectTableViewController initWithView:hasGroups:]):
1119         (-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
1120         (-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
1121         (-[WKSelectTableViewController populateCell:withItem:]):
1122         (-[WKSelectTableViewController findItemIndexAt:]):
1123         (-[WKSelectTableViewController findItemAt:]):
1124         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
1125         (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
1126         * WebProcess/WebPage/ios/WebPageIOS.mm:
1127         (WebKit::WebPage::getAssistedNodeInformation):
1128
1129 2014-06-23  Dan Bernstein  <mitz@apple.com>
1130
1131         [Cocoa] No way to grant storage quotas for web application cache
1132         https://bugs.webkit.org/show_bug.cgi?id=134213
1133
1134         Reviewed by Anders Carlsson.
1135
1136         * UIProcess/API/APIUIClient.h:
1137         (API::UIClient::reachedApplicationCacheOriginQuota): Added this new client function, with
1138         a default implementation that calls the completion handler with the current quota.
1139
1140         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared a new delegate method.
1141
1142         * UIProcess/API/Cocoa/_WKSecurityOrigin.mm:
1143         (-[_WKSecurityOrigin _initWithSecurityOrigin:WebCore::]): Changed the parameter into a const
1144         reference, since we copy it.
1145         * UIProcess/API/Cocoa/_WKSecurityOriginInternal.h:
1146
1147         * UIProcess/Cocoa/UIDelegate.h: Override API::UIClient::reachedApplicationCacheOriginQuota.
1148         Added flag to m_delegateMethods struct for new delegate method.
1149         * UIProcess/Cocoa/UIDelegate.mm:
1150         (WebKit::UIDelegate::setDelegate): Set new flag in m_delegateMethods struct.
1151         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Updated for change in
1152         _WKSecurityOrigin initializer.
1153         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Added. Calls the new
1154         delegate method.
1155
1156         * UIProcess/WebPageProxy.cpp:
1157         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota): Added. Forwards the message to
1158         the UI client.
1159         * UIProcess/WebPageProxy.h:
1160
1161         * UIProcess/WebPageProxy.messages.in: Added ReachedApplicationCacheOriginQuota message.
1162
1163         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
1164         (API::InjectedBundle::PageUIClient::didReachApplicationCacheOriginQuota): Changed the return
1165         type to bool, indicating whether the client handled the callback.
1166
1167         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1168         (WebKit::InjectedBundlePageUIClient::didReachApplicationCacheOriginQuota): Return the
1169         appropriate value.
1170         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1171
1172         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1173         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): If the bundle client didn’t
1174         handle the callback, send a message the the UI process, and update the quota with the reply.
1175
1176 2014-06-23  Tim Horton  <timothy_horton@apple.com>
1177
1178         [wk2] Synchronously wait a short time for a layer tree update after bringing a web view in-window
1179         https://bugs.webkit.org/show_bug.cgi?id=134189
1180
1181         Reviewed by Simon Fraser.
1182
1183         Make the old behavior of -[WKView endDeferringViewInWindowChangesSync] the default; synchronously wait
1184         for a fraction of a second when a page that was previously in-window but currently isn't comes back in-window,
1185         until new content is painted (or we hit a timeout).
1186         
1187         * UIProcess/DrawingAreaProxy.h:
1188         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState):
1189         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
1190         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1191         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState):
1192         Delegate waitForDidUpdateViewState to the DrawingAreaProxys, because behavior is very dependent on them.
1193
1194         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1195         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1196         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers):
1197         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
1198         Implement waitForDidUpdateViewState for the RemoteLayerTree; it waits for CommitLayerTree.
1199
1200         * UIProcess/WebPageProxy.cpp:
1201         (WebKit::WebPageProxy::WebPageProxy):
1202         (WebKit::WebPageProxy::updateViewState):
1203         (WebKit::WebPageProxy::viewStateDidChange):
1204         (WebKit::WebPageProxy::dispatchViewStateChange):
1205         (WebKit::WebPageProxy::waitForDidUpdateViewState):
1206         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1207         (WebKit::WebPageProxy::viewSize): Deleted.
1208         * UIProcess/WebPageProxy.h:
1209         (WebKit::WebPageProxy::didUpdateViewState):
1210         * UIProcess/API/mac/WKView.mm:
1211         (-[WKView endDeferringViewInWindowChangesSync]):
1212         Always waitForDidUpdateViewState when a page that was previously in-window but currently isn't comes back in-window.
1213
1214         * WebProcess/WebPage/DrawingArea.h:
1215         (WebKit::DrawingArea::viewStateDidChange):
1216         * WebProcess/WebPage/WebPage.cpp:
1217         (WebKit::WebPage::WebPage):
1218         (WebKit::WebPage::setViewState):
1219         (WebKit::WebPage::didUpdateViewStateTimerFired): Deleted.
1220         * WebProcess/WebPage/WebPage.h:
1221         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1222         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1223         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1224         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
1225         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1226         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1227         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1228         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange):
1229         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired):
1230         * WebProcess/WebPage/mac/WebPageMac.mm:
1231         (WebKit::WebPage::didUpdateViewStateTimerFired): Deleted.
1232         Delegate sending of didUpdateViewState to the DrawingAreas (RemoteLayerTreeDrawingArea won't send it,
1233             because the UI process waits for CommitLayerTree instead).
1234
1235 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
1236
1237         [iOS][wk2] Ensure that layers are marked volatile before allowing the process to suspend
1238         https://bugs.webkit.org/show_bug.cgi?id=134004
1239         <rdar://problem/17186342>
1240
1241         Reviewed by Simon Fraser.
1242
1243         WebKit tries to make layers volatile when unparented, but sometimes isn't given
1244         a chance to do so before the process gets suspended, so we end up with lots of
1245         non-volatile surfaces that should really be volatile.
1246
1247         * Shared/mac/RemoteLayerBackingStoreCollection.h:
1248         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1249         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatileImmediately):
1250         (WebKit::RemoteLayerBackingStoreCollection::markAllBackingStoreVolatileImmediatelyIfPossible):
1251         Add markAllBackingStoreVolatileImmediatelyIfPossible, which tries to mark *all*
1252         buffers of *all* backing store, (live and unreachable), (front, back, and secondary),
1253         volatile right away. It returns false if any buffer isn't marked volatile (because it was in-use).
1254
1255         * UIProcess/ios/ProcessThrottler.h:
1256         * UIProcess/ios/ProcessThrottler.mm:
1257         (WebKit::ProcessThrottler::updateAssertion):
1258         (WebKit::ProcessThrottler::processReadyToSuspend):
1259         (WebKit::ProcessThrottler::didCancelProcessSuspension):
1260         * UIProcess/ios/WebProcessProxyIOS.mm:
1261         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend):
1262         (WebKit::WebProcessProxy::didCancelProcessSuspension):
1263         * UIProcess/WebProcessProxy.h:
1264         * UIProcess/WebProcessProxy.messages.in:
1265         * WebProcess/WebProcess.h:
1266         * WebProcess/WebProcess.messages.in:
1267         If the UI process is waiting for the Web process to confirm that it can suspend
1268         and something happens (the view is reparented) that cancels the suspension, inform
1269         the Web process that this happened, so that it can cancel any cleanup that might still be taking place.
1270
1271         * UIProcess/WebPageProxy.cpp:
1272         (WebKit::WebPageProxy::viewStateDidChange):
1273         If a view goes in-window, dispatch the view state change immediately without delay,
1274         to minimize the latency between coming in-window and being ready to go.
1275
1276         * WebProcess/WebPage/DrawingArea.h:
1277         (WebKit::DrawingArea::markLayersVolatileImmediatelyIfPossible):
1278         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1279         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1280         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
1281         Schedule a flush when we change the root layer; otherwise, we can end up
1282         detaching the root layer but changing nothing else, and never committing that change.
1283
1284         (WebKit::RemoteLayerTreeDrawingArea::markLayersVolatileImmediatelyIfPossible):
1285
1286         * WebProcess/WebProcess.cpp:
1287         (WebKit::WebProcess::WebProcess):
1288         (WebKit::WebProcess::processWillSuspend):
1289         (WebKit::WebProcess::cancelProcessWillSuspend):
1290         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
1291         (WebKit::WebProcess::processSuspensionCleanupTimerFired):
1292         When the UI process is going to suspend the process, it sends us ProcessWillSuspend,
1293         and defers the suspension until we send a ProcessReadyToSuspend back.
1294         Delay ProcessReadyToSuspend until all layers in our process have been marked volatile.
1295         We'll keep trying every 20ms until they're all volatile. For safety, the UI process will eventually
1296         stop waiting for us, but the volatility change is usually applied successfully within the first
1297         or second timer callback.
1298
1299 2014-06-23  Oliver Hunt  <oliver@apple.com>
1300
1301         Ensure that we always use symlink free paths when specifying cache directories
1302         https://bugs.webkit.org/show_bug.cgi?id=134206
1303
1304         Reviewed by Anders Carlsson.
1305
1306         Sandboxing will deny symlink based paths, so we use realpath to create extensions.
1307         This leaves us in the position of an extension using a visually different path
1308         from other parts of the process code.  This patch simply makes sure that we always
1309         use the realpath for cache directories, so making debugging easier and also ensuring
1310         that we don't ever accidentally try to use a path with symlinks that will thus get
1311         denied.
1312
1313         * Shared/SandboxExtension.h:
1314         (WebKit::stringByResolvingSymlinksInPath):
1315         * Shared/mac/SandboxExtensionMac.mm:
1316         (WebKit::stringByResolvingSymlinksInPath):
1317         * UIProcess/WebContext.cpp:
1318         (WebKit::WebContext::ensureNetworkProcess):
1319         * UIProcess/mac/WebContextMac.mm:
1320         (WebKit::WebContext::platformDefaultApplicationCacheDirectory):
1321         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
1322         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory):
1323         (WebKit::WebContext::platformDefaultIconDatabasePath):
1324         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
1325
1326 2014-06-23  Roger Fong  <roger_fong@apple.com>
1327
1328         Unregister notification observer registered in r170156.
1329         https://bugs.webkit.org/show_bug.cgi?id=134204.
1330
1331         Reviewed by Tim Horton.
1332
1333         * UIProcess/API/mac/WKView.mm:
1334         (-[WKView dealloc]):
1335
1336 2014-06-23  Dan Bernstein  <mitz@apple.com>
1337
1338         [Cocoa] No way to grant storage quotas for WebSQL
1339         https://bugs.webkit.org/show_bug.cgi?id=134175
1340
1341         Reviewed by Anders Carlsson.
1342
1343         * Shared/WebSecurityOrigin.h:
1344         (WebKit::WebSecurityOrigin::securityOrigin): Changed to return a non-const reference.
1345
1346         * UIProcess/API/APIUIClient.h:
1347         (API::UIClient::exceededDatabaseQuota): Added a completion handler parameter than takes the
1348         new quota, and changed the return type to void.
1349
1350         * UIProcess/API/C/WKPage.cpp:
1351         (WKPageSetPageUIClient): Changed the override of exceededDatabaseQuota to call the
1352         completion handler with the new quota, or with the existing quota if the client doesn’t
1353         implement the callback.
1354
1355         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared new delegate method.
1356
1357         * UIProcess/API/Cocoa/_WKSecurityOrigin.h: Added.
1358         * UIProcess/API/Cocoa/_WKSecurityOrigin.mm: Added.
1359         (-[_WKSecurityOrigin _initWithSecurityOrigin:WebCore::]): Store the origin in an ivar.
1360         (-[_WKSecurityOrigin protocol]): Added this accessor.
1361         (-[_WKSecurityOrigin host]): Ditto.
1362         (-[_WKSecurityOrigin port]): Ditto.
1363         * UIProcess/API/Cocoa/_WKSecurityOriginInternal.h: Added.
1364
1365         * UIProcess/Cocoa/UIDelegate.h: Override API::UIClient::exceededDatabaseQuota. Added flag
1366         to m_delegateMethods struct for new delegate method.
1367         * UIProcess/Cocoa/UIDelegate.mm:
1368         (WebKit::UIDelegate::setDelegate): Set new flag in m_delegateMethods struct.
1369         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Added. Calls the new delegate method.
1370
1371         * UIProcess/WebPageProxy.cpp:
1372         (WebKit::WebPageProxy::exceededDatabaseQuota): Updated for the new client interface: now
1373         passing a completion handler that replies with the new quota.
1374
1375         * WebKit2.xcodeproj/project.pbxproj: Added references to new files, sorted a group.
1376
1377 2014-06-23  Simon Fraser  <simon.fraser@apple.com>
1378
1379         More build fixing after r170295.
1380
1381         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1382         (InitWebCoreSystemInterface):
1383
1384 2014-06-23  Anders Carlsson  <andersca@apple.com>
1385
1386         Give read-only properties proper ownership attributes
1387         https://bugs.webkit.org/show_bug.cgi?id=134197
1388         <rdar://problem/16830117>
1389
1390         Reviewed by Dan Bernstein.
1391
1392         Also, make WKFrameInfo conform to NSCopying since it's a data-only object and thus intended to be copied.
1393
1394         * UIProcess/API/Cocoa/WKBackForwardList.h:
1395         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1396         * UIProcess/API/Cocoa/WKFrameInfo.h:
1397         * UIProcess/API/Cocoa/WKFrameInfo.mm:
1398         (-[WKFrameInfo copyWithZone:]):
1399         (-[WKFrameInfo setRequest:]): Deleted.
1400         * UIProcess/API/Cocoa/WKNavigation.h:
1401         * UIProcess/API/Cocoa/WKNavigationAction.h:
1402         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1403         (-[WKNavigationAction setSourceFrame:]):
1404         (-[WKNavigationAction setTargetFrame:]):
1405         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
1406         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1407         * UIProcess/API/Cocoa/WKScriptMessage.h:
1408         * UIProcess/API/Cocoa/WKUserContentController.h:
1409         * UIProcess/API/Cocoa/WKUserScript.h:
1410         * UIProcess/API/Cocoa/WKWebView.h:
1411
1412 2014-06-23  Gwang Yoon Hwang  <yoon@igalia.com>
1413
1414         Unreviewed, GTK build fix after r170274.
1415
1416         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1417         Drawing::m_webPage changed to reference.
1418
1419         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1420         (WebKit::DrawingAreaImpl::setNeedsDisplay):
1421         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
1422         (WebKit::DrawingAreaImpl::forceRepaint):
1423         (WebKit::DrawingAreaImpl::updatePreferences):
1424         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
1425         (WebKit::DrawingAreaImpl::updateBackingStoreState):
1426         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
1427         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1428         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1429         (WebKit::DrawingAreaImpl::display):
1430         * WebProcess/WebPage/DrawingAreaImpl.h:
1431
1432 2014-06-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1433
1434         REGRESSION(r170163): It made everything crash on EFL
1435         https://bugs.webkit.org/show_bug.cgi?id=134097
1436
1437         Unreviewed EFL layout test and perforamcne crash fix.
1438
1439         * WebProcess/WebPage/WebPage.cpp: Add a null check for m_mainFrame.
1440         (WebKit::WebPage::didCompletePageTransition):
1441
1442 2014-06-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1443
1444         Unreviewed EFL build fix since r170274. Use reference for m_webPage member variable.
1445
1446         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1447         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
1448         (WebKit::CoordinatedDrawingArea::setNeedsDisplay):
1449         (WebKit::CoordinatedDrawingArea::setNeedsDisplayInRect):
1450         (WebKit::CoordinatedDrawingArea::forceRepaint):
1451         (WebKit::CoordinatedDrawingArea::updatePreferences):
1452         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged):
1453         (WebKit::CoordinatedDrawingArea::layerHostDidFlushLayers):
1454         (WebKit::CoordinatedDrawingArea::updateBackingStoreState):
1455         (WebKit::CoordinatedDrawingArea::sendDidUpdateBackingStoreState):
1456         (WebKit::CoordinatedDrawingArea::suspendPainting):
1457         (WebKit::CoordinatedDrawingArea::resumePainting):
1458         (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode):
1459         (WebKit::CoordinatedDrawingArea::display):
1460         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
1461
1462 2014-06-22  Tim Horton  <timothy_horton@apple.com>
1463
1464         [iOS][wk2] Swiping back sometimes results in a missing (not blank) swipe snapshot
1465         https://bugs.webkit.org/show_bug.cgi?id=134181
1466
1467         Reviewed by Benjamin Poulain.
1468
1469         * UIProcess/ios/ViewGestureControllerIOS.mm:
1470         (WebKit::ViewGestureController::ViewGestureController):
1471         (WebKit::ViewGestureController::endSwipeGesture):
1472         (WebKit::ViewGestureController::setRenderTreeSize):
1473         (WebKit::ViewGestureController::removeSwipeSnapshot):
1474         * UIProcess/mac/ViewGestureController.h:
1475         Make it explicit that we should only remove the swipe snapshot when a
1476         big-enough render tree size arrives *after the swipe ends*.
1477
1478 2014-06-22  Tim Horton  <timothy_horton@apple.com>
1479
1480         Thread some references through the remote layer tree code
1481         https://bugs.webkit.org/show_bug.cgi?id=134177
1482
1483         Reviewed by Zalan Bujtas.
1484
1485         A first pass at references for never-null things (first pass because I didn't touch the collections).
1486         Things that aren't straightforward reference-threading:
1487
1488         * Shared/mac/RemoteLayerBackingStoreCollection.h:
1489         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1490         Remove the unimplemented/nonexistant RemoteLayerBackingStoreCollection::create.
1491         Make RemoteLayerBackingStoreCollection constructor not take a context, because m_context is never used.
1492
1493         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1494         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1495         Factor out grabbing the PlatformLayerID in a few places.
1496
1497         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1498         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1499         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1500         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1501         Use WebPage::mainFrameView() instead of WebPage::corePage()->mainFrame().view().
1502
1503         * Shared/mac/RemoteLayerTreeTransaction.h:
1504         * Shared/mac/RemoteLayerTreeTransaction.mm:
1505         * WebProcess/WebPage/DrawingArea.cpp:
1506         * WebProcess/WebPage/DrawingArea.h:
1507         * WebProcess/WebPage/WebPage.cpp:
1508         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1509         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1510         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1511         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
1512         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:om):
1513         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
1514         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
1515         * Shared/mac/RemoteLayerBackingStore.mm:
1516         References.
1517         
1518 2014-06-22  Anders Carlsson  <andersca@apple.com>
1519
1520         Replace a couple of uses of bind with lambdas
1521         https://bugs.webkit.org/show_bug.cgi?id=134172
1522
1523         Reviewed by Sam Weinig.
1524
1525         * Platform/IPC/Connection.cpp:
1526         (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
1527         (IPC::Connection::connectionDidClose):
1528         (IPC::Connection::dispatchMessage):
1529         (IPC::Connection::dispatchConnectionDidClose): Deleted.
1530         * Platform/IPC/Connection.h:
1531         * Shared/Plugins/NPObjectProxy.cpp:
1532         (WebKit::NPObjectProxy::NP_Deallocate):
1533         * UIProcess/Storage/LocalStorageDatabase.cpp:
1534         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
1535         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1536         (WebKit::NetscapePlugin::pluginThreadAsyncCall):
1537         (WebKit::NetscapePlugin::handlePluginThreadAsyncCall): Deleted.
1538         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1539         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1540         (WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync):
1541         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
1542
1543 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
1544
1545         Have scrollingTreeAsText() dump the non-fast-scrollable region
1546         https://bugs.webkit.org/show_bug.cgi?id=134149
1547
1548         Reviewed by Sam Weinig.
1549
1550         Dump the non-fast-scrollable region (as an array of rects).
1551
1552         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1553         (WebKit::RemoteScrollingTreeTextStream::dump):
1554
1555 2014-06-22  Anders Carlsson  <andersca@apple.com>
1556
1557         Add IPC decoding support to BackForwardListState
1558         https://bugs.webkit.org/show_bug.cgi?id=134171
1559
1560         Reviewed by Dan Bernstein.
1561
1562         * Shared/SessionState.cpp:
1563         (WebKit::isValidEnum):
1564         (WebKit::HTTPBody::Element::decode):
1565         (WebKit::HTTPBody::decode):
1566         (WebKit::FrameState::decode):
1567         (WebKit::PageState::decode):
1568         (WebKit::BackForwardListState::decode):
1569         * Shared/SessionState.h:
1570
1571 2014-06-22  Anders Carlsson  <andersca@apple.com>
1572
1573         Address a review comment.
1574
1575         * UIProcess/mac/LegacySessionStateCoding.cpp:
1576         (WebKit::HistoryEntryDataDecoder::markInvalid):
1577         (WebKit::decodeFormDataElement):
1578
1579 2014-06-21  Anders Carlsson  <andersca@apple.com>
1580
1581         Implement the rest of back forward tree decoding
1582         https://bugs.webkit.org/show_bug.cgi?id=134166
1583
1584         Reviewed by Sam Weinig.
1585
1586         * UIProcess/mac/LegacySessionStateCoding.cpp:
1587         (WebKit::HistoryEntryDataDecoder::operator>>):
1588         (WebKit::decodeFormDataElement):
1589         (WebKit::decodeFormData):
1590         (WebKit::decodeBackForwardTreeNode):
1591
1592 2014-06-22  Dan Bernstein  <mitz@apple.com>
1593
1594         [iOS] WKWebViewConfiguration.allowsInlineMediaPlayback has no effect
1595         https://bugs.webkit.org/show_bug.cgi?id=134170
1596
1597         Reviewed by Anders Carlsson.
1598
1599         * UIProcess/API/Cocoa/WKWebView.mm:
1600         (-[WKWebView initWithFrame:configuration:]): Fixed a typo.
1601
1602 2014-06-21  Zan Dobersek  <zdobersek@igalia.com>
1603
1604         Unreviewed. Fixing the GTK+ build after r170253.
1605
1606         * UIProcess/API/gtk/WebKitSettings.cpp:
1607         (_WebKitSettingsPrivate::_WebKitSettingsPrivate): WebPreferences::create()
1608         now takes an additional String argument.
1609
1610 2014-06-21  Dan Bernstein  <mitz@apple.com>
1611
1612         CallbackMap::put should be able to take an unwrapped function
1613         https://bugs.webkit.org/show_bug.cgi?id=134104
1614
1615         Reviewed by Anders Carlsson.
1616
1617         * UIProcess/GenericCallback.h:
1618         (WebKit::CallbackMap::put): Added an overload that takes a function and creates and puts a
1619         callback. Changed both overloads of put() to return the callback ID.
1620
1621         * UIProcess/WebPageProxy.cpp:
1622         (WebKit::WebPageProxy::validateCommand):
1623         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
1624         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
1625         (WebKit::WebPageProxy::getSourceForFrame):
1626         (WebKit::WebPageProxy::getContentsAsString):
1627         (WebKit::WebPageProxy::getBytecodeProfile):
1628         (WebKit::WebPageProxy::getContentsAsMHTMLData):
1629         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
1630         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
1631         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
1632         (WebKit::WebPageProxy::getResourceDataFromFrame):
1633         (WebKit::WebPageProxy::getWebArchiveOfFrame):
1634         (WebKit::WebPageProxy::getMarkedRangeAsync):
1635         (WebKit::WebPageProxy::getSelectedRangeAsync):
1636         (WebKit::WebPageProxy::characterIndexForPointAsync):
1637         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
1638         (WebKit::WebPageProxy::takeSnapshot):
1639
1640 2014-06-21  Anders Carlsson  <andersca@apple.com>
1641
1642         Make it possible to override debug preferences on a per-identifier basis as well as globally
1643         https://bugs.webkit.org/show_bug.cgi?id=134164
1644
1645         Reviewed by Dan Bernstein.
1646
1647         * Shared/WebPreferencesDefinitions.h:
1648         * Shared/WebPreferencesKeys.cpp:
1649         * Shared/WebPreferencesKeys.h:
1650         * Shared/WebPreferencesStore.cpp:
1651         (WebKit::defaults):
1652         * UIProcess/API/C/WKPreferences.cpp:
1653         (WKPreferencesCreate):
1654         (WKPreferencesCreateWithIdentifier):
1655         * UIProcess/API/Cocoa/WKPreferences.mm:
1656         (-[WKPreferences init]):
1657         * UIProcess/WebPageGroup.cpp:
1658         (WebKit::WebPageGroup::WebPageGroup):
1659         * UIProcess/WebPreferences.cpp:
1660         (WebKit::WebPreferences::create):
1661         (WebKit::WebPreferences::createWithLegacyDefaults):
1662         (WebKit::WebPreferences::WebPreferences):
1663         * UIProcess/WebPreferences.h:
1664         * UIProcess/mac/WebPreferencesMac.mm:
1665         (WebKit::makeKey):
1666         (WebKit::debugUserDefaultsValue):
1667         (WebKit::setDebugBoolValueIfInUserDefaults):
1668         (WebKit::WebPreferences::platformInitializeStore):
1669
1670 2014-06-21  Anders Carlsson  <andersca@apple.com>
1671
1672         Begin work on decoding form data
1673         https://bugs.webkit.org/show_bug.cgi?id=134163
1674
1675         Reviewed by Sam Weinig.
1676
1677         * UIProcess/mac/LegacySessionStateCoding.cpp:
1678         (WebKit::HistoryEntryDataDecoder::operator>>):
1679         (WebKit::HistoryEntryDataDecoder::isValid):
1680         (WebKit::isValidEnum):
1681         (WebKit::decodeFormDataElement):
1682         (WebKit::decodeFormData):
1683         (WebKit::decodeBackForwardTreeNode):
1684
1685 2014-06-21  Anders Carlsson  <andersca@apple.com>
1686
1687         Only initialize WebPreferences from NSUserDefaults if there's an identifier
1688         https://bugs.webkit.org/show_bug.cgi?id=134162
1689
1690         Reviewed by Sam Weinig.
1691
1692         We don't want to allow changing preferences by registering user defaults.
1693
1694         * UIProcess/mac/WebPreferencesMac.mm:
1695         (WebKit::makeKey):
1696         (WebKit::WebPreferences::platformInitializeStore):
1697
1698 2014-06-21  Anders Carlsson  <andersca@apple.com>
1699
1700         Begin work on decoding the back/forward tree
1701         https://bugs.webkit.org/show_bug.cgi?id=134161
1702
1703         Reviewed by Sam Weinig.
1704
1705         * UIProcess/mac/LegacySessionStateCoding.cpp:
1706         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries):
1707         (WebKit::HistoryEntryDataDecoder::operator>>):
1708         (WebKit::HistoryEntryDataDecoder::decodeArithmeticType):
1709         (WebKit::HistoryEntryDataDecoder::bufferIsLargeEnoughToContain):
1710         (WebKit::decodeBackForwardTreeNode):
1711         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
1712         (WebKit::HistoryEntryDataDecoder::decode): Deleted.
1713
1714 2014-06-21  Brady Eidson  <beidson@apple.com>
1715
1716         Gamepad API - Deprecate the existing implementation
1717         https://bugs.webkit.org/show_bug.cgi?id=134108
1718
1719         Reviewed by Timothy Hatcher.
1720
1721         -Add new "GAMEPAD_DEPRECATED" build flag, moving the existing implementation to use it
1722         -Move some implementation files into a "deprecated" subdirectory.
1723
1724         * Configurations/FeatureDefines.xcconfig:
1725
1726 2014-06-20  Anders Carlsson  <andersca@apple.com>
1727
1728         Implement more of HistoryEntryDataDecoder
1729         https://bugs.webkit.org/show_bug.cgi?id=134146
1730
1731         Reviewed by Sam Weinig.
1732
1733         * UIProcess/mac/LegacySessionStateCoding.cpp:
1734         (WebKit::HistoryEntryDataDecoder::HistoryEntryDataDecoder):
1735         (WebKit::HistoryEntryDataDecoder::operator>>):
1736         (WebKit::HistoryEntryDataDecoder::decode):
1737         (WebKit::HistoryEntryDataDecoder::decodeFixedLengthData):
1738         (WebKit::HistoryEntryDataDecoder::alignBufferPosition):
1739         (WebKit::HistoryEntryDataDecoder::alignedBuffer):
1740         (WebKit::HistoryEntryDataDecoder::alignedBufferIsLargeEnoughToContain):
1741         (WebKit::HistoryEntryDataDecoder::markInvalid):
1742         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
1743
1744 2014-06-21  Commit Queue  <commit-queue@webkit.org>
1745
1746         Unreviewed, rolling out r170244.
1747         https://bugs.webkit.org/show_bug.cgi?id=134157
1748
1749         GTK/EFL bindings generator works differently, making this
1750         patch not work there.  Will fix entire patch after a rollout.
1751         (Requested by bradee-oh on #webkit).
1752
1753         Reverted changeset:
1754
1755         "Gamepad API - Deprecate the existing implementation"
1756         https://bugs.webkit.org/show_bug.cgi?id=134108
1757         http://trac.webkit.org/changeset/170244
1758
1759 2014-06-21  Brady Eidson  <beidson@apple.com>
1760
1761         Gamepad API - Deprecate the existing implementation
1762         https://bugs.webkit.org/show_bug.cgi?id=134108
1763
1764         Reviewed by Timothy Hatcher.
1765
1766         -Add new "GAMEPAD_DEPRECATED" build flag, moving the existing implementation to use it
1767         -Add the "Deprecated" suffix to some implementation files
1768
1769         * Configurations/FeatureDefines.xcconfig:
1770
1771 2014-06-21  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1772
1773         [CoordinatedGraphics][WK2][EFL] Page is moved to (0,0) position before rendering content
1774         https://bugs.webkit.org/show_bug.cgi?id=133300
1775
1776         Reviewed by Csaba Osztrogonác.
1777
1778         When new page is loaded, PageViewportController::didCommitLoad() calls PageViewportController::syncVisibleContents()
1779         with initial position via applyPositionAfterRenderingContents() before starting to render
1780         new page by PageViewportController::didRenderFrame(). This call flow causes that webview shows
1781         incomplete tiles to the user during a few milliseconds. To fix showing incomplete tiles during
1782         the page loading, this patch adds a flag so that we don't show the incomplete tiles until showing
1783         new page.
1784
1785         * UIProcess/API/efl/EwkView.cpp:
1786         (EwkView::EwkView):
1787         * UIProcess/API/efl/EwkView.h:
1788         (EwkView::setWaitingForNewPage):
1789         (EwkView::waitingForNewPage):
1790         * UIProcess/efl/PageLoadClientEfl.cpp:
1791         (WebKit::PageLoadClientEfl::didCommitLoadForFrame):
1792         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
1793         (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
1794         * UIProcess/efl/ViewClientEfl.cpp:
1795         (WebKit::ViewClientEfl::didRenderFrame):
1796         (WebKit::ViewClientEfl::didCompletePageTransition):
1797
1798 2014-06-21  Ryosuke Niwa  <rniwa@webkit.org>
1799
1800         Commit queue has been failing due to a build failure in WKFoundation.h
1801         https://bugs.webkit.org/show_bug.cgi?id=134152
1802
1803         Reviewed by Csaba Osztrogonác.
1804         Landed by Brady Eidson.
1805
1806         The build failure was caused by WKFoundation.h erroneously redefining
1807         NSURLSessionAuthChallengeDisposition even when building with 10.9 SDK.
1808
1809         The availability of this type depends on the version of SDK,
1810         not the target operating system.
1811
1812         * Shared/API/Cocoa/WKFoundation.h:
1813
1814 2014-06-21  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
1815
1816         Removing PAGE_VISIBILITY_API compile guard.
1817         https://bugs.webkit.org/show_bug.cgi?id=133844
1818
1819         Reviewed by Gavin Barraclough.
1820
1821         * Configurations/FeatureDefines.xcconfig:
1822         * WebProcess/WebPage/WebPage.cpp:
1823         (WebKit::WebPage::updatePreferences):
1824
1825 2014-06-20  Anders Carlsson  <andersca@apple.com>
1826
1827         Implement more of LegacySessionStateDecoder
1828         https://bugs.webkit.org/show_bug.cgi?id=134145
1829
1830         Reviewed by Sam Weinig.
1831
1832         * Shared/SessionState.h:
1833         * UIProcess/mac/LegacySessionStateCoding.cpp:
1834         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry):
1835         (WebKit::HistoryEntryDataDecoder::HistoryEntryDataDecoder):
1836         (WebKit::HistoryEntryDataDecoder::finishDecoding):
1837         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
1838         * UIProcess/mac/LegacySessionStateCoding.h:
1839
1840 2014-06-20  Anders Carlsson  <andersca@apple.com>
1841
1842         Implement more of LegacySessionStateDecoder
1843         https://bugs.webkit.org/show_bug.cgi?id=134144
1844
1845         Reviewed by Sam Weinig.
1846
1847         * Shared/SessionState.cpp:
1848         (WebKit::BackForwardListState::encode):
1849         (WebKit::SessionState::encode): Deleted.
1850         * Shared/SessionState.h:
1851         * UIProcess/mac/LegacySessionStateCoding.cpp:
1852         (WebKit::LegacySessionStateDecoder::decodeSessionState):
1853         (WebKit::LegacySessionStateDecoder::decodeSessionHistory):
1854         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory):
1855         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory):
1856         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries):
1857         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry):
1858         * UIProcess/mac/LegacySessionStateCoding.h:
1859
1860 2014-06-20  Ryuan Choi  <ryuan.choi@samsung.com>
1861
1862         Unreviewed. build fix for the cmake based ports since r170188
1863
1864         * CMakeLists.txt: Added LegacySessionState.cpp in source list.
1865
1866 2014-06-20  Dan Bernstein  <mitz@apple.com>
1867
1868         [Cocoa] No way to get the main frame’s main resource’s data
1869         https://bugs.webkit.org/show_bug.cgi?id=134113
1870
1871         Reviewed by Sam Weinig.
1872
1873         * UIProcess/API/Cocoa/WKWebView.mm:
1874         (-[WKWebView _getMainResourceDataWithCompletionHandler:]): Added. Calls
1875         WebPageProxy::getMainResourceDataOfFrame and invokes the completion handler form the
1876         callback.
1877         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.
1878
1879         * UIProcess/WebPageProxy.cpp:
1880         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Made it safe to pass a NULL frame into
1881         this function.
1882
1883 2014-06-20  Anders Carlsson  <andersca@apple.com>
1884
1885         Introduce a WKSessionStateRef object
1886         https://bugs.webkit.org/show_bug.cgi?id=134136
1887
1888         Reviewed by Tim Horton.
1889
1890         WKSessionStateRef is going to hold session state, making it possible to migrate state from one 
1891         webpage to another without having to do any serialization/deserialization.
1892
1893         * Shared/API/c/WKBase.h:
1894         * Shared/APIObject.h:
1895         * Shared/SessionState.cpp:
1896         (WebKit::SessionState::encode):
1897         * Shared/SessionState.h:
1898         * UIProcess/API/APISessionState.cpp: Added.
1899         (API::SessionState::create):
1900         (API::SessionState::SessionState):
1901         (API::SessionState::~SessionState):
1902         * UIProcess/API/APISessionState.h:
1903         * UIProcess/API/C/WKAPICast.h:
1904         * UIProcess/API/C/WKSessionStateRef.cpp:
1905         (WKSessionStateCreateFromData):
1906         * UIProcess/API/C/WKSessionStateRef.h:
1907         * UIProcess/mac/LegacySessionStateCoding.cpp:
1908         (WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder):
1909         (WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder):
1910         (WebKit::LegacySessionStateDecoder::decodeSessionState):
1911         * UIProcess/mac/LegacySessionStateCoding.h:
1912         * WebKit2.xcodeproj/project.pbxproj:
1913
1914 2014-06-19  Enrica Casucci  <enrica@apple.com>
1915
1916         iOS WebKit2: selection handles become too large when zooming a page.
1917         https://bugs.webkit.org/show_bug.cgi?id=134084
1918         <rdar://problem/16799164>
1919
1920         Reviewed by Benjamin Poulain.
1921
1922         Since the document view is zoomed, we add a subview that has the inverse transform
1923         of the document view. This new view becomes the root for the selection hierarchy.
1924         The new view has zero size, not to interfere with the existing gestures on the WKContenView
1925         therefore we implement hitTest to detect interaction with the selection elements.
1926
1927         * UIProcess/ios/WKContentView.mm:
1928         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1929         * UIProcess/ios/WKContentViewInteraction.h:
1930         * UIProcess/ios/WKContentViewInteraction.mm:
1931         (-[WKContentView setupInteraction]):
1932         (-[WKContentView cleanupInteraction]):
1933         (-[WKContentView unscaledView]):
1934         (-[WKContentView inverseScale]):
1935         (-[WKContentView _updateUnscaledView]):
1936         (-[WKContentView hitTest:withEvent:::]):
1937         (-[WKContentView selectedTextRange]):
1938
1939 2014-06-20  Timothy Horton  <timothy_horton@apple.com>
1940
1941         Snapshotting WKThumbnailViews should not tell Web processes backing unparented WKViews that they're in window
1942         https://bugs.webkit.org/show_bug.cgi?id=134134
1943         <rdar://problem/17402119>
1944
1945         Reviewed by Anders Carlsson.
1946
1947         * UIProcess/API/mac/WKView.mm:
1948         (-[WKView _setThumbnailView:]):
1949         Re-evaluating our in-window state is only useful if we're going to use the live layer tree;
1950         snapshots can be taken of unparented views with no trouble. Plus, doing so sets off a chain of
1951         expensive things in the Web process which we can avoid if using snapshots.
1952
1953 2014-06-20  Timothy Horton  <timothy_horton@apple.com>
1954
1955         WKThumbnailView should only use live layer trees before the snapshot arrives for parented WKViews
1956         https://bugs.webkit.org/show_bug.cgi?id=134129
1957         <rdar://problem/17401591>
1958
1959         Reviewed by Anders Carlsson.
1960
1961         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1962         (-[_WKThumbnailView initWithFrame:fromWKView:]):
1963         Add a white background to WKThumbnailView, so that if we have no snapshot and no layer tree,
1964         the view isn't transparent.
1965
1966         * UIProcess/API/mac/WKView.mm:
1967         (-[WKView _updateThumbnailViewLayer]):
1968         We currently pull the live layer tree into the WKThumbnailView even in snapshot mode,
1969         before the snapshot arrives, to avoid flashing when transitioning a live WKView to a thumbnail view.
1970         This is, however, not useful for unparented WKViews, because their layer tree will be detached
1971         and we'll flash anyway. So, only do that when the WKView is parented.
1972
1973 2014-06-20  Geoffrey Garen  <ggaren@apple.com>
1974
1975         WebKit delegate methods should document their default behaviors
1976         https://bugs.webkit.org/show_bug.cgi?id=134132
1977
1978         Reviewed by Dan Bernstein.
1979
1980         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1981         * UIProcess/API/Cocoa/WKUIDelegate.h:
1982
1983 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
1984
1985         Fix lots of WK2 test crashes.
1986
1987         We don't always have a ScrollingCoordinator.
1988
1989         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1990         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1991
1992 2014-06-20  Anders Carlsson  <andersca@apple.com>
1993
1994         Always use XPC on iOS
1995         https://bugs.webkit.org/show_bug.cgi?id=134130
1996
1997         Reviewed by Sam Weinig.
1998
1999         * UIProcess/ios/WebProcessProxyIOS.mm:
2000         (WebKit::WebProcessProxy::platformGetLaunchOptions):
2001         (WebKit::shouldUseXPC): Deleted.
2002
2003 2014-06-20  Anders Carlsson  <andersca@apple.com>
2004
2005         Fix build.
2006
2007         * Shared/SessionState.cpp:
2008
2009 2014-06-20  Anders Carlsson  <andersca@apple.com>
2010
2011         Add ArgumentEncoder support to PageState and friends
2012         https://bugs.webkit.org/show_bug.cgi?id=134128
2013
2014         Reviewed by Andreas Kling.
2015
2016         Change the classes to structs, get rid of the constructors/destructors
2017         and add encode member functions.
2018
2019         * Shared/SessionState.cpp:
2020         (WebKit::HTTPBody::Element::encode):
2021         (WebKit::HTTPBody::encode):
2022         (WebKit::FrameState::encode):
2023         (WebKit::PageState::encode):
2024         (WebKit::HTTPBody::Element::Element): Deleted.
2025         (WebKit::HTTPBody::Element::~Element): Deleted.
2026         (WebKit::FrameState::FrameState): Deleted.
2027         (WebKit::FrameState::~FrameState): Deleted.
2028         (WebKit::PageState::PageState): Deleted.
2029         (WebKit::PageState::~PageState): Deleted.
2030         * Shared/SessionState.h:
2031         (WebKit::HTTPBody::Element::type): Deleted.
2032
2033 2014-06-20  Anders Carlsson  <andersca@apple.com>
2034
2035         Add encoding and decoding support for WTF::Optional
2036         https://bugs.webkit.org/show_bug.cgi?id=134125
2037
2038         Reviewed by Andreas Kling.
2039
2040         * Platform/IPC/ArgumentCoders.h:
2041         (IPC::ArgumentCoder<WTF::Optional<T>>::encode):
2042         (IPC::ArgumentCoder<WTF::Optional<T>>::decode):
2043
2044 2014-06-20  Anders Carlsson  <andersca@apple.com>
2045
2046         Give NPAPI post requests a default content type
2047         https://bugs.webkit.org/show_bug.cgi?id=134120
2048
2049         Reviewed by Andreas Kling.
2050
2051         * WebProcess/Plugins/PluginView.cpp:
2052         (WebKit::PluginView::loadURL):
2053
2054 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
2055
2056         Always commit the scrolling tree when we flush layers
2057         https://bugs.webkit.org/show_bug.cgi?id=134115
2058
2059         Reviewed by Beth Dakin.
2060         
2061         The scrolling state tree contains bare pointers to GraphicsLayers, which get
2062         converted to CALayers at commit time. To avoid a window of time where those
2063         GraphicsLayer pointers go stale, commit the scrolling tree whenever we flush the
2064         compositing layer tree.
2065
2066         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2067         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2068
2069 2014-06-19  Simon Fraser  <simon.fraser@apple.com>
2070
2071         [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews)
2072         https://bugs.webkit.org/show_bug.cgi?id=134085
2073         <rdar://problem/16440586>
2074
2075         Reviewed by Tim Horton.
2076         
2077         Add some debug-only assertions that check that the number of nodes we encoded is
2078         the expected number.
2079
2080         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2081         (WebKit::encodeNodeAndDescendants):
2082         (WebKit::RemoteScrollingCoordinatorTransaction::encode):
2083
2084 2014-06-19  Simon Fraser  <simon.fraser@apple.com>
2085
2086         Handle scrolling tree modifications which remove intermediate nodes
2087         https://bugs.webkit.org/show_bug.cgi?id=134082
2088
2089         Reviewed by Tim Horton.
2090
2091         When updating the scrolling tree from the state tree, we failed to maintain
2092         the children arrays correctly. Fix by removing all children on scrolling nodes,
2093         and allowing the calls on children to add them back. A temporary hash map
2094         keeps the nodes alive.
2095         
2096         The state tree's m_nodesRemovedSinceLastCommit was also made into a HashSet,
2097         to make it easier to handle removal followed by re-insertion.
2098
2099         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2100         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2101         (WebKit::RemoteScrollingTreeTextStream::dump):
2102
2103 2014-06-19  Simon Fraser  <simon.fraser@apple.com>
2104
2105         Make ScrollingTreeNodes refounted, for easier tree reconfiguration
2106         https://bugs.webkit.org/show_bug.cgi?id=134075
2107
2108         Reviewed by Tim Horton.
2109
2110         Make ScrollingTreeNode be ref-counted.
2111
2112         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2113         (WebKit::RemoteScrollingTree::createNode):
2114         * UIProcess/Scrolling/RemoteScrollingTree.h:
2115         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2116         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2117         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::create):
2118         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
2119         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2120         (WebKit::RemoteScrollingCoordinator::createScrollingTreeNode):
2121
2122 2014-06-20  Dan Bernstein  <mitz@apple.com>
2123
2124         [Cocoa] No way to get the MIME type of the main frame
2125         https://bugs.webkit.org/show_bug.cgi?id=134111
2126
2127         Reviewed by Anders Carlsson.
2128
2129         * UIProcess/API/Cocoa/WKWebView.mm:
2130         (-[WKWebView _MIMEType]): Added. Returns the MIME type of the main frame, or nil.
2131         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2132
2133 2014-06-20  Joseph Pecoraro  <pecoraro@apple.com>
2134
2135         [iOS]: Overrelease of RetainPtr object in file upload
2136         https://bugs.webkit.org/show_bug.cgi?id=134072
2137
2138         Reviewed by Brady Eidson.
2139
2140         This ivar is a RetainPtr, the release will be done automatically
2141         for us when we assign to nil or destruct.
2142
2143         * UIProcess/ios/WKContentViewInteraction.mm:
2144         (-[WKContentView fileUploadPanelDidDismiss:]):
2145
2146 2014-06-20  Anders Carlsson  <andersca@apple.com>
2147
2148         Begin stubbing out new session state classes
2149         https://bugs.webkit.org/show_bug.cgi?id=134110
2150
2151         Reviewed by Geoffrey Garen.
2152
2153         The basic idea is that these classes will replace the data blobs representing HistoryItems
2154         that we currently send back and forth between the web and UI processes.
2155         
2156         * Shared/SessionState.cpp: Added.
2157         (WebKit::HTTPBody::Element::Element):
2158         (WebKit::HTTPBody::Element::~Element):
2159         (WebKit::FrameState::FrameState):
2160         (WebKit::FrameState::~FrameState):
2161         (WebKit::PageState::PageState):
2162         (WebKit::PageState::~PageState):
2163         * Shared/SessionState.h: Added.
2164         (WebKit::HTTPBody::Element::type):
2165         * WebKit2.xcodeproj/project.pbxproj:
2166
2167 2014-06-20  Anders Carlsson  <andersca@apple.com>
2168
2169         Rename SessionState to LegacySessionState
2170         https://bugs.webkit.org/show_bug.cgi?id=134107
2171
2172         Reviewed by Dan Bernstein.
2173
2174         * Shared/LegacySessionState.cpp: Renamed from Source/WebKit2/Shared/SessionState.cpp.
2175         (IPC::ArgumentCoder<RefPtr<T>>::encode):
2176         (IPC::ArgumentCoder<RefPtr<T>>::decode):
2177         (WebKit::LegacySessionState::LegacySessionState):
2178         (WebKit::LegacySessionState::isEmpty):
2179         (WebKit::LegacySessionState::encode):
2180         (WebKit::LegacySessionState::decode):
2181         * Shared/LegacySessionState.h: Renamed from Source/WebKit2/Shared/SessionState.h.
2182         (WebKit::LegacySessionState::list):
2183         (WebKit::LegacySessionState::currentIndex):
2184         * Shared/WebPageCreationParameters.h:
2185         * UIProcess/WebPageProxy.cpp:
2186         (WebKit::WebPageProxy::creationParameters):
2187         * UIProcess/cf/WebPageProxyCF.cpp:
2188         (WebKit::WebPageProxy::restoreFromSessionStateData):
2189         * WebKit2.xcodeproj/project.pbxproj:
2190         * WebProcess/WebPage/WebPage.cpp:
2191         (WebKit::WebPage::restoreSession):
2192         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem):
2193         * WebProcess/WebPage/WebPage.h:
2194         * WebProcess/WebPage/WebPage.messages.in:
2195
2196 2014-06-20  Anders Carlsson  <andersca@apple.com>
2197
2198         Document the underlying types of the WKWindowFeatures rect properties
2199         https://bugs.webkit.org/show_bug.cgi?id=134103
2200
2201         Reviewed by Dan Bernstein.
2202
2203         * UIProcess/API/Cocoa/WKWindowFeatures.h:
2204
2205 2014-06-20  Zan Dobersek  <zdobersek@igalia.com>
2206
2207         PluginProcessMainUnix should only scan for plugins when X11 plugin architecture is enabled
2208         https://bugs.webkit.org/show_bug.cgi?id=134098
2209
2210         Reviewed by Carlos Garcia Campos.
2211
2212         * PluginProcess/unix/PluginProcessMainUnix.cpp: Guard the call to NetscapePluginModule::scanPlugin()
2213         with PLUGIN_ARCHITECTURE(X11) since the declaration has the same build guard. In case the X11 plugin
2214         architecture is not enabled the program exits with EXIT_FAILURE.
2215
2216 2014-06-20  Tim Horton  <timothy_horton@apple.com>
2217
2218         LayerPool’d PlatformCALayerRemote/RemoteLayerBackingStore can have stale context pointers
2219         https://bugs.webkit.org/show_bug.cgi?id=134050
2220         <rdar://problem/17315114>
2221
2222         Reviewed by Simon Fraser.
2223
2224         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2225         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2226         (WebKit::PlatformCALayerRemote::layerPool):
2227         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2228         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2229         (WebKit::RemoteLayerTreeContext::layerPool):
2230         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2231         (WebKit::RemoteLayerTreeContext::buildTransaction):
2232         Ensure that layers being committed are always in the context that is committing them.
2233         Use a LayerPool per RemoteLayerTreeContext, to avoid moving layers between contexts.
2234
2235 2014-06-20  Tim Horton  <timothy_horton@apple.com>
2236
2237         WKContentViewInteraction isn't cleaned up when the Web Content process crashes
2238         https://bugs.webkit.org/show_bug.cgi?id=134080
2239         <rdar://problem/17387652> and <rdar://problem/16848360>
2240
2241         Reviewed by Benjamin Poulain.
2242
2243         * UIProcess/ios/WKContentView.mm:
2244         (-[WKContentView _processDidExit]):
2245         Tear down WKContentViewInteraction when the process crashes.
2246
2247         (-[WKContentView _didRelaunchProcess]):
2248         Set WKContentViewInteraction back up when the process is relaunched.
2249
2250         * UIProcess/ios/WKContentViewInteraction.mm:
2251         (-[WKContentView cleanupInteraction]):
2252         Clear the SmartMagnificationController, which is a message receiver and thus must be re-created with the new page.
2253         Remove all gesture recognizers from the content view.
2254         Clear _fileUploadPanel, else we'll get an assert the next time we try to open one.
2255
2256         * UIProcess/WebPageProxy.cpp:
2257         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2258         Give the PageClient a chance to clean up *before* we clean up internals;
2259         it is at a higher level and some cleanup depends on WebPageProxy members
2260         not having been cleared yet.
2261
2262 2014-06-19  Dan Bernstein  <mitz@apple.com>
2263
2264         Removed unused SPI -[WKWebView _runJavaScriptInMainFrame:].
2265
2266         Rubber-stamped by Simon Fraser.
2267
2268         * UIProcess/API/Cocoa/WKWebView.mm:
2269         (-[WKWebView _runJavaScriptInMainFrame:]): Deleted.
2270         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2271
2272 2014-06-19  Dan Bernstein  <mitz@apple.com>
2273
2274         Use a single map for all callback types in WebPageProxy
2275         https://bugs.webkit.org/show_bug.cgi?id=134069
2276
2277         Reviewed by Tim Horton.
2278
2279         * UIProcess/GenericCallback.h:
2280         (WebKit::CallbackMap::take):
2281         * UIProcess/WebPageProxy.cpp:
2282         (WebKit::WebPageProxy::printFinishedCallback):
2283         (WebKit::WebPageProxy::resetState):
2284         (WebKit::WebPageProxy::drawPagesForPrinting):
2285         * UIProcess/WebPageProxy.h:
2286         * UIProcess/mac/WebPageProxyMac.mm:
2287         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
2288         (WebKit::WebPageProxy::attributedStringForCharacterRangeCallback):
2289
2290 2014-06-19  Anders Carlsson  <andersca@apple.com>
2291
2292         Another build fix attempt.
2293
2294         * Shared/API/Cocoa/WKFoundation.h:
2295
2296 2014-06-19  Dan Bernstein  <mitz@apple.com>
2297
2298         [iOS] Legacy processes are installed inside WebKit.framework
2299         https://bugs.webkit.org/show_bug.cgi?id=134079
2300
2301         Reviewed by Anders Carlsson.
2302
2303         * Configurations/All.xcconfig: Exclude the legacy processes on iOS so they don’t get copied.
2304         * Configurations/BaseLegacyProcess.xcconfig: Set SKIP_INSTALL to YES on iOS.
2305
2306 2014-06-19  Anders Carlsson  <andersca@apple.com>
2307
2308         It's OS X, not OSX...
2309
2310         * Shared/API/Cocoa/WKFoundation.h:
2311
2312 2014-06-19  Antti Koivisto  <antti@apple.com>
2313
2314         Unfreeze the layer tree on DidFirstVisuallyNonEmptyLayout
2315         https://bugs.webkit.org/show_bug.cgi?id=134073
2316
2317         Reviewed by Simon Fraser.
2318         
2319         DidFirstLayout is too early and we usually get a blank page. This doesn't match the existing iOS behavior either.
2320
2321         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2322         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
2323         * WebProcess/WebPage/WebPage.cpp:
2324         (WebKit::WebPage::WebPage):
2325
2326 2014-06-19  Anders Carlsson  <andersca@apple.com>
2327
2328         Try to fix the Mavericks build.
2329
2330         * Shared/API/Cocoa/WKFoundation.h:
2331
2332 2014-06-19  Sam Weinig  <sam@webkit.org>
2333
2334         [Cocoa] Need SPI to determine if the WKWebView is displaying a standalone image
2335         https://bugs.webkit.org/show_bug.cgi?id=134071
2336
2337         Reviewed by Anders Carlsson.
2338
2339         * UIProcess/API/Cocoa/WKWebView.mm:
2340         (-[WKWebView _isDisplayingStandaloneImageDocument]):
2341         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2342
2343 2014-06-19  Dan Bernstein  <mitz@apple.com>
2344
2345         Use a single map for all callback types in WebPageProxy
2346         https://bugs.webkit.org/show_bug.cgi?id=134069
2347
2348         Reviewed by Anders Carlsson.
2349
2350         * UIProcess/GenericCallback.h:
2351         (WebKit::CallbackBase::as): Added. Performs a dynamic cast to a specific callback type.
2352         (WebKit::CallbackBase::CallbackBase): Added a type parameter, which is used to initialize
2353         the new m_type member.
2354         (WebKit::GenericCallback::GenericCallback): Pass the type to the base class constructor.
2355         (WebKit::GenericCallback::type): Added. Returns a unique type.
2356         (WebKit::GenericCallback::invalidate): Now virtual.
2357
2358         (WebKit::CallbackMap::put): Adds the callback to the map.
2359         (WebKit::CallbackMap::take): Removes the callback from the map, and dynamically casts it to
2360         the specified type.
2361         (WebKit::CallbackMap::invalidate): Invalidates the map.
2362
2363         * UIProcess/WebPageProxy.cpp:
2364         (WebKit::WebPageProxy::validateCommand):
2365         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
2366         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
2367         (WebKit::WebPageProxy::getSourceForFrame):
2368         (WebKit::WebPageProxy::getContentsAsString):
2369         (WebKit::WebPageProxy::getBytecodeProfile):
2370         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
2371         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
2372         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
2373         (WebKit::WebPageProxy::getResourceDataFromFrame):
2374         (WebKit::WebPageProxy::getWebArchiveOfFrame):
2375         (WebKit::WebPageProxy::forceRepaint):
2376         (WebKit::WebPageProxy::clearLoadDependentCallbacks):
2377         (WebKit::WebPageProxy::voidCallback):
2378         (WebKit::WebPageProxy::dataCallback):
2379         (WebKit::WebPageProxy::imageCallback):
2380         (WebKit::WebPageProxy::stringCallback):
2381         (WebKit::WebPageProxy::scriptValueCallback):
2382         (WebKit::WebPageProxy::computedPagesCallback):
2383         (WebKit::WebPageProxy::validateCommandCallback):
2384         (WebKit::WebPageProxy::unsignedCallback):
2385         (WebKit::WebPageProxy::editingRangeCallback):
2386         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
2387         (WebKit::WebPageProxy::resetState):
2388         (WebKit::WebPageProxy::computePagesForPrinting):
2389         (WebKit::WebPageProxy::drawRectToImage):
2390         (WebKit::WebPageProxy::drawPagesToPDF):
2391         (WebKit::WebPageProxy::getMarkedRangeAsync):
2392         (WebKit::WebPageProxy::getSelectedRangeAsync):
2393         (WebKit::WebPageProxy::characterIndexForPointAsync):
2394         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
2395         (WebKit::WebPageProxy::takeSnapshot):
2396         * UIProcess/WebPageProxy.h:
2397         * UIProcess/ios/WebPageProxyIOS.mm:
2398         (WebKit::WebPageProxy::gestureCallback):
2399         (WebKit::WebPageProxy::touchesCallback):
2400         (WebKit::WebPageProxy::autocorrectionDataCallback):
2401         (WebKit::WebPageProxy::dictationContextCallback):
2402         (WebKit::WebPageProxy::autocorrectionContextCallback):
2403         (WebKit::WebPageProxy::selectWithGesture):
2404         (WebKit::WebPageProxy::updateSelectionWithTouches):
2405         (WebKit::WebPageProxy::requestAutocorrectionData):
2406         (WebKit::WebPageProxy::applyAutocorrection):
2407         (WebKit::WebPageProxy::requestDictationContext):
2408         (WebKit::WebPageProxy::requestAutocorrectionContext):
2409         (WebKit::WebPageProxy::selectWithTwoTouches):
2410
2411 2014-06-19  Anders Carlsson  <andersca@apple.com>
2412
2413         No way to handle HTTP Authentication with WKWebView
2414         https://bugs.webkit.org/show_bug.cgi?id=134067
2415         <rdar://problem/17317874>
2416
2417         Reviewed by Dan Bernstein.
2418
2419         Add a public webView:didReceiveAuthenticationChallenge:completionHandler: delegate method and get rid of the SPI.
2420         
2421         * Shared/API/Cocoa/WKFoundation.h:
2422         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2423         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2424         * UIProcess/Cocoa/NavigationState.mm:
2425         (WebKit::NavigationState::setNavigationDelegate):
2426         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
2427
2428 2014-06-18  Roger Fong  <roger_fong@apple.com>
2429
2430         Don't kill the UIProcess until all local storage transactions have been committed.
2431         https://bugs.webkit.org/show_bug.cgi?id=134042.
2432         <rdar://problem/16660724>.
2433
2434         Reviewed by Anders Carlsson.
2435
2436         * UIProcess/API/mac/WKView.mm: Add a listener for the application will terminate notification.
2437         (-[WKView _applicationWillTerminate:]):
2438         (-[WKView initWithFrame:context:configuration:webView:]):
2439         * UIProcess/WebContext.cpp: Calls code in StorageManager to cleanup local storage transactions upon application termination.
2440         (WebKit::WebContext::applicationWillTerminate):
2441         * UIProcess/WebContext.h:
2442
2443         * UIProcess/Storage/StorageManager.cpp:
2444         (WebKit::StorageManager::applicationWillTerminate):
2445         Dispatch local storage cleanup task to background thread and make sure the UIProcess can't exit early.
2446         * UIProcess/Storage/StorageManager.h:
2447
2448 2014-06-19  Oliver Hunt  <oliver@apple.com>
2449
2450         Switch to using the process parameters during initialisation
2451         to determine whether we hsould be using the network process.
2452
2453         RS=Sam Weinig
2454
2455         * WebProcess/cocoa/WebProcessCocoa.mm:
2456         (WebKit::WebProcess::platformInitializeWebProcess):
2457
2458 2014-06-19  Pratik Solanki  <psolanki@apple.com>
2459
2460         Copy SharedBuffer data into IPC message directly
2461         https://bugs.webkit.org/show_bug.cgi?id=133920
2462
2463         Reviewed by Anders Carlsson.
2464
2465         When data array callbacks are enabled, we currently merge all the CFDataRefs in SharedBuffer
2466         into one contiguous memory buffer when creating IPC::DataReference. This patch creates a
2467         subclass of DataReference that uses SharedBuffer::getSomeData() to copy the data directly
2468         into the IPC message.
2469
2470         * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
2471         (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer):
2472         * Platform/IPC/ArgumentEncoder.cpp:
2473         (IPC::ArgumentEncoder::reserve): Added.
2474         (IPC::ArgumentEncoder::grow):
2475         * Platform/IPC/ArgumentEncoder.h:
2476         * Platform/IPC/DataReference.cpp:
2477         (IPC::SharedBufferDataReference::encode):
2478         * Platform/IPC/DataReference.h:
2479         (IPC::DataReference::~DataReference):
2480
2481 2014-06-18  Zan Dobersek  <zdobersek@igalia.com>
2482
2483         Unreviewed. Fixing the GTK+ build after r170114.
2484
2485         * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
2486         (webkit_authentication_request_get_proposed_credential):
2487         The core() accessor has been renamed to credential().
2488
2489 2014-06-18  Dan Bernstein  <mitz@apple.com>
2490
2491         Try to fix the Mountain Lion build.
2492
2493         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2494         * UIProcess/Cocoa/NavigationState.mm:
2495         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
2496
2497 2014-06-18  Tim Horton  <timothy_horton@apple.com>
2498
2499         Remove RemoteLayerBackingStore’s RemoteLayerTreeContext pointer
2500         https://bugs.webkit.org/show_bug.cgi?id=134055
2501
2502         Reviewed by Simon Fraser.
2503
2504         * Shared/mac/RemoteLayerBackingStore.h:
2505         * Shared/mac/RemoteLayerBackingStore.mm:
2506         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
2507         (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore):
2508         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2509         (WebKit::RemoteLayerBackingStore::display):
2510         (WebKit::RemoteLayerBackingStore::drawInContext):
2511         Remove RemoteLayerBackingStore's RemoteLayerTreeContext pointer. Instead, use the PlatformCALayer's.
2512         Pass the PlatformCALayer in to the constructor, and remove it from ensureBackingStore();
2513         RemoteLayerBackingStore is (for now) strictly tied to a single layer.
2514
2515         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2516         (WebKit::PlatformCALayerRemote::ensureBackingStore):
2517         (WebKit::PlatformCALayerRemote::updateBackingStore):
2518         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2519         (WebKit::PlatformCALayerRemote::context):
2520
2521 2014-06-18  Dan Bernstein  <mitz@apple.com>
2522
2523         [Cocoa] Modernize one-method authentication
2524         https://bugs.webkit.org/show_bug.cgi?id=134051
2525
2526         Reviewed by Anders Carlsson.
2527
2528         Instead of an NSURLConnection-style delegate method that takes a challenge and responds to
2529         its sender, provide an NSURLSession-style method that takes a challenge and a completion
2530         handler.
2531
2532         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method, replacing
2533         old unused method.
2534         * UIProcess/Cocoa/NavigationState.h: Renamed flag in m_navigationDelegateMethods struct.
2535         * UIProcess/Cocoa/NavigationState.mm:
2536         (WebKit::NavigationState::setNavigationDelegate): Check for new delegate method and update
2537         new flag.
2538
2539         (WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): If
2540         the delegate implements the new method, return true (if it cannot handle the protection
2541         space, it can reject it through the completion handler), except for server-trust
2542         authentication, which is not supported yet.
2543         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): If the
2544         delegate implements the new method, call it, passing a completion handler that calls the
2545         right AuthenticationDecisionListener function based on its disposition and credential
2546         parameters.
2547
2548 2014-06-18  Anders Carlsson  <andersca@apple.com>
2549
2550         Make FrameLoadType a strongly typed enum
2551         https://bugs.webkit.org/show_bug.cgi?id=134047
2552
2553         Reviewed by Andreas Kling.
2554
2555         * UIProcess/WebPageProxy.cpp:
2556         (WebKit::WebPageProxy::didCommitLoadForFrame):
2557         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2558         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2559         * WebProcess/WebPage/WebPage.cpp:
2560         (WebKit::WebPage::goForward):
2561         (WebKit::WebPage::goBack):
2562         (WebKit::WebPage::goToBackForwardItem):
2563         (WebKit::shouldReuseCommittedSandboxExtension):
2564         (WebKit::WebPage::didCommitLoad):
2565
2566 2014-06-18  Anders Carlsson  <andersca@apple.com>
2567
2568         Simplify WebSecurityOrigin
2569         https://bugs.webkit.org/show_bug.cgi?id=134049
2570
2571         Reviewed by Andreas Kling.
2572
2573         * Shared/API/c/WKSecurityOrigin.cpp:
2574         (WKSecurityOriginCreateFromString):
2575         (WKSecurityOriginCreateFromDatabaseIdentifier):
2576         (WKSecurityOriginCopyDatabaseIdentifier):
2577         (WKSecurityOriginCopyToString):
2578         (WKSecurityOriginCopyProtocol):
2579         (WKSecurityOriginCopyHost):
2580         (WKSecurityOriginGetPort):
2581         * Shared/WebSecurityOrigin.h:
2582         (WebKit::WebSecurityOrigin::securityOrigin):
2583         (WebKit::WebSecurityOrigin::createFromDatabaseIdentifier): Deleted.
2584         (WebKit::WebSecurityOrigin::protocol): Deleted.
2585         (WebKit::WebSecurityOrigin::host): Deleted.
2586         (WebKit::WebSecurityOrigin::port): Deleted.
2587         (WebKit::WebSecurityOrigin::databaseIdentifier): Deleted.
2588         (WebKit::WebSecurityOrigin::toString): Deleted.
2589         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2590         (WebKit::WebNotificationManagerProxy::providerDidUpdateNotificationPolicy):
2591         (WebKit::WebNotificationManagerProxy::providerDidRemoveNotificationPolicies):
2592         * UIProcess/Storage/StorageManager.cpp:
2593         (WebKit::StorageManager::deleteEntriesForOrigin):
2594         * UIProcess/Storage/StorageManager.h:
2595         * UIProcess/WebApplicationCacheManagerProxy.cpp:
2596         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin):
2597         * UIProcess/WebDatabaseManagerProxy.cpp:
2598         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
2599         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
2600         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
2601         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
2602         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
2603         (WebKit::WebDatabaseManagerProxy::didModifyOrigin):
2604         (WebKit::WebDatabaseManagerProxy::didModifyDatabase):
2605         * UIProcess/WebKeyValueStorageManager.cpp:
2606         (WebKit::didGetStorageDetailsByOrigin):
2607         * UIProcess/WebOriginDataManagerProxy.cpp:
2608         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
2609         * UIProcess/WebPageProxy.cpp:
2610         (WebKit::WebPageProxy::exceededDatabaseQuota):
2611         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2612         * UIProcess/WebResourceCacheManagerProxy.cpp:
2613         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
2614         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2615         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:window:]):
2616         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2617         (WebKit::WebChromeClient::exceededDatabaseQuota):
2618
2619 2014-06-18  Anders Carlsson  <andersca@apple.com>
2620
2621         Add back WKPageRunJavaScriptInMainFrame_b for now
2622         https://bugs.webkit.org/show_bug.cgi?id=134045
2623         <rdar://problem/17368879>
2624
2625         Reviewed by Tim Horton.
2626
2627         Reverted changeset:
2628
2629         "Remove WKPageRunJavaScriptInMainFrame_b"
2630         https://bugs.webkit.org/show_bug.cgi?id=133926
2631         http://trac.webkit.org/changeset/169991
2632
2633 2014-06-18  Anders Carlsson  <andersca@apple.com>
2634
2635         Simplify WebPageProxy::saveRecentSearches and WebPageProxy::loadRecentSearches
2636         https://bugs.webkit.org/show_bug.cgi?id=134041
2637
2638         Reviewed by Andreas Kling.
2639
2640         * UIProcess/cf/WebPageProxyCF.cpp:
2641         (WebKit::WebPageProxy::saveRecentSearches):
2642         (WebKit::WebPageProxy::loadRecentSearches):
2643
2644 2014-06-18  Simon Fraser  <simon.fraser@apple.com>
2645
2646         Make ScrollingStateNodes refcounted, and other minor cleanup
2647         https://bugs.webkit.org/show_bug.cgi?id=134040
2648
2649         Reviewed by Beth Dakin.
2650
2651         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2652         (WebKit::encodeNodeAndDescendants):
2653
2654 2014-06-18  Benjamin Poulain  <benjamin@webkit.org>
2655
2656         [iOS][WK2] Do not add padding when magnifying replaced elements
2657         https://bugs.webkit.org/show_bug.cgi?id=134019
2658
2659         Reviewed by Tim Horton.
2660
2661         Having margins for regular blocks make sense to improve readability. For replaced elements,
2662         we should follow iOS's UI and display edge to edge.
2663
2664         * UIProcess/ios/SmartMagnificationController.mm:
2665         (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
2666
2667 2014-06-18  Benjamin Poulain  <bpoulain@apple.com>
2668
2669         [iOS][WK2] Re-sync didCommitLoadForMainFrame with its corresponding tile update
2670         https://bugs.webkit.org/show_bug.cgi?id=134009
2671
2672         Reviewed by Tim Horton.
2673
2674         WKWebView assumed the first _didCommitLayerTree: after _didCommitLoadForMainFrame
2675         had the state of the page being loaded.
2676
2677         This is not always true. Sometimes, a set of tiles can be rendering asynchronously while the next
2678         page is loaded, and does not flush the queue until after didCommitLoadForMainFrame is executed.
2679
2680         Tim introduced a transactionID with each layer tree update. This patch uses that to synchronize
2681         WKWebView with the right set of tiles.
2682
2683         * UIProcess/API/Cocoa/WKWebView.mm:
2684         (-[WKWebView _didCommitLoadForMainFrame]):
2685         (-[WKWebView _didCommitLayerTree:WebKit::]):
2686         (-[WKWebView _updateVisibleContentRects]):
2687         * UIProcess/WebPageProxy.h:
2688         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2689         (WebKit::RemoteLayerTreeDrawingAreaProxy::nextLayerTreeTransactionID):
2690         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in:
2691         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2692         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2693         (WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
2694         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2695         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2696
2697 2014-06-18  Anders Carlsson  <andersca@apple.com>
2698
2699         Simplify WebCredential
2700         https://bugs.webkit.org/show_bug.cgi?id=134036
2701
2702         Reviewed by Andreas Kling.
2703
2704         * UIProcess/API/C/WKCredential.cpp:
2705         (WKCredentialCreate):
2706         (WKCredentialCreateWithCertificateInfo):
2707         (WKCredentialCopyUser):
2708         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2709         (WebKit::AuthenticationChallengeProxy::useCredential):
2710         * UIProcess/Authentication/WebCredential.cpp:
2711         (WebKit::WebCredential::credential):
2712         (WebKit::WebCredential::core): Deleted.
2713         (WebKit::WebCredential::user): Deleted.
2714         * UIProcess/Authentication/WebCredential.h:
2715         (WebKit::WebCredential::create): Deleted.
2716
2717 2014-06-18  Anders Carlsson  <andersca@apple.com>
2718
2719         Adopt modern C++11 loops and fix WebArchive creation functions
2720         https://bugs.webkit.org/show_bug.cgi?id=134032
2721
2722         Reviewed by Andreas Kling.
2723
2724         * Shared/APIWebArchive.cpp:
2725         (API::WebArchive::WebArchive):
2726
2727 2014-06-18  Anders Carlsson  <andersca@apple.com>
2728
2729         Give WKWebView on iOS a mobile user agent
2730         https://bugs.webkit.org/show_bug.cgi?id=134034
2731         <rdar://problem/17346489>
2732
2733         Reviewed by Enrica Casucci.
2734
2735         * UIProcess/API/Cocoa/WKWebView.mm:
2736         (-[WKWebView initWithFrame:configuration:]):
2737
2738 2014-06-18  Joseph Pecoraro  <pecoraro@apple.com>
2739
2740         Remove stale include, header was removed in r170101.
2741
2742         Unreviewed build fix.
2743
2744         * Shared/API/Cocoa/WebKitPrivate.h:
2745
2746 2014-06-18  Anders Carlsson  <andersca@apple.com>
2747
2748         Add CF type cast function templates and use them in KeyedDecoder in WebKit2
2749         https://bugs.webkit.org/show_bug.cgi?id=134033
2750
2751         Reviewed by Sam Weinig.
2752
2753         * Shared/cf/KeyedDecoder.cpp:
2754         (WebKit::KeyedDecoder::KeyedDecoder):
2755         (WebKit::KeyedDecoder::decodeBytes):
2756         (WebKit::KeyedDecoder::decodeBool):
2757         (WebKit::KeyedDecoder::decodeInt32):
2758         (WebKit::KeyedDecoder::decodeInt64):
2759         (WebKit::KeyedDecoder::decodeFloat):
2760         (WebKit::KeyedDecoder::decodeDouble):
2761         (WebKit::KeyedDecoder::decodeString):
2762         (WebKit::KeyedDecoder::beginObject):
2763         (WebKit::KeyedDecoder::beginArray):
2764         (WebKit::KeyedDecoder::beginArrayElement):
2765
2766 2014-06-18  Dan Bernstein  <mitz@apple.com>
2767
2768         Remove the unused _WKBackForwardListDidChangeNotification.
2769
2770         Reviewed by Anders Carlsson.
2771
2772         * UIProcess/API/Cocoa/WKBackForwardList.mm:
2773         * UIProcess/API/Cocoa/WKBackForwardListInternal.h:
2774         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Removed.
2775         * UIProcess/Cocoa/NavigationState.h:
2776         * UIProcess/Cocoa/NavigationState.mm:
2777         (WebKit::NavigationState::LoaderClient::didChangeBackForwardList): Deleted.
2778         * WebKit2.xcodeproj/project.pbxproj:
2779
2780 2014-06-18  Andreas Kling  <akling@apple.com>
2781
2782         Set main thread QoS policies after IPC initialization.
2783         <https://webkit.org/b/134014>
2784
2785         Something was flipping the QoS level back to "unspecified" after
2786         setting it in the ChildProcess initialization code. Pending a better
2787         understanding of what really happens, move the code to a later stage,
2788         after IPC channels are up and running. Now the priority sticks.
2789
2790         Reviewed by Anders Carlsson.
2791
2792         * NetworkProcess/NetworkProcess.cpp:
2793         (WebKit::NetworkProcess::initializeNetworkProcess):
2794         * Shared/ChildProcess.cpp:
2795         (WebKit::ChildProcess::initialize):
2796         * WebProcess/WebProcess.cpp:
2797         (WebKit::WebProcess::initializeWebProcess):
2798
2799 2014-06-17  Dan Bernstein  <mitz@apple.com>
2800
2801         [Cocoa] WKWebView's _privateBrowsingEnabled property is unused
2802         https://bugs.webkit.org/show_bug.cgi?id=134013
2803
2804         Reviewed by Sam Weinig.
2805
2806         * UIProcess/API/Cocoa/WKWebView.mm:
2807         (-[WKWebView _privateBrowsingEnabled]): Deleted.
2808         (-[WKWebView _setPrivateBrowsingEnabled:]): Deleted.
2809         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2810
2811 2014-06-17  Tim Horton  <timothy_horton@apple.com>
2812
2813         [iOS][wk2] Use ImageDocument to display subframe PDFs
2814         https://bugs.webkit.org/show_bug.cgi?id=133944
2815         <rdar://problem/17205983>
2816
2817         Reviewed by Dan Bates.
2818
2819         * WebProcess/WebPage/WebPage.cpp:
2820         (WebKit::WebPage::updatePreferences):
2821         Always use ImageDocument for subframe PDFs in WebKit2 on iOS.
2822
2823 2014-06-17  Anders Carlsson  <andersca@apple.com>
2824
2825         Make it possible to use -[NSBundle classNamed:] to find WebKitLegacy classes
2826         https://bugs.webkit.org/show_bug.cgi?id=134008
2827         <rdar://problem/17037600>
2828
2829         Reviewed by Dan Bernstein.
2830
2831         * UIProcess/API/Cocoa/LegacyBundleForClass.mm: Added.
2832         * WebKit2.xcodeproj/project.pbxproj:
2833
2834 2014-06-17  Anders Carlsson  <andersca@apple.com>
2835
2836         Expose the location of website data
2837         https://bugs.webkit.org/show_bug.cgi?id=134000
2838         <rdar://problem/17350498>
2839
2840         Reviewed by Dan Bernstein.
2841
2842         Also, remove the bundle ID from the website data path for containerized apps.
2843
2844         * Shared/mac/SandboxUtilities.cpp:
2845         (WebKit::processIsAppSandboxed):
2846         * Shared/mac/SandboxUtilities.h:
2847         * UIProcess/API/Cocoa/WKProcessPool.mm:
2848         (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
2849         (websiteDataDirectoryURL):
2850         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2851
2852 2014-06-17  Jeremy Jones  <jeremyj@apple.com>
2853
2854         Improve enter and exit fullscreen transition by using two step transition.
2855         https://bugs.webkit.org/show_bug.cgi?id=133706
2856
2857         Reviewed by Simon Fraser.
2858
2859         Add setupFullscreen()/didSetupFullscreen() and cleanupFullscreen()/didCleanupFullscreen()
2860         to the proxies. And refactor enter/exit fullscreen to do some of the work in setup/cleanup.
2861
2862         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2863         Add four methods mentioned above.
2864         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
2865         Add Setup/Cleanup functions.
2866         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2867         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): does what enterFullscreen used to do.
2868         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): forward IPC.
2869         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): forward IPC.
2870         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): changed to enterFullscreen
2871         * WebProcess/ios/WebVideoFullscreenManager.h: Add didSetup/didCleanup
2872         * WebProcess/ios/WebVideoFullscreenManager.messages.in: Add didSetup/didCleanup
2873         * WebProcess/ios/WebVideoFullscreenManager.mm: 
2874         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): refactored,
2875         some implementation moves to didSetupFullscreen.
2876         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
2877         Moves the video layer over to the hosted layer, and initiates fullscreen.
2878         (WebKit::WebVideoFullscreenManager::didExitFullscreen): refactored,
2879         some implementation moves to didCleanupFullscreen, and initiates cleanup.
2880         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
2881         Final cleanup refactored from didExitFullscreen()
2882
2883 2014-06-17  Eric Carlson  <eric.carlson@apple.com>
2884
2885         [iOS] enable background audio in WK2
2886         https://bugs.webkit.org/show_bug.cgi?id=133996
2887
2888         Reviewed by Jer Noble.
2889
2890         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist: Mark as
2891             allowed to play audio when in the background.
2892         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
2893
2894 2014-06-17  Simon Fraser  <simon.fraser@apple.com>
2895
2896         [UI-side compositing] fix reflections on composited layers
2897         https://bugs.webkit.org/show_bug.cgi?id=133942
2898
2899         Reviewed by Tim Horton.
2900         
2901         Fix reflections on composited layers. There are two main set of changes.
2902         
2903         First, a PlatformCALayerRemote which is a clone has to track the layer
2904         it is a clone of, so it knows where to grab the contents from in the UI process.
2905         This layer may be told that its contents need updating out of order during
2906         recursiveBuildTransaction(), so we need some small changes in RemoteLayerTreeContext
2907         to allow a layer to add itself to the set of layers requiring commit.
2908         
2909         In the UI process, a new step is added to RemoteLayerTreeHost::updateLayerTree()
2910         to go through clones, and copy their contents from the origin layer.
2911         
2912         The second set of changes makes platformCALayerLayerDidDisplay() work for
2913         UI-side compositing by not taking a PlatformLayer*, but instead a PlatformCALayer*.
2914         PlatformCALayer::setContentsChanged() changed to copyContentsFromLayer() so we know
2915         what the origin layer is.
2916
2917         * Shared/mac/RemoteLayerBackingStore.mm:
2918         (WebKit::RemoteLayerBackingStore::display): Remove the early return so we can always
2919         call platformCALayerLayerDidDisplay().
2920         * Shared/mac/RemoteLayerTreeTransaction.h:
2921         * Shared/mac/RemoteLayerTreeTransaction.mm:
2922         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2923         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
2924         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
2925         (WebKit::dumpChangedLayers):
2926         * UIProcess/mac/RemoteLayerTreeHost.mm:
2927         (WebKit::RemoteLayerTreeHost::updateLayerTree):
2928         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2929         (WebKit::PlatformCALayerRemote::clone):
2930         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2931         (WebKit::PlatformCALayerRemote::copyContentsFromLayer):
2932         (WebKit::PlatformCALayerRemote::setClonedLayer):
2933         (WebKit::PlatformCALayerRemote::setContentsChanged): Deleted.
2934         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2935         (WebKit::PlatformCALayerRemote::properties):
2936         (WebKit::PlatformCALayerRemote::context):
2937
2938 2014-06-17  Anders Carlsson  <andersca@apple.com>
2939
2940         Remove session state methods from WKBrowsingContextController
2941         https://bugs.webkit.org/show_bug.cgi?id=133995
2942
2943         Reviewed by Dan Bernstein.
2944
2945         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
2946         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2947         (-[WKBrowsingContextController sessionState]): Deleted.
2948         (-[WKBrowsingContextController restoreFromSessionState:]): Deleted.
2949
2950 2014-06-17  Brady Eidson  <beidson@apple.com>
2951
2952         Only show telephone number highlights if only one number is selected
2953         <rdar://problem/16874568> and https://bugs.webkit.org/show_bug.cgi?id=133989
2954
2955         Reviewed by Tim Horton.
2956
2957         Add a flag to TelephoneNumberData to remember if it was hovered over:
2958         * WebProcess/WebPage/TelephoneNumberOverlayController.h:
2959         (WebKit::TelephoneNumberData::hovered):
2960         (WebKit::TelephoneNumberData::setHovered):
2961         (WebKit::TelephoneNumberData::TelephoneNumberData):
2962
2963         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
2964         (WebKit::TelephoneNumberOverlayController::drawRect): Only draw the highlight if one
2965           phone number is selected.
2966         (WebKit::TelephoneNumberOverlayController::mouseEvent): Update the hover state of the
2967           current phone number, and setNeedsDisplay if the hover state changes.
2968         (WebKit::TelephoneNumberOverlayController::clearHighlights):
2969
2970 2014-06-17  Tim Horton  <timothy_horton@apple.com>
2971
2972         Remove WKContentView _setFindIndicator:fadeOut:animate:
2973         https://bugs.webkit.org/show_bug.cgi?id=133976
2974
2975         Reviewed by Anders Carlsson.
2976
2977         Find indicators are totally internal to FindController on iOS,
2978         we don't need to push them to the content view via PageClient,
2979         so this code was unused.
2980
2981         * UIProcess/ios/PageClientImplIOS.mm:
2982         (WebKit::PageClientImpl::setFindIndicator):
2983         * UIProcess/ios/WKContentView.h:
2984         * UIProcess/ios/WKContentView.mm:
2985         (-[WKContentView _setFindIndicator:WebKit::fadeOut:animate:]): Deleted.
2986
2987 2014-06-17  Andreas Kling  <akling@apple.com>
2988
2989         Web process main thread priority is lower than some network process threads.
2990         <https://webkit.org/b/133987>
2991         <rdar://problem/17330300>
2992
2993         Mark the main thread as "user initiated" in process entry.
2994
2995         Reviewed by Maciej Stachowiak.
2996
2997         * Shared/ChildProcess.cpp:
2998         (WebKit::ChildProcess::initialize):
2999
3000 2014-06-17  Anders Carlsson  <andersca@apple.com>
3001
3002         Add SPI to get the NSURLRequest from a WKNavigationResponse
3003         https://bugs.webkit.org/show_bug.cgi?id=133984
3004         <rdar://problem/17006399>
3005
3006         Reviewed by Dan Bernstein.
3007
3008         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
3009         (-[WKNavigationResponse _request]):
3010         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
3011         * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
3012         * UIProcess/Cocoa/NavigationState.mm:
3013         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
3014
3015 2014-06-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3016
3017         [EFL][WK2] Skip failing EFL API tests
3018         https://bugs.webkit.org/show_bug.cgi?id=133981
3019
3020         Reviewed by Csaba Osztrogonác.
3021
3022         UserMessage, WillLoad and test_ewk2_view have been failed since r169784.
3023
3024         * PlatformEfl.cmake:
3025
3026 2014-06-17  Zan Dobersek  <zdobersek@igalia.com>
3027
3028         Unreviewed build fix for the GTK+ port. Removing the *Callback::create() wrappings
3029         for lambda callbacks that aren't required anymore after the changes in r170041.
3030
3031         * UIProcess/API/gtk/WebKitWebView.cpp:
3032         (webkit_web_view_can_execute_editing_command):
3033         (webkit_web_view_run_javascript):
3034         (resourcesStreamReadCallback):
3035         (webkit_web_view_save):
3036         (webkit_web_view_save_to_file):
3037
3038 2014-06-16  Jaehun Lim  <ljaehun.lim@samsung.com>
3039
3040         Unreviewed build fix when MHTML is enabled after r170041
3041
3042         * UIProcess/API/C/WKPage.cpp:
3043         (WKPageGetContentsAsMHTMLData):
3044
3045 2014-06-16  Dan Bernstein  <mitz@apple.com>
3046
3047         Part 2 of: Change GenericCallback<> function parameters into std::function<>
3048         https://bugs.webkit.org/show_bug.cgi?id=133927
3049
3050         Reviewed by Sam Weinig.
3051
3052         * UIProcess/API/C/WKPage.cpp:
3053         (WKPageRunJavaScriptInMainFrame):
3054         (WKPageRenderTreeExternalRepresentation):
3055         (WKPageGetSourceForFrame):
3056         (WKPageGetContentsAsString):
3057         (WKPageGetBytecodeProfile):
3058         (WKPageGetSelectionAsWebArchiveData):
3059         (WKPageValidateCommand):
3060         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
3061         (WKPluginSiteDataManagerClearSiteData):
3062         (WKPluginSiteDataManagerClearAllSiteData):
3063         * UIProcess/API/Cocoa/WKWebView.mm:
3064         (-[WKWebView evaluateJavaScript:completionHandler:]):
3065         * UIProcess/API/mac/WKView.mm:
3066         (-[WKView validateUserInterfaceItem:]):
3067         (-[WKView startSpeaking:]):
3068         (-[WKView selectedRangeWithCompletionHandler:]):
3069         (-[WKView markedRangeWithCompletionHandler:]):
3070         (-[WKView hasMarkedTextWithCompletionHandler:]):
3071         (-[WKView firstRectForCharacterRange:completionHandler:]):
3072         (-[WKView characterIndexForPoint:completionHandler:]):
3073         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
3074         (WebKit::WebPluginSiteDataManager::clearSiteData):
3075         * UIProcess/Plugins/WebPluginSiteDataManager.h:
3076         * UIProcess/WebPageProxy.cpp:
3077         (WebKit::WebPageProxy::validateCommand):
3078         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
3079         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
3080         (WebKit::WebPageProxy::getSourceForFrame):
3081         (WebKit::WebPageProxy::getContentsAsString):
3082         (WebKit::WebPageProxy::getBytecodeProfile):
3083         (WebKit::WebPageProxy::getContentsAsMHTMLData):
3084         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
3085         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
3086         (WebKit::WebPageProxy::getMarkedRangeAsync):
3087         (WebKit::WebPageProxy::getSelectedRangeAsync):
3088         (WebKit::WebPageProxy::characterIndexForPointAsync):
3089         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
3090         (WebKit::WebPageProxy::takeSnapshot):
3091         * UIProcess/WebPageProxy.h:
3092         * UIProcess/ios/WKContentViewInteraction.mm:
3093         (-[WKContentView _define:]):
3094         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
3095         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
3096         (-[WKContentView requestDictationContext:]):
3097         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
3098         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
3099         * UIProcess/ios/WebPageProxyIOS.mm:
3100         (WebKit::WebPageProxy::updateSelectionWithTouches):
3101         (WebKit::WebPageProxy::requestAutocorrectionData):
3102         (WebKit::WebPageProxy::applyAutocorrection):
3103         (WebKit::WebPageProxy::requestDictationContext):
3104         (WebKit::WebPageProxy::requestAutocorrectionContext):
3105
3106 2014-06-16  Jaehun Lim  <ljaehun.lim@samsung.com>
3107
3108         Unreviewed build fix after r170029
3109
3110         Use String() instead of AtomicString().
3111
3112         * UIProcess/InspectorServer/HTTPRequest.cpp:
3113         (WebKit::HTTPRequest::parseHeaders):
3114
3115 2014-06-16  Brent Fulgham  <bfulgham@apple.com>
3116
3117         [Win] Use TileController on Windows
3118         https://bugs.webkit.org/show_bug.cgi?id=133895
3119
3120         Reviewed by Tim Horton.
3121
3122         * WebProcess/WebPage/mac/PlatformCALayerRemote.h: Remove
3123         unneeded overload.
3124
3125 2014-06-16  Timothy Horton  <timothy_horton@apple.com>
3126
3127         [iOS][wk2] Swipe snapshots are removed too quickly if there is no saved render tree size
3128         https://bugs.webkit.org/show_bug.cgi?id=133891
3129
3130         Reviewed by Simon Fraser.
3131
3132         * UIProcess/ios/ViewGestureControllerIOS.mm:
3133         (WebKit::ViewGestureController::endSwipeGesture):
3134         (WebKit::ViewGestureController::setRenderTreeSize):
3135         If we don't know the target render tree size, wait until the first layer tree commit
3136         that comes in, instead of removing the snapshot when the gesture ends.
3137
3138 2014-06-16  Timothy Horton  <timothy_horton@apple.com>
3139
3140         [iOS][wk2] Swiping back briefly shows the previous page before loading the new one
3141         https://bugs.webkit.org/show_bug.cgi?id=133885
3142
3143         Reviewed by Simon Fraser.
3144
3145         Remove a race between the UI and Web processes when removing the swipe snapshot.
3146         Previously, it was possible to get a commit from the Web process with layer content
3147         (and render tree size) from the previous page *after* sending the navigation request
3148         to the page, because of the asynchronicity of layer tree commits. This could cause
3149         the snapshot to be removed early (if the previous fully-loaded page had a sufficiently
3150         large render tree size), revealing the old tiles underneath the snapshot.
3151
3152         * Shared/mac/RemoteLayerTreeTransaction.h:
3153         (WebKit::RemoteLayerTreeTransaction::transactionID):
3154         (WebKit::RemoteLayerTreeTransaction::setTransactionID):
3155         * Shared/mac/RemoteLayerTreeTransaction.mm:
3156         (WebKit::RemoteLayerTreeTransaction::encode):
3157         (WebKit::RemoteLayerTreeTransaction::decode):
3158         * UIProcess/DrawingAreaProxy.h:
3159         (WebKit::DrawingAreaProxy::lastVisibleTransactionID):
3160         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3161         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3162         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3163         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3164         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers):
3165         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3166         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3167         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3168         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3169         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
3170         Keep track of an ever-increasing transaction ID in RemoteLayerTreeDrawingArea(Proxy).
3171         It increments in the UI process at didUpdate time, because the Web process cannot
3172         have started on a new layer tree commit until didUpdate is sent.
3173         It increments in the Web process at commit time.
3174
3175         * UIProcess/ios/ViewGestureControllerIOS.mm:
3176         (WebKit::ViewGestureController::endSwipeGesture):
3177         (WebKit::ViewGestureController::setRenderTreeSize):
3178         * UIProcess/mac/ViewGestureController.h:
3179         Adopt transaction IDs; don't remove the snapshot until the commit
3180         that includes the navigation arrives.
3181
3182 2014-06-16  Dan Bernstein  <mitz@apple.com>
3183
3184         <rdar://problem/17327707> [Cocoa] Expose WebPreferences::storageBlockingPolicy
3185         https://bugs.webkit.org/show_bug.cgi?id=133958
3186
3187         Reviewed by Anders Carlsson.
3188
3189         * UIProcess/API/Cocoa/WKPreferences.mm:
3190         (toStorageBlockingPolicy): Added this helper conversion function.
3191         (toAPI): Ditto.
3192         (-[WKPreferences _storageBlockingPolicy]): Added this getter.
3193         (-[WKPreferences _setStorageBlockingPolicy:]): Added this setter.
3194         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared new _storageBlockingPolicy property
3195         and _WKStorageBlockingPolicy enum. 
3196
3197 2014-06-16  Anders Carlsson  <andersca@apple.com>
3198
3199         Don't use AtomicString in HTTPHeaderMap
3200         https://bugs.webkit.org/show_bug.cgi?id=133957
3201         <rdar://problem/15256572>
3202
3203         Reviewed by Andreas Kling.
3204
3205         Update for WebCore changes.
3206
3207         * Shared/WebCoreArgumentCoders.cpp:
3208         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
3209
3210 2014-06-15  Anders Carlsson  <andersca@apple.com>
3211
3212         Change ResourceRequestBase::addHTTPHeaderFields to setHTTPHeaderFields instead
3213         https://bugs.webkit.org/show_bug.cgi?id=133925
3214
3215         Reviewed by Sam Weinig.
3216
3217         * PluginProcess/PluginControllerProxy.h:
3218         * Shared/WebCoreArgumentCoders.cpp:
3219         (IPC::ArgumentCoder<ResourceRequest>::decode):
3220         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3221         (WebKit::NPN_PostURL):
3222         * WebProcess/Plugins/PluginView.cpp:
3223         (WebKit::PluginView::loadURL):
3224         * WebProcess/Plugins/PluginView.h:
3225
3226 2014-06-16  Anders Carlsson  <andersca@apple.com>
3227
3228         Add HTTPHeaderName overloads on ResourceResponseBase
3229         https://bugs.webkit.org/show_bug.cgi?id=133946
3230
3231         Reviewed by Andreas Kling.
3232
3233         * WebProcess/Plugins/PluginView.cpp:
3234         (WebKit::buildHTTPHeaders):
3235
3236 2014-06-16  Dan Bernstein  <mitz@apple.com>
3237
3238         Fixed a typo in the last change.
3239
3240         * UIProcess/API/Cocoa/WKPreferences.mm:
3241         (-[WKPreferences init]):
3242
3243 2014-06-16  Dan Bernstein  <mitz@apple.com>
3244
3245         [Cocoa] Remove WKPreferences persistence in user defaults
3246         https://bugs.webkit.org/show_bug.cgi?id=133945
3247
3248         Reviewed by Anders Carlsson.
3249
3250         * UIProcess/API/Cocoa/WKPreferences.h: Removed userDefaultsKeyPrefix property and
3251         initializer with userDefaultsKeyPrefix parameter.
3252         * UIProcess/API/Cocoa/WKPreferences.mm:
3253         (-[WKPreferences init]): Changed to initialize an instance with an empty identifier, which
3254         means that it won’t persist to user defaults.
3255         (-[WKPreferences initWithUserDefaultsKeyPrefix:]): Deleted.
3256         (-[WKPreferences userDefaultsKeyPrefix]): Deleted.
3257
3258 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
3259
3260         Page::findStringMatchingRanges() should take Vector<RefPtr<Range>> by reference instead of pointer
3261         https://bugs.webkit.org/show_bug.cgi?id=133677
3262
3263         Reviewed by Anders Carlsson.
3264
3265         * WebProcess/WebPage/FindController.cpp:
3266         (WebKit::FindController::findString): Update the call to Page::findStringMatchingRanges() to pass
3267         in a Vector<RefPtr<Range>> reference instead of a pointer.
3268         (WebKit::FindController::findStringMatches): Ditto.
3269
3270 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
3271
3272         Unreviewed build fixes for the EFL and GTK+ ports after r169994 and 170000.
3273
3274         * UIProcess/API/C/WKPluginSiteDataManager.cpp: Undefine the None macro under X11.
3275         * UIProcess/API/gtk/WebKitCookieManager.cpp:
3276         (webkit_cookie_manager_get_accept_policy): Remove unnecessary ::create() wrappings.
3277         (webkit_cookie_manager_get_domains_with_cookies): Ditto.
3278         * UIProcess/API/gtk/WebKitWebResource.cpp:
3279         (webkit_web_resource_get_data): Ditto.
3280
3281 2014-06-15  Dan Bernstein  <mitz@apple.com>
3282
3283         Part 1 of: Change GenericCallback<> function parameters into std::function<>
3284         https://bugs.webkit.org/show_bug.cgi?id=133927
3285
3286         Reviewed by Sam Weinig.
3287
3288         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3289         (WKApplicationCacheManagerGetApplicationCacheOrigins):
3290         * UIProcess/API/C/WKContext.cpp:
3291         (WKContextGetStatistics):
3292         (WKContextGetStatisticsWithOptions):
3293         * UIProcess/API/C/WKCookieManager.cpp:
3294         (WKCookieManagerGetHostnamesWithCookies):
3295         (WKCookieManagerGetHTTPCookieAcceptPolicy):
3296         * UIProcess/API/C/WKDatabaseManager.cpp:
3297         (WKDatabaseManagerGetDatabasesByOrigin):
3298         (WKDatabaseManagerGetDatabaseOrigins):
3299         * UIProcess/API/C/WKFrame.cpp:
3300         (WKFrameGetMainResourceData):
3301         (WKFrameGetResourceData):
3302         (WKFrameGetWebArchive):
3303         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3304         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
3305         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
3306         * UIProcess/API/C/WKMediaCacheManager.cpp:
3307         (WKMediaCacheManagerGetHostnamesWithMediaCache):
3308         * UIProcess/API/C/WKOriginDataManager.cpp:
3309         (WKOriginDataManagerGetOrigins):
3310         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
3311         (WKPluginSiteDataManagerGetSitesWithData):
3312         * UIProcess/API/C/WKResourceCacheManager.cpp:
3313         (WKResourceCacheManagerGetCacheOrigins):
3314         * UIProcess/API/Cocoa/WKWebView.mm:
3315         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
3316         * UIProcess/API/mac/WKView.mm:
3317         (-[WKView attributedSubstringForProposedRange:completionHandler:]):
3318         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
3319         (WebKit::WebPluginSiteDataManager::getSitesWithData):
3320         * UIProcess/Plugins/WebPluginSiteDataManager.h:
3321         * UIProcess/WebApplicationCacheManagerProxy.cpp:
3322         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
3323         * UIProcess/WebApplicationCacheManagerProxy.h:
3324         * UIProcess/WebContext.cpp:
3325         (WebKit::WebContext::getStatistics):
3326         * UIProcess/WebContext.h:
3327         * UIProcess/WebCookieManagerProxy.cpp:
3328         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
3329         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
3330         * UIProcess/WebCookieManagerProxy.h:
3331         * UIProcess/WebDatabaseManagerProxy.cpp:
3332         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
3333         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
3334         * UIProcess/WebDatabaseManagerProxy.h:
3335         * UIProcess/WebFrameProxy.cpp:
3336         (WebKit::WebFrameProxy::getWebArchive):
3337         (WebKit::WebFrameProxy::getMainResourceData):
3338         (WebKit::WebFrameProxy::getResourceData):
3339         * UIProcess/WebFrameProxy.h:
3340         * UIProcess/WebKeyValueStorageManager.cpp:
3341         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
3342         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
3343         * UIProcess/WebKeyValueStorageManager.h:
3344         * UIProcess/WebMediaCacheManagerProxy.cpp:
3345         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
3346         * UIProcess/WebMediaCacheManagerProxy.h:
3347         * UIProcess/WebOriginDataManagerProxy.cpp:
3348         (WebKit::WebOriginDataManagerProxy::getOrigins):
3349         * UIProcess/WebOriginDataManagerProxy.h:
3350         * UIProcess/WebPageProxy.cpp:
3351         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
3352         (WebKit::WebPageProxy::getResourceDataFromFrame):
3353         (WebKit::WebPageProxy::getWebArchiveOfFrame):
3354         * UIProcess/WebPageProxy.h:
3355         * UIProcess/WebResourceCacheManagerProxy.cpp:
3356         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
3357         * UIProcess/WebResourceCacheManagerProxy.h:
3358         * UIProcess/ios/WKContentViewInteraction.mm:
3359         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
3360         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
3361         * UIProcess/ios/WebPageProxyIOS.mm:
3362         (WebKit::WebPageProxy::selectWithGesture):
3363         (WebKit::WebPageProxy::selectWithTwoTouches):
3364         * UIProcess/mac/WebPageProxyMac.mm:
3365         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
3366
3367 2014-06-15  Dan Bernstein  <mitz@apple.com>
3368
3369         <rdar://problem/17291697> [Cocoa] Can’t tell at policy decision time whether WebKit can handle the request
3370         https://bugs.webkit.org/show_bug.cgi?id=133930
3371
3372         Reviewed by Sam Weinig.
3373
3374         * Shared/NavigationActionData.cpp:
3375         (WebKit::NavigationActionData::NavigationActionData): Initialize new member canHandleRequest
3376         to false.
3377         (WebKit::NavigationActionData::encode): Encode canHandleRequest.
3378         (WebKit::NavigationActionData::decode): Decode it.
3379         * Shared/NavigationActionData.h: Declared new boolean member canHandleRequest.
3380
3381         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3382         (-[WKNavigationAction _initWithNavigationActionData:]): Set new ivar _canHandleRequest from
3383         the action data.
3384         (-[WKNavigationAction _canHandleRequest]): Added this getter.
3385         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Declared new property _canHandleRequest.
3386
3387         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3388         (WebKit::WebChromeClient::createWindow): Set canHandleRequest in the NavigationActionData.
3389
3390         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3391         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
3392         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
3393
3394 2014-06-15  Ryuan Choi  <ryuan.choi@samsung.com>
3395
3396         [EFL][WK2] Change ewk_view_settings_get to ewk_page_group_settings_get
3397         https://bugs.webkit.org/show_bug.cgi?id=133841
3398
3399         Reviewed by Gyuyoung Kim.
3400
3401         Ewk_Settings object is a member of Ewk_Page_Group.
3402         So, Ewk_Page_Group is better place for the getter of Ewk_Settings.
3403
3404         * UIProcess/API/efl/ewk_page_group.cpp:
3405         (ewk_page_group_settings_get): Added instead of ewk_view_settings_get.
3406         * UIProcess/API/efl/ewk_page_group.h:
3407         * UIProcess/API/efl/ewk_view.cpp:
3408         (ewk_view_settings_get): Deleted.
3409         * UIProcess/API/efl/ewk_view.h:
3410         * UIProcess/API/efl/tests/test_ewk2_page_group.cpp:
3411         (TEST_F):
3412         * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
3413         (TEST_F):
3414         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
3415         (TEST_F): Deleted.
3416
3417 2014-06-15  Anders Carlsson  <andersca@apple.com>
3418
3419         Add an autorelease() member function to RetainPtr
3420         https://bugs.webkit.org/show_bug.cgi?id=133929
3421
3422         Reviewed by Dan Bernstein.
3423
3424         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
3425         (-[_WKRemoteObjectRegistry remoteObjectProxyWithInterface:]):
3426         * UIProcess/API/Cocoa/WKWebView.mm:
3427         (-[WKWebView navigationDelegate]):
3428         (-[WKWebView UIDelegate]):
3429         (-[WKWebView loadRequest:]):
3430         (-[WKWebView loadHTMLString:baseURL:]):
3431         (-[WKWebView goToBackForwardListItem:]):
3432         (-[WKWebView goBack]):
3433         (-[WKWebView goForward]):
3434         (-[WKWebView reload]):
3435         (-[WKWebView reloadFromOrigin]):
3436         (-[WKWebView _historyDelegate]):
3437         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3438         (WebKit::animationValueFromKeyframeValue):
3439
3440 2014-06-15  Dan Bernstein  <mitz@apple.com>
3441
3442         Get rid of VoidAPICallback
3443         https://bugs.webkit.org/show_bug.cgi?id=133928
3444
3445         Reviewed by Sam Weinig.
3446
3447         * UIProcess/API/C/WKPage.cpp:
3448         (WKPageForceRepaint): Wrap the API callback in a generic callback here.
3449
3450         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
3451         (WKPluginSiteDataManagerClearSiteData): Ditto.
3452         (WKPluginSiteDataManagerClearAllSiteData): Ditto.
3453
3454         * UIProcess/GenericCallback.h:
3455         (WebKit::GenericCallback::performCallback): Added this helper for 0-argument callbacks.
3456         (WebKit::VoidCallback::create): Deleted.
3457         (WebKit::VoidCallback::~VoidCallback): Deleted.
3458         (WebKit::VoidCallback::performCallback): Deleted.
3459         (WebKit::VoidCallback::invalidate): Deleted.
3460         (WebKit::VoidCallback::VoidCallback): Deleted.
3461         (WebKit::VoidAPICallback::create): Deleted.
3462
3463         * UIProcess/mac/WKFullScreenWindowController.h:
3464
3465 2014-06-15  Zan Dobersek  <zdobersek@igalia.com>
3466
3467         Unreviewed build fix for the GTK+ port after r169990.
3468
3469         * UIProcess/WebPageProxy.cpp:
3470         (WebKit::WebPageProxy::resetState): Pass the error value to
3471         the rest of invalidateCallbackMap calls.
3472
3473 2014-06-15  Anders Carlsson  <andersca@apple.com>
3474
3475         Remove WKPageRunJavaScriptInMainFrame_b
3476         https://bugs.webkit.org/show_bug.cgi?id=133926
3477
3478         Reviewed by Dan Bernstein.
3479
3480         * UIProcess/API/C/WKPage.cpp:
3481         (callRunJavaScriptBlockAndRelease): Deleted.
3482         (WKPageRunJavaScriptInMainFrame_b): Deleted.
3483         * UIProcess/API/C/WKPage.h:
3484
3485 2014-06-15  Anders Carlsson  <andersca@apple.com>