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