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