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