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