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