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