Unreviewed. Wrong units used in offset calculation from r167961.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-04-30  Roger Fong  <roger_fong@apple.com>
2
3         Unreviewed. Wrong units used in offset calculation from r167961.
4
5         * WebProcess/WebPage/WebPage.cpp:
6         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
7         I accidentally mixed and matches LayoutUnits with Ints in offset calculation here.
8         It should all just be in LayoutUnits.
9
10 2014-04-29  Benjamin Poulain  <bpoulain@apple.com>
11
12         [iOS][WK2] When pageScaleFactor * deviceScaleFactor = 1, the tile grid is completely messed up
13         https://bugs.webkit.org/show_bug.cgi?id=132368
14
15         Reviewed by Simon Fraser.
16
17         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
18         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
19         PlatformCALayerRemote always initialized the content scale to 1. Since contentsScale is supposed to reflect
20         zoomScale * deviceScaleFactor, the value should be 2.
21
22         This was causing bugs whenever the page scale factor was 1/2 on retina device (device scale factor = 2).
23
24         When the page is initialized, GraphicsLayerCA::updateContentsScale(0.5) computes a contentsScale of 1. There is an early
25         return on if (contentsScale == m_layer->contentsScale()). Since PlatformCALayerRemote->contentsScale() was incorreclty
26         returning one, we were leaving the tile backing unmodified.
27
28         Later, when the transaction is commited, the tile backing would still be default initialized and would render everything
29         at the wrong scale.
30
31 2014-04-29  Eric Carlson  <eric.carlson@apple.com>
32
33         [Mac] tag the video layers with descriptive name to aid debugging
34         https://bugs.webkit.org/show_bug.cgi?id=132371
35
36         Reviewed by Darin Adler.
37
38         * WebProcess/ios/WebVideoFullscreenManager.mm:
39         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Set the 
40             fullscreen host layer name in a debug build.
41
42 2014-04-29  Brady Eidson  <beidson@apple.com>
43
44         Handle selection services menu.
45         <rdar://problem/16727798> and https://bugs.webkit.org/show_bug.cgi?id=132362
46
47         Reviewed by Tim Horton.
48
49         Add members for the relevant info for showing a service menu for a selection:
50         * Shared/ContextMenuContextData.cpp:
51         (WebKit::ContextMenuContextData::ContextMenuContextData):
52         (WebKit::ContextMenuContextData::controlledDataIsEditable):
53         * Shared/ContextMenuContextData.h:
54         (WebKit::ContextMenuContextData::ContextMenuContextData):
55         (WebKit::ContextMenuContextData::controlledSelectionData):
56         (WebKit::ContextMenuContextData::needsServicesMenu):
57
58         * UIProcess/WebPageProxy.h:
59         * UIProcess/WebPageProxy.messages.in:
60         * UIProcess/mac/WebPageProxyMac.mm:
61         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard.
62         (WebKit::WebPageProxy::showSelectionServiceMenu):
63
64         Update the services menu code to know the difference between an image service and a selection service:
65         * UIProcess/mac/WebContextMenuProxyMac.h:
66         * UIProcess/mac/WebContextMenuProxyMac.mm:
67         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
68         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
69         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
70         (WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
71         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
72         (WebKit::WebContextMenuProxyMac::clearServicesMenu):
73         (WebKit::WebContextMenuProxyMac::populate):
74         (WebKit::WebContextMenuProxyMac::showContextMenu):
75         (WebKit::WebContextMenuProxyMac::setupImageServicesMenu): Deleted.
76         (WebKit::WebContextMenuProxyMac::clearImageServicesMenu): Deleted.
77
78         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
79         (WebKit::WebPasteboardOverrides::getDataForOverride):
80
81         * WebProcess/WebPage/WebPage.h:
82         * WebProcess/WebPage/WebPage.messages.in:
83         * WebProcess/WebPage/mac/WebPageMac.mm:
84         (WebKit::WebPage::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard.
85         (WebKit::WebPage::handleSelectionServiceClick): Pass the relevant selection data through to the UIProcess as RTFD data.
86
87         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
88         (WebKit::SelectionOverlayController::handleClick): Notify the WebPage of the click.
89
90 2014-04-29  Dan Bernstein  <mitz@apple.com>
91
92         <rdar://problem/16745596> [Cocoa] Crash when invoking a method with an unsigned parameter on a remote object
93         https://bugs.webkit.org/show_bug.cgi?id=132366
94
95         Reviewed by Anders Carlsson.
96
97         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
98         (encodeInvocation): Handle the 'I' type code. Interpret the 'q' and 'Q' type codes in an
99         architecture-independent manner.
100         (decodeInvocationArguments): Ditto.
101
102 2014-04-29  Roger Fong  <roger_fong@apple.com>
103
104         Don't immediately snapshot plugin to allow for proper dominant plugin detection.
105         https://bugs.webkit.org/show_bug.cgi?id=132294.
106         <rdar://problem/16745679>
107
108         Reviewed by Dean Jackson.
109
110         * WebProcess/Plugins/PluginView.cpp:
111         (WebKit::PluginView::didInitializePlugin):
112         Instead of immediately setting the display state to DisplaySnapshot,
113         put it on a timer to let the page fully layout and get hit test properly.
114
115 2014-04-28  Roger Fong  <roger_fong@apple.com>
116
117         Plugins hidden by images should autoplay.
118         https://bugs.webkit.org/show_bug.cgi?id=132222.
119         <rdar://problem/16653536>
120
121         Reviewed by Jon Lee and Darin Adler.
122
123         * WebProcess/WebPage/WebPage.cpp:
124         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
125         If the image on top of the plugin is similarly sized and similarly positioned as the plugin rect,
126         set the plugin to autoplay. This is assuming that the previous snapshot checks have passed as well.
127
128 2014-04-29  Filip Pizlo  <fpizlo@apple.com>
129
130         Use LLVM as a backend for the fourth-tier DFG JIT (a.k.a. the FTL JIT)
131         https://bugs.webkit.org/show_bug.cgi?id=112840
132
133         Rubber stamped by Geoffrey Garen.
134
135         * Configurations/FeatureDefines.xcconfig:
136
137 2014-04-29  Brady Eidson  <beidson@apple.com>
138
139         Change Image Controls replacement to use selection and paste
140         <rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992
141
142         Reviewed by Tim Horton.
143
144         Add a "pasteboard override" mechanism which allows WebKit to keep pasteboard content local
145         to the WebProcess and access it there without having to message up to the UI process:
146         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Added.
147         (WebKit::WebPasteboardOverrides::sharedPasteboardOverrides):
148         (WebKit::WebPasteboardOverrides::WebPasteboardOverrides):
149         (WebKit::WebPasteboardOverrides::addOverride):
150         (WebKit::WebPasteboardOverrides::removeOverride):
151         (WebKit::WebPasteboardOverrides::overriddenTypes):
152         (WebKit::WebPasteboardOverrides::getDataForOverride):
153         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: Added.
154
155         Change the pasteboard strategy to consult the pasteboard overrides before consulting the native pasteboard:
156         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
157         (WebKit::WebPlatformStrategies::getTypes):
158         (WebKit::WebPlatformStrategies::bufferForType):
159
160         Add "replaceSelectionWithPasteboardData" which uses the new pasteboard overrides mechanism
161         and then has WebCore perform the replacement:
162         * WebProcess/WebPage/WebPage.h:
163         * WebProcess/WebPage/WebPage.messages.in:
164         * WebProcess/WebPage/mac/WebPageMac.mm:
165         (WebKit::replaceSelectionPasteboardName):
166         (WebKit::WebPage::replaceSelectionWithPasteboardData):
167
168         * UIProcess/mac/WebPageProxyMac.mm:
169         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
170
171         * UIProcess/mac/WebContextMenuProxyMac.h:
172         (WebKit::WebContextMenuProxyMac::page):
173         * UIProcess/mac/WebContextMenuProxyMac.mm:
174         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Use "replaceSelectionWithPasteboardData".
175         (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
176         (WebKit::WebContextMenuProxyMac::replaceControlledImage): Deleted.
177
178         Remain other remnants of "replaceControlledImage":
179         * UIProcess/WebPageProxy.cpp:
180         (WebKit::WebPageProxy::replaceControlledImage): Deleted.
181         * UIProcess/WebPageProxy.h:
182         * WebProcess/WebPage/WebContextMenu.cpp:
183         (WebKit::WebContextMenu::replaceControlledImage): Deleted.
184         * WebProcess/WebPage/WebContextMenu.h:
185         * WebProcess/WebPage/WebPage.cpp:
186         (WebKit::WebPage::replaceControlledImage): Deleted.
187
188         * WebKit2.xcodeproj/project.pbxproj:
189
190 2014-04-29  Tim Horton  <timothy_horton@apple.com>
191
192         Build fix.
193
194         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
195
196 2014-04-29  Alexey Proskuryakov  <ap@apple.com>
197
198         [WK2] DatabaseProcess should be sandboxed
199         https://bugs.webkit.org/show_bug.cgi?id=132324
200         <rdar://problem/15961708>
201
202         Reviewed by Darin Adler.
203
204         * Configurations/WebKit2.xcconfig: Added the profile to the list of files skipped
205         on iOS.
206
207         * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess):
208         Consume a sandbox extension for IndexedDB directory (which we get with initialization
209         message after entering sandbox).
210
211         * DatabaseProcess/ios: Added.
212         * DatabaseProcess/ios/DatabaseProcessIOS.mm: Copied from Source/WebKit2/DatabaseProcess/mac/DatabaseProcessMac.mm.
213         Separated from Mac version to match how other processes are implemented.
214
215         * DatabaseProcess/mac/DatabaseProcessMac.mm: (WebKit::DatabaseProcess::initializeProcessName):
216         Removed ifdefs.
217
218         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Added.
219
220         * DerivedSources.make: Generate the profile from .sb.in.
221
222         * Shared/Databases/DatabaseProcessCreationParameters.cpp:
223         (WebKit::DatabaseProcessCreationParameters::encode):
224         (WebKit::DatabaseProcessCreationParameters::decode):
225         * Shared/Databases/DatabaseProcessCreationParameters.h:
226         Added a sandbox extension for indexedDatabaseDirectory.
227
228         * Shared/SecurityOriginData.h: Added an unrelated FIXME.
229
230         * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureDatabaseProcess): Create
231         a sandbox extension for indexedDatabaseDirectory.
232
233         * WebKit2.xcodeproj/project.pbxproj: Added new files.
234
235 2014-04-28  Andy Estes  <aestes@apple.com>
236
237         [iOS] Introduce -didNotHandleTapAsClickAtPoint: to WKUIDelegatePrivate
238         https://bugs.webkit.org/show_bug.cgi?id=132316
239
240         Reviewed by Darin Adler.
241
242         One WebKit2 client is interested to know if a tap was not handled by an element that responds to clicks.
243         Introduce a new, private WKUIDelegate method telling it that a tap at a location was not handled as a click on
244         an element.
245
246         * UIProcess/API/APIUIClient.h:
247         (API::UIClient::didNotHandleTapAsClick):
248         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
249         * UIProcess/Cocoa/UIDelegate.h:
250         * UIProcess/Cocoa/UIDelegate.mm:
251         (WebKit::UIDelegate::setDelegate):
252         (WebKit::UIDelegate::UIClient::didNotHandleTapAsClick):
253         * UIProcess/WebPageProxy.h:
254         * UIProcess/WebPageProxy.messages.in:
255         * UIProcess/ios/WebPageProxyIOS.mm:
256         (WebKit::WebPageProxy::didNotHandleTapAsClick):
257         * WebProcess/WebPage/ios/WebPageIOS.mm:
258         (WebKit::WebPage::handleTap): Sent Messages::WebPageProxy::DidNotHandleTapAsClick if the tap wasn't handled, no
259         node responded to the click event, or the responding node wasn't an element.
260
261 2014-04-29  Zan Dobersek  <zdobersek@igalia.com>
262
263         [GTK][WK2] Avoid Vector copies in WebViewBaseInputMethodFilter::setPreedit()
264         https://bugs.webkit.org/show_bug.cgi?id=132323
265
266         Reviewed by Carlos Garcia Campos.
267
268         * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp:
269         (WebKit::WebViewBaseInputMethodFilter::setPreedit): Inline the Vector object construction into
270         the WebPageProxy::setComposition() call to avoid extra Vector copies and moves.
271
272 2014-04-28  Dan Bernstein  <mitz@apple.com>
273
274         <rdar://problem/16750708> REGRESSION (r159358): Crash in InjectedBundleHitTestResult::frame
275         https://bugs.webkit.org/show_bug.cgi?id=132318
276
277         Reviewed by Andy Estes.
278
279         * UIProcess/Cocoa/NavigationState.mm:
280         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): Fixed a typo: set
281         the source frame, not the destination frame.
282
283         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
284         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Changed to get the
285         frame for the action not from a hit test result, because some link activation actions are
286         not mouse events, but rather from the event’s target.
287
288 2014-04-28  Benjamin Poulain  <bpoulain@apple.com>
289
290         [iOS][WK2] Restore the scroll position and scale from the HistoryItem (mostly)
291         https://bugs.webkit.org/show_bug.cgi?id=132307
292         <rdar://problem/16031704>
293
294         Reviewed by Simon Fraser.
295
296         Restore the scroll position and scale on back-forward by restoring the values from HistoryItem.
297         This covers the common cases, see <rdar://problem/16031704>.
298
299         * UIProcess/API/Cocoa/WKWebView.mm:
300         (-[WKWebView _didCommitLayerTree:WebKit::]):
301         (-[WKWebView _didCommitLoadForMainFrame]): Deleted.
302         * UIProcess/API/Cocoa/WKWebViewInternal.h:
303         * UIProcess/ios/WKContentView.mm:
304         (-[WKContentView _didCommitLoadForMainFrame]):
305         Get rid of the old code restoring the scroll position. This is now done by the WebProcess.
306
307         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
308         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
309         Update the scrolling tree after invoking didCommitLayerTree() on the WebPageProxy.
310
311         WKContentView and WKWebView states are updated in response to didCommitLayerTree(), the content size
312         and scale in particular are set there.
313
314         After that, the content size/scale is in the same state as the layerTree update, and we can scroll
315         the content as needed.
316
317         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
318         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
319         (WebKit::WebFrameLoaderClient::restoreViewState):
320         iOS WebKit1 uses a custom restoreViewState(), do the same for WebKit2 since the generic code is #ifdefed out.
321         This is also necessary for the main frame's state update.
322
323         * WebProcess/WebPage/WebPage.h:
324         * WebProcess/WebPage/ios/WebPageIOS.mm:
325         (WebKit::WebPage::restorePageState):
326         Restore the scale and position of the main frame. For now, we assume m_userHasChangedPageScaleFactor is set otherwise
327         the initial-scale would override the restored value. We will need to fix that, the value should probably be saved with
328         the history.
329
330 2014-04-28  Benjamin Poulain  <bpoulain@apple.com>
331
332         [iOS][WK2] iOS fix after r167867
333         https://bugs.webkit.org/show_bug.cgi?id=132302
334
335         Reviewed by Simon Fraser.
336
337         iOS Touch Points uses "phase" for describing the touch points state for historical reasons.
338         This patch adds state() as a synonym for phase, and revert r167893.
339
340         * Shared/WebEvent.h:
341         (WebKit::WebPlatformTouchPoint::state):
342         * UIProcess/WebPageProxy.cpp:
343         (WebKit::areAllTouchPointsReleased):
344
345 2014-04-28  Andy Estes  <aestes@apple.com>
346
347         Fix a transcription error from r167901.
348
349         When addressing Darin's review feedback, I moved the iteration of dataArray from
350         QuickLookDocumentData::append() to WebQuickLookHandleClient::didReceiveDataArray(),
351         but I forgot to update the context argument to CFArrayApplyFunction() accordingly.
352
353         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
354         (WebKit::WebQuickLookHandleClient::didReceiveDataArray):
355
356 2014-04-28  Enrica Casucci  <enrica@apple.com>
357
358         [WK2 iOS] Need to show title in the action sheet for images not inside an anchor element.
359         https://bugs.webkit.org/show_bug.cgi?id=132304
360         <rdar://problem/16535227>
361
362         Reviewed by Benjamin Poulain.
363
364         If the image in not inside an anchor tag, we must use the title attribute as
365         title for the action sheet.
366
367         * UIProcess/ios/WKActionSheetAssistant.mm:
368         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
369
370 2014-04-28  Tim Horton  <timothy_horton@apple.com>
371
372         WebKit2 View Gestures (Swipe): Discard snapshots made with a different view size/pixel density
373         https://bugs.webkit.org/show_bug.cgi?id=132115
374
375         Reviewed by Simon Fraser.
376
377         We shouldn't try to use snapshots if they no longer match the destination view size.
378         To do this, we need an accurate understanding of the topContentInset, both for the Web view,
379         and for any custom views, because we don't want to include the inset area in the snapshot,
380         and we don't want to reject snapshots that differ from the current view only because they have an inset or not.
381
382         * UIProcess/API/Cocoa/WKViewPrivate.h:
383         * UIProcess/API/mac/WKView.mm:
384         (-[WKView _takeViewSnapshot]):
385         (-[WKView _setCustomSwipeViewsTopContentInset:]):
386         Add and plumb through a topContentInset property to apply to the custom swipe views.
387         For simplicitly's sake in the multi-view case, it is applied in window coordinates,
388         so clients will have to do conversions if necessary.
389         Don't include the top content inset in the snapshot that is taken.
390
391         * UIProcess/mac/ViewGestureController.h:
392         (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
393         * UIProcess/mac/ViewGestureControllerMac.mm:
394         (WebKit::ViewGestureController::ViewGestureController):
395         (WebKit::ViewGestureController::windowRelativeBoundsForCustomSwipeViews):
396         Apply the aforementioned custom swipe view top content inset.
397
398         (WebKit::ViewGestureController::determineSnapshotLayerParent):
399         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
400         Factor these out of beginSwipeGesture.
401
402         (WebKit::ViewGestureController::retrieveSnapshotForItem):
403         Don't return a snapshot if the current deviceScaleFactor doesn't match that
404         at which the snapshot was taken, or if the size of the snapshot doesn't match
405         the unobscured part of the snapshot layer (the layer's size sans top content inset).
406
407         (WebKit::layerGeometryFlippedToRoot): Added.
408         Determine whether geometry flipping occurs between a layer and the root of the tree it is in.
409
410         (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews):
411         Factor out debugging layer properties, and add some borders and backgrounds to our layers.
412         I switched to invert instead of blur because blur makes the borders hard to use.
413
414         (WebKit::ViewGestureController::beginSwipeGesture):
415         Add an additional layer, the swipeLayer, which is the parent of the swipeSnapshotLayer.
416         We use this layer to compensate for geometry flipping, since we don't necessarily
417         know the structure of the layer tree ahead of time when inserting snapshots into the
418         client's layer tree, in the custom swipe view case.
419         The swipe layer is always the full size of the view, including topContentInset, and
420         has a white background in order to fill in that space. The snapshot layer is the size
421         of the view *excluding* the topContentInset, which should match the size of the snapshot image
422         itself (and we reject the image and just paint white if this is not the case).
423
424         (WebKit::ViewGestureController::handleSwipeGesture):
425         (WebKit::ViewGestureController::removeSwipeSnapshot):
426         Move and remove the new swipeLayer.
427
428         * UIProcess/mac/ViewSnapshotStore.h:
429         * UIProcess/mac/ViewSnapshotStore.mm:
430         (WebKit::ViewSnapshotStore::recordSnapshot):
431         Store the deviceScaleFactor at the time the snapshot was taken.
432         Fix a bug where the count of snapshots with live images was too high
433         because we were failing to decrement it when replacing a snapshot of
434         an existing item with a fresh one.
435
436 2014-04-28  Enrica Casucci  <enrica@apple.com>
437
438         WK2 iOS: crash when handling a synthetic keyboard event.
439         https://bugs.webkit.org/show_bug.cgi?id=132296
440         <rdar://problem/16469726>
441
442         Reviewed by Benjamin Poulain.
443
444         Adding a null check, since synthetic keyboard events do not
445         have a corresponding platform event. We already do this on OS X.
446
447         * WebProcess/WebPage/ios/WebPageIOS.mm:
448         (WebKit::WebPage::handleEditingKeyboardEvent):
449
450 2014-04-24  Andy Estes  <aestes@apple.com>
451
452         [iOS] Implement WebQuickLookHandleClient for WebKit2
453         https://bugs.webkit.org/show_bug.cgi?id=132157
454
455         Reviewed by Darin Adler.
456
457         * Shared/API/Cocoa/_WKNSFileManagerExtras.h: Added.
458         * Shared/API/Cocoa/_WKNSFileManagerExtras.mm: Added.
459         (+[NSFileManager _web_createTemporaryFileForQuickLook:]): Called WebCore::createTemporaryFileForQuickLook().
460         * Shared/ios/QuickLookDocumentData.cpp: Added.
461         (WebKit::QuickLookDocumentData::QuickLookDocumentData):
462         (WebKit::QuickLookDocumentData::append): Appened each CFDataRef to m_data and added their sizes to m_size.
463         (WebKit::QuickLookDocumentData::decodedData): Returned the combined CFDataRef created by decode().
464         Named this method 'decodedData' to indicate that it should only be called on objects populated by decode().
465         (WebKit::QuickLookDocumentData::clear): Cleared m_data and reset m_size to 0.
466         (WebKit::QuickLookDocumentData::encode): Implemented a custom encoding function to avoid having to combine
467         m_data into contiguous memory at encoding time. Encoded m_size then sequentially encoded each member of m_data.
468         (WebKit::QuickLookDocumentData::decode): Decoded the byte stream into a single CFDataRef. Eagerly copied the
469         decoded data rather than using a DataReference since we know this will outlive the decoder.
470         * Shared/ios/QuickLookDocumentData.h: Added.
471         * UIProcess/API/APILoaderClient.h:
472         (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
473         (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
474         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
475         * UIProcess/Cocoa/NavigationState.h:
476         * UIProcess/Cocoa/NavigationState.mm:
477         (WebKit::NavigationState::setNavigationDelegate):
478         (WebKit::NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
479         (WebKit::NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
480         * UIProcess/WebPageProxy.h:
481         * UIProcess/WebPageProxy.messages.in:
482         * UIProcess/ios/WebPageProxyIOS.mm:
483         (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame):
484         (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):
485         * WebKit2.xcodeproj/project.pbxproj:
486         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
487         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
488         (WebKit::WebFrameLoaderClient::didCreateQuickLookHandle):
489         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: Added.
490         (WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Sent DidStartLoadForQuickLookDocumentInMainFrame
491         to WebPageProxy.
492         (WebKit::WebQuickLookHandleClient::didReceiveDataArray): Appended dataArray to m_data.
493         (WebKit::WebQuickLookHandleClient::didFinishLoading): Sent DidFinishLoadForQuickLookDocumentInMainFrame to
494         WebPageProxy and then cleared m_data.
495         (WebKit::WebQuickLookHandleClient::didFail): Cleared m_data.
496         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Added.
497         (WebKit::WebQuickLookHandleClient::create):
498
499 2014-04-28  Brady Eidson  <beidson@apple.com>
500
501         Hide service controls for selection behind a runtime switch
502         <rdar://problem/16736616> and https://bugs.webkit.org/show_bug.cgi?id=132291
503
504         Reviewed by Tim Horton.
505
506         * Shared/WebPreferencesStore.h:
507
508         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
509         (WebKit::WebEditorClient::selectionRectsDidChange): Do nothing if the UI is disabled.
510
511         * WebProcess/WebPage/WebPage.cpp:
512         (WebKit::WebPage::WebPage):
513         (WebKit::WebPage::updatePreferences):
514
515         * WebProcess/WebPage/WebPage.h:
516         (WebKit::WebPage::serviceControlsEnabled):
517
518 2014-04-28  Commit Queue  <commit-queue@webkit.org>
519
520         Unreviewed, rolling out r167853.
521         https://bugs.webkit.org/show_bug.cgi?id=132288
522
523         caused crashes+timeouts+layout test failures described in the
524         bug (Requested by thorton on #webkit).
525
526         Reverted changeset:
527
528         "Coalesce responses on network process side"
529         https://bugs.webkit.org/show_bug.cgi?id=132229
530         http://trac.webkit.org/changeset/167853
531
532 2014-04-28  Simon Fraser  <simon.fraser@apple.com>
533
534         Fix the iOS buld.
535
536         * UIProcess/WebPageProxy.cpp:
537         (WebKit::areAllTouchPointsReleased):
538
539 2014-04-24  Simon Fraser  <simon.fraser@apple.com>
540
541         [iOS WK2] Make subview rebuilding more incremental
542         https://bugs.webkit.org/show_bug.cgi?id=132162
543         <rdar://problem/16718916>
544
545         Reviewed by Sam Weinig.
546         
547         Previously we did bulk replacement of subviews, but that triggers
548         UIKit to send spurious will/DidMoveToWindow messages, which can
549         interfere with UIScrollView scrolling.
550         
551         Make _web_setSubviews more incremental, only removing
552         deleted subviews, adding new ones, and moving existing ones
553         into the correct order.
554
555         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
556         (-[UIView _web_setSubviews:]):
557
558 2014-04-24  Simon Fraser  <simon.fraser@apple.com>
559
560         [iOS WK2] flickery scrolling with overflow-scrolling:touch
561         https://bugs.webkit.org/show_bug.cgi?id=132150
562         <rdar://problem/16683006>
563
564         Reviewed by Tim Horton.
565         
566         Maintain a flag that tells us if the user is interacting
567         with the UIScrollView, and while set, don't clobber the contentOffset
568         via scrolling tree updates.
569
570         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
571         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:WebKit::]):
572         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
573         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
574         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): We need this one,
575         not scrollViewDidEndScrollingAnimation:, to detect the end of decleration.
576         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
577         (-[WKOverflowScrollViewDelegate scrollViewDidEndScrollingAnimation:]): Deleted.
578
579 2014-04-28  Krzysztof Wolanski  <k.wolanski@samsung.com>
580
581         [X11] Add missing case for mime type application/x-webkit-test-netscape
582         https://bugs.webkit.org/show_bug.cgi?id=132278
583
584         Reviewed by Darin Adler.
585
586         Case for x-webkit-test-netscape has been omitted along with r167759.
587
588         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
589         (WebKit::NetscapePlugin::initialize):
590
591 2014-04-28  Zan Dobersek  <zdobersek@igalia.com>
592
593         [WK2][X11] NetscapePluginModule::scanPlugin() should write UTF-8 strings to stdout
594         https://bugs.webkit.org/show_bug.cgi?id=132245
595
596         Reviewed by Carlos Garcia Campos.
597
598         NetscapePluginModule::scanPlugin(), in the helper writeLine function, takes each character
599         of the given string and writes it out as a UChar, doing two fputc calls for each byte of the
600         16-bit type.
601
602         This fails badly with characters with integer value less than 256 as the most significant byte
603         of the UChar is written out as a null character. This effectively chops the output that's gathered
604         in the UIProcess and is parsed in PluginProcessProxy::scanPlugin().
605
606         To avoid all this, the UTF-8 encoding of the string is written out in the PluginProcess, and
607         String::fromUTF8() is called in the UIProcess to properly decode the received string.
608
609         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
610         (WebKit::writeCharacter):
611         (WebKit::writeLine):
612         (WebKit::writeByte): Deleted.
613         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
614         (WebKit::PluginProcessProxy::scanPlugin):
615
616 2014-04-28  Zan Dobersek  <zdobersek@igalia.com>
617
618         [GTK][WK2] Missing return statement in webkit_plugin_get_description()
619         https://bugs.webkit.org/show_bug.cgi?id=132263
620
621         Reviewed by Carlos Garcia Campos.
622
623         * UIProcess/API/gtk/WebKitPlugin.cpp:
624         (webkit_plugin_get_description): Actually return the data of the cached
625         plugin description CString.
626
627 2014-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
628
629         [GTK] Crash in debug build with removing windowed plugin child widgets from the view
630         https://bugs.webkit.org/show_bug.cgi?id=132252
631
632         Reviewed by Philippe Normand.
633
634         It crashes due to an assert in HashTable that checks the iterators
635         validity. The problem is that we are iterating the children map
636         and the callback called on every iteration might modify the map,
637         making the iterators invalid. This happens when the WebView is
638         destroyed, GtkContainer calls gtk_container_foreach() with
639         gtk_widget_destroy as callback. When a widget inside a container
640         is destroyed, it's removed from the container, and in our case,
641         the child widget is removed from the map. This fixes several
642         crashes when running layout tests in debug bot.
643
644         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
645         (webkitWebViewBaseContainerForall): Use copyKeysToVector() instead
646         of using a range iterator for the map keys and check in every
647         iteration that the child widget from the keys vector is still
648         present in the map before calling the callback.
649
650 2014-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
651
652         [GTK] GObject introspection links to installed libs when using jhbuild
653         https://bugs.webkit.org/show_bug.cgi?id=132220
654
655         Reviewed by Martin Robinson.
656
657         The problem is that gobject-introspection is linking the temporary
658         binaries adding the library paths present LDFLAGS environment
659         variable first, taking precedence over the libraries in the build
660         dir. Since the libraries paths of the dependencies are already
661         correctly deduced by gobject-introspection using ldd, we can
662         just unset the LDFLAGS variable before calling g-ir-scanner to
663         make sure the libraries in the build dir take predence.
664
665         * PlatformGTK.cmake:
666
667 2014-04-27  Tim Horton  <timothy_horton@apple.com>
668
669         REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes
670         https://bugs.webkit.org/show_bug.cgi?id=132239
671         <rdar://problem/16192842>
672
673         Reviewed by Darin Adler.
674
675         * WebProcess/WebPage/WebPage.cpp:
676         (WebKit::WebPage::scalePage):
677         The change in r167864 broke iOS animated resize, because it was depending on
678         the dynamic size update code not running if the scale wasn't going to change.
679         So, as a band-aid we should bail from doing that work if the scales aren't different.
680         In the long term we should try to untangle this code and make it less platform dependent.
681
682 2014-04-27  Eunmi Lee  <eunmi15.lee@samsung.com>
683
684         TouchEvent is not handled after releasing any point among touched points.
685         https://bugs.webkit.org/show_bug.cgi?id=132043
686
687         Reviewed by Benjamin Poulain.
688
689         Handle TouchEvent until all touched points are released by setting
690         trackingTouchEvents variable to false when all points are released.
691
692         * UIProcess/WebPageProxy.cpp:
693         (WebKit::areAllTouchPointsReleased):
694         (WebKit::WebPageProxy::handleTouchEventSynchronously):
695         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
696         (WebKit::WebPageProxy::handleTouchEvent):
697
698 2014-04-27  Alexey Proskuryakov  <ap@apple.com>
699
700         Don't use DispatchMessageEvenWhenWaitingForSyncReply for messages from NetworkProcess
701         https://bugs.webkit.org/show_bug.cgi?id=132144
702
703         Reviewed by Darin Adler.
704
705         * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
706         (WebKit::AsynchronousNetworkLoaderClient::willSendRequest):
707         (WebKit::AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace):
708         Dont use the IPC::DispatchMessageEvenWhenWaitingForSyncReply flag. It's not needed,
709         almost never works in NetworkProcess, but may cause trouble if it did.
710
711         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
712         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): Removed
713         setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage()
714         function call, because there are no more any messages in NetworkProcess it could affect.
715
716         * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchMessage): Added a FIXME
717         for an unrelated bug Anders and myself noticed while looking into this.
718
719 2014-04-27  Dan Bernstein  <mitz@apple.com>
720
721         [Cocoa] -[WKWebProcessPlugInController parameters] returns nil if no parameters have been set yet
722         https://bugs.webkit.org/show_bug.cgi?id=132223
723
724         Reviewed by Sam Weinig.
725
726         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
727         (WebKit::InjectedBundle::bundleParameters): Create the WKWebProcessBundleParameters if
728         needed.
729
730 2014-04-27  Tim Horton  <timothy_horton@apple.com>
731
732         REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes
733         https://bugs.webkit.org/show_bug.cgi?id=132239
734         <rdar://problem/16192842>
735
736         Reviewed by Sam Weinig.
737
738         * WebProcess/WebPage/WebPage.cpp:
739         (WebKit::WebPage::scalePage):
740         The early-return added to WebPage::scalePage breaks callers who depend
741         on being able to call scalePage() with the same scale but a different
742         origin and having that change take effect.
743
744         Page::setPageScaleFactor already has the requisite logic, so move
745         the early return down after that call, and guard only notification
746         of page scale changes.
747
748 2014-04-25  Andy Estes  <aestes@apple.com>
749
750         [iOS] Stop creating a WKWebResourceQuickLookDelegate for every WebResourceLoader
751         https://bugs.webkit.org/show_bug.cgi?id=132215
752
753         Reviewed by Dan Bernstein.
754
755         * WebKit2.xcodeproj/project.pbxproj:
756         * WebProcess/Network/WebResourceLoader.cpp:
757         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): Called QuickLookHandle::create() directly.
758         * WebProcess/Network/WebResourceLoader.h:
759         * WebProcess/ios/WebResourceLoaderIOS.mm: Removed.
760
761 2014-04-27  Sam Weinig  <sam@webkit.org>
762
763         [iOS WebKit2] Add support for text autosizing
764         <rdar://problem/16545245>
765         https://bugs.webkit.org/show_bug.cgi?id=132237
766
767         Reviewed by Tim Horton.
768
769         * Shared/WebPageCreationParameters.cpp:
770         (WebKit::WebPageCreationParameters::encode):
771         (WebKit::WebPageCreationParameters::decode):
772         * Shared/WebPageCreationParameters.h:
773         * UIProcess/WebPageProxy.cpp:
774         (WebKit::WebPageProxy::creationParameters):
775         * UIProcess/WebPageProxy.h:
776         * UIProcess/ios/WebPageProxyIOS.mm:
777         (WebKit::WebPageProxy::textAutosizingWidth):
778         * WebProcess/WebPage/WebPage.cpp:
779         (WebKit::WebPage::WebPage):
780         Pass the text autosizing width from the UIProcess to WebProcess.
781
782 2014-04-27  Tim Horton  <timothy_horton@apple.com>
783
784         WebKit2 View Gestures (Zoom): Pages with 'background-attachment: fixed' don't behave correctly when zoomed
785         https://bugs.webkit.org/show_bug.cgi?id=132225
786         <rdar://problem/15729975>
787
788         Reviewed by Darin Adler.
789
790         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
791         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
792         (WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom):
793         (WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom):
794         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
795         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
796         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
797         Factor out code to choose which layer (and shadow layer) to apply the transient zoom to.
798         If we have a contentsContainmentLayer (because we have composited background-attachment: fixed),
799         it applies page scale, so we should apply the transient zoom to that layer
800         instead of the RenderView's main GraphicsLayer.
801
802 2014-04-27  Pratik Solanki  <psolanki@apple.com>
803
804         Unreviewed. iOS build fix.
805
806         * UIProcess/ios/SmartMagnificationController.h:
807
808 2014-04-27  Zan Dobersek  <zdobersek@igalia.com>
809
810         Move cross-port WebKit2 code to std::unique_ptr
811         https://bugs.webkit.org/show_bug.cgi?id=129670
812
813         Reviewed by Darin Adler.
814
815         Replace uses of OwnPtr, PassOwnPtr in cross-port WebKit2 code with std::unique_ptr.
816
817         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
818         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
819         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
820         * NetworkProcess/NetworkProcess.h:
821         (WebKit::NetworkProcess::addSupplement):
822         * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
823         (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
824         * NetworkProcess/SynchronousNetworkLoaderClient.h:
825         * Platform/IPC/Connection.cpp:
826         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
827         * Platform/IPC/Connection.h:
828         * Platform/IPC/MessageReceiver.h:
829         * Platform/Module.h:
830         * Platform/WorkQueue.h:
831         * Platform/efl/ModuleEfl.cpp:
832         (WebKit::Module::load):
833         * Platform/mac/LayerHostingContext.mm:
834         * Shared/APIURL.h:
835         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
836         * Shared/Plugins/NPRemoteObjectMap.cpp:
837         * Shared/ShareableBitmap.h:
838         * UIProcess/DrawingAreaProxyImpl.h:
839         * UIProcess/InspectorServer/WebSocketServer.cpp:
840         (WebKit::WebSocketServer::didAcceptConnection):
841         (WebKit::WebSocketServer::didCloseWebSocketServerConnection):
842         * UIProcess/InspectorServer/WebSocketServer.h:
843         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
844         (WebKit::connectionCallback):
845         * UIProcess/Network/NetworkProcessProxy.cpp:
846         (WebKit::NetworkProcessProxy::createDownloadProxy):
847         * UIProcess/Network/NetworkProcessProxy.h:
848         * UIProcess/Notifications/WebNotificationManagerProxy.h:
849         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
850         (WebKit::WebPluginSiteDataManager::getSitesWithData):
851         (WebKit::WebPluginSiteDataManager::clearSiteData):
852         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins):
853         (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins):
854         * UIProcess/Plugins/WebPluginSiteDataManager.h:
855         * UIProcess/Storage/StorageManager.cpp:
856         (WebKit::callCallbackFunction):
857         (WebKit::StorageManager::getOriginsInternal):
858         * UIProcess/WebPageProxy.cpp:
859         (WebKit::ExceededDatabaseQuotaRecords::areBeingProcessed):
860         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
861         (WebKit::ExceededDatabaseQuotaRecords::add):
862         (WebKit::ExceededDatabaseQuotaRecords::next):
863         (WebKit::WebPageProxy::handleMouseEvent):
864         (WebKit::WebPageProxy::handleWheelEvent):
865         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
866         (WebKit::WebPageProxy::internalShowContextMenu):
867         * UIProcess/WebPageProxy.h:
868         * UIProcess/WebProcessProxy.cpp:
869         (WebKit::WebProcessProxy::createDownloadProxy):
870         * UIProcess/WebProcessProxy.h:
871         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
872         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
873         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
874         (WebKit::NetscapePluginStream::deliverData):
875         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
876         * WebProcess/Plugins/PluginProcessConnectionManager.h:
877         * WebProcess/Plugins/PluginProxy.cpp:
878         (WebKit::PluginProxy::initialize):
879         (WebKit::PluginProxy::didCreatePluginInternal):
880         (WebKit::PluginProxy::didFailToCreatePluginInternal):
881         * WebProcess/Plugins/PluginProxy.h:
882         * WebProcess/Plugins/PluginView.cpp:
883         (WebKit::PluginView::createWebEvent):
884         (WebKit::PluginView::handleEvent):
885         * WebProcess/Plugins/PluginView.h:
886         * WebProcess/WebCoreSupport/WebPopupMenu.h:
887         * WebProcess/WebPage/EventDispatcher.cpp:
888         (WebKit::EventDispatcher::EventDispatcher):
889         * WebProcess/WebPage/EventDispatcher.h:
890         * WebProcess/WebPage/WebPage.cpp:
891         (WebKit::WebPage::WebPage):
892         (WebKit::WebPage::beginPrinting):
893         * WebProcess/WebPage/WebPage.h:
894         * WebProcess/WebProcess.h:
895         (WebKit::WebProcess::addSupplement):
896
897 2014-04-27  Antti Koivisto  <antti@apple.com>
898
899         Coalesce responses on network process side
900         https://bugs.webkit.org/show_bug.cgi?id=132229
901
902         Reviewed by Andreas Kling.
903         
904         To reduce IPC we should coalesce response data in the network process and send it over with single IPC call.
905
906         * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
907         (WebKit::AsynchronousNetworkLoaderClient::AsynchronousNetworkLoaderClient):
908         (WebKit::AsynchronousNetworkLoaderClient::didReceiveResponse):
909         (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer):
910         (WebKit::AsynchronousNetworkLoaderClient::didFinishLoading):
911         (WebKit::AsynchronousNetworkLoaderClient::didFail):
912         (WebKit::AsynchronousNetworkLoaderClient::dispatchPartialCoalescedResponse):
913         (WebKit::AsynchronousNetworkLoaderClient::clearCoalescedResponse):
914         (WebKit::AsynchronousNetworkLoaderClient::responseCoalesceTimerFired):
915         
916             Coalesce the response. Completed response is sent on didFinishLoading. If the coalesce timer fires
917             before that the data accumulated so far is dispatched.
918
919         * NetworkProcess/AsynchronousNetworkLoaderClient.h:
920         * NetworkProcess/NetworkResourceLoader.h:
921         * WebProcess/Network/WebResourceLoader.cpp:
922         (WebKit::WebResourceLoader::didReceiveCompleteResponse):
923         * WebProcess/Network/WebResourceLoader.h:
924         * WebProcess/Network/WebResourceLoader.messages.in:
925         
926             Add a new message type that covers didReceiveResponse, didReceiveBuffer and didFinishLoading in a single message.
927
928 2014-04-26  Tim Horton  <timothy_horton@apple.com>
929
930         REGRESSION (r167775): Safari crashes in ViewSnapshotStore::pruneSnapshots after loading 20 pages
931         https://bugs.webkit.org/show_bug.cgi?id=132204
932         <rdar://problem/16735622>
933
934         Reviewed by Dan Bernstein and Sam Weinig.
935
936         * UIProcess/mac/ViewSnapshotStore.mm:
937         (WebKit::ViewSnapshotStore::pruneSnapshots):
938         (WebKit::ViewSnapshotStore::recordSnapshot):
939         Fix a bug where the count of snapshots with live images was too high
940         because we were failing to decrement it when replacing a snapshot of
941         an existing item with a fresh one.
942
943 2014-04-26  Dan Bernstein  <mitz@apple.com>
944
945         [Cocoa] Rename a bundle form delegate method
946         https://bugs.webkit.org/show_bug.cgi?id=132221
947
948         Reviewed by Adele Peterson.
949
950         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Renamed.
951         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
952         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Check for the method
953         under the old (“new”) name and under the new name.
954
955 2014-04-25  Dan Bernstein  <mitz@apple.com>
956
957         [Cocoa] Synthesized getter for WKNavigationAction's _userInitiated property has the wrong name
958         https://bugs.webkit.org/show_bug.cgi?id=132219
959
960         Reviewed by Sam Weinig.
961
962         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
963
964 2014-04-25  Simon Fraser  <simon.fraser@apple.com>
965
966         [iOS] getAssistedNodeInformation crashes getting the bounding box if it doesn't have a renderer
967         https://bugs.webkit.org/show_bug.cgi?id=132217
968         <rdar://problem/16671662>
969
970         Reviewed by Dean Jackson.
971
972         * WebProcess/WebPage/ios/WebPageIOS.mm:
973         (WebKit::WebPage::getAssistedNodeInformation): Check that m_assistedNode has
974         a renderer before asking for its bounding box.
975
976 2014-04-25  Benjamin Poulain  <bpoulain@apple.com>
977
978         [iOS][WK2] Add an intermediary view to do the target transform and adjustment transform
979         https://bugs.webkit.org/show_bug.cgi?id=132175
980
981         Reviewed by Enrica Casucci.
982
983         Some utility views of WKContentView account for the transforms between the content view
984         and the utility view.
985
986         Since the dynamic resize relies on setting subLayerTransforms, it is getting in the way.
987
988         This patch adds a layer in between for the animation. That way the content view remains
989         unscaled.
990
991         * UIProcess/API/Cocoa/WKWebView.mm:
992         (-[WKWebView _didCommitLayerTree:WebKit::]):
993         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
994         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
995         (-[WKWebView _endAnimatedResize]):
996
997 2014-04-25  Enrica Casucci  <enrica@apple.com>
998
999         REGRESSION (iOS WebKit2): Selection is not being repainted during live resize.
1000         https://bugs.webkit.org/show_bug.cgi?id=132216
1001         <rdar://problem/16628819>
1002
1003         Reviewed by Benjamin Poulain.
1004
1005         Since the selection is drawn in the UIProcess on iOS,
1006         we need to update the selection rects and force a repaint
1007         during a live resize.
1008
1009         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1010         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1011         * WebProcess/WebPage/WebPage.h:
1012         * WebProcess/WebPage/ios/WebPageIOS.mm:
1013         (WebKit::WebPage::updateSelectionAppearance):
1014
1015 2014-04-25  Brady Eidson  <beidson@apple.com>
1016
1017         Add a selection overlay.
1018         <rdar://problem/16727797> and https://bugs.webkit.org/show_bug.cgi?id=132200
1019
1020         Reviewed by David Hyatt.
1021
1022         * WebKit2.xcodeproj/project.pbxproj:
1023
1024         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1025         (WebKit::WebEditorClient::selectionRectsDidChange): Pass the new selection rects on
1026           to the selection overlay controller.
1027         * WebProcess/WebCoreSupport/WebEditorClient.h:
1028
1029         * WebProcess/WebPage/SelectionOverlayController.cpp: Added.
1030         (WebKit::SelectionOverlayController::SelectionOverlayController):
1031         (WebKit::SelectionOverlayController::createOverlayIfNeeded):
1032         (WebKit::SelectionOverlayController::destroyOverlay):
1033         (WebKit::SelectionOverlayController::pageOverlayDestroyed):
1034         (WebKit::SelectionOverlayController::willMoveToWebPage):
1035         (WebKit::SelectionOverlayController::didMoveToWebPage):
1036         (WebKit::SelectionOverlayController::selectionRectsDidChange):
1037         (WebKit::SelectionOverlayController::drawRect):
1038         (WebKit::SelectionOverlayController::mouseEvent):
1039         * WebProcess/WebPage/SelectionOverlayController.h: Added.
1040         (WebKit::SelectionOverlayController::create):
1041         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Added.
1042         (WebKit::SelectionOverlayController::drawRect):
1043         (WebKit::SelectionOverlayController::mouseEvent):
1044         (WebKit::SelectionOverlayController::handleClick):
1045         (WebKit::SelectionOverlayController::clearHighlight):
1046
1047         * WebProcess/WebPage/WebPage.cpp:
1048         (WebKit::WebPage::selectionOverlayController):
1049         * WebProcess/WebPage/WebPage.h:
1050
1051 2014-04-25  Enrica Casucci  <enrica@apple.com>
1052
1053         Remove duplicate member variable in WKAutocorrectionRects and WKAutocorrectionContext.
1054         https://bugs.webkit.org/show_bug.cgi?id=132206
1055
1056         Reviewed by Benjamin Poulain.
1057
1058         * UIProcess/ios/WKContentViewInteraction.mm:
1059
1060 2014-04-25  Dean Jackson  <dino@apple.com>
1061
1062         Allow a platform-specific size enumeration to be passed into popup-menu display
1063         https://bugs.webkit.org/show_bug.cgi?id=132195
1064
1065         Reviewed by Brent Fulgham. With some in-person review comments from Sam Weinig.
1066
1067         Platforms like OS X use a set of predefined sizes for built-in controls
1068         used for <select>: normal, small and mini. Expose that information to
1069         the PopupMenuClient via the PopupMenuStyle, allowing it to be passed
1070         into the platform code in WebKitSystemInterface.
1071
1072         * Shared/PlatformPopupMenuData.cpp: Encode and decode the PopupMenuSize enum.
1073         (WebKit::PlatformPopupMenuData::encode):
1074         (WebKit::PlatformPopupMenuData::decode):
1075         * Shared/PlatformPopupMenuData.h: Add PopupMenuSize member variable.
1076         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1077         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Convert the PopupMenuSize
1078         into a WKControlSize, and pass that into WKPopupMenu.
1079         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
1080         (WebKit::WebPopupMenu::setUpPlatformData): Add the PopupMenuSize to
1081         the PlatformPopupMenuData.
1082
1083 2014-04-25  Tim Horton  <timothy_horton@apple.com>
1084
1085         REGRESSION (r167775): Safari crashes in ViewSnapshotStore::pruneSnapshots after loading 20 pages
1086         https://bugs.webkit.org/show_bug.cgi?id=132204
1087         <rdar://problem/16729123>
1088
1089         Reviewed by Anders Carlsson.
1090
1091         * UIProcess/mac/ViewSnapshotStore.h:
1092         * UIProcess/mac/ViewSnapshotStore.mm:
1093         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
1094         (WebKit::ViewSnapshotStore::pruneSnapshots):
1095         (WebKit::ViewSnapshotStore::recordSnapshot):
1096         Keep track of the number of snapshots that actually have live images; the
1097         size of the snapshot map no longer represents that.
1098         Also, fix the crash by using the UUID from the current item instead of from
1099         the (potentially null) most distant item; r167775 accidentally typo'd this.
1100
1101 2014-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1102
1103         [GTK] Plugin process crashes with GTK2 windowed plugins
1104         https://bugs.webkit.org/show_bug.cgi?id=132127
1105
1106         Reviewed by Martin Robinson.
1107
1108         It happens sometimes because the socket is used before the plug
1109         has been added. A runtime critical warnings is shown and it
1110         sometimes ends up crashing.
1111
1112         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1113         (WebKit::NetscapePlugin::platformPostInitializeWindowed): Do not
1114         show the plug widget until the socket is connected.
1115
1116 2014-04-24  Andreas Kling  <akling@apple.com>
1117
1118         [iOS WebKit2] Enable optimization to mmap downloaded resources once they become file-backed.
1119         <https://webkit.org/b/132171>
1120         <rdar://problem/16720733>
1121
1122         Implement a CFNetwork-based version of NetworkResourceLoader::willCacheResponseAsync()
1123         and activate the DiskCacheMonitor code path. This means that once resources go into
1124         file system cache, we get notified and mmap them from disk, saving heaps of memory.
1125
1126         Reviewed by Antti Koivisto.
1127
1128         * NetworkProcess/NetworkResourceLoader.h:
1129         * NetworkProcess/mac/DiskCacheMonitor.mm:
1130         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1131         (WebKit::NetworkResourceLoader::willCacheResponseAsync):
1132
1133 2014-04-24  Andreas Kling  <akling@apple.com>
1134
1135         [iOS WebKit2] RemoteLayerTreeDrawingArea should force CA to garbage collect surfaces.
1136         <https://webkit.org/b/132160>
1137         <rdar://problem/16110687>
1138
1139         Do an empty CATransaction at the end of RemoteLayerTreeDrawingArea::flushLayers()
1140         to get CA to garbage collect its IOSurfaces. This helps clean up unused surfaces
1141         that we'd otherwise end up hanging on to for a long time.
1142
1143         Reviewed by Tim Horton.
1144
1145         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1146         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
1147
1148 2014-04-24  Commit Queue  <commit-queue@webkit.org>
1149
1150         Unreviewed, rolling out r167700.
1151         https://bugs.webkit.org/show_bug.cgi?id=132142
1152
1153         Incorrectly reverted the change in r167547 for
1154         webkit.org/b/131898 (Requested by rniwa on #webkit).
1155
1156         Reverted changeset:
1157
1158         "Cursor doesn't change back to pointer when leaving the Safari
1159         window"
1160         https://bugs.webkit.org/show_bug.cgi?id=132038
1161         http://trac.webkit.org/changeset/167700
1162
1163 2014-04-24  Brady Eidson  <beidson@apple.com>
1164
1165         Rename "IMAGE_CONTROLS" feature to "SERVICE_CONTROLS"
1166         https://bugs.webkit.org/show_bug.cgi?id=132155
1167
1168         Reviewed by Tim Horton.
1169
1170         * Configurations/FeatureDefines.xcconfig:
1171         * Shared/ContextMenuContextData.cpp:
1172         (WebKit::ContextMenuContextData::ContextMenuContextData):
1173         (WebKit::ContextMenuContextData::operator=):
1174         (WebKit::ContextMenuContextData::encode):
1175         (WebKit::ContextMenuContextData::decode):
1176         * Shared/ContextMenuContextData.h:
1177         * UIProcess/WebPageProxy.cpp:
1178         (WebKit::WebPageProxy::internalShowContextMenu):
1179         * UIProcess/WebPageProxy.h:
1180         * UIProcess/mac/WebContextMenuProxyMac.h:
1181         * UIProcess/mac/WebContextMenuProxyMac.mm:
1182         (WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
1183         (WebKit::WebContextMenuProxyMac::populate):
1184         (WebKit::WebContextMenuProxyMac::showContextMenu):
1185         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1186         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1187         * WebProcess/WebPage/WebContextMenu.cpp:
1188         * WebProcess/WebPage/WebContextMenu.h:
1189         * WebProcess/WebPage/WebPage.cpp:
1190         (WebKit::WebPage::updatePreferences):
1191         * WebProcess/WebPage/WebPage.h:
1192         * WebProcess/WebPage/WebPage.messages.in:
1193
1194 2014-04-24  Joseph Pecoraro  <pecoraro@apple.com>
1195
1196         [iOS] Add some missing overrides and remove unnecessary virtuals
1197         https://bugs.webkit.org/show_bug.cgi?id=132153
1198
1199         Reviewed by Darin Adler.
1200
1201         * UIProcess/ios/PageClientImplIOS.h:
1202         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1203
1204 2014-04-24  Tim Horton  <timothy_horton@apple.com>
1205
1206         WebKit2 View Gestures: Use a single struct for the snapshot, and pass it around
1207         https://bugs.webkit.org/show_bug.cgi?id=132114
1208
1209         Reviewed by Simon Fraser.
1210
1211         Have only a single map in ViewSnapshotStore, from back-forward item
1212         to ViewSnapshotStore::Snapshot, and return the Snapshot struct when looking
1213         up snapshots (via getSnapshot()), so that future patches can persist additional
1214         information along with the snapshot.
1215
1216         * UIProcess/ios/ViewGestureControllerIOS.mm:
1217         (WebKit::ViewGestureController::beginSwipeGesture):
1218         (WebKit::ViewGestureController::endSwipeGesture):
1219         * UIProcess/mac/ViewGestureController.h:
1220         * UIProcess/mac/ViewGestureControllerMac.mm:
1221         (WebKit::ViewGestureController::retrieveSnapshotForItem):
1222         (WebKit::ViewGestureController::beginSwipeGesture):
1223         (WebKit::ViewGestureController::endSwipeGesture):
1224         Adopt getSnapshot() instead of snapshotAndRenderTreeSize().
1225         Move retrieveSnapshotForItem out into a separate function (for future use).
1226
1227         * UIProcess/mac/ViewSnapshotStore.h:
1228         (WebKit::ViewSnapshotStore::disableSnapshotting):
1229         (WebKit::ViewSnapshotStore::enableSnapshotting):
1230         * UIProcess/mac/ViewSnapshotStore.mm:
1231         (WebKit::ViewSnapshotStore::pruneSnapshots):
1232         (WebKit::ViewSnapshotStore::recordSnapshot):
1233         (WebKit::ViewSnapshotStore::getSnapshot):
1234         (WebKit::ViewSnapshotStore::snapshotAndRenderTreeSize): Deleted.
1235         Make Snapshot struct public.
1236         Get rid of the separate map of back-forward items to render tree sizes.
1237         When evicting, instead of removing the entry, clear out its snapshot image;
1238         this way, we can keep other snapshot metadata around.
1239
1240 2014-04-24  Enrica Casucci  <enrica@apple.com>
1241
1242         [iOS WebKit2] Should properly handle focus redirect (keyboard state changes when focus changes).
1243         https://bugs.webkit.org/show_bug.cgi?id=132136
1244         <rdar://problem/16238336>
1245
1246         Reviewed by Benjamin Poulain.
1247
1248         Focusing a field from JavaScript should not make the keyboard or the select picker
1249         appear unless the user has already started interacting with one of the fields in the page.
1250         Adding a parameter to StartAssistingNode to indicate whether the focus change is a result
1251         of a user action.
1252
1253         * UIProcess/PageClient.h:
1254         * UIProcess/WebPageProxy.h:
1255         * UIProcess/WebPageProxy.messages.in:
1256         * UIProcess/ios/PageClientImplIOS.h:
1257         * UIProcess/ios/PageClientImplIOS.mm:
1258         (WebKit::PageClientImpl::startAssistingNode):
1259         * UIProcess/ios/WKContentViewInteraction.h:
1260         * UIProcess/ios/WKContentViewInteraction.mm:
1261         (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]):
1262         * UIProcess/ios/WebPageProxyIOS.mm:
1263         (WebKit::WebPageProxy::startAssistingNode):
1264         * WebProcess/WebPage/WebPage.cpp:
1265         (WebKit::WebPage::WebPage):
1266         (WebKit::WebPage::dispatchTouchEvent):
1267         * WebProcess/WebPage/WebPage.h:
1268         * WebProcess/WebPage/ios/WebPageIOS.mm:
1269         (WebKit::WebPage::handleTap):
1270         (WebKit::WebPage::elementDidFocus):
1271
1272 2014-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
1273
1274         FontCache::fontCache() never returns nullptr so it can be made to return a reference instead
1275         https://bugs.webkit.org/show_bug.cgi?id=132110
1276
1277         Reviewed by Tim Horton.
1278
1279         Updates callers to use '.' instead of '->'.
1280
1281         No new tests are necessary because there should be no behavior change.
1282
1283         * WebProcess/WebProcess.cpp:
1284         (WebKit::WebProcess::terminate):
1285         (WebKit::WebProcess::didClose):
1286         (WebKit::WebProcess::getWebCoreStatistics):
1287
1288 2014-04-24  Eric Carlson  <eric.carlson@apple.com>
1289
1290         [iOS] Manage AudioSession category according to media type
1291         https://bugs.webkit.org/show_bug.cgi?id=132096
1292
1293         Reviewed by Jer Noble.
1294
1295         * WebProcess/WebPage/WebPage.cpp:
1296         (WebKit::WebPage::WebPage): Tell WebCore to manage the AudioSession.
1297
1298 2014-04-24  Tim Horton  <timothy_horton@apple.com>
1299
1300         [wk2] Provide SPI allowing clients to hand events directly to swipe code, bypassing scrolling
1301         https://bugs.webkit.org/show_bug.cgi?id=132092
1302         <rdar://problem/15948244>
1303
1304         Reviewed by Darin Adler.
1305
1306         * UIProcess/API/Cocoa/WKViewPrivate.h:
1307         * UIProcess/API/mac/WKView.mm:
1308         (-[WKView _tryToSwipeWithEvent:ignoringPinnedState:]):
1309         Added. Hand the event directly to ViewGestureController, optionally
1310         ignoring whether or not the WKView is scrollable (always pretending that it is not).
1311
1312         * UIProcess/mac/ViewGestureController.h:
1313         (WebKit::ViewGestureController::shouldIgnorePinnedState):
1314         (WebKit::ViewGestureController::setShouldIgnorePinnedState):
1315         * UIProcess/mac/ViewGestureControllerMac.mm:
1316         (WebKit::ViewGestureController::ViewGestureController):
1317         (WebKit::ViewGestureController::scrollEventCanBecomeSwipe):
1318         (WebKit::ViewGestureController::handleScrollWheelEvent):
1319         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
1320         (WebKit::scrollEventCanBecomeSwipe):
1321         If we're ignoring the view's pinned state, pretend that we're always pinned,
1322         and don't worry about sending events to WebCore.
1323
1324 2014-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1325
1326         [GTK] wmode='transparent' for flash plugin doesn't work
1327         https://bugs.webkit.org/show_bug.cgi?id=120055
1328
1329         Reviewed by Gustavo Noronha Silva.
1330
1331         Force opaque window mode for flash plugin when wmode='transparent',
1332         since X11 backend doesn't support transparency. We should add
1333         proper transparency support because forcing opaque window mode
1334         doesn't really work. Handle this as a plugin quirk instead of
1335         adding X11 specific code to WebFrameLoaderClient::createPlugin().
1336
1337         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
1338         (WebKit::NetscapePluginModule::determineQuirks): Add
1339         ForceFlashWindowlessMode quirk for flash in case of EFL platform
1340         because EFL port doesn't support windowed plugins.
1341         * Shared/Plugins/PluginQuirks.h: Add ForceFlashWindowlessMode X11
1342         plugin quirk.
1343         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1344         (WebKit::NetscapePlugin::initialize): Modify or add wmode
1345         parameter for flash plugin, to force opaque window mode when
1346         transparent mode is specified or when ForceFlashWindowlessMode
1347         quirk is present.
1348         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1349         (WebKit::WebFrameLoaderClient::createPlugin): Remove X11 specific code.
1350
1351 2014-04-23  Simon Fraser  <simon.fraser@apple.com>
1352
1353         [iOS WK2] Missing content inside long overflow-scrolling:touch 
1354         https://bugs.webkit.org/show_bug.cgi?id=132105
1355
1356         Reviewed by Tim Horton.
1357         
1358         PlatformCALayerRemote needs to track bounds origin as well as size,
1359         since iOS uses bounds origin for overflow scrolling.
1360
1361         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1362         (WebKit::applyPropertiesToLayer):
1363         * Shared/mac/RemoteLayerTreeTransaction.h:
1364         * Shared/mac/RemoteLayerTreeTransaction.mm:
1365         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1366         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1367         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1368         (WebKit::dumpChangedLayers):
1369         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1370         (WebKit::PlatformCALayerRemote::updateBackingStore):
1371         (WebKit::PlatformCALayerRemote::bounds):
1372         (WebKit::PlatformCALayerRemote::setBounds):
1373
1374 2014-04-23  Andreas Kling  <akling@apple.com>
1375
1376         Remove unused WKPageSetMemoryCacheClientCallsEnabled API.
1377         <https://webkit.org/b/132098>
1378
1379         This API was added to WK2 back in 2011 but never actually used.
1380
1381         Reviewed by Anders Carlsson.
1382
1383         * Shared/WebPageCreationParameters.cpp:
1384         (WebKit::WebPageCreationParameters::encode):
1385         (WebKit::WebPageCreationParameters::decode):
1386         * Shared/WebPageCreationParameters.h:
1387         * UIProcess/API/C/WKPage.cpp:
1388         (WKPageSetMemoryCacheClientCallsEnabled): Deleted.
1389         * UIProcess/API/C/WKPage.h:
1390         * UIProcess/WebPageProxy.cpp:
1391         (WebKit::WebPageProxy::WebPageProxy):
1392         (WebKit::WebPageProxy::creationParameters):
1393         (WebKit::WebPageProxy::setMemoryCacheClientCallsEnabled): Deleted.
1394         * UIProcess/WebPageProxy.h:
1395         * WebProcess/WebPage/WebPage.cpp:
1396         (WebKit::WebPage::WebPage):
1397         (WebKit::WebPage::setMemoryCacheMessagesEnabled): Deleted.
1398         * WebProcess/WebPage/WebPage.h:
1399         * WebProcess/WebPage/WebPage.messages.in:
1400
1401 2014-04-23  Simon Fraser  <simon.fraser@apple.com>
1402
1403         [iOS WK2] Make -webkit-overflow-scrolling:touch work
1404         https://bugs.webkit.org/show_bug.cgi?id=132097
1405
1406         Reviewed by Tim Horton.
1407         
1408         Scrolling of UIScrollViews in content (for -webkit-overflow-scrolling:touch)
1409         depends on them getting hit-tested correctly. UIKit hit testing assumes
1410         that subviews are enclosed by their ancestors, but this is not true of
1411         web content. In addition, we had a root layer that was zero sized.
1412         
1413         Fix by overriding hitTest:withEvent: on our content WKViews to hit
1414         test subviews even if they are not enclosed.
1415
1416         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1417         (-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]):
1418         (-[UIView _findDescendantViewAtPoint:withEvent:]):
1419         (-[WKCompositingView hitTest:withEvent:]):
1420         (-[WKTransformView hitTest:withEvent:]):
1421         (-[WKRemoteView hitTest:withEvent:]):
1422         (WebKit::RemoteLayerTreeHost::createLayer):
1423         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1424         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
1425         Update debug borders on the root layer.
1426         (WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
1427         Size the root layer to the contents size. This isn't strictly necessary
1428         given the hit testing overrides, but seems sensible to do anyway.
1429
1430 2014-04-23  Simon Fraser  <simon.fraser@apple.com>
1431
1432         Nonopaque layers double-paint with UI-side compositing
1433         https://bugs.webkit.org/show_bug.cgi?id=132101
1434
1435         Reviewed by Tim Horton.
1436         
1437         The non-IOSurface code path was failing to clear the backing store
1438         before painting.
1439
1440         * Shared/mac/RemoteLayerBackingStore.mm:
1441         (WebKit::RemoteLayerBackingStore::display):
1442         (WebKit::RemoteLayerBackingStore::drawInContext):
1443
1444 2014-04-23  Benjamin Poulain  <bpoulain@apple.com>
1445
1446         [iOS][WK2] Image and text documents sometime gets the webpage viewport configuration
1447         https://bugs.webkit.org/show_bug.cgi?id=132099
1448
1449         Reviewed by Tim Horton.
1450
1451         When didReceiveMobileDocType(), if the doctype was not XHTML mobile, we were setting
1452         the viewport configuration to webpageParameters(). This is obviously not correct for
1453         Image and Text documents.
1454
1455         This patch moves the code deciding the default configuration out of WebPage::didCommitLoad()
1456         and use it from WebPage::didCommitLoad() and WebPage::didReceiveMobileDocType().
1457
1458         * WebProcess/WebPage/WebPage.cpp:
1459         (WebKit::WebPage::didCommitLoad):
1460         * WebProcess/WebPage/WebPage.h:
1461         * WebProcess/WebPage/ios/WebPageIOS.mm:
1462         (WebKit::WebPage::didReceiveMobileDocType):
1463         (WebKit::WebPage::resetViewportDefaultConfiguration):
1464
1465 2014-04-23  Benjamin Poulain  <bpoulain@apple.com>
1466
1467         [iOS][WK2] Fix a few mistakes affecting the initial layout and the initial unobscured rect
1468         https://bugs.webkit.org/show_bug.cgi?id=132093
1469         <rdar://problem/16703237>
1470
1471         Reviewed by Tim Horton.
1472
1473         The user of WKWebView can setup a size on device pixels, which can add half a point to the minimum
1474         layout size. By rounding this up before applying the page scale, we ended up with rounding errors
1475         on the layout size and the transitory unobscured content rect.
1476
1477         This patch fixes changes the minimal layout size to float point values to reduce the rounding problems.
1478
1479         * UIProcess/API/Cocoa/WKWebView.mm:
1480         (setViewportConfigurationMinimumLayoutSize):
1481         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
1482         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1483         * UIProcess/WebPageProxy.h:
1484         * UIProcess/ios/WebPageProxyIOS.mm:
1485         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1486         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
1487         (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI):
1488
1489         * WebProcess/WebPage/WebPage.cpp:
1490         (WebKit::WebPage::didCommitLoad):
1491         Defaulting the content size to the minimum layout size only works if the initial-scale is 1.
1492         ViewportConfiguration knows exactly what to do before the first layout.
1493
1494         * WebProcess/WebPage/WebPage.h:
1495         * WebProcess/WebPage/WebPage.messages.in:
1496         * WebProcess/WebPage/ios/WebPageIOS.mm:
1497         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
1498         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
1499         (WebKit::WebPage::dynamicViewportSizeUpdate):
1500         A few fixes here:
1501         -setZoomedOutPageScaleFactor() was incorrectly using the initial scale. 99% of the time, initial scale
1502          and minimum scale are equal, but the page can specify something different with the viewport meta tag.
1503         -Use floating point for manipulating the minimum layout sizes, then round the value.
1504         -minimumLayoutSizeInDocumentCoordinate was scaled the wrong way around.
1505
1506         (WebKit::WebPage::viewportConfigurationChanged):
1507
1508 2014-04-23  Yongjun Zhang  <yongjun_zhang@apple.com>
1509
1510         Support encoding/decoding NSUInteger arguments in WKRemoteObjectCoder.
1511         https://bugs.webkit.org/show_bug.cgi?id=132040
1512
1513         Add support for encoding/decoding NSUInteger arguments.
1514
1515         Reviewed by Sam Weinig.
1516
1517         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1518         (encodeInvocation):
1519         (decodeInvocationArguments):
1520
1521 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
1522
1523         Cursor doesn't change back to pointer when leaving the Safari window
1524         https://bugs.webkit.org/show_bug.cgi?id=132038
1525
1526         Reviewed by Alexey Proskuryakov.
1527
1528         Since the cursor type is now updated asynchronously after r147739,
1529         [window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0]
1530         evalutes to false depending on how fast cursor is moving.
1531
1532         Instead, check whether the NSWindow of the WebView is the key window or not since
1533         key window appears to control the cursor style in Cocoa as far as I've tested:
1534         https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
1535
1536         * UIProcess/mac/PageClientImpl.mm:
1537         (WebKit::PageClientImpl::setCursor):
1538
1539 2014-04-22  Yongjun Zhang  <yongjun_zhang@apple.com>
1540
1541         Add SPI to expose provisional URL from Frame.
1542         https://bugs.webkit.org/show_bug.cgi?id=132014
1543
1544         Add methods to return the provisional URL from WKWebProcessPlugInFrame.
1545
1546         Reviewed by Dan Bernstein.
1547
1548         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1549         (-[WKWebProcessPlugInFrame _provisionalURL]):
1550         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
1551
1552 2014-04-22  Benjamin Poulain  <bpoulain@apple.com>
1553
1554         [iOS][WK2] Split iOS touch event dispatch for the regular touch event dispatch
1555         https://bugs.webkit.org/show_bug.cgi?id=132033
1556
1557         Reviewed by Simon Fraser.
1558
1559         The generic touch event dispatching does not work well with iOS gesture recognizers.
1560         Some events are required to be synchronous, while other needs can be asynchronous and
1561         can even use event coalescing. We only need UI callback for the synchronous events.
1562
1563         Previously, that was implemented by changing the property ShouldSendEventsSynchronously
1564         on WebPageProxy. That is causing issues when synchronous events are sent right after asynchronous
1565         events because the responses in WebPageProxy::didReceiveEvent() easily get out of order.
1566
1567         This patch completely split the UIGestureRecognizerDispatching from the normal asynchronous event dispatching.
1568
1569         Synchronous events are sent directly to the WebProcess and report the result to the PageClient right away.
1570
1571         Asynchronous events are sent to the EventDispatcher where they are coalesced until the main thread is free
1572         to process events.
1573
1574         There can be a race where a synchronous event comes before the asynchronous events are processed. In that case,
1575         the synchronous event handler starts by getting the events out of the EventDispatcher and dispatch them first.
1576
1577         * Shared/NativeWebTouchEvent.h:
1578         (WebKit::NativeWebTouchEvent::uniqueId): Deleted.
1579         * Shared/ios/NativeWebTouchEventIOS.mm:
1580         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1581         * UIProcess/WebPageProxy.cpp:
1582         (WebKit::WebPageProxy::handleSynchronousTouchEvent):
1583         (WebKit::WebPageProxy::sendAsynchronousTouchEvent):
1584         (WebKit::WebPageProxy::didReceiveEvent):
1585         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1586         * UIProcess/WebPageProxy.h:
1587         * UIProcess/ios/WKContentViewInteraction.h:
1588         * UIProcess/ios/WKContentViewInteraction.mm:
1589         (-[WKContentView _webTouchEventsRecognized:]):
1590         (-[WKContentView _webTouchEvent:WebKit::preventsNativeGestures:]):
1591         * WebProcess/WebPage/EventDispatcher.cpp:
1592         (WebKit::EventDispatcher::EventDispatcher):
1593         (WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
1594         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
1595         (WebKit::EventDispatcher::touchEvent):
1596         (WebKit::EventDispatcher::dispatchTouchEvents):
1597         * WebProcess/WebPage/EventDispatcher.h:
1598         * WebProcess/WebPage/EventDispatcher.messages.in:
1599         * WebProcess/WebPage/WebPage.cpp:
1600         (WebKit::WebPage::dispatchTouchEvent):
1601         (WebKit::WebPage::touchEventSync):
1602         (WebKit::WebPage::touchEvent):
1603         (WebKit::WebPage::touchEventSyncForTesting):
1604         (WebKit::WebPage::didCommitLoad):
1605         * WebProcess/WebPage/WebPage.h:
1606         * WebProcess/WebPage/WebPage.messages.in:
1607         * WebProcess/WebPage/ios/WebPageIOS.mm:
1608         (WebKit::WebPage::dispatchAsynchronousTouchEventsQueue):
1609
1610 2014-04-22  Chris Fleizach  <cfleizach@apple.com>
1611
1612         AX: iOS hit-testing does not work when page is zoomed
1613         https://bugs.webkit.org/show_bug.cgi?id=132013
1614
1615         Reviewed by Simon Fraser.
1616
1617         Implement accessibilityHitTest so that the point can be converted correctly.
1618
1619         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
1620         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
1621
1622 2014-04-22  Commit Queue  <commit-queue@webkit.org>
1623
1624         Unreviewed, rolling out r167674.
1625         https://bugs.webkit.org/show_bug.cgi?id=132025
1626
1627         Going a different way with this (Requested by bradee-oh on
1628         #webkit).
1629
1630         Reverted changeset:
1631
1632         "Change Image Controls replacement to use selection and paste"
1633         https://bugs.webkit.org/show_bug.cgi?id=131992
1634         http://trac.webkit.org/changeset/167674
1635
1636 2014-04-22  Joseph Pecoraro  <pecoraro@apple.com>
1637
1638         Remove unused local variable
1639         https://bugs.webkit.org/show_bug.cgi?id=132020
1640
1641         Reviewed by Alexey Proskuryakov.
1642
1643         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1644         (-[WKSelectPopover initWithView:hasGroups:]):
1645
1646 2014-04-22  Brady Eidson  <beidson@apple.com>
1647
1648         Change Image Controls replacement to use selection and paste
1649         <rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992
1650
1651         Reviewed by Tim Horton.
1652
1653         * UIProcess/mac/WebContextMenuProxyMac.mm:
1654         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Write the
1655           replacement data to a special pasteboard, then replace the current selection from
1656           that pasteboard.
1657
1658         Remove all other code used to support the old replacement mechanism:
1659         * UIProcess/WebPageProxy.cpp:
1660         (WebKit::WebPageProxy::replaceControlledImage): Deleted.
1661         * UIProcess/WebPageProxy.h:
1662         * UIProcess/mac/WebContextMenuProxyMac.h:
1663         (WebKit::WebContextMenuProxyMac::page):
1664         (WebKit::WebContextMenuProxyMac::replaceControlledImage): Deleted.
1665         * WebProcess/WebPage/WebContextMenu.cpp:
1666         (WebKit::WebContextMenu::replaceControlledImage): Deleted.
1667         * WebProcess/WebPage/WebContextMenu.h:
1668         * WebProcess/WebPage/WebPage.cpp:
1669         (WebKit::WebPage::replaceControlledImage): Deleted.
1670         * WebProcess/WebPage/WebPage.h:
1671         * WebProcess/WebPage/WebPage.messages.in:
1672
1673 2014-04-22  Eunmi Lee  <eunmi15.lee@samsung.com>
1674
1675         [EFL][WK2] Remove duplicated code to set size to the DrawingArea.
1676         https://bugs.webkit.org/show_bug.cgi?id=131972
1677
1678         Reviewed by Andreas Kling.
1679
1680         DrawingArea's size is set in the WebView.cpp when EwkView's size is
1681         changed, so we don't have to set again in the PageViewportController.
1682
1683         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1684         (WebKit::PageViewportController::didChangeViewportSize):
1685
1686 2014-04-22  Tim Horton  <timothy_horton@apple.com>
1687
1688         WKThumbnailView doesn't quite work with topContentInset
1689         https://bugs.webkit.org/show_bug.cgi?id=131976
1690         <rdar://problem/16642127>
1691
1692         Reviewed by Darin Adler.
1693
1694         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1695         (-[_WKThumbnailView initWithFrame:fromWKView:]):
1696         _WKThumbnailView always needs a layer.
1697         We don't want to use snapshots by default, this was debugging accidentally landed in the last change.
1698
1699         (-[_WKThumbnailView _requestSnapshotIfNeeded]):
1700         Don't request a new snapshot if the scale is the same as the existing one.
1701         Reduce the height of the snapshot by the topContentInset.
1702         Having the origin at (0, 0) is still correct, as the inset content is in negative Y space,
1703         and (0, 0) is the true origin of the content.
1704
1705         (-[_WKThumbnailView setScale:]):
1706         When not snapshotting, we've decided that WKThumbnailView should apply the scale to the WKView layer tree,
1707         instead of depending on clients to do so.
1708
1709         (-[_WKThumbnailView setUsesSnapshot:]):
1710         We *do* need to apply thumbnail scale in the web process even when snapshotting,
1711         because we use the live layer tree temporarily while waiting for the asynchronous
1712         snapshot to return. This was a misstep in the last thumbnail view patch.
1713
1714 2014-04-22  Shivakumar JM  <shiva.jm@samsung.com>
1715
1716         [WebKit2] Cleanup the build from unused parameter in WebProcess Module 
1717         https://bugs.webkit.org/show_bug.cgi?id=131970
1718
1719         Reviewed by Darin Adler.
1720
1721         Fix a build warning by removing the parameters in function paintLayerContents() to fix build warning.
1722
1723         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1724         (WebKit::CoordinatedLayerTreeHost::paintLayerContents):
1725
1726 2014-04-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1727
1728         [GTK] Crash after getting web view context property with g_object_get
1729         https://bugs.webkit.org/show_bug.cgi?id=131983
1730
1731         Reviewed by Philippe Normand.
1732
1733         The problem is that the getter is using g_value_take_object() and
1734         the default context is destroyed when the caller releases its ref.
1735
1736         * UIProcess/API/gtk/WebKitWebView.cpp:
1737         (webkitWebViewGetProperty): Use g_value_set_object() instead of
1738         g_value_take_object().
1739
1740 2014-04-22  Ryuan Choi  <ryuan.choi@samsung.com>
1741
1742         [EFL][WK2] Remove unnecessary includes in files of Source/WebKit2/UIProcess/API/efl
1743         https://bugs.webkit.org/show_bug.cgi?id=131979
1744
1745         Reviewed by Gyuyoung Kim.
1746
1747         Removed unnecessary includes of header files.
1748         In addition, tried to use forward declarations.
1749
1750         * UIProcess/API/efl/EwkView.cpp:
1751         * UIProcess/API/efl/EwkView.h:
1752         * UIProcess/API/efl/EwkViewCallbacks.h:
1753         * UIProcess/API/efl/GestureRecognizer.h:
1754         * UIProcess/API/efl/ewk_context_menu_item_private.h:
1755         * UIProcess/API/efl/ewk_context_menu_private.h:
1756         * UIProcess/API/efl/ewk_download_job.cpp:
1757         * UIProcess/API/efl/ewk_download_job_private.h:
1758         * UIProcess/API/efl/ewk_form_submission_request.cpp:
1759         * UIProcess/API/efl/ewk_form_submission_request_private.h:
1760         * UIProcess/API/efl/ewk_navigation_data.cpp:
1761         * UIProcess/API/efl/ewk_navigation_data_private.h:
1762         * UIProcess/API/efl/ewk_page_group_private.h:
1763         * UIProcess/API/efl/ewk_popup_menu_private.h:
1764         * UIProcess/API/efl/ewk_view.cpp:
1765         * UIProcess/API/efl/ewk_window_features_private.h:
1766         * UIProcess/efl/PageUIClientEfl.cpp:
1767         * UIProcess/efl/ViewClientEfl.cpp:
1768
1769 2014-04-21  Tim Horton  <timothy_horton@apple.com>
1770
1771         [wk2] Don't send intrinsic content size updates with dirty layout
1772         https://bugs.webkit.org/show_bug.cgi?id=131964
1773         <rdar://problem/14292718>
1774
1775         Reviewed by Simon Fraser.
1776
1777         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1778         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1779         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1780         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
1781         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
1782         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1783         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
1784         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired): Deleted.
1785         Instead of using a timer (which can fire while layout is dirty) to coalesce
1786         intrinsic content size changes, send them only from flushLayers, just after updating layout.
1787         This ensures that we never get intermediate intrinsic content sizes that won't be painted.
1788
1789 2014-04-21  Tim Horton  <timothy_horton@apple.com>
1790
1791         Remove a unnecessary forward-declared class from TiledCoreAnimationDrawingArea.
1792
1793         Rubber-stamped by Simon Fraser.
1794
1795         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1796
1797 2014-04-21  Simon Fraser  <simon.fraser@apple.com>
1798
1799         Don't try to use a null connection()->xpcConnection()
1800         https://bugs.webkit.org/show_bug.cgi?id=131961
1801
1802         Reviewed by Dan Bernstein.
1803         
1804         If running with -WebKit2UseXPCServiceForWebProcess NO, connection()->xpcConnection()
1805         is null and xpc_connection_get_pid() would crash, so null-check the xpcConnection.
1806
1807         * UIProcess/Network/NetworkProcessProxy.cpp:
1808         (WebKit::NetworkProcessProxy::didFinishLaunching):
1809
1810 2014-04-21  Dan Bernstein  <mitz@apple.com>
1811
1812         WebKit part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
1813         https://bugs.webkit.org/show_bug.cgi?id=131939
1814
1815         Reviewed by David Kilzer.
1816
1817         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1818         (WebKit::NetworkConnectionToWebProcess::setDefersLoading): Added. Forwards the message to
1819         the NetworkResourceLoader. 
1820         * NetworkProcess/NetworkConnectionToWebProcess.h:
1821
1822         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Added SetDefersLoading message.
1823
1824         * NetworkProcess/NetworkResourceLoader.cpp:
1825         (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize new member variable
1826         m_defersLoading from the new field in the loader parameters.
1827         (WebKit::NetworkResourceLoader::start): Added. Like WebCore::ResourceLoader, if loading is
1828         deferred, keep the request in m_deferredRequest and bail out.
1829         (WebKit::NetworkResourceLoader::setDefersLoading): Added. Similar to
1830         WebCore::ResourceLoader::setDefersLoading.
1831         * NetworkProcess/NetworkResourceLoader.h:
1832         (WebKit::NetworkResourceLoader::defersLoading): 
1833
1834         * Shared/Network/NetworkResourceLoadParameters.cpp:
1835         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Initialize new field
1836         defersLoading to false.
1837         (WebKit::NetworkResourceLoadParameters::encode): Encode new field.
1838         (WebKit::NetworkResourceLoadParameters::decode): Decode new field.
1839         * Shared/Network/NetworkResourceLoadParameters.h: Added defersLoading field.
1840
1841         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1842         (WebKit::WebResourceLoadScheduler::scheduleLoad): Populate defersLoading field in the load
1843         parameters.
1844         (WebKit::WebResourceLoadScheduler::setDefersLoading): Send a message to the Network process.
1845         * WebProcess/Network/WebResourceLoadScheduler.h:
1846
1847 2014-04-21  Anders Carlsson  <andersca@apple.com>
1848
1849         Errors passed to delegate methods should have recovery attempters
1850         https://bugs.webkit.org/show_bug.cgi?id=131957
1851         <rdar://problem/16642539>
1852
1853         Reviewed by Tim Horton.
1854
1855         * UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h: Added.
1856         * UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm: Added.
1857         * UIProcess/Cocoa/NavigationState.mm:
1858         (WebKit::createErrorWithRecoveryAttempter):
1859         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
1860         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame):
1861         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h: Added.
1862         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: Added.
1863         (-[WKReloadFrameErrorRecoveryAttempter initWithWebView:frameHandle:urlString:]):
1864         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
1865         * WebKit2.xcodeproj/project.pbxproj:
1866
1867 2014-04-21  Eric Carlson  <eric.carlson@apple.com>
1868
1869         [Mac] implement WebKitDataCue
1870         https://bugs.webkit.org/show_bug.cgi?id=131799
1871
1872         Reviewed by Dean Jackson.
1873
1874         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
1875
1876 2014-04-21  Beth Dakin  <bdakin@apple.com>
1877
1878         topContentInset does not play well with fullscreen elements
1879         https://bugs.webkit.org/show_bug.cgi?id=131955
1880         -and corresponding-
1881         <rdar://problem/16651925>
1882
1883         Reviewed by Sam Weinig.
1884
1885         If you take an element (such as a <video>) fullscreen when you have a 
1886         topContentInset set, there will be an inset-sized gap at the top of the fullscreen 
1887         video.
1888
1889         Save and restore the topContentInset whenever the scroll position is saved and 
1890         restored.
1891         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1892         (WebKit::WebFullScreenManager::WebFullScreenManager):
1893         (WebKit::WebFullScreenManager::saveScrollPosition):
1894         (WebKit::WebFullScreenManager::restoreScrollPosition):
1895         * WebProcess/FullScreen/WebFullScreenManager.h:
1896
1897 2014-04-21  Gavin Barraclough  <baraclough@apple.com>
1898
1899         Don't use ProcessAssertion on simulator
1900         https://bugs.webkit.org/show_bug.cgi?id=131950
1901
1902         Rubber stamped by Enrica Casucci
1903
1904         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1905         (WebKit::connectToService):
1906         * UIProcess/ios/ProcessAssertion.h:
1907
1908 2014-04-21  Enrica Casucci  <enrica@apple.com>
1909
1910         [iOS WebKit2] support replacements for misspelled words.
1911         https://bugs.webkit.org/show_bug.cgi?id=131827
1912         <rdar://problem/16319657>
1913
1914         Reviewed by Darin Adler.
1915
1916         This is the second a final piece to support replacements.
1917         It adds some entrypoints used by the keyboard code to perform
1918         replacement when reaching the edge of a word using backspace.
1919         I've modified the behavior of replaceSelectedText to work both
1920         with caret or range selections.
1921
1922         * Shared/EditorState.cpp:
1923         (WebKit::EditorState::encode):
1924         (WebKit::EditorState::decode):
1925         * Shared/EditorState.h:
1926         (WebKit::EditorState::EditorState):
1927         * UIProcess/ios/WKContentViewInteraction.mm:
1928         (-[WKContentView isReplaceAllowed]):
1929         (-[WKContentView _characterBeforeCaretSelection]):
1930         * WebProcess/WebPage/WebPage.cpp:
1931         (WebKit::WebPage::editorState):
1932         * WebProcess/WebPage/ios/WebPageIOS.mm:
1933         (WebKit::WebPage::replaceSelectedText):
1934
1935 2014-04-21  Gavin Barraclough  <baraclough@apple.com>
1936
1937         Don't use ProcessAssertion on simulator
1938         https://bugs.webkit.org/show_bug.cgi?id=131950
1939
1940         Rubber stamped by Benjamin Poulain
1941
1942         * UIProcess/ios/ProcessAssertion.mm:
1943         (WebKit::ProcessAssertion::ProcessAssertion):
1944         (WebKit::ProcessAssertion::setState):
1945
1946 2014-04-21  Anders Carlsson  <andersca@apple.com>
1947
1948         Another build fix.
1949
1950         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1951         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
1952
1953 2014-04-21  Anders Carlsson  <andersca@apple.com>
1954
1955         Build fix.
1956
1957         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1958         (WebKit::XPCServiceInitializer):
1959
1960 2014-04-21  Tim Horton  <timothy_horton@apple.com>
1961
1962         [iOS WebKit2] Implement CSS viewport units
1963         https://bugs.webkit.org/show_bug.cgi?id=131863
1964         <rdar://problem/16279088>
1965
1966         Reviewed by Darin Adler.
1967
1968         * UIProcess/API/Cocoa/WKWebView.mm:
1969         (setMinimumLayoutSizeForMinimalUI):
1970         (-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
1971         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
1972         Add _setMinimumLayoutSizeOverrideForMinimalUI:, which pushes said size
1973         down from the client to WebPageIOS, below.
1974
1975         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1976         * UIProcess/WebPageProxy.h:
1977         * UIProcess/ios/WebPageProxyIOS.mm:
1978         (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI):
1979         * WebProcess/WebPage/WebPage.h:
1980         * WebProcess/WebPage/WebPage.messages.in:
1981         * WebProcess/WebPage/ios/WebPageIOS.mm:
1982         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
1983         (WebKit::WebPage::viewportConfigurationChanged):
1984         Update FrameView's viewport size based on the minimum layout size for minimal UI (if we have it)
1985         or the normal minimum layout size, scaled to the page's initial scale.
1986
1987 2014-04-21  Benjamin Poulain  <bpoulain@apple.com>
1988
1989         [iOS][WK2] Fix the dynamic viewport update when the viewport's max-scale conflict with the transition
1990         https://bugs.webkit.org/show_bug.cgi?id=131884
1991
1992         Reviewed by Darin Adler.
1993
1994         <rdar://problem/16667291>
1995
1996         * UIProcess/API/Cocoa/WKWebView.mm:
1997         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1998         It is fairly common to have a viewport configuration with min-scale=1 and max-scale=1.
1999         Since we were only changing the minimumScale for the transition, the target scale was affected
2000         by max-scale. This was breaking the transition from portrait to landscale.
2001
2002 2014-04-21  Benjamin Poulain  <bpoulain@apple.com>
2003
2004         [iOS][WK2] Make dynamic viewport size update content aware
2005         https://bugs.webkit.org/show_bug.cgi?id=131874
2006
2007         Reviewed by Tim Horton.
2008
2009         When possible, adjust the scroll position based on the content on dynamic viewport resize.
2010
2011         * WebProcess/WebPage/WebPage.cpp:
2012         (WebKit::WebPage::WebPage):
2013         (WebKit::WebPage::scalePage):
2014         (WebKit::WebPage::pageDidScroll):
2015         * WebProcess/WebPage/WebPage.h:
2016         The scrolling heuristic are not invertible, especially the content heuristic. To have the right
2017         behavior when doing resize without changing the page, we save the old scroll position and restore
2018         it when the content size and scale is restored.
2019
2020         * WebProcess/WebPage/ios/WebPageIOS.mm:
2021         (WebKit::WebPage::dynamicViewportSizeUpdate):
2022         On dynamic update, start by finding what node is at the center of the screen. After the layout, put that
2023         node back in the center.
2024
2025         (WebKit::WebPage::updateVisibleContentRects):
2026
2027 2014-04-21  Anders Carlsson  <andersca@apple.com>
2028
2029         Need default WKNavigationDelegate behavior
2030         https://bugs.webkit.org/show_bug.cgi?id=131944
2031         <rdar://problem/15949822>
2032
2033         Reviewed by Dan Bernstein.
2034
2035         Port the WebKit1 default delegate behavior over.
2036
2037         * UIProcess/Cocoa/NavigationState.mm:
2038         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2039         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2040
2041 2014-04-21  Dan Bernstein  <mitz@apple.com>
2042
2043         [Cocoa] Expose WebPage::setDefersLoading
2044         https://bugs.webkit.org/show_bug.cgi?id=131943
2045
2046         Reviewed by Anders Carlsson, but he doesn’t like this.
2047
2048         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2049         (-[WKWebProcessPlugInBrowserContextController _defersLoading]): Added this accessor.
2050         (-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]): Ditto.
2051         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2052         Declared new property _defersLoading.
2053
2054         * WebProcess/WebPage/WebPage.cpp:
2055         (WebKit::WebPage::defersLoading): Added this getter.
2056         * WebProcess/WebPage/WebPage.h:
2057
2058 2014-04-21  Joseph Pecoraro  <pecoraro@apple.com>
2059
2060         Remove unused WebKitSystemInterface functions
2061         https://bugs.webkit.org/show_bug.cgi?id=131938
2062
2063         Reviewed by Alexey Proskuryakov.
2064
2065         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2066         (InitWebCoreSystemInterface):
2067
2068 2014-04-21  Anders Carlsson  <andersca@apple.com>
2069
2070         Check the com.apple.security.network.client entitlement for all processes
2071         https://bugs.webkit.org/show_bug.cgi?id=131942
2072         <rdar://problem/12354188>
2073
2074         Reviewed by Dan Bernstein.
2075
2076         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2077         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
2078         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2079         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2080         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
2081
2082 2014-04-20  Dan Bernstein  <mitz@apple.com>
2083
2084         [Cocoa] Remove interfaces in the To Be Removed groups
2085         https://bugs.webkit.org/show_bug.cgi?id=131925
2086
2087         Reviewed by Darin Adler.
2088
2089         * Shared/API/Cocoa/WKRemoteObjectInterface.h: Removed.
2090         * Shared/API/Cocoa/WKRemoteObjectInterface.mm: Removed.
2091         * Shared/API/Cocoa/WKRemoteObjectRegistry.h: Removed.
2092         * Shared/API/Cocoa/WKRemoteObjectRegistry.mm: Removed.
2093         * UIProcess/API/Cocoa/WKProcessPool.mm:
2094         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.h: Removed.
2095         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.mm: Removed.
2096         * UIProcess/API/Cocoa/WKProcessPoolConfigurationPrivate.h: Removed.
2097         * UIProcess/API/Cocoa/WKProcessPoolToBeRemoved.mm: Removed.
2098         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2099         * WebKit2.xcodeproj/project.pbxproj:
2100         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInBrowserContextControllerToBeRemoved.mm: Removed.
2101         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2102
2103 2014-04-20  Dan Bernstein  <mitz@apple.com>
2104
2105         [Cocoa] Crash when setting a bundle parameter to nil
2106         https://bugs.webkit.org/show_bug.cgi?id=131917
2107
2108         Reviewed by Sam Weinig.
2109
2110         * UIProcess/API/Cocoa/WKProcessPool.mm:
2111         (-[WKProcessPool _setObject:forBundleParameter:]): If the object is nil, use
2112         -[NSMutableDictionary removeObjectForKey:] rather than -setObject:forKey:.
2113
2114         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
2115         (-[WKWebProcessBundleParameters setParameter:forKey:]): Ditto.
2116
2117         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2118         (WebKit::InjectedBundle::setBundleParameter): Unrelatedly, create m_bundleParameters if
2119         needed, as it may have not been created on intialization if no bundle parameters were set
2120         at the time.
2121
2122 2014-04-20  Dan Bernstein  <mitz@apple.com>
2123
2124         [Cocoa] Remove unused -webView:didFinishLoadingNavigation: delegate method
2125         https://bugs.webkit.org/show_bug.cgi?id=131914
2126
2127         Reviewed by Sam Weinig.
2128
2129         * UIProcess/Cocoa/NavigationState.h: Removed flag from m_navigationDelegateMethods struct.
2130         * UIProcess/Cocoa/NavigationState.mm:
2131         (WebKit::NavigationState::setNavigationDelegate): Removed check for whether the method is
2132         implemented.
2133         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Stopped calling the method
2134         if implemented.
2135
2136 2014-04-19  Anders Carlsson  <andersca@apple.com>
2137
2138         Plug-in process crashes if NP_Initialize returns an error the second time it's called
2139         https://bugs.webkit.org/show_bug.cgi?id=131903
2140         <rdar://problem/14355462>
2141
2142         Reviewed by Sam Weinig.
2143
2144         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2145         (WebKit::NetscapePluginModule::decrementLoadCount):
2146         Don't try to unload the plug-in if it hasn't been initialized.
2147
2148 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
2149
2150         [UI-side compositing] Implement blend modes
2151         https://bugs.webkit.org/show_bug.cgi?id=131891
2152         <rdar://problem/16490085>
2153
2154         Reviewed by Tim Horton.
2155
2156         Implement blend modes with UI-side compositing.
2157         
2158         PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in
2159         PlatformCALayerMac and PlatformCALayerRemote.
2160         PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform
2161         layer, so it can be called from the UI process on a CALayer*.
2162         
2163         Add BlendMode to LayerProperties, and initialize, encode and decode it,
2164         as well as adding dumping support for blend modes.
2165         
2166         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2167         (WebKit::applyPropertiesToLayer):
2168         * Shared/mac/RemoteLayerTreeTransaction.h:
2169         * Shared/mac/RemoteLayerTreeTransaction.mm:
2170         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2171         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
2172         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
2173         (WebKit::RemoteLayerTreeTextStream::operator<<):
2174         (WebKit::dumpChangedLayers):
2175         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2176         (WebKit::PlatformCALayerRemote::setBlendMode):
2177         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2178
2179 2014-04-19  Joseph Pecoraro  <pecoraro@apple.com>
2180
2181         Fix leak of UIScreenEdgePanGestureRecognizer in WKSwipeTransitionController
2182         https://bugs.webkit.org/show_bug.cgi?id=131877
2183
2184         Reviewed by Darin Adler.
2185
2186         * UIProcess/ios/ViewGestureControllerIOS.mm:
2187         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
2188
2189 2014-04-19  Dan Bernstein  <mitz@apple.com>
2190
2191         Don’t install a source file inside WebProcess.app.
2192
2193         * WebKit2.xcodeproj/project.pbxproj: Removed ViewUpdateDispatcher.messages.in from
2194         WebProcess’s Copy Bundle Resources build phase.
2195
2196 2014-04-19  Darin Adler  <darin@apple.com>
2197
2198         [Mac] WebView adjusts the cursor even when another window is in front
2199         https://bugs.webkit.org/show_bug.cgi?id=131898
2200         rdar://problem/14619911
2201
2202         Reviewed by Dan Bernstein.
2203
2204         * UIProcess/API/mac/WKView.mm:
2205         (-[WKView _setCursor:]): Deleted. Moved the code all into PageClientImpl, since none of it
2206         interacts with anything special about a WKView.
2207
2208         * UIProcess/API/mac/WKViewInternal.h: Deleted the _setCursor: method.
2209
2210         * UIProcess/mac/PageClientImpl.mm:
2211         (WebKit::PageClientImpl::setCursor): Added a check that the window is under the cursor
2212         and do nothing if it's not.
2213
2214 2014-04-19  Dan Bernstein  <mitz@apple.com>
2215
2216         Use XPC services in the iOS Simulator, but not in Mountain Lion
2217         https://bugs.webkit.org/show_bug.cgi?id=131894
2218
2219         Reviewed by Anders Carlsson.
2220
2221         * Configurations/NetworkService.Development.xcconfig: Defined INFOPLIST_FILE for the
2222         Simulator.
2223         * Configurations/NetworkService.xcconfig: Ditto.
2224         * Configurations/WebContentService.Development.xcconfig: Ditto.
2225         * Configurations/WebContentService.xcconfig: Ditto.
2226         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2227         (WebKit::systemDirectoryPath): Added this helper function that returns a slash-terminated
2228         path to the System directory in the current runtime.
2229         (WebKit::ProcessLauncher::launchProcess): Changed to use the above function to tell whether
2230         a development version of WebKit2 is being used.
2231         * WebKit2Prefix.h: Set WTF_USE_XPC_SERVICES to 1 when targeting the iOS Simulator, but not
2232         when targeting Mountain Lion.
2233
2234 2014-04-19  Dan Bernstein  <mitz@apple.com>
2235
2236         [Cocoa] Crash in -[WKWebProcessPlugInHitTestResult nodeHandle] when nodeHandle() is null
2237         https://bugs.webkit.org/show_bug.cgi?id=131888
2238
2239         Reviewed by Jon Honeycutt.
2240
2241         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
2242         (-[WKWebProcessPlugInHitTestResult nodeHandle]): Added a null check.
2243
2244 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
2245
2246         [iOS WK2] Fuzzy layers on sites using perspective and transforms
2247         https://bugs.webkit.org/show_bug.cgi?id=131873
2248         <rdar://problem/16540576>
2249
2250         Reviewed by Sam Weinig.
2251         
2252         Always set rasterizationScale on CALayers in the UI process
2253         (as we do for WK1) so that layers are rasterized taking the
2254         device scale into account. We can do unconditionally; this
2255         is benign on layers that CA doesn't rasterize.
2256
2257         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2258         (WebKit::applyPropertiesToLayer):
2259
2260 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
2261
2262         Use 'override' in GraphicsLayerCA
2263         https://bugs.webkit.org/show_bug.cgi?id=131882
2264
2265         Reviewed by Tim Horton.
2266         
2267         Add an 'override'.
2268
2269         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
2270
2271 2014-04-19  Darin Adler  <darin@apple.com>
2272
2273         Assertion in WebPage::runModal accesses object after it may have been destroyed
2274         https://bugs.webkit.org/show_bug.cgi?id=131875
2275
2276         Reviewed by Anders Carlsson.
2277
2278         * WebProcess/WebPage/WebPage.cpp:
2279         (WebKit::WebPage::runModal): Ref the WebPage so it's still around so we can
2280         check the m_isRunningModal flag.
2281
2282 2014-04-18  Commit Queue  <commit-queue@webkit.org>
2283
2284         Unreviewed, rolling out r167527.
2285         https://bugs.webkit.org/show_bug.cgi?id=131883
2286
2287         Broke 32-bit build (Requested by ap on #webkit).
2288
2289         Reverted changeset:
2290
2291         "[Mac] implement WebKitDataCue"
2292         https://bugs.webkit.org/show_bug.cgi?id=131799
2293         http://trac.webkit.org/changeset/167527
2294
2295 2014-04-18  Eric Carlson  <eric.carlson@apple.com>
2296
2297         [Mac] implement WebKitDataCue
2298         https://bugs.webkit.org/show_bug.cgi?id=131799
2299
2300         Reviewed by Dean Jackson.
2301
2302         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
2303
2304 2014-04-18  Anders Carlsson  <andersca@apple.com>
2305
2306         Keep the WebPageProxy alive for the lifetime of all PageLoadState::Transaction objects
2307         https://bugs.webkit.org/show_bug.cgi?id=131872
2308         <rdar://problem/15758414>
2309
2310         Reviewed by Dan Bernstein.
2311
2312         * UIProcess/PageLoadState.cpp:
2313         (WebKit::PageLoadState::PageLoadState):
2314         (WebKit::PageLoadState::Transaction::Transaction):
2315         (WebKit::PageLoadState::Transaction::~Transaction):
2316         * UIProcess/PageLoadState.h:
2317         (WebKit::PageLoadState::Transaction::Transaction): Deleted.
2318         (WebKit::PageLoadState::Transaction::~Transaction): Deleted.
2319         * UIProcess/WebPageProxy.cpp:
2320         (WebKit::WebPageProxy::WebPageProxy):
2321
2322 2014-04-18  Stephanie Lewis  <slewis@apple.com>
2323
2324         We shouldn’t create page throttlers for other pages than WebKit2 pages.
2325         Part of <rdar://problem/16473045> Visibility state counters are often incorrect.
2326         https://bugs.webkit.org/show_bug.cgi?id=131696
2327
2328         Reviewed by Gavin Barraclough.
2329
2330         Page throttlers were being created for SVG images and other page instances that
2331         were not accurately tracking the states that enable and disable page throttling.
2332         Make the throttler an unique ptr and only initialize it for WebKit2.
2333
2334         This also fixes  an inefficiency where we would throttle a new page on creation because 
2335         we assumed it was visible even if that was not the case.
2336
2337         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: Check page throttler exists.
2338         (WebKit::NPRuntimeObjectMap::evaluate):
2339         * WebProcess/WebPage/WebPage.cpp: 
2340         (WebKit::WebPage::WebPage): Initialize page throttler for WebKit2 views.
2341         (WebKit::WebPage::mouseEvent): Check page throttler exists.
2342         (WebKit::WebPage::wheelEvent): ditto
2343         (WebKit::WebPage::keyEvent): ditto
2344
2345 2014-04-18  Anders Carlsson  <andersca@apple.com>
2346
2347         Don't allow app sandboxed apps without the network client entitlement to launch the network process
2348         https://bugs.webkit.org/show_bug.cgi?id=131868
2349         <rdar://problem/12354188>
2350
2351         Reviewed by Dan Bernstein.
2352
2353         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2354         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
2355         Add a new delegate that implements checkEntitlements().
2356
2357         (NetworkServiceInitializer):
2358         Pass the new delegate to XPCServiceInitializer.
2359
2360         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2361         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2362         Call checkEntitlements.
2363
2364         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
2365         Return true.
2366
2367         (WebKit::XPCServiceInitializerDelegate::hasEntitlement):
2368         Helper function that returns whether a client has the given entitlement.
2369
2370         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
2371         Helper function that checks whether the client is sandboxed.
2372
2373 2014-04-18  Alice Barraclough  <alice.barraclough@webkit.org>
2374
2375         Find on page - extend API by providing highlighted match index
2376         https://bugs.webkit.org/show_bug.cgi?id=131776
2377
2378         Reviewed by Tim Horton.
2379
2380         * Shared/WebFindOptions.h: Add an option for determining match index.
2381
2382         Plumb through the API layers the addition of a parameter for match index.
2383         * UIProcess/API/APIFindClient.h:
2384         (API::FindClient::didFindString):
2385         * UIProcess/API/C/WKPage.cpp:
2386         (WKPageSetPageFindClient):
2387         * UIProcess/API/Cocoa/WKWebView.mm:
2388         (toFindOptions):
2389         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2390         (NS_OPTIONS):
2391         * UIProcess/API/Cocoa/_WKFindDelegate.h:
2392         * UIProcess/Cocoa/FindClient.h:
2393         * UIProcess/Cocoa/FindClient.mm:
2394         (WebKit::FindClient::setDelegate):
2395         (WebKit::FindClient::didFindString):
2396         * UIProcess/WebFindClient.cpp:
2397         (WebKit::WebFindClient::didFindString):
2398         * UIProcess/WebFindClient.h:
2399         * UIProcess/WebPageProxy.cpp:
2400         (WebKit::WebPageProxy::didFindString):
2401         * UIProcess/WebPageProxy.h:
2402         * UIProcess/WebPageProxy.messages.in:
2403
2404         The actual tracking of the match index is contained in FindController class.
2405         * WebProcess/WebPage/FindController.cpp:
2406         (WebKit::FindController::FindController): Start out as -1, understood to be an undefined index in this context.
2407         (WebKit::FindController::updateFindUIAfterPageScroll): 
2408             Perform the calculation of matchCount if the flag for DetermineMatchIndex is on.
2409         If matchCount exceeds max, keep the match index undefined because otherwise the finding could advance
2410         to a point where the index exceeds the match count, legitimately. If matchCount doesn't exceed the max, then make
2411         sure the match index, which had been being incremented or decremented blindly back in findString(), is normalized
2412         to be less than match count.
2413         (WebKit::FindController::findString): 
2414             If there is a user selection existing on the page, the next occurence of the string will be found after that
2415         selection. In that case we still want the index to properly reflect its ordinal  position within the entire document.
2416         Use findStringMatchingRanges to provide the match index, and set a flag that prevents the match index from being
2417         blindly incremented or decremented later. After findString() is actually called on the page, increment or decrement
2418         the find index under specific conditions. 
2419         (WebKit::FindController::hideFindIndicator): Reset match index when find UI goes away.
2420         * WebProcess/WebPage/FindController.h: Add m_foundStringMatchIndex to private variables.
2421         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2422         (WebKit::FindController::hideFindIndicator): Reset match index when find UI goes away.
2423
2424 2014-04-18  Joseph Pecoraro  <pecoraro@apple.com>
2425
2426         Correct some issues small issues in WK2 file upload InjectedBundle APIs
2427         https://bugs.webkit.org/show_bug.cgi?id=131852
2428
2429         Reviewed by Dan Bernstein.
2430
2431         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2432         (API::InjectedBundle::PageUIClient::shouldGenerateFileForUpload):
2433         The default return value, meaning no, should return the null string. The
2434         result is checked later, and null string is a special value meaning no.
2435
2436         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2437         (WebKit::InjectedBundlePageUIClient::generateFileForUpload):
2438         Pre-check for the correct client function we will use.
2439
2440 2014-04-18  Andy Estes  <aestes@apple.com>
2441
2442         [iOS] REGRESSION (r167039): WebKit incorrectly sets a background process assertion state when displaying a PDF
2443         https://bugs.webkit.org/show_bug.cgi?id=131860
2444         <rdar://problem/16631282>
2445
2446         Reviewed by Tim Horton.
2447
2448         We were basing our process assertion state on whether or not the
2449         process had a WKContentView in a window, but when displaying a PDF
2450         we've removed the WKContentView from the window. Base this decision
2451         instead on whether or not the WKWebView is in the window.
2452
2453         * UIProcess/API/Cocoa/WKWebView.mm:
2454         (-[WKWebView didMoveToWindow]):
2455         * UIProcess/ios/PageClientImplIOS.mm:
2456         (WebKit::PageClientImpl::isViewInWindow):
2457
2458 2014-04-18  Anders Carlsson  <andersca@apple.com>
2459
2460         Address a couple of review comments
2461         https://bugs.webkit.org/show_bug.cgi?id=131856
2462
2463         Reviewed by Dan Bernstein.
2464
2465         * UIProcess/API/Cocoa/WKNavigationAction.h:
2466         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2467         * UIProcess/API/Cocoa/WKPreferences.h:
2468         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2469         * UIProcess/API/Cocoa/WKWebView.h:
2470
2471 2014-04-18  Anders Carlsson  <andersca@apple.com>
2472
2473         Handle pluginOrigin being null
2474         https://bugs.webkit.org/show_bug.cgi?id=131849
2475         <rdar://problem/16655898>
2476
2477         Reviewed by Alexey Proskuryakov.
2478
2479         * WebProcess/WebProcess.cpp:
2480         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
2481
2482 2014-04-18  Dan Bernstein  <mitz@apple.com>
2483
2484         [Cocoa] Add a navigation delegate method corresponding to didFinishDocumentLoadForFrame for the main frame
2485         https://bugs.webkit.org/show_bug.cgi?id=131847
2486
2487         Reviewed by Anders Carlsson.
2488
2489         * UIProcess/API/APILoaderClient.h:
2490         (API::LoaderClient::didFinishDocumentLoadForFrame): Added a navigationID parameter.
2491         * UIProcess/API/C/WKPage.cpp:
2492         (WKPageSetPageLoaderClient): Updated for the above change in paramerers.
2493         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
2494         * UIProcess/Cocoa/NavigationState.h: Declare override of didFinishDocumentLoadForFrame.
2495         * UIProcess/Cocoa/NavigationState.mm:
2496         (WebKit::NavigationState::setNavigationDelegate): Initialize
2497         webViewNavigationDidFinishDocumentLoad flag in the delegate methods struct.
2498         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Added override
2499         of the client function which calls the delegate.
2500         * UIProcess/WebPageProxy.cpp:
2501         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Get and pass the navigation ID to
2502         the client.
2503         * UIProcess/WebPageProxy.h: Added navigationID parameter.
2504         * UIProcess/WebPageProxy.messages.in: Ditto.
2505         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2506         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): Get and send the navigation
2507         ID to the UI process.
2508
2509 2014-04-18  Philippe Normand  <pnormand@igalia.com>
2510
2511         Remove NETWORK_INFO support
2512         https://bugs.webkit.org/show_bug.cgi?id=131841
2513
2514         Reviewed by Gyuyoung Kim.
2515
2516         * CMakeLists.txt:
2517         * PlatformEfl.cmake:
2518         * Shared/API/c/WKBase.h:
2519         * Shared/APIObject.h:
2520         * Shared/WebNetworkInfo.cpp: Removed.
2521         * Shared/WebNetworkInfo.h: Removed.
2522         * UIProcess/API/C/WKAPICast.h:
2523         * UIProcess/API/C/WKContext.cpp:
2524         (WKContextGetNetworkInfoManager): Deleted.
2525         * UIProcess/API/C/WKContext.h:
2526         * UIProcess/API/C/WKNetworkInfo.cpp: Removed.
2527         * UIProcess/API/C/WKNetworkInfo.h: Removed.
2528         * UIProcess/API/C/WKNetworkInfoManager.cpp: Removed.
2529         * UIProcess/API/C/WKNetworkInfoManager.h: Removed.
2530         * UIProcess/API/efl/ewk_context.cpp:
2531         (EwkContext::EwkContext):
2532         * UIProcess/API/efl/ewk_context_private.h:
2533         * UIProcess/WebContext.cpp:
2534         (WebKit::WebContext::WebContext):
2535         * UIProcess/WebContext.h:
2536         * UIProcess/WebNetworkInfoManagerProxy.cpp: Removed.
2537         * UIProcess/WebNetworkInfoManagerProxy.h: Removed.
2538         * UIProcess/WebNetworkInfoManagerProxy.messages.in: Removed.
2539         * UIProcess/WebNetworkInfoProvider.cpp: Removed.
2540         * UIProcess/WebNetworkInfoProvider.h: Removed.
2541         * UIProcess/efl/NetworkInfoProvider.cpp: Removed.
2542         * UIProcess/efl/NetworkInfoProvider.h: Removed.
2543         * WebProcess/NetworkInfo/WebNetworkInfoManager.cpp: Removed.
2544         * WebProcess/NetworkInfo/WebNetworkInfoManager.h: Removed.
2545         * WebProcess/NetworkInfo/WebNetworkInfoManager.messages.in: Removed.
2546         * WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp: Removed.
2547         * WebProcess/WebCoreSupport/WebNetworkInfoClient.h: Removed.
2548         * WebProcess/WebPage/WebPage.cpp:
2549         (WebKit::WebPage::WebPage):
2550         * WebProcess/WebProcess.cpp:
2551         (WebKit::WebProcess::WebProcess):
2552
2553 2014-04-17  Daniel Bates  <dabates@apple.com>
2554
2555         [iOS] Hook up screen.{availHeight, availWidth, height, width}
2556         https://bugs.webkit.org/show_bug.cgi?id=131821
2557         <rdar://problem/16413795>
2558
2559         Reviewed by Benjamin Poulain and Tim Horton.
2560
2561         Implement WebKit2-specific support infrastructure.
2562
2563         Additionally substitute "screenSize" for "viewporScreenSize" to make the code more understandable.
2564
2565         * Shared/WebPageCreationParameters.cpp:
2566         (WebKit::WebPageCreationParameters::encode): Modified to encode the available screen size
2567         creation parameter.
2568         (WebKit::WebPageCreationParameters::decode): Modified to decode the available screen size
2569         creation parameter.
2570         * Shared/WebPageCreationParameters.h:
2571         * UIProcess/WebPageProxy.cpp:
2572         (WebKit::WebPageProxy::creationParameters): Initialize the available screen size
2573         parameter.
2574         * UIProcess/WebPageProxy.h:
2575         * UIProcess/ios/WebPageProxyIOS.mm:
2576         (WebKit::WebPageProxy::screenSize): Renamed; formerly named viewportScreenSize.
2577         (WebKit::WebPageProxy::availableScreenSize): Added.
2578         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2579         (WebKit::WebChromeClient::screenSize): Renamed; formerly named viewportScreenSize.
2580         (WebKit::WebChromeClient::availableScreenSize): Added; turns around and calls WebPage::availableScreenSize().
2581         * WebProcess/WebCoreSupport/WebChromeClient.h:
2582         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2583         (InitWebCoreSystemInterface): Hook up WebKit System Interface function WKGetAvailableScreenSize.
2584         * WebProcess/WebPage/WebPage.cpp:
2585         (WebKit::WebPage::WebPage): Initialize available screen size instance variable.
2586         * WebProcess/WebPage/WebPage.h:
2587         * WebProcess/WebPage/ios/WebPageIOS.mm:
2588         (WebKit::WebPage::screenSize):
2589         (WebKit::WebPage::availableScreenSize):
2590
2591 2014-04-17  Anders Carlsson  <andersca@apple.com>
2592
2593         Remove unused API enums
2594         https://bugs.webkit.org/show_bug.cgi?id=131836
2595
2596         Reviewed by Tim Horton.
2597
2598         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2599         (NS_ENUM):
2600         * UIProcess/Cocoa/NavigationState.mm:
2601         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2602         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2603
2604 2014-04-17  Brent Fulgham  <bfulgham@apple.com>
2605
2606         Make RenderLayerBacking get the timingFunction of the correct animation.
2607         https://bugs.webkit.org/show_bug.cgi?id=100632
2608
2609         Reviewed by Simon Fraser.
2610
2611         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2612         (IPC::ArgumentCoder<GraphicsLayerAnimation>::decode): Update for new signatures for
2613         FloatAnimationValue, TransformAnimationValue, etc.
2614
2615 2014-04-17  Enrica Casucci  <enrica@apple.com>
2616
2617         [iOS WebKit2] support replacements for misspelled words.
2618         https://bugs.webkit.org/show_bug.cgi?id=131827
2619         <rdar://problem/16319657>
2620
2621         Reviewed by Benjamin Poulain.
2622
2623         This is the first part of the work to add support for replacements.
2624         It handles _promptForReplace in canPerformAction to decide
2625         whether to show the Replace button in the menu and add the
2626         implementation of the replace action.
2627
2628         * Shared/EditorState.cpp:
2629         (WebKit::EditorState::encode):
2630         (WebKit::EditorState::decode):
2631         * Shared/EditorState.h:
2632         (WebKit::EditorState::EditorState):
2633         * UIProcess/WebPageProxy.h:
2634         * UIProcess/ios/WKContentViewInteraction.mm:
2635         (-[WKContentView selectedText]):
2636         (-[WKContentView replaceText:withText:]):
2637         (-[WKContentView _promptForReplace:]):
2638         (-[WKContentView replace:]):
2639         (-[WKContentView canPerformAction:withSender:]):
2640         (-[WKContentView selectWordForReplacement]): This is called
2641         by UIKit when the user taps on a mispelled word to select it.
2642         * UIProcess/ios/WebPageProxyIOS.mm:
2643         (WebKit::WebPageProxy::replaceSelectedText):
2644         * WebProcess/WebPage/WebPage.cpp:
2645         (WebKit::WebPage::WebPage):
2646         (WebKit::WebPage::editorState):
2647         * WebProcess/WebPage/WebPage.h:
2648         * WebProcess/WebPage/WebPage.messages.in:
2649         * WebProcess/WebPage/ios/WebPageIOS.mm:
2650         (WebKit::WebPage::selectWithGesture): Removed m_shouldReturnWordForSelection.
2651         We now return always the word corresponding to the caret selection or
2652         the selected text up to a maximum of 200 characters.
2653         (WebKit::WebPage::extendSelection):
2654         (WebKit::WebPage::replaceSelectedText):
2655
2656 2014-04-17  Tim Horton  <timothy_horton@apple.com>
2657
2658         [iOS] REGRESSION (r166975): WKPDFView is broken
2659         https://bugs.webkit.org/show_bug.cgi?id=131828
2660
2661         Reviewed by Simon Fraser.
2662
2663         * UIProcess/API/Cocoa/WKWebView.mm:
2664         (-[WKWebView _didCommitLayerTree:WebKit::]):
2665         Bail from updating the scroll view parameters from the layer tree update
2666         while it's being managed by a custom content view.
2667         We'll get any changes again in the next commit after removing the custom
2668         content view (and painting the new page) anyway, so this should be OK.
2669
2670 2014-04-17  Pratik Solanki  <psolanki@apple.com>
2671
2672         _webProcessIdentifier should return 0 if the web process crashed
2673         https://bugs.webkit.org/show_bug.cgi?id=131813
2674         <rdar://problem/16650605>
2675
2676         Reviewed by Anders Carlsson.
2677
2678         * UIProcess/API/Cocoa/WKWebView.mm:
2679         (-[WKWebView _hasWebProcess]):
2680         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2681
2682 2014-04-17  Darin Adler  <darin@apple.com>
2683
2684         Remove use of deprecatedDeleteAllValues in NPRemoteObjectMap::pluginDestroyed
2685         https://bugs.webkit.org/show_bug.cgi?id=122496
2686
2687         Reviewed by Brent Fulgham.
2688
2689         * Shared/Plugins/NPRemoteObjectMap.cpp:
2690         (WebKit::NPRemoteObjectMap::pluginDestroyed): Use new-style code and write the
2691         deprecatedDeleteAllValues function out using a loop. Might be nice to return here
2692         and use unique_ptr instead some day, but I tried that before and got it wrong, so
2693         lets do that another time.
2694
2695 2014-04-17  Darin Adler  <darin@apple.com>
2696
2697         Add separate flag for IndexedDatabase in workers since the current implementation is not threadsafe
2698         https://bugs.webkit.org/show_bug.cgi?id=131785
2699         rdar://problem/16003108
2700
2701         Reviewed by Brady Eidson.
2702
2703         * Configurations/FeatureDefines.xcconfig: Added INDEXED_DATABASE_IN_WORKERS.
2704
2705 2014-04-17  Dan Bernstein  <mitz@apple.com>
2706
2707         WebKit2 part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
2708         https://bugs.webkit.org/show_bug.cgi?id=131783
2709
2710         Reviewed by Tim Horton.
2711
2712         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2713         (WebKit::WebChromeClient::createWindow): Set the isProcessingUserGesture field of
2714         the NavigationActionData to the corresponding value in the NavigationAction.
2715         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2716         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
2717         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
2718
2719 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2720
2721         [iOS][WK2] Fix the DidCommitLoad initial scrolling position
2722         https://bugs.webkit.org/show_bug.cgi?id=131780
2723
2724         Reviewed by Jon Honeycutt.
2725
2726         * UIProcess/API/Cocoa/WKWebView.mm:
2727         (-[WKWebView _didCommitLayerTree:]):
2728         That code is older than _obscuredInsets and used the contentInsets as a workaround.
2729
2730 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2731
2732         [iOS][WK2] Fix annoying scrolling bugs
2733         https://bugs.webkit.org/show_bug.cgi?id=131722
2734
2735         Reviewed by Simon Fraser.
2736
2737         * UIProcess/API/Cocoa/WKWebView.mm:
2738         (-[WKWebView _scrollToContentOffset:WebCore::]):
2739         We are scrolling at the wrong position when we have the "small obscured insets".
2740
2741 2014-04-16  Gavin Barraclough  <baraclough@apple.com>
2742
2743         On iOS keep network process running using a process assertion rather than a boost
2744         https://bugs.webkit.org/show_bug.cgi?id=131779
2745
2746         Reviewed by Benjamin Poulain.
2747
2748         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2749         (WebKit::connectToService):
2750             - No need to leak a boost onto the NetworkProcess on iOS.
2751         * UIProcess/Network/NetworkProcessProxy.cpp:
2752         (WebKit::NetworkProcessProxy::didFinishLaunching):
2753             - Take a ProcessAssertion on the NetworkProcess.
2754         * UIProcess/Shared/ChildProcessProxy.h:
2755             - Added m_assertion.
2756         * UIProcess/WebProcessProxy.h:
2757             - Removed m_assertion.
2758         * UIProcess/ios/ProcessAssertion.h: Added.
2759             - Added - refactored from WebProcessProxy.h.
2760         * UIProcess/ios/ProcessAssertion.mm: Added.
2761         (WebKit::ProcessAssertion::ProcessAssertion):
2762         (WebKit::ProcessAssertion::setState):
2763             - Added - refactored from WebProcessProxyIOS.mm.
2764         * UIProcess/ios/WebProcessProxyIOS.mm:
2765         (WebKit::WebProcessProxy::updateProcessState):
2766             - Code refactored out to ProcessAssertion.mm.
2767         * WebKit2.xcodeproj/project.pbxproj:
2768             - Added files.
2769
2770 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2771
2772         [iOS][WK2] Improve the approximation of the scroll position of the dynamic viewport size updates
2773         https://bugs.webkit.org/show_bug.cgi?id=131720
2774
2775         Reviewed by Tim Horton.
2776
2777         * UIProcess/API/Cocoa/WKWebView.mm:
2778         (-[WKWebView _scrollToContentOffset:]):
2779         The scrolling tree was forcing scroll at the wrong scale during the transition. 
2780
2781         (-[WKWebView _setMinimumLayoutSizeOverride:]):
2782         This was left out by accident. The WebProcess was getting the new layout size twice, making
2783         WebPage::dynamicViewportSizeUpdate() very confused when the content size changes.
2784
2785         * WebProcess/WebPage/ios/WebPageIOS.mm:
2786         (WebKit::WebPage::dynamicViewportSizeUpdate):
2787         Add scrolling adjustment for the dynamic relayout case:
2788         -Sticky top and bottom like the UIProcess.
2789         -Keep the same relative position of the unobscured rect's center.
2790
2791         Also fix a bug in the horizontal and vertical adjustments: the code was using the exposed rect
2792         instead of the unobscured rect, which made the adjustments off by the size of the obscured insets.
2793
2794         The type is changed from double to float since ARMv7 has a grudge against double.
2795
2796 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2797
2798         [iOS][WK2] Do not update the visible content rects when setting the same obscured insets multiple times
2799         https://bugs.webkit.org/show_bug.cgi?id=131633
2800
2801         Reviewed by Darin Adler.
2802
2803         We should avoid computing the visible content rects when not needed.
2804
2805         * UIProcess/API/Cocoa/WKWebView.mm:
2806         (-[WKWebView _setObscuredInsets:]):
2807
2808 2014-04-16  Zan Dobersek  <zdobersek@igalia.com>
2809
2810         Make IPC::Arguments a variadic template
2811         https://bugs.webkit.org/show_bug.cgi?id=131684
2812
2813         Reviewed by Darin Adler.
2814
2815         Make IPC::Arguments a variadic template that uses the template parameter pack to further
2816         define the std::tuple ValueType and is used to define the std::tuple container of the
2817         values passed into the container.
2818
2819         * Platform/IPC/Arguments.h:
2820         (IPC::Arguments::Arguments):
2821         (IPC::Arguments::encode):
2822         (IPC::Arguments::decode):
2823         (IPC::Arguments0::encode): Deleted.
2824         (IPC::Arguments0::decode): Deleted.
2825         (IPC::Arguments1::Arguments1): Deleted.
2826         (IPC::Arguments1::encode): Deleted.
2827         (IPC::Arguments1::decode): Deleted.
2828         (IPC::Arguments2::Arguments2): Deleted.
2829         (IPC::Arguments2::encode): Deleted.
2830         (IPC::Arguments2::decode): Deleted.
2831         (IPC::Arguments3::Arguments3): Deleted.
2832         (IPC::Arguments3::encode): Deleted.
2833         (IPC::Arguments3::decode): Deleted.
2834         (IPC::Arguments4::Arguments4): Deleted.
2835         (IPC::Arguments4::encode): Deleted.
2836         (IPC::Arguments4::decode): Deleted.
2837         (IPC::Arguments5::Arguments5): Deleted.
2838         (IPC::Arguments5::encode): Deleted.
2839         (IPC::Arguments5::decode): Deleted.
2840         (IPC::Arguments6::Arguments6): Deleted.
2841         (IPC::Arguments6::encode): Deleted.
2842         (IPC::Arguments6::decode): Deleted.
2843         (IPC::Arguments7::Arguments7): Deleted.
2844         (IPC::Arguments7::encode): Deleted.
2845         (IPC::Arguments7::decode): Deleted.
2846         (IPC::Arguments8::Arguments8): Deleted.
2847         (IPC::Arguments8::encode): Deleted.
2848         (IPC::Arguments8::decode): Deleted.
2849         (IPC::Arguments10::Arguments10): Deleted.
2850         (IPC::Arguments10::encode): Deleted.
2851         (IPC::Arguments10::decode): Deleted.
2852         * Scripts/webkit2/LegacyMessages-expected.h:
2853         * Scripts/webkit2/Messages-expected.h:
2854         * Scripts/webkit2/messages.py: Clean up the code a bit.
2855         (reply_parameter_type):
2856         (arguments_type):
2857         (reply_type):
2858         (decode_type):
2859         (arguments_type_old): Deleted.
2860         (base_class): Deleted.
2861         (delayed_reply_type): Deleted.
2862
2863 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2864
2865         Deduplicate LayerTreeContext
2866         https://bugs.webkit.org/show_bug.cgi?id=131773
2867
2868         Reviewed by Simon Fraser.
2869
2870         There are three identical implementations, one for each platform, for no reason.
2871
2872         * CMakeLists.txt:
2873         * PlatformEfl.cmake:
2874         * PlatformGTK.cmake:
2875         * Shared/LayerTreeContext.cpp: Renamed from Source/WebKit2/Shared/mac/LayerTreeContextMac.mm.
2876         (WebKit::LayerTreeContext::LayerTreeContext):
2877         (WebKit::LayerTreeContext::~LayerTreeContext):
2878         (WebKit::LayerTreeContext::encode):
2879         (WebKit::LayerTreeContext::decode):
2880         (WebKit::LayerTreeContext::isEmpty):
2881         (WebKit::operator==):
2882         * Shared/LayerTreeContext.h:
2883         (WebKit::operator!=): Deleted.
2884         * Shared/efl/LayerTreeContextEfl.cpp: Removed.
2885         * Shared/gtk/LayerTreeContextGtk.cpp: Removed.
2886         * WebKit2.xcodeproj/project.pbxproj:
2887         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2888         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2889         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2890         (WebKit::LayerTreeHostGtk::initialize):
2891
2892 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2893
2894         Don't build LayerTreeHost on Mac (and clean it up)
2895         https://bugs.webkit.org/show_bug.cgi?id=131769
2896
2897         Reviewed by Simon Fraser.
2898
2899         * WebKit2.xcodeproj/project.pbxproj:
2900         Don't include it in the project.
2901
2902         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2903         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2904         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2905         (WebKit::CoordinatedDrawingArea::updatePreferences):
2906         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2907         (WebKit::DrawingAreaImpl::updatePreferences):
2908         * WebProcess/WebPage/LayerTreeHost.h:
2909         (WebKit::LayerTreeHost::setLayerHostingMode): Deleted.
2910         (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Deleted.
2911         * WebProcess/WebPage/WebPage.cpp:
2912         (WebKit::WebPage::updatePreferences):
2913         * WebProcess/WebPage/ios/WebPageIOS.mm:
2914         Get rid of LayerTreeHost::supportsAcceleratedCompositing, which always returns true everywhere.
2915         Remove some LayerTreeHost.h includes.
2916         Remove LayerTreeHost::setLayerHostingMode, which is PLATFORM(COCOA) and not needed.
2917
2918 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
2919
2920         Failing to decode a layer tree commit message resulted in silent and mysterious failure
2921         https://bugs.webkit.org/show_bug.cgi?id=131766
2922         <rdar://problem/16520894>
2923
2924         Reviewed by Sam Weinig.
2925         
2926         If the message decode failed, we should have already marked the message as invalid.
2927         Failing to do so indicates in a decode code coding error.
2928
2929         * Platform/IPC/HandleMessage.h:
2930         (IPC::handleMessage):
2931         (IPC::handleMessageVariadic):
2932         (IPC::handleMessageDelayed):
2933
2934 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2935
2936         Minor include sanity in WebPage.h
2937         https://bugs.webkit.org/show_bug.cgi?id=131752
2938
2939         Reviewed by Simon Fraser.
2940
2941         * WebProcess/WebPage/WebPage.h:
2942         Remove a bunch of unnecessary includes.
2943         Un-indent some stuff.
2944
2945         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2946         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2947         * WebProcess/WebPage/FindController.cpp:
2948         * WebProcess/WebPage/WebPage.cpp:
2949         * WebProcess/WebPage/mac/WebPageMac.mm:
2950         Add back more specific includes, into implementation files.
2951         
2952         * WebProcess/WebPage/WebUndoStep.cpp:
2953         (WebKit::WebUndoStep::~WebUndoStep):
2954         * WebProcess/WebPage/WebUndoStep.h:
2955         Add an out-of-line destructor.
2956
2957 2014-04-16  Gavin Barraclough  <baraclough@apple.com>
2958
2959         REGRESSION: PCE.js is 20x slower in WebKit2 because timers are throttled
2960         https://bugs.webkit.org/show_bug.cgi?id=131189
2961
2962         Unreviewed rollout of r166754
2963
2964         This change is no longer necessary.
2965
2966         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2967         (WebKit::connectToService):
2968
2969 2014-04-16  Alexey Proskuryakov  <ap@apple.com>
2970
2971         Updating tests after bug 131721, [GTK] Fix unused parameter warnings.
2972
2973         * Scripts/webkit2/LegacyMessageReceiver-expected.cpp:
2974         (WebKit::WebPage::didReceiveWebPageMessage):
2975         (WebKit::WebPage::didReceiveSyncWebPageMessage):
2976         * Scripts/webkit2/MessageReceiver-expected.cpp:
2977         (WebKit::WebPage::didReceiveMessage):
2978         (WebKit::WebPage::didReceiveSyncMessage):
2979
2980 2014-04-16  Brendan Long  <b.long@cablelabs.com>
2981
2982         [GTK] Fix unused parameter warnings
2983         https://bugs.webkit.org/show_bug.cgi?id=131721
2984
2985         Reviewed by Darin Adler.
2986
2987         * Scripts/webkit2/messages.py:
2988         (generate_message_handler): Add UNUSED_PARAM() for a couple parameters which aren't always used.
2989         * Shared/WebCoreArgumentCoders.cpp:
2990         (IPC::ArgumentCoder<LinearTimingFunction>::decode): Remove unused parameters.
2991         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
2992         (API::InjectedBundle::FormClient::textDidChangeInTextField): Same.
2993         (API::InjectedBundle::FormClient::willSubmitForm): Same.
2994         (API::InjectedBundle::FormClient::willSendSubmitEvent): Same.
2995         * WebProcess/Network/NetworkProcessConnection.cpp:
2996         (WebKit::NetworkProcessConnection::didReceiveSyncMessage): Same.
2997
2998 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2999
3000         Accidentally included some style-checker-testing changes in the last commit.
3001
3002         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3003         (WebKit::PDFPlugin::attemptToUnlockPDF):
3004         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
3005
3006 2014-04-16  Tim Horton  <timothy_horton@apple.com>
3007
3008         Fix some style checker complaints in PDFPlugin
3009         https://bugs.webkit.org/show_bug.cgi?id=131706
3010
3011         Reviewed by Darin Adler.
3012
3013         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3014         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
3015         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:forParameter:]):
3016         (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
3017         (WebKit::PDFPlugin::attemptToUnlockPDF):
3018         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
3019         (WebKit::PDFPlugin::isEditingCommandEnabled):
3020         (WebKit::PDFPlugin::nextMatchForString):
3021         (WebKit::PDFPlugin::handleWheelEvent):
3022         (WebKit::PDFPlugin::liveData):
3023
3024 2014-04-15  Dan Bernstein  <mitz@apple.com>
3025
3026         [Cocoa] Add a form delegate method corresponding to willSubmitForm
3027         https://bugs.webkit.org/show_bug.cgi?id=131718
3028
3029         Reviewed by Tim Horton.
3030
3031         * UIProcess/API/Cocoa/WKWebView.mm:
3032         (-[WKWebView _setFormDelegate:]): Changed to define and create a FormClient (which derives
3033         from API::FormClient and messages a delegate), and set it as the form client.
3034
3035         * UIProcess/API/Cocoa/_WKFormDelegate.h: Declared new delegate method.
3036
3037         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added a
3038         variant of willSubmitForm that returs a user object to pass to the delegate in the UI
3039         process, giving it a temporary name with “new”.
3040
3041         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3042         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Changed willSubmitForm()
3043         to check for the new bundle delegate method first and encode the user object as user data.
3044         Moved the encoding of an NSObject <NSSecureCoding> as user data into a helper function.
3045
3046 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
3047
3048         Make page overlay functionality working on coordinated graphics.
3049         https://bugs.webkit.org/show_bug.cgi?id=131425
3050
3051         Reviewed by Darin Adler.
3052
3053         Page overlay functionality did not work on coordinated graphics since r166975.
3054         This patch removes deprecated code related to the PageOverlay GraphicsLayer management.
3055         and makes CoordinatedLayerTreeHost use PageOverlayController.
3056
3057         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
3058         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged):
3059         (WebKit::CoordinatedDrawingArea::didInstallPageOverlay): Deleted.
3060         (WebKit::CoordinatedDrawingArea::didUninstallPageOverlay): Deleted.
3061         (WebKit::CoordinatedDrawingArea::setPageOverlayNeedsDisplay): Deleted.
3062         (WebKit::CoordinatedDrawingArea::setPageOverlayOpacity): Deleted.
3063         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
3064         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3065         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
3066         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
3067         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
3068         (WebKit::CoordinatedLayerTreeHost::didInstallPageOverlay): Deleted.
3069         (WebKit::CoordinatedLayerTreeHost::didUninstallPageOverlay): Deleted.
3070         (WebKit::CoordinatedLayerTreeHost::setPageOverlayNeedsDisplay): Deleted.
3071         (WebKit::CoordinatedLayerTreeHost::setPageOverlayOpacity): Deleted.
3072         (WebKit::CoordinatedLayerTreeHost::createPageOverlayLayer): Deleted.
3073         (WebKit::CoordinatedLayerTreeHost::destroyPageOverlayLayer): Deleted.
3074         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3075         * WebProcess/WebPage/LayerTreeHost.h:
3076         (WebKit::LayerTreeHost::didInstallPageOverlay):
3077         (WebKit::LayerTreeHost::didUninstallPageOverlay):
3078         (WebKit::LayerTreeHost::setPageOverlayNeedsDisplay):
3079
3080 2014-04-15  Dan Bernstein  <mitz@apple.com>
3081
3082         Introduce API::FormClient
3083         https://bugs.webkit.org/show_bug.cgi?id=131714
3084
3085         Reviewed by Tim Horton.
3086
3087         * UIProcess/API/APIFormClient.h: Added.
3088         (API::FormClient::~FormClient):
3089         (API::FormClient::willSubmitForm):
3090
3091         * UIProcess/API/C/WKPage.cpp:
3092         (WKPageSetPageFormClient): Changed to create a WebFormClient and call
3093         WebPageProxy::setFormClient.
3094
3095         * UIProcess/WebFormClient.cpp:
3096         (WebKit::WebFormClient::WebFormClient): Added a constructor from WKPageFormClientBase.
3097         * UIProcess/WebFormClient.h: Added inheritance from API::FormClient, marked overrides as
3098         such.
3099
3100         * UIProcess/WebPageProxy.cpp:
3101         (WebKit::WebPageProxy::WebPageProxy): Initialize m_formClient member.
3102         (WebKit::WebPageProxy::setFormClient): Added. Updates m_formClient.
3103         (WebKit::WebPageProxy::close): Updated code to clear m_formClient.
3104         (WebKit::WebPageProxy::willSubmitForm): Updated for type change.
3105         (WebKit::WebPageProxy::initializeFormClient): Deleted.
3106         * UIProcess/WebPageProxy.h:
3107
3108         * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
3109
3110 2014-04-15  Simon Fraser  <simon.fraser@apple.com>
3111
3112         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
3113         https://bugs.webkit.org/show_bug.cgi?id=131665
3114
3115         Reviewed by Tim Horton.
3116
3117         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
3118         was triggering a compositing layer flush when called with a null rootLayer, which happens
3119         for pages going into the page cache. This would trigger a layer flush that would clobber
3120         the root layer for the visible page, resulting in missing content.
3121         
3122         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
3123         was being added to (and then removed from) every single compositing layers.
3124         
3125         Fix both these by changing to a pull model, where RenderLayerCompositor requests
3126         the overlay layer via ChromeClient, and gets it at the end of every flush,
3127         adding to the children of the root layer.
3128
3129         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3130         (WebKit::WebChromeClient::documentOverlayLayerForFrame):
3131         * WebProcess/WebCoreSupport/WebChromeClient.h:
3132         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3133         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
3134
3135 2014-04-15  Jinwoo Song  <jinwoo7.song@samsung.com>
3136
3137         [EFL][WK2] Pass Mouse movement data to WebMouseEvent
3138         https://bugs.webkit.org/show_bug.cgi?id=131663
3139
3140         Reviewed by Gyuyoung Kim.
3141
3142         Currently mouse movement data are not passed to WebMouseEvent. Instead, they are set to 0 as default.
3143         EFL port needs to send the deltaX and deltaY for PointerLock API which will be implemented later.
3144
3145         * Shared/efl/WebEventFactory.cpp:
3146         (WebKit::WebEventFactory::createWebMouseEvent):
3147
3148 2014-04-15  Commit Queue  <commit-queue@webkit.org>
3149
3150         Unreviewed, rolling out r167298.
3151         https://bugs.webkit.org/show_bug.cgi?id=131670
3152
3153         Broke CSS filters (17 test crashes) (Requested by ap on
3154         #webkit).
3155
3156         Reverted changeset:
3157
3158         "[iOS WK2] Pages often blank on first load if page loaded by
3159         typing the URL"
3160         https://bugs.webkit.org/show_bug.cgi?id=131665
3161         http://trac.webkit.org/changeset/167298
3162
3163 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3164
3165         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
3166         https://bugs.webkit.org/show_bug.cgi?id=131665
3167
3168         Reviewed by Tim Horton.
3169
3170         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
3171         was triggering a compositing layer flush when called with a null rootLayer, which happens
3172         for pages going into the page cache. This would trigger a layer flush that would clobber
3173         the root layer for the visible page, resulting in missing content.
3174         
3175         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
3176         was being added to (and then removed from) every single compositing layers.
3177         
3178         Fix both these by changing to a pull model, where RenderLayerCompositor requests
3179         the overlay layer via ChromeClient, and gets it at the end of every flush,
3180         adding to the children of the root layer.
3181
3182         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3183         (WebKit::WebChromeClient::documentOverlayLayerForFrame):
3184         * WebProcess/WebCoreSupport/WebChromeClient.h:
3185         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3186         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
3187
3188 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3189
3190         Fix the 32-bit build.
3191
3192         * UIProcess/mac/ViewGestureControllerMac.mm:
3193
3194 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3195
3196         REGRESSION (WebKit2): Programmatic scrolls in overflow-scrolling:touch don't work
3197         https://bugs.webkit.org/show_bug.cgi?id=131649
3198
3199         Reviewed by Tim Horton.
3200         
3201         Update the UIScrollView's contentOffset when we're told that the scroll position
3202         changed.
3203         
3204         Also refactor slightly to have a single exception-protected block.
3205
3206         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3207         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
3208
3209 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3210
3211         Fix the 32-bit build.
3212
3213         * UIProcess/mac/ViewGestureControllerMac.mm:
3214
3215 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3216
3217         Sometimes-crash under handleSwipeGesture after closing a window or quitting
3218         https://bugs.webkit.org/show_bug.cgi?id=131648
3219         <rdar://problem/15966106>
3220
3221         Reviewed by Simon Fraser.
3222
3223         * UIProcess/mac/ViewGestureController.h:
3224         * UIProcess/mac/ViewGestureControllerMac.mm:
3225         (WebKit::ViewGestureController::~ViewGestureController):
3226         (WebKit::ViewGestureController::trackSwipeGesture):
3227         Keep a Objective C object with a single boolean property, isCancelled, on
3228         the ViewGestureController, and also retained by the swipe-tracking block.
3229         When the ViewGestureController is destroyed, we set isCancelled to YES,
3230         and the next time the block is invoked, we will cancel the swipe without
3231         touching the destroyed ViewGestureController.
3232
3233         (WebKit::ViewGestureController::handleSwipeGesture):
3234         Don't try to handle a swipe gesture if the drawing area is missing.
3235
3236         (WebKit::ViewGestureController::endSwipeGesture):
3237         Clear the swipe cancellation tracker when the gesture completes.
3238
3239 2014-04-14  Enrica Casucci  <enrica@apple.com>
3240
3241         REGRESSION(r166027) Menu is shown and immediately hidden after doubletap gesture.
3242         https://bugs.webkit.org/show_bug.cgi?id=131646
3243         <rdar://problem/16614374>
3244
3245         Reviewed by Benjamin Poulain.
3246
3247         This is a problem with every gesture that changes the selection
3248         We don't need to delay updating the selection if the selection is
3249         being changed with a gesture.
3250
3251         * UIProcess/ios/WKContentViewInteraction.h:
3252         * UIProcess/ios/WKContentViewInteraction.mm:
3253         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]):
3254         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
3255         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
3256         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
3257         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
3258         (-[WKContentView _selectionChanged]):
3259
3260 2014-04-14  Dan Bernstein  <mitz@apple.com>
3261
3262         Let the bundle form client know whether a change in a text field was initiated by user typing
3263         https://bugs.webkit.org/show_bug.cgi?id=131643
3264
3265         Reviewed by Sam Weinig.
3266
3267         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added
3268         initiatedByUserTyping parameter to the delegate method.
3269
3270         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3271         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Updated overload of
3272         textDidChangeInTextField to take the initiatedByUserTyping parameter and pass it along to
3273         the delegate.
3274
3275         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
3276         (API::InjectedBundle::FormClient::textDidChangeInTextField): Added initiatedByUserTyping
3277         parameter.
3278
3279         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
3280         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField): Maintained the existing
3281         behavior of not calling the C SPI client if the change was not initiated by user typing.
3282         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Updated for added parameter.
3283
3284         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3285         (WebKit::WebEditorClient::textDidChangeInTextField): Changed to call the bundle client
3286         function unconditionally, but pass along whether the change was initiated by user typing.
3287
3288 2014-04-14  Dan Bernstein  <mitz@apple.com>
3289
3290         [Cocoa] Add a WKWebProcessPlugInFormDelegate method corresponding to willSendSubmitEvent
3291         https://bugs.webkit.org/show_bug.cgi?id=131639
3292
3293         Reviewed by Tim Horton.
3294
3295         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared
3296         new delegate method.
3297         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3298         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added an override
3299         of API::InjectedBundle::FormClient::willSendSubmitEvent which calls the new delegate
3300         method.
3301
3302 2014-04-14  Benjamin Poulain  <bpoulain@apple.com>
3303
3304         [iOS][WK2] Change the SPI used when starting the rotation animation
3305         https://bugs.webkit.org/show_bug.cgi?id=131638
3306
3307         Reviewed by Tim Horton.
3308
3309         Having an update block where all the properties are changed is more convenient for Safari.
3310
3311         * UIProcess/API/Cocoa/WKWebView.mm:
3312         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3313         (-[WKWebView _beginAnimatedResizeToSize:obscuredInsets:minimumLayoutSizeOverride:]): Deleted.
3314         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3315
3316 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3317
3318         [iOS WK2] Hash table assertion closing a tab
3319         https://bugs.webkit.org/show_bug.cgi?id=131640
3320
3321         Reviewed by Tim Horton.
3322         
3323         Have RemoteLayerTreeContext keep track of all PlatformCALayerRemotes,
3324         and clear their context pointer when it is being destroyed to avoid
3325         calling into a deleted object later.
3326
3327         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3328         (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
3329         (WebKit::PlatformCALayerRemote::addAnimationForKey):
3330         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3331         (WebKit::PlatformCALayerRemote::clearContext):
3332         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
3333         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3334         (WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
3335         (WebKit::RemoteLayerTreeContext::layerWasCreated):
3336         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
3337
3338 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3339
3340         Allow dynamic changes of WKThumbnailView snapshot scale
3341         https://bugs.webkit.org/show_bug.cgi?id=131628
3342         <rdar://problem/16584156>
3343
3344         Reviewed by Beth Dakin.
3345
3346         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
3347         (-[_WKThumbnailView _requestSnapshotIfNeeded]):
3348         Don't bail from requesting a snapshot just because we already had one; we want to resnapshot.
3349         Keep track of when we bail from requesting a snapshot because we have one in-flight, so we can request it later.
3350
3351         (-[_WKThumbnailView _didTakeSnapshot:]):
3352         Apply the scale to the bitmap size (whoops!).
3353         Make CA always resize the content to fill the thumbnail view's layer, respecting aspect ratio.
3354         Re-snapshot if we previously deferred a snapshot.
3355
3356         (-[_WKThumbnailView setScale:]):
3357         If we get a scale change, request a new snapshot.
3358
3359         (-[_WKThumbnailView setUsesSnapshot:]):
3360         Never apply thumbnail scale to the page if we're using snapshots. It's unnecessary,
3361         because scale will be applied simply when painting the software snapshot.
3362         Apply the thumbnail scale if we're going from usesSnapshot -> !usesSnapshot.
3363
3364         * WebProcess/WebPage/WebPage.cpp:
3365         (WebKit::WebPage::snapshotAtSize):
3366         Snapshots should use the greater of the two scales, so as to never leave a portion of the snapshot unpainted.
3367
3368 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3369
3370         REGRESSION (WebKit2 View Gestures): Double-tap doesn't work properly when there's no element underneath the cursor
3371         https://bugs.webkit.org/show_bug.cgi?id=131629
3372         <rdar://problem/16192821>
3373
3374         Reviewed by Dan Bernstein.
3375
3376         * UIProcess/mac/ViewGestureControllerMac.mm:
3377         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
3378         If there's nothing under the cursor, zoom towards the cursor instead of towards 0,0.
3379
3380 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3381
3382         Run filter animations in the UI process with UI-side compositing
3383         https://bugs.webkit.org/show_bug.cgi?id=131199
3384         <rdar://problem/16479487>
3385
3386         Reviewed by Sam Weinig.
3387         
3388         * Shared/WebCoreArgumentCoders.cpp: Removed lots of WebCore::
3389         (IPC::ArgumentCoder<SelectionRect>::decode):
3390         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
3391         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
3392         (IPC::ArgumentCoder<PasteboardImage>::encode):
3393         (IPC::ArgumentCoder<PasteboardImage>::decode):
3394         (IPC::ArgumentCoder<URL>::decode):
3395         (IPC::ArgumentCoder<UserStyleSheet>::encode):
3396         (IPC::ArgumentCoder<UserStyleSheet>::decode):
3397         (IPC::ArgumentCoder<UserScript>::encode):
3398         (IPC::ArgumentCoder<UserScript>::decode):
3399         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
3400         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
3401         (IPC::ArgumentCoder<FixedPositionViewportConstraints>::encode):
3402         (IPC::ArgumentCoder<FixedPositionViewportConstraints>::decode):
3403         (IPC::ArgumentCoder<StickyPositionViewportConstraints>::encode):
3404         (IPC::ArgumentCoder<StickyPositionViewportConstraints>::decode):
3405         (IPC::ArgumentCoder<FilterOperation>::encode):
3406         (IPC::decodeFilterOperation):
3407         (IPC::ArgumentCoder<FilterOperations>::encode):
3408         (IPC::ArgumentCoder<WebCore::UserStyleSheet>::encode): Deleted.
3409         (IPC::ArgumentCoder<WebCore::UserStyleSheet>::decode): Deleted.
3410         (IPC::ArgumentCoder<WebCore::UserScript>::encode): Deleted.
3411         (IPC::ArgumentCoder<WebCore::UserScript>::decode): Deleted.
3412         (IPC::ArgumentCoder<WebCore::ScrollableAreaParameters>::encode): Deleted.
3413         (IPC::ArgumentCoder<WebCore::ScrollableAreaParameters>::decode): Deleted.
3414         (IPC::ArgumentCoder<WebCore::FixedPositionViewportConstraints>::encode): Deleted.
3415         (IPC::ArgumentCoder<WebCore::FixedPositionViewportConstraints>::decode): Deleted.
3416         (IPC::ArgumentCoder<WebCore::StickyPositionViewportConstraints>::encode): Deleted.
3417         (IPC::ArgumentCoder<WebCore::StickyPositionViewportConstraints>::decode): Deleted.
3418         (IPC::encodeFilterOperation): Deleted.
3419         Add encoding/decoding support for FilterOperation.
3420         decodeFilterOperation() has to be a bare function because of the RefPtr
3421         out parameter.
3422         REFERENCE filters should never be encoded, since they have CachedSVGDocumentReferences.
3423
3424         * Shared/WebCoreArgumentCoders.h:
3425
3426         * Shared/mac/RemoteLayerTreeTransaction.mm:
3427         (WebKit::RemoteLayerTreeTextStream::operator<<):
3428         Add logging for filter animations to the RemoteLayerTree log output.
3429
3430         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
3431         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
3432         (WebKit::GraphicsLayerCARemote::addAnimation): Deleted. We can run
3433         filter animations now.
3434
3435         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
3436         KeyValues have a RefPtr<WebCore::FilterOperation> now (which can't be part of
3437         the union because we need its constructor to get called).
3438         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3439         (WebKit::PlatformCAAnimationRemote::KeyframeValue::encode): Encode the filter.
3440         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode): Decode the filter.
3441         (WebKit::PlatformCAAnimationRemote::setFromValue): Implement.
3442         (WebKit::PlatformCAAnimationRemote::setToValue): Implement.
3443         (WebKit::PlatformCAAnimationRemote::setValues): Implement.
3444         (WebKit::animationValueFromKeyframeValue): Handle filters.
3445
3446 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3447
3448         Fix the build.
3449
3450         * UIProcess/mac/PageClientImpl.h:
3451
3452 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3453
3454         [WK2 iOS] Scrolling to anchor links is broken
3455         https://bugs.webkit.org/show_bug.cgi?id=131618
3456         <rdar://problem/16599144>
3457
3458         Reviewed by Tim Horton.
3459         
3460         The RemoteScrollingTree implements scrollingTreeNodeRequestsScroll
3461         to get informed about requested scroll position updates, and passes
3462         them along via the RemoteScrollingCoordinatorProxy, WebPageProxy and PageClient
3463         to the WKWebView, which performs a scroll.
3464
3465         * UIProcess/API/Cocoa/WKWebView.mm:
3466         (-[WKWebView _scrollToContentOffset:WebCore::]): Scroll to content offset,
3467         taking page scale and insets into account.
3468         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3469         * UIProcess/CoordinatedGraphics/WebView.cpp:
3470         (WebKit::WebView::requestScroll):
3471         * UIProcess/CoordinatedGraphics/WebView.h:
3472         * UIProcess/PageClient.h:
3473         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3474         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll):
3475         Pass scrolls along to the WebPageProxy for the root node. We will also need
3476         to handle programmatic scrolls for overflow soon.
3477         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3478         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3479         (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll):
3480         * UIProcess/Scrolling/RemoteScrollingTree.h:
3481         * UIProcess/WebPageProxy.cpp:
3482         (WebKit::WebPageProxy::requestScroll):
3483         * UIProcess/WebPageProxy.h:
3484         * UIProcess/ios/PageClientImplIOS.h:
3485         * UIProcess/ios/PageClientImplIOS.mm:
3486         (WebKit::PageClientImpl::canScrollView):
3487         (WebKit::PageClientImpl::requestScroll):
3488         * UIProcess/mac/PageClientImpl.mm:
3489         (WebKit::PageClientImpl::requestScroll):
3490
3491 2014-04-12  Antti Koivisto  <antti@apple.com>
3492
3493         Keep secondary tile grid for zoomed-out scale
3494         https://bugs.webkit.org/show_bug.cgi?id=131586
3495
3496         Reviewed by Darin Adler.
3497
3498         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
3499         (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
3500         (WebKit::PlatformCALayerRemoteTiledBacking::customSublayers):
3501         
3502             Always request new sublayer list from tile controller.
3503
3504         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
3505
3506 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3507
3508         Make WK(Web)View magnification setters actually use view-relative positions
3509         https://bugs.webkit.org/show_bug.cgi?id=131611
3510         <rdar://problem/15965239>
3511
3512         Reviewed by Darin Adler.
3513
3514         * UIProcess/API/mac/WKView.mm:
3515         (-[WKView setMagnification:centeredAtPoint:]):
3516         (-[WKView setMagnification:]):
3517         Use scalePageInViewCoordinates instead.
3518
3519         * UIProcess/WebPageProxy.cpp:
3520         (WebKit::WebPageProxy::scalePageInViewCoordinates):
3521         * UIProcess/WebPageProxy.h:
3522         * WebProcess/WebPage/WebPage.cpp:
3523         (WebKit::WebPage::scalePageInViewCoordinates):
3524         (WebKit::WebPage::pageScaleFactor):
3525         * WebProcess/WebPage/WebPage.h:
3526         * WebProcess/WebPage/WebPage.messages.in:
3527         Add scalePageInViewCoordinates, which turns the scale centerpoint within the view
3528         into what scalePage expects: a post-scale scroll offset.
3529
3530 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3531
3532         Support setting a background color on page overlays
3533         https://bugs.webkit.org/show_bug.cgi?id=131600
3534
3535         Reviewed by Darin Adler.
3536
3537         * WebProcess/WebPage/PageOverlay.cpp:
3538         (WebKit::PageOverlay::PageOverlay):
3539         (WebKit::PageOverlay::bounds):
3540         (WebKit::PageOverlay::startFadeInAnimation):
3541         (WebKit::PageOverlay::startFadeOutAnimation):
3542         (WebKit::PageOverlay::startFadeAnimation):
3543         (WebKit::PageOverlay::fadeAnimationTimerFired):
3544         Minor style adjustments.
3545         Use more references everywhere.
3546
3547         (WebKit::PageOverlay::setBackgroundColor):
3548         (WebKit::PageOverlay::setNeedsDisplay):
3549         * WebProcess/WebPage/PageOverlay.h:
3550         (WebKit::PageOverlay::backgroundColor):
3551         Keep track of our background color, and push it down to the page overlay controller if we have one.
3552
3553         * WebProcess/WebPage/PageOverlayController.cpp:
3554         (WebKit::updateOverlayGeometry):
3555         (WebKit::PageOverlayController::clearPageOverlay):
3556         Page overlays will always have the right size, and just use drawsContents to determine
3557         whether or not they should tile/have backing store/etc.
3558
3559         (WebKit::PageOverlayController::installPageOverlay):
3560         (WebKit::PageOverlayController::didChangeOverlayBackgroundColor):
3561         Set the background color of the layer.
3562
3563         * WebProcess/WebPage/PageOverlayController.h:
3564
3565         * WebProcess/WebPage/WebPage.cpp:
3566         (WebKit::WebPage::WebPage):
3567         References!
3568
3569 2014-04-13  Andy Estes  <aestes@apple.com>
3570
3571         [QuickLook] Move file system-related code into WebKit
3572         https://bugs.webkit.org/show_bug.cgi?id=131597
3573
3574         Reviewed by Dan Bernstein.
3575
3576         * WebProcess/Network/WebResourceLoader.h: Made m_quickLookHandle a unique_ptr.
3577         * WebProcess/ios/WebResourceLoaderIOS.mm:
3578         (WebKit::WebResourceLoader::setUpQuickLookHandleIfNeeded):
3579
3580 2014-04-13  Andy Estes  <aestes@apple.com>
3581
3582         REGRESSION (r167164): -[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:] _block_invoke can access a deallocated completionHandler
3583         https://bugs.webkit.org/show_bug.cgi?id=131595
3584
3585         Reviewed by Dan Bernstein.
3586
3587         Make a copy of completionHandler and release it after we're done with it.
3588
3589         * Shared/mac/CookieStorageShim.mm:
3590         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
3591
3592 2014-04-13  Pratik Solanki  <psolanki@apple.com>
3593
3594         Don't use ImportanceAssertion on iOS
3595         https://bugs.webkit.org/show_bug.cgi?id=131481
3596         <rdar://problem/16575830>
3597
3598         Reviewed by Darin Adler.
3599
3600         We have other API to mark processes as being in use on iOS. No need to use ImportanceAssertion.
3601
3602         * Platform/IPC/MessageDecoder.cpp:
3603         * Platform/IPC/MessageDecoder.h:
3604         * Platform/IPC/mac/ConnectionMac.cpp:
3605         (IPC::Connection::receiveSourceEventHandler):
3606         * Platform/IPC/mac/ImportanceAssertion.h:
3607
3608 2014-04-13  Commit Queue  <commit-queue@webkit.org>
3609
3610         Unreviewed, rolling out r167168 and r167194.
3611         https://bugs.webkit.org/show_bug.cgi?id=131589
3612
3613         Caused massive ASSERTION failures on the GTK Debug bot
3614         (Requested by philn on #webkit).
3615
3616         Reverted changesets:
3617
3618         "[GTK] Add HighDPI support for non-accelerated compositing
3619         contents"
3620         https://bugs.webkit.org/show_bug.cgi?id=131562
3621         http://trac.webkit.org/changeset/167168
3622
3623         "Unreviewed. Fix GTK+ build with recent cairo and GTK+ after
3624         r167168."
3625         http://trac.webkit.org/changeset/167194
3626
3627 2014-04-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3628
3629         Unreviewed. Fix GTK+ build with recent cairo and GTK+ after r167168.
3630
3631         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3632         (webkitWebViewBaseCreateWebPage):
3633
3634 2014-04-12  Andy Estes  <aestes@apple.com>
3635
3636         [iOS] Move QuickLookHandle from ResourceLoader to WebResourceLoader
3637         https://bugs.webkit.org/show_bug.cgi?id=131580
3638
3639         Reviewed by Darin Adler.
3640
3641         There's no need to bloat WebKit1's ResourceLoader with a pointer that
3642         only WebKit2's WebResourceLoader cares about.
3643
3644         * WebProcess/Network/WebResourceLoader.cpp:
3645         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
3646         (WebKit::WebResourceLoader::didReceiveData):
3647         (WebKit::WebResourceLoader::didFinishResourceLoad):
3648         (WebKit::WebResourceLoader::didFailResourceLoad):
3649         * WebProcess/Network/WebResourceLoader.h:
3650         * WebProcess/ios/WebResourceLoaderIOS.mm:
3651         (WebKit::WebResourceLoader::setUpQuickLookHandleIfNeeded):
3652
3653 2014-04-11  Alexey Proskuryakov  <ap@apple.com>
3654
3655         [Mac] Crashes when copying or pasting huge images
3656         https://bugs.webkit.org/show_bug.cgi?id=131576
3657         <rdar://problem/12131833>
3658         <rdar://problem/14427398>
3659
3660         Reviewed by Darin Adler.
3661
3662         Added a few null checks for SharedMemory::create() return value in pasteboard code.
3663         Error handling feels a bit sketchy, but
3664         - I'm not sure what it should look like ideally;
3665         - it matches the kind of error handling we already have in these functions;
3666         - it appears to work reasonably well in practice. We get empty content, which
3667         is not nice, but not particularly problematic either. When copying an animated GIF,
3668         we also get the GIF in RTFD flavor, so even pasting into NSTextViews works!
3669
3670         * Platform/mac/SharedMemoryMac.cpp:
3671         (WebKit::SharedMemory::createFromVMBuffer):
3672         * UIProcess/mac/WebContextMac.mm:
3673         (WebKit::WebContext::getPasteboardBufferForType):
3674         (WebKit::WebContext::readBufferFromPasteboard):
3675         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3676         (WebKit::WebPlatformStrategies::setBufferForType):
3677
3678         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage):
3679         Also renamed some variables to prevent name collisions with with nested scope.
3680
3681 2014-04-11  Ryuan Choi  <ryuan.choi@samsung.com>
3682
3683         Unreviewed build fix on the EFL port after r167152
3684
3685         * WebProcess/WebPage/PageOverlay.cpp:
3686         (WebKit::PageOverlay::bounds):
3687
3688 2014-04-11  Hyowon Kim  <hw1008.kim@samsung.com>
3689
3690         [WK2] WebProcess crashes, when closing window after opening page by means of context menu
3691         https://bugs.webkit.org/show_bug.cgi?id=131439
3692
3693         Reviewed by Tim Horton.
3694
3695         CoordinatedGraphicsLayer calls notifyFlushRequired() through its client when destroyed.
3696         When PageOverlayController::notifyFlushRequired() is called, the DrawingArea could be null
3697         because it's destoryed in WebPage::close().
3698
3699         * WebProcess/WebPage/PageOverlayController.cpp:
3700         (WebKit::PageOverlayController::notifyFlushRequired): Add null check of m_webPage->drawingArea().
3701
3702 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3703
3704         Lots of compositing test failures after r167152
3705         https://bugs.webkit.org/show_bug.cgi?id=131574
3706
3707         Reviewed by Simon Fraser.
3708
3709         * WebProcess/WebPage/PageOverlayController.h:
3710         Skip page overlay layers in layer tree dumps, for consistency between platforms.
3711
3712 2014-04-11  Beth Dakin  <bdakin@apple.com>
3713
3714         Need WK2 API to disable rubber-banding
3715         https://bugs.webkit.org/show_bug.cgi?id=131567
3716
3717         Reviewed by Simon Fraser.
3718
3719         New API allows the client to enable/disable horizontal or vertical rubber-banding. 
3720         By default, rubber-banding is enabled.
3721         * UIProcess/API/C/WKPage.cpp:
3722         (WKPageVerticalRubberBandingIsEnabled):
3723         (WKPageSetEnableVerticalRubberBanding):
3724         (WKPageHorizontalRubberBandingIsEnabled):
3725         (WKPageSetEnableHorizontalRubberBanding):
3726         * UIProcess/API/C/WKPage.h:
3727         * UIProcess/WebPageProxy.cpp:
3728         (WebKit::WebPageProxy::WebPageProxy):
3729         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
3730         (WebKit::WebPageProxy::verticalRubberBandingIsEnabled):
3731         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
3732         (WebKit::WebPageProxy::horizontalRubberBandingIsEnabled):
3733         * UIProcess/WebPageProxy.h:
3734         * WebProcess/WebPage/WebPage.cpp:
3735         (WebKit::WebPage::setEnableVerticalRubberBanding):
3736         (WebKit::WebPage::setEnableHorizontalRubberBanding):
3737         * WebProcess/WebPage/WebPage.h:
3738         * WebProcess/WebPage/WebPage.messages.in:
3739
3740 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3741
3742         Fix the Mac build.
3743
3744         * WebProcess/WebPage/FindController.cpp:
3745         (WebKit::FindController::updateFindIndicator):
3746
3747 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3748
3749         [iOS WebKit2] Find-in-page indicator
3750         https://bugs.webkit.org/show_bug.cgi?id=131510
3751         <rdar://problem/16547777>
3752
3753         Reviewed by Simon Fraser and Enrica Casucci.
3754
3755         * WebKit2.xcodeproj/project.pbxproj:
3756         * WebProcess/WebPage/FindController.cpp:
3757         (WebKit::FindController::updateFindUIAfterPageScroll):
3758         WebKit2 will clear the selection if we reveal it while not enabling selection painting.
3759         So, avoid revealing it.
3760
3761         (WebKit::FindController::findString):
3762         (WebKit::FindController::hideFindIndicator):
3763         (WebKit::FindController::willFindString):
3764         (WebKit::FindController::didFailToFindString):
3765         (WebKit::FindController::didHideFindIndicator):
3766         #if out the cross-platform find indicator code on iOS; it will be replaced
3767         by the code in FindControllerIOS.
3768
3769         * WebProcess/WebPage/FindController.h:
3770
3771         * WebProcess/WebPage/ios/FindControllerIOS.mm: Added.
3772         (highlightColor):
3773         (WebKit::FindIndicatorOverlayClientIOS::drawRect):
3774         Paint the selection (with black text forced on), and the yellow rounded rect
3775         into the indicator page overlay.
3776
3777         (WebKit::FindController::updateFindIndicator):
3778         Create or update a small document-relative page overlay in the selection rect.
3779
3780         (WebKit::FindController::hideFindIndicator):
3781         (WebKit::FindController::willFindString):
3782         (WebKit::FindController::didFailToFindString):
3783         (WebKit::FindController::didHideFindIndicator):
3784         Add willFindString, didFailToFindString, and didHideFindIndicator functions.
3785         They do nothing, except on iOS where they are used to prevent selection change
3786         messages from being dispatched while using find-in-page, and to force
3787         WebCore to compute a selection rect (via updateAppearance) despite the selection not being painted.
3788
3789         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
3790         (WebKit::FindIndicatorOverlayClientIOS::setFrame):
3791
3792 2014-04-11  Owen Taylor  <otaylor@redhat.com>
3793
3794         [GTK] Add HighDPI support for non-accelerated compositing contents
3795         https://bugs.webkit.org/show_bug.cgi?id=131562
3796
3797         Reviewed by Martin Robinson.
3798
3799         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3800         (scaleFactorChanged): Added this callback to pass scale changes to the page proxy.
3801         (webkitWebViewBaseCreateWebPage): Attach the callback to the notify signal.
3802         * UIProcess/cairo/BackingStoreCairo.cpp:
3803         (WebKit::createBackingStoreForGTK): Pass the scale factor to the WebCore backing store.
3804         (WebKit::BackingStore::incorporateUpdate): Ditto.
3805
3806 2014-04-10  Jer Noble  <jer.noble@apple.com>
3807
3808         [WK2] Dispatch to main thread's run loop to handle cookie requests.
3809         https://bugs.webkit.org/show_bug.cgi?id=131524
3810
3811         Reviewed by Brady Eidson.
3812
3813         When using synchronous network APIs from the main thread (e.g., -[NSImage
3814         initWithContentsOfURL:]) our cookie shim would attempt to dispath_async
3815         to the main thread to handle the cookie request, and block against the original
3816         request. CFNetwork is still servicing the run loop however, so rather than
3817         dispatch_async to the main queue, use the RunLoop to dispatch to the main thread.
3818
3819         * Shared/mac/CookieStorageShim.mm:
3820         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
3821
3822 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3823
3824         Make the stylebot happier with r167154.
3825
3826         * UIProcess/PageClient.h:
3827         * UIProcess/WebPageProxy.h:
3828         * UIProcess/ios/PageClientImplIOS.h:
3829
3830 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3831
3832         [iOS WebKit2] Expose a simplified zoom-to-rect to the WebProcess
3833         https://bugs.webkit.org/show_bug.cgi?id=131563
3834
3835         Reviewed by Simon Fraser.
3836
3837         * UIProcess/PageClient.h:
3838         * UIProcess/WebPageProxy.h:
3839         * UIProcess/WebPageProxy.messages.in:
3840         * UIProcess/ios/PageClientImplIOS.h:
3841         * UIProcess/ios/PageClientImplIOS.mm:
3842         (WebKit::PageClientImpl::zoomToRect):
3843         * UIProcess/ios/WebPageProxyIOS.mm:
3844         (WebKit::WebPageProxy::zoomToRect):
3845         * WebProcess/WebPage/WebPage.h:
3846         * WebProcess/WebPage/ios/WebPageIOS.mm:
3847         (WebKit::WebPage::zoomToRect):
3848         Add a simple message that calls WKContentView's zoom-to-rect code given just a rect and min/max scale.
3849         We will use the center of the rect as the zoom origin, and will try to show the whole rect.
3850
3851 2014-04-10  Jer Noble  <jer.noble@apple.com>
3852
3853         [iOS][WK2] Videos should animate into and out of fullscreen.
3854         https://bugs.webkit.org/show_bug.cgi?id=131497
3855
3856         Reviewed by Simon Fraser.
3857
3858         Pass a starting rect for the enterFullscreen animation and an ending rect
3859         for the exitFullscreen animation.
3860
3861         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3862         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
3863         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3864         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): Pass initialFrame.
3865         * WebProcess/ios/WebVideoFullscreenManager.mm:
3866         (WebKit::screenRectOfContents): Casts node -> element and returns its screenRect().
3867         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Pass initialFrame.
3868         (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): Pass finalFrame.
3869
3870 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3871
3872         Support document-relative and custom-frame page overlays
3873         https://bugs.webkit.org/show_bug.cgi?id=131560
3874         <rdar://problem/16595556>
3875
3876         Reviewed by Simon Fraser.
3877
3878         Add "document-relative" overlays, which attach to (and scroll with) the document,
3879         and can be given a frame rect within the document to avoid overallocation of backing store.
3880
3881         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3882         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
3883         * WebProcess/WebPage/WebPage.cpp:
3884         (WebKit::WebPage::mainFrame):
3885         (WebKit::WebPage::mainFrameView):
3886         (WebKit::WebPage::didChangeScrollOffsetForFrame):
3887         * WebProcess/WebPage/WebPage.h:
3888         Let the PageOverlayController know *which* frame scrolled, instead of "any frame".
3889
3890         * WebProcess/WebPage/FindController.cpp:
3891         (WebKit::FindController::updateFindUIAfterPageScroll):
3892         Factor out shared code.
3893
3894         (WebKit::FindController::willMoveToWebPage):
3895         (WebKit::FindController::drawRect):
3896         We can use clearRect() instead of a transparency layer and fillRect().
3897         I've looked through all the other overlay clients I know of and none of them
3898         depend on having a transparency layer at the overlay level.
3899
3900         * WebProcess/WebPage/PageOverlay.cpp:
3901         (WebKit::PageOverlay::create):
3902         (WebKit::PageOverlay::PageOverlay):
3903         (WebKit::PageOverlay::bounds):
3904         (WebKit::PageOverlay::frame):
3905         (WebKit::PageOverlay::setFrame):
3906         (WebKit::PageOverlay::drawRect):
3907         Add OverlayType, which allows creation of Document or View relative overlays.
3908         All overlays up to this point are View relative, so we default to that.
3909         Document-relative overlays scroll with the page instead of repainting as
3910         the page scrolls. They can also be given an explicit frame, allowing them
3911         to be smaller than the entire document.
3912
3913         * WebProcess/WebPage/PageOverlay.h:
3914         (WebKit::PageOverlay::overlayType):
3915         (WebKit::PageOverlay::webPage):
3916         (WebKit::PageOverlay::client): Deleted.
3917         * WebProcess/WebPage/PageOverlayController.cpp:
3918         (WebKit::PageOverlayController::initialize):
3919         (WebKit::PageOverlayController::installPageOverlay):
3920         (WebKit::PageOverlayController::uninstallPageOverlay):
3921         (WebKit::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
3922         (WebKit::updateOverlayGeometry):
3923         (WebKit::PageOverlayController::setPageOverlayNeedsDisplay):
3924         (WebKit::PageOverlayController::didChangeViewSize):
3925         (WebKit::PageOverlayController::didChangeDocumentSize):
3926         (WebKit::PageOverlayController::didChangeDeviceScaleFactor):
3927         (WebKit::PageOverlayController::didScrollFrame):
3928         (WebKit::PageOverlayController::flushPageOverlayLayers):
3929         (WebKit::PageOverlayController::didChangeOverlayFrame):
3930         Keep two overlay root layers - one for view-relative
3931         and one for document-relative overlays.
3932         Don't force synchronous scrolling if we only have document-relative overlays.
3933         Update the overlay's position as well as its size whenever necessary.
3934         Update document-relative overlay geometry when the document size changes.
3935         Only explicitly flush view-relative overlays; document-relative ones
3936         are plugged into the WebCore layer tree and flushed along with the page.
3937
3938         * WebProcess/WebPage/PageOverlayController.h:
3939         (WebKit::PageOverlayController::documentOverlayRootLayer):
3940         (WebKit::PageOverlayController::viewOverlayRootLayer):
3941         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3942         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3943         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
3944         (WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
3945         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3946         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
3947         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
3948         Let the PageOverlay controller know when the document size changes.
3949         When we set up compositing, push the document overlay root layer
3950         down into WebCore.
3951
3952 2014-04-11  Pratik Solanki  <psolanki@apple.com>
3953
3954         [iOS WebKit2]: Share NSURLCache directory for webkit processes
3955         https://bugs.webkit.org/show_bug.cgi?id=131513
3956         <rdar://problem/16420859>
3957
3958         Reviewed by Alexey Proskuryakov.
3959
3960         Use iOS specific NSURLCache API to share the cache directory used by the networking process,
3961         web process and Safari.
3962
3963         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3964         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3965         * WebProcess/cocoa/WebProcessCocoa.mm:
3966         (WebKit::WebProcess::platformInitializeWebProcess):
3967
3968 2014-04-11  Alexey Proskuryakov  <ap@apple.com>
3969
3970         [Mac] Add IconServices to WebProcess sandbox profile
3971         https://bugs.webkit.org/show_bug.cgi?id=131558
3972         <rdar://problem/16552397>
3973
3974         Reviewed by Brady Eidson.
3975
3976         * WebProcess/com.apple.WebProcess.sb.in:
3977
3978 2014-04-11  Antti Koivisto  <antti@apple.com>
3979
3980         Pipe initial scale factor to TileController
3981         https://bugs.webkit.org/show_bug.cgi?id=131521
3982
3983         Reviewed by Tim Horton.
3984
3985         * WebProcess/WebPage/ios/WebPageIOS.mm:
3986         (WebKit::WebPage::viewportConfigurationChanged):
3987
3988 2014-04-10  Chris Fleizach  <cfleizach@apple.com>
3989
3990         AX: WebProcess at com.apple.WebCore: WebCore::AXObjectCache::rootObject + 18
3991         https://bugs.webkit.org/show_bug.cgi?id=131522
3992
3993         Reviewed by Anders Carlsson.
3994
3995         Protect against documents that have had their render tree destroyed, and no longer return a valid cache.
3996
3997         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3998
3999 2014-04-11  Brent Fulgham  <bfulgham@apple.com>
4000
4001         [Mac] Prevent crash when exiting fullscreen mode
4002         https://bugs.webkit.org/show_bug.cgi?id=131528
4003
4004         Reviewed by Jer Noble.
4005
4006         * UIProcess/mac/WKFullScreenWindowController.mm:
4007         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
4008         Clean up the _scaleAnimation controller, not just the _fadeAnimation controller.
4009         (-[WKFullScreenWindowController close]): If we are doing an immediate
4010         close of the view, we need to stop animations so we avoid any
4011         final timer events from interacting with invalid window handles.
4012
4013 2014-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
4014
4015         wk2-gtk does not display anything
4016         https://bugs.webkit.org/show_bug.cgi?id=125558
4017
4018         Reviewed by Martin Robinson.
4019
4020         Remove fcntl call to set access mode flags on the duplicated files
4021         descriptor. Those flags are ignored in Linux and make fcntl to
4022         fail in FreeBSD. We should handle the case where the passed
4023         protection is ReadOnly.
4024         Thanks to Raphael Kubo da Costa who proposed the solution.
4025
4026         * Platform/unix/SharedMemoryUnix.cpp:
4027         (WebKit::SharedMemory::createHandle):
4028         (WebKit::accessModeFile): Deleted.
4029