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