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