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