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