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