[Cocoa] Remove interfaces in the To Be Removed groups
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-04-20  Dan Bernstein  <mitz@apple.com>
2
3         [Cocoa] Remove interfaces in the To Be Removed groups
4         https://bugs.webkit.org/show_bug.cgi?id=131925
5
6         Reviewed by Darin Adler.
7
8         * Shared/API/Cocoa/WKRemoteObjectInterface.h: Removed.
9         * Shared/API/Cocoa/WKRemoteObjectInterface.mm: Removed.
10         * Shared/API/Cocoa/WKRemoteObjectRegistry.h: Removed.
11         * Shared/API/Cocoa/WKRemoteObjectRegistry.mm: Removed.
12         * UIProcess/API/Cocoa/WKProcessPool.mm:
13         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.h: Removed.
14         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.mm: Removed.
15         * UIProcess/API/Cocoa/WKProcessPoolConfigurationPrivate.h: Removed.
16         * UIProcess/API/Cocoa/WKProcessPoolToBeRemoved.mm: Removed.
17         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
18         * WebKit2.xcodeproj/project.pbxproj:
19         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInBrowserContextControllerToBeRemoved.mm: Removed.
20         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
21
22 2014-04-20  Dan Bernstein  <mitz@apple.com>
23
24         [Cocoa] Crash when setting a bundle parameter to nil
25         https://bugs.webkit.org/show_bug.cgi?id=131917
26
27         Reviewed by Sam Weinig.
28
29         * UIProcess/API/Cocoa/WKProcessPool.mm:
30         (-[WKProcessPool _setObject:forBundleParameter:]): If the object is nil, use
31         -[NSMutableDictionary removeObjectForKey:] rather than -setObject:forKey:.
32
33         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
34         (-[WKWebProcessBundleParameters setParameter:forKey:]): Ditto.
35
36         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
37         (WebKit::InjectedBundle::setBundleParameter): Unrelatedly, create m_bundleParameters if
38         needed, as it may have not been created on intialization if no bundle parameters were set
39         at the time.
40
41 2014-04-20  Dan Bernstein  <mitz@apple.com>
42
43         [Cocoa] Remove unused -webView:didFinishLoadingNavigation: delegate method
44         https://bugs.webkit.org/show_bug.cgi?id=131914
45
46         Reviewed by Sam Weinig.
47
48         * UIProcess/Cocoa/NavigationState.h: Removed flag from m_navigationDelegateMethods struct.
49         * UIProcess/Cocoa/NavigationState.mm:
50         (WebKit::NavigationState::setNavigationDelegate): Removed check for whether the method is
51         implemented.
52         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Stopped calling the method
53         if implemented.
54
55 2014-04-19  Anders Carlsson  <andersca@apple.com>
56
57         Plug-in process crashes if NP_Initialize returns an error the second time it's called
58         https://bugs.webkit.org/show_bug.cgi?id=131903
59         <rdar://problem/14355462>
60
61         Reviewed by Sam Weinig.
62
63         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
64         (WebKit::NetscapePluginModule::decrementLoadCount):
65         Don't try to unload the plug-in if it hasn't been initialized.
66
67 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
68
69         [UI-side compositing] Implement blend modes
70         https://bugs.webkit.org/show_bug.cgi?id=131891
71         <rdar://problem/16490085>
72
73         Reviewed by Tim Horton.
74
75         Implement blend modes with UI-side compositing.
76         
77         PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in
78         PlatformCALayerMac and PlatformCALayerRemote.
79         PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform
80         layer, so it can be called from the UI process on a CALayer*.
81         
82         Add BlendMode to LayerProperties, and initialize, encode and decode it,
83         as well as adding dumping support for blend modes.
84         
85         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
86         (WebKit::applyPropertiesToLayer):
87         * Shared/mac/RemoteLayerTreeTransaction.h:
88         * Shared/mac/RemoteLayerTreeTransaction.mm:
89         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
90         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
91         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
92         (WebKit::RemoteLayerTreeTextStream::operator<<):
93         (WebKit::dumpChangedLayers):
94         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
95         (WebKit::PlatformCALayerRemote::setBlendMode):
96         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
97
98 2014-04-19  Joseph Pecoraro  <pecoraro@apple.com>
99
100         Fix leak of UIScreenEdgePanGestureRecognizer in WKSwipeTransitionController
101         https://bugs.webkit.org/show_bug.cgi?id=131877
102
103         Reviewed by Darin Adler.
104
105         * UIProcess/ios/ViewGestureControllerIOS.mm:
106         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
107
108 2014-04-19  Dan Bernstein  <mitz@apple.com>
109
110         Don’t install a source file inside WebProcess.app.
111
112         * WebKit2.xcodeproj/project.pbxproj: Removed ViewUpdateDispatcher.messages.in from
113         WebProcess’s Copy Bundle Resources build phase.
114
115 2014-04-19  Darin Adler  <darin@apple.com>
116
117         [Mac] WebView adjusts the cursor even when another window is in front
118         https://bugs.webkit.org/show_bug.cgi?id=131898
119         rdar://problem/14619911
120
121         Reviewed by Dan Bernstein.
122
123         * UIProcess/API/mac/WKView.mm:
124         (-[WKView _setCursor:]): Deleted. Moved the code all into PageClientImpl, since none of it
125         interacts with anything special about a WKView.
126
127         * UIProcess/API/mac/WKViewInternal.h: Deleted the _setCursor: method.
128
129         * UIProcess/mac/PageClientImpl.mm:
130         (WebKit::PageClientImpl::setCursor): Added a check that the window is under the cursor
131         and do nothing if it's not.
132
133 2014-04-19  Dan Bernstein  <mitz@apple.com>
134
135         Use XPC services in the iOS Simulator, but not in Mountain Lion
136         https://bugs.webkit.org/show_bug.cgi?id=131894
137
138         Reviewed by Anders Carlsson.
139
140         * Configurations/NetworkService.Development.xcconfig: Defined INFOPLIST_FILE for the
141         Simulator.
142         * Configurations/NetworkService.xcconfig: Ditto.
143         * Configurations/WebContentService.Development.xcconfig: Ditto.
144         * Configurations/WebContentService.xcconfig: Ditto.
145         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
146         (WebKit::systemDirectoryPath): Added this helper function that returns a slash-terminated
147         path to the System directory in the current runtime.
148         (WebKit::ProcessLauncher::launchProcess): Changed to use the above function to tell whether
149         a development version of WebKit2 is being used.
150         * WebKit2Prefix.h: Set WTF_USE_XPC_SERVICES to 1 when targeting the iOS Simulator, but not
151         when targeting Mountain Lion.
152
153 2014-04-19  Dan Bernstein  <mitz@apple.com>
154
155         [Cocoa] Crash in -[WKWebProcessPlugInHitTestResult nodeHandle] when nodeHandle() is null
156         https://bugs.webkit.org/show_bug.cgi?id=131888
157
158         Reviewed by Jon Honeycutt.
159
160         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
161         (-[WKWebProcessPlugInHitTestResult nodeHandle]): Added a null check.
162
163 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
164
165         [iOS WK2] Fuzzy layers on sites using perspective and transforms
166         https://bugs.webkit.org/show_bug.cgi?id=131873
167         <rdar://problem/16540576>
168
169         Reviewed by Sam Weinig.
170         
171         Always set rasterizationScale on CALayers in the UI process
172         (as we do for WK1) so that layers are rasterized taking the
173         device scale into account. We can do unconditionally; this
174         is benign on layers that CA doesn't rasterize.
175
176         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
177         (WebKit::applyPropertiesToLayer):
178
179 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
180
181         Use 'override' in GraphicsLayerCA
182         https://bugs.webkit.org/show_bug.cgi?id=131882
183
184         Reviewed by Tim Horton.
185         
186         Add an 'override'.
187
188         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
189
190 2014-04-19  Darin Adler  <darin@apple.com>
191
192         Assertion in WebPage::runModal accesses object after it may have been destroyed
193         https://bugs.webkit.org/show_bug.cgi?id=131875
194
195         Reviewed by Anders Carlsson.
196
197         * WebProcess/WebPage/WebPage.cpp:
198         (WebKit::WebPage::runModal): Ref the WebPage so it's still around so we can
199         check the m_isRunningModal flag.
200
201 2014-04-18  Commit Queue  <commit-queue@webkit.org>
202
203         Unreviewed, rolling out r167527.
204         https://bugs.webkit.org/show_bug.cgi?id=131883
205
206         Broke 32-bit build (Requested by ap on #webkit).
207
208         Reverted changeset:
209
210         "[Mac] implement WebKitDataCue"
211         https://bugs.webkit.org/show_bug.cgi?id=131799
212         http://trac.webkit.org/changeset/167527
213
214 2014-04-18  Eric Carlson  <eric.carlson@apple.com>
215
216         [Mac] implement WebKitDataCue
217         https://bugs.webkit.org/show_bug.cgi?id=131799
218
219         Reviewed by Dean Jackson.
220
221         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
222
223 2014-04-18  Anders Carlsson  <andersca@apple.com>
224
225         Keep the WebPageProxy alive for the lifetime of all PageLoadState::Transaction objects
226         https://bugs.webkit.org/show_bug.cgi?id=131872
227         <rdar://problem/15758414>
228
229         Reviewed by Dan Bernstein.
230
231         * UIProcess/PageLoadState.cpp:
232         (WebKit::PageLoadState::PageLoadState):
233         (WebKit::PageLoadState::Transaction::Transaction):
234         (WebKit::PageLoadState::Transaction::~Transaction):
235         * UIProcess/PageLoadState.h:
236         (WebKit::PageLoadState::Transaction::Transaction): Deleted.
237         (WebKit::PageLoadState::Transaction::~Transaction): Deleted.
238         * UIProcess/WebPageProxy.cpp:
239         (WebKit::WebPageProxy::WebPageProxy):
240
241 2014-04-18  Stephanie Lewis  <slewis@apple.com>
242
243         We shouldn’t create page throttlers for other pages than WebKit2 pages.
244         Part of <rdar://problem/16473045> Visibility state counters are often incorrect.
245         https://bugs.webkit.org/show_bug.cgi?id=131696
246
247         Reviewed by Gavin Barraclough.
248
249         Page throttlers were being created for SVG images and other page instances that
250         were not accurately tracking the states that enable and disable page throttling.
251         Make the throttler an unique ptr and only initialize it for WebKit2.
252
253         This also fixes  an inefficiency where we would throttle a new page on creation because 
254         we assumed it was visible even if that was not the case.
255
256         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: Check page throttler exists.
257         (WebKit::NPRuntimeObjectMap::evaluate):
258         * WebProcess/WebPage/WebPage.cpp: 
259         (WebKit::WebPage::WebPage): Initialize page throttler for WebKit2 views.
260         (WebKit::WebPage::mouseEvent): Check page throttler exists.
261         (WebKit::WebPage::wheelEvent): ditto
262         (WebKit::WebPage::keyEvent): ditto
263
264 2014-04-18  Anders Carlsson  <andersca@apple.com>
265
266         Don't allow app sandboxed apps without the network client entitlement to launch the network process
267         https://bugs.webkit.org/show_bug.cgi?id=131868
268         <rdar://problem/12354188>
269
270         Reviewed by Dan Bernstein.
271
272         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
273         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
274         Add a new delegate that implements checkEntitlements().
275
276         (NetworkServiceInitializer):
277         Pass the new delegate to XPCServiceInitializer.
278
279         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
280         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
281         Call checkEntitlements.
282
283         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
284         Return true.
285
286         (WebKit::XPCServiceInitializerDelegate::hasEntitlement):
287         Helper function that returns whether a client has the given entitlement.
288
289         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
290         Helper function that checks whether the client is sandboxed.
291
292 2014-04-18  Alice Barraclough  <alice.barraclough@webkit.org>
293
294         Find on page - extend API by providing highlighted match index
295         https://bugs.webkit.org/show_bug.cgi?id=131776
296
297         Reviewed by Tim Horton.
298
299         * Shared/WebFindOptions.h: Add an option for determining match index.
300
301         Plumb through the API layers the addition of a parameter for match index.
302         * UIProcess/API/APIFindClient.h:
303         (API::FindClient::didFindString):
304         * UIProcess/API/C/WKPage.cpp:
305         (WKPageSetPageFindClient):
306         * UIProcess/API/Cocoa/WKWebView.mm:
307         (toFindOptions):
308         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
309         (NS_OPTIONS):
310         * UIProcess/API/Cocoa/_WKFindDelegate.h:
311         * UIProcess/Cocoa/FindClient.h:
312         * UIProcess/Cocoa/FindClient.mm:
313         (WebKit::FindClient::setDelegate):
314         (WebKit::FindClient::didFindString):
315         * UIProcess/WebFindClient.cpp:
316         (WebKit::WebFindClient::didFindString):
317         * UIProcess/WebFindClient.h:
318         * UIProcess/WebPageProxy.cpp:
319         (WebKit::WebPageProxy::didFindString):
320         * UIProcess/WebPageProxy.h:
321         * UIProcess/WebPageProxy.messages.in:
322
323         The actual tracking of the match index is contained in FindController class.
324         * WebProcess/WebPage/FindController.cpp:
325         (WebKit::FindController::FindController): Start out as -1, understood to be an undefined index in this context.
326         (WebKit::FindController::updateFindUIAfterPageScroll): 
327             Perform the calculation of matchCount if the flag for DetermineMatchIndex is on.
328         If matchCount exceeds max, keep the match index undefined because otherwise the finding could advance
329         to a point where the index exceeds the match count, legitimately. If matchCount doesn't exceed the max, then make
330         sure the match index, which had been being incremented or decremented blindly back in findString(), is normalized
331         to be less than match count.
332         (WebKit::FindController::findString): 
333             If there is a user selection existing on the page, the next occurence of the string will be found after that
334         selection. In that case we still want the index to properly reflect its ordinal  position within the entire document.
335         Use findStringMatchingRanges to provide the match index, and set a flag that prevents the match index from being
336         blindly incremented or decremented later. After findString() is actually called on the page, increment or decrement
337         the find index under specific conditions. 
338         (WebKit::FindController::hideFindIndicator): Reset match index when find UI goes away.
339         * WebProcess/WebPage/FindController.h: Add m_foundStringMatchIndex to private variables.
340         * WebProcess/WebPage/ios/FindControllerIOS.mm:
341         (WebKit::FindController::hideFindIndicator): Reset match index when find UI goes away.
342
343 2014-04-18  Joseph Pecoraro  <pecoraro@apple.com>
344
345         Correct some issues small issues in WK2 file upload InjectedBundle APIs
346         https://bugs.webkit.org/show_bug.cgi?id=131852
347
348         Reviewed by Dan Bernstein.
349
350         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
351         (API::InjectedBundle::PageUIClient::shouldGenerateFileForUpload):
352         The default return value, meaning no, should return the null string. The
353         result is checked later, and null string is a special value meaning no.
354
355         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
356         (WebKit::InjectedBundlePageUIClient::generateFileForUpload):
357         Pre-check for the correct client function we will use.
358
359 2014-04-18  Andy Estes  <aestes@apple.com>
360
361         [iOS] REGRESSION (r167039): WebKit incorrectly sets a background process assertion state when displaying a PDF
362         https://bugs.webkit.org/show_bug.cgi?id=131860
363         <rdar://problem/16631282>
364
365         Reviewed by Tim Horton.
366
367         We were basing our process assertion state on whether or not the
368         process had a WKContentView in a window, but when displaying a PDF
369         we've removed the WKContentView from the window. Base this decision
370         instead on whether or not the WKWebView is in the window.
371
372         * UIProcess/API/Cocoa/WKWebView.mm:
373         (-[WKWebView didMoveToWindow]):
374         * UIProcess/ios/PageClientImplIOS.mm:
375         (WebKit::PageClientImpl::isViewInWindow):
376
377 2014-04-18  Anders Carlsson  <andersca@apple.com>
378
379         Address a couple of review comments
380         https://bugs.webkit.org/show_bug.cgi?id=131856
381
382         Reviewed by Dan Bernstein.
383
384         * UIProcess/API/Cocoa/WKNavigationAction.h:
385         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
386         * UIProcess/API/Cocoa/WKPreferences.h:
387         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
388         * UIProcess/API/Cocoa/WKWebView.h:
389
390 2014-04-18  Anders Carlsson  <andersca@apple.com>
391
392         Handle pluginOrigin being null
393         https://bugs.webkit.org/show_bug.cgi?id=131849
394         <rdar://problem/16655898>
395
396         Reviewed by Alexey Proskuryakov.
397
398         * WebProcess/WebProcess.cpp:
399         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
400
401 2014-04-18  Dan Bernstein  <mitz@apple.com>
402
403         [Cocoa] Add a navigation delegate method corresponding to didFinishDocumentLoadForFrame for the main frame
404         https://bugs.webkit.org/show_bug.cgi?id=131847
405
406         Reviewed by Anders Carlsson.
407
408         * UIProcess/API/APILoaderClient.h:
409         (API::LoaderClient::didFinishDocumentLoadForFrame): Added a navigationID parameter.
410         * UIProcess/API/C/WKPage.cpp:
411         (WKPageSetPageLoaderClient): Updated for the above change in paramerers.
412         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
413         * UIProcess/Cocoa/NavigationState.h: Declare override of didFinishDocumentLoadForFrame.
414         * UIProcess/Cocoa/NavigationState.mm:
415         (WebKit::NavigationState::setNavigationDelegate): Initialize
416         webViewNavigationDidFinishDocumentLoad flag in the delegate methods struct.
417         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Added override
418         of the client function which calls the delegate.
419         * UIProcess/WebPageProxy.cpp:
420         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Get and pass the navigation ID to
421         the client.
422         * UIProcess/WebPageProxy.h: Added navigationID parameter.
423         * UIProcess/WebPageProxy.messages.in: Ditto.
424         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
425         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): Get and send the navigation
426         ID to the UI process.
427
428 2014-04-18  Philippe Normand  <pnormand@igalia.com>
429
430         Remove NETWORK_INFO support
431         https://bugs.webkit.org/show_bug.cgi?id=131841
432
433         Reviewed by Gyuyoung Kim.
434
435         * CMakeLists.txt:
436         * PlatformEfl.cmake:
437         * Shared/API/c/WKBase.h:
438         * Shared/APIObject.h:
439         * Shared/WebNetworkInfo.cpp: Removed.
440         * Shared/WebNetworkInfo.h: Removed.
441         * UIProcess/API/C/WKAPICast.h:
442         * UIProcess/API/C/WKContext.cpp:
443         (WKContextGetNetworkInfoManager): Deleted.
444         * UIProcess/API/C/WKContext.h:
445         * UIProcess/API/C/WKNetworkInfo.cpp: Removed.
446         * UIProcess/API/C/WKNetworkInfo.h: Removed.
447         * UIProcess/API/C/WKNetworkInfoManager.cpp: Removed.
448         * UIProcess/API/C/WKNetworkInfoManager.h: Removed.
449         * UIProcess/API/efl/ewk_context.cpp:
450         (EwkContext::EwkContext):
451         * UIProcess/API/efl/ewk_context_private.h:
452         * UIProcess/WebContext.cpp:
453         (WebKit::WebContext::WebContext):
454         * UIProcess/WebContext.h:
455         * UIProcess/WebNetworkInfoManagerProxy.cpp: Removed.
456         * UIProcess/WebNetworkInfoManagerProxy.h: Removed.
457         * UIProcess/WebNetworkInfoManagerProxy.messages.in: Removed.
458         * UIProcess/WebNetworkInfoProvider.cpp: Removed.
459         * UIProcess/WebNetworkInfoProvider.h: Removed.
460         * UIProcess/efl/NetworkInfoProvider.cpp: Removed.
461         * UIProcess/efl/NetworkInfoProvider.h: Removed.
462         * WebProcess/NetworkInfo/WebNetworkInfoManager.cpp: Removed.
463         * WebProcess/NetworkInfo/WebNetworkInfoManager.h: Removed.
464         * WebProcess/NetworkInfo/WebNetworkInfoManager.messages.in: Removed.
465         * WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp: Removed.
466         * WebProcess/WebCoreSupport/WebNetworkInfoClient.h: Removed.
467         * WebProcess/WebPage/WebPage.cpp:
468         (WebKit::WebPage::WebPage):
469         * WebProcess/WebProcess.cpp:
470         (WebKit::WebProcess::WebProcess):
471
472 2014-04-17  Daniel Bates  <dabates@apple.com>
473
474         [iOS] Hook up screen.{availHeight, availWidth, height, width}
475         https://bugs.webkit.org/show_bug.cgi?id=131821
476         <rdar://problem/16413795>
477
478         Reviewed by Benjamin Poulain and Tim Horton.
479
480         Implement WebKit2-specific support infrastructure.
481
482         Additionally substitute "screenSize" for "viewporScreenSize" to make the code more understandable.
483
484         * Shared/WebPageCreationParameters.cpp:
485         (WebKit::WebPageCreationParameters::encode): Modified to encode the available screen size
486         creation parameter.
487         (WebKit::WebPageCreationParameters::decode): Modified to decode the available screen size
488         creation parameter.
489         * Shared/WebPageCreationParameters.h:
490         * UIProcess/WebPageProxy.cpp:
491         (WebKit::WebPageProxy::creationParameters): Initialize the available screen size
492         parameter.
493         * UIProcess/WebPageProxy.h:
494         * UIProcess/ios/WebPageProxyIOS.mm:
495         (WebKit::WebPageProxy::screenSize): Renamed; formerly named viewportScreenSize.
496         (WebKit::WebPageProxy::availableScreenSize): Added.
497         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
498         (WebKit::WebChromeClient::screenSize): Renamed; formerly named viewportScreenSize.
499         (WebKit::WebChromeClient::availableScreenSize): Added; turns around and calls WebPage::availableScreenSize().
500         * WebProcess/WebCoreSupport/WebChromeClient.h:
501         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
502         (InitWebCoreSystemInterface): Hook up WebKit System Interface function WKGetAvailableScreenSize.
503         * WebProcess/WebPage/WebPage.cpp:
504         (WebKit::WebPage::WebPage): Initialize available screen size instance variable.
505         * WebProcess/WebPage/WebPage.h:
506         * WebProcess/WebPage/ios/WebPageIOS.mm:
507         (WebKit::WebPage::screenSize):
508         (WebKit::WebPage::availableScreenSize):
509
510 2014-04-17  Anders Carlsson  <andersca@apple.com>
511
512         Remove unused API enums
513         https://bugs.webkit.org/show_bug.cgi?id=131836
514
515         Reviewed by Tim Horton.
516
517         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
518         (NS_ENUM):
519         * UIProcess/Cocoa/NavigationState.mm:
520         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
521         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
522
523 2014-04-17  Brent Fulgham  <bfulgham@apple.com>
524
525         Make RenderLayerBacking get the timingFunction of the correct animation.
526         https://bugs.webkit.org/show_bug.cgi?id=100632
527
528         Reviewed by Simon Fraser.
529
530         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
531         (IPC::ArgumentCoder<GraphicsLayerAnimation>::decode): Update for new signatures for
532         FloatAnimationValue, TransformAnimationValue, etc.
533
534 2014-04-17  Enrica Casucci  <enrica@apple.com>
535
536         [iOS WebKit2] support replacements for misspelled words.
537         https://bugs.webkit.org/show_bug.cgi?id=131827
538         <rdar://problem/16319657>
539
540         Reviewed by Benjamin Poulain.
541
542         This is the first part of the work to add support for replacements.
543         It handles _promptForReplace in canPerformAction to decide
544         whether to show the Replace button in the menu and add the
545         implementation of the replace action.
546
547         * Shared/EditorState.cpp:
548         (WebKit::EditorState::encode):
549         (WebKit::EditorState::decode):
550         * Shared/EditorState.h:
551         (WebKit::EditorState::EditorState):
552         * UIProcess/WebPageProxy.h:
553         * UIProcess/ios/WKContentViewInteraction.mm:
554         (-[WKContentView selectedText]):
555         (-[WKContentView replaceText:withText:]):
556         (-[WKContentView _promptForReplace:]):
557         (-[WKContentView replace:]):
558         (-[WKContentView canPerformAction:withSender:]):
559         (-[WKContentView selectWordForReplacement]): This is called
560         by UIKit when the user taps on a mispelled word to select it.
561         * UIProcess/ios/WebPageProxyIOS.mm:
562         (WebKit::WebPageProxy::replaceSelectedText):
563         * WebProcess/WebPage/WebPage.cpp:
564         (WebKit::WebPage::WebPage):
565         (WebKit::WebPage::editorState):
566         * WebProcess/WebPage/WebPage.h:
567         * WebProcess/WebPage/WebPage.messages.in:
568         * WebProcess/WebPage/ios/WebPageIOS.mm:
569         (WebKit::WebPage::selectWithGesture): Removed m_shouldReturnWordForSelection.
570         We now return always the word corresponding to the caret selection or
571         the selected text up to a maximum of 200 characters.
572         (WebKit::WebPage::extendSelection):
573         (WebKit::WebPage::replaceSelectedText):
574
575 2014-04-17  Tim Horton  <timothy_horton@apple.com>
576
577         [iOS] REGRESSION (r166975): WKPDFView is broken
578         https://bugs.webkit.org/show_bug.cgi?id=131828
579
580         Reviewed by Simon Fraser.
581
582         * UIProcess/API/Cocoa/WKWebView.mm:
583         (-[WKWebView _didCommitLayerTree:WebKit::]):
584         Bail from updating the scroll view parameters from the layer tree update
585         while it's being managed by a custom content view.
586         We'll get any changes again in the next commit after removing the custom
587         content view (and painting the new page) anyway, so this should be OK.
588
589 2014-04-17  Pratik Solanki  <psolanki@apple.com>
590
591         _webProcessIdentifier should return 0 if the web process crashed
592         https://bugs.webkit.org/show_bug.cgi?id=131813
593         <rdar://problem/16650605>
594
595         Reviewed by Anders Carlsson.
596
597         * UIProcess/API/Cocoa/WKWebView.mm:
598         (-[WKWebView _hasWebProcess]):
599         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
600
601 2014-04-17  Darin Adler  <darin@apple.com>
602
603         Remove use of deprecatedDeleteAllValues in NPRemoteObjectMap::pluginDestroyed
604         https://bugs.webkit.org/show_bug.cgi?id=122496
605
606         Reviewed by Brent Fulgham.
607
608         * Shared/Plugins/NPRemoteObjectMap.cpp:
609         (WebKit::NPRemoteObjectMap::pluginDestroyed): Use new-style code and write the
610         deprecatedDeleteAllValues function out using a loop. Might be nice to return here
611         and use unique_ptr instead some day, but I tried that before and got it wrong, so
612         lets do that another time.
613
614 2014-04-17  Darin Adler  <darin@apple.com>
615
616         Add separate flag for IndexedDatabase in workers since the current implementation is not threadsafe
617         https://bugs.webkit.org/show_bug.cgi?id=131785
618         rdar://problem/16003108
619
620         Reviewed by Brady Eidson.
621
622         * Configurations/FeatureDefines.xcconfig: Added INDEXED_DATABASE_IN_WORKERS.
623
624 2014-04-17  Dan Bernstein  <mitz@apple.com>
625
626         WebKit2 part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
627         https://bugs.webkit.org/show_bug.cgi?id=131783
628
629         Reviewed by Tim Horton.
630
631         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
632         (WebKit::WebChromeClient::createWindow): Set the isProcessingUserGesture field of
633         the NavigationActionData to the corresponding value in the NavigationAction.
634         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
635         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
636         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
637
638 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
639
640         [iOS][WK2] Fix the DidCommitLoad initial scrolling position
641         https://bugs.webkit.org/show_bug.cgi?id=131780
642
643         Reviewed by Jon Honeycutt.
644
645         * UIProcess/API/Cocoa/WKWebView.mm:
646         (-[WKWebView _didCommitLayerTree:]):
647         That code is older than _obscuredInsets and used the contentInsets as a workaround.
648
649 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
650
651         [iOS][WK2] Fix annoying scrolling bugs
652         https://bugs.webkit.org/show_bug.cgi?id=131722
653
654         Reviewed by Simon Fraser.
655
656         * UIProcess/API/Cocoa/WKWebView.mm:
657         (-[WKWebView _scrollToContentOffset:WebCore::]):
658         We are scrolling at the wrong position when we have the "small obscured insets".
659
660 2014-04-16  Gavin Barraclough  <baraclough@apple.com>
661
662         On iOS keep network process running using a process assertion rather than a boost
663         https://bugs.webkit.org/show_bug.cgi?id=131779
664
665         Reviewed by Benjamin Poulain.
666
667         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
668         (WebKit::connectToService):
669             - No need to leak a boost onto the NetworkProcess on iOS.
670         * UIProcess/Network/NetworkProcessProxy.cpp:
671         (WebKit::NetworkProcessProxy::didFinishLaunching):
672             - Take a ProcessAssertion on the NetworkProcess.
673         * UIProcess/Shared/ChildProcessProxy.h:
674             - Added m_assertion.
675         * UIProcess/WebProcessProxy.h:
676             - Removed m_assertion.
677         * UIProcess/ios/ProcessAssertion.h: Added.
678             - Added - refactored from WebProcessProxy.h.
679         * UIProcess/ios/ProcessAssertion.mm: Added.
680         (WebKit::ProcessAssertion::ProcessAssertion):
681         (WebKit::ProcessAssertion::setState):
682             - Added - refactored from WebProcessProxyIOS.mm.
683         * UIProcess/ios/WebProcessProxyIOS.mm:
684         (WebKit::WebProcessProxy::updateProcessState):
685             - Code refactored out to ProcessAssertion.mm.
686         * WebKit2.xcodeproj/project.pbxproj:
687             - Added files.
688
689 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
690
691         [iOS][WK2] Improve the approximation of the scroll position of the dynamic viewport size updates
692         https://bugs.webkit.org/show_bug.cgi?id=131720
693
694         Reviewed by Tim Horton.
695
696         * UIProcess/API/Cocoa/WKWebView.mm:
697         (-[WKWebView _scrollToContentOffset:]):
698         The scrolling tree was forcing scroll at the wrong scale during the transition. 
699
700         (-[WKWebView _setMinimumLayoutSizeOverride:]):
701         This was left out by accident. The WebProcess was getting the new layout size twice, making
702         WebPage::dynamicViewportSizeUpdate() very confused when the content size changes.
703
704         * WebProcess/WebPage/ios/WebPageIOS.mm:
705         (WebKit::WebPage::dynamicViewportSizeUpdate):
706         Add scrolling adjustment for the dynamic relayout case:
707         -Sticky top and bottom like the UIProcess.
708         -Keep the same relative position of the unobscured rect's center.
709
710         Also fix a bug in the horizontal and vertical adjustments: the code was using the exposed rect
711         instead of the unobscured rect, which made the adjustments off by the size of the obscured insets.
712
713         The type is changed from double to float since ARMv7 has a grudge against double.
714
715 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
716
717         [iOS][WK2] Do not update the visible content rects when setting the same obscured insets multiple times
718         https://bugs.webkit.org/show_bug.cgi?id=131633
719
720         Reviewed by Darin Adler.
721
722         We should avoid computing the visible content rects when not needed.
723
724         * UIProcess/API/Cocoa/WKWebView.mm:
725         (-[WKWebView _setObscuredInsets:]):
726
727 2014-04-16  Zan Dobersek  <zdobersek@igalia.com>
728
729         Make IPC::Arguments a variadic template
730         https://bugs.webkit.org/show_bug.cgi?id=131684
731
732         Reviewed by Darin Adler.
733
734         Make IPC::Arguments a variadic template that uses the template parameter pack to further
735         define the std::tuple ValueType and is used to define the std::tuple container of the
736         values passed into the container.
737
738         * Platform/IPC/Arguments.h:
739         (IPC::Arguments::Arguments):
740         (IPC::Arguments::encode):
741         (IPC::Arguments::decode):
742         (IPC::Arguments0::encode): Deleted.
743         (IPC::Arguments0::decode): Deleted.
744         (IPC::Arguments1::Arguments1): Deleted.
745         (IPC::Arguments1::encode): Deleted.
746         (IPC::Arguments1::decode): Deleted.
747         (IPC::Arguments2::Arguments2): Deleted.
748         (IPC::Arguments2::encode): Deleted.
749         (IPC::Arguments2::decode): Deleted.
750         (IPC::Arguments3::Arguments3): Deleted.
751         (IPC::Arguments3::encode): Deleted.
752         (IPC::Arguments3::decode): Deleted.
753         (IPC::Arguments4::Arguments4): Deleted.
754         (IPC::Arguments4::encode): Deleted.
755         (IPC::Arguments4::decode): Deleted.
756         (IPC::Arguments5::Arguments5): Deleted.
757         (IPC::Arguments5::encode): Deleted.
758         (IPC::Arguments5::decode): Deleted.
759         (IPC::Arguments6::Arguments6): Deleted.
760         (IPC::Arguments6::encode): Deleted.
761         (IPC::Arguments6::decode): Deleted.
762         (IPC::Arguments7::Arguments7): Deleted.
763         (IPC::Arguments7::encode): Deleted.
764         (IPC::Arguments7::decode): Deleted.
765         (IPC::Arguments8::Arguments8): Deleted.
766         (IPC::Arguments8::encode): Deleted.
767         (IPC::Arguments8::decode): Deleted.
768         (IPC::Arguments10::Arguments10): Deleted.
769         (IPC::Arguments10::encode): Deleted.
770         (IPC::Arguments10::decode): Deleted.
771         * Scripts/webkit2/LegacyMessages-expected.h:
772         * Scripts/webkit2/Messages-expected.h:
773         * Scripts/webkit2/messages.py: Clean up the code a bit.
774         (reply_parameter_type):
775         (arguments_type):
776         (reply_type):
777         (decode_type):
778         (arguments_type_old): Deleted.
779         (base_class): Deleted.
780         (delayed_reply_type): Deleted.
781
782 2014-04-16  Tim Horton  <timothy_horton@apple.com>
783
784         Deduplicate LayerTreeContext
785         https://bugs.webkit.org/show_bug.cgi?id=131773
786
787         Reviewed by Simon Fraser.
788
789         There are three identical implementations, one for each platform, for no reason.
790
791         * CMakeLists.txt:
792         * PlatformEfl.cmake:
793         * PlatformGTK.cmake:
794         * Shared/LayerTreeContext.cpp: Renamed from Source/WebKit2/Shared/mac/LayerTreeContextMac.mm.
795         (WebKit::LayerTreeContext::LayerTreeContext):
796         (WebKit::LayerTreeContext::~LayerTreeContext):
797         (WebKit::LayerTreeContext::encode):
798         (WebKit::LayerTreeContext::decode):
799         (WebKit::LayerTreeContext::isEmpty):
800         (WebKit::operator==):
801         * Shared/LayerTreeContext.h:
802         (WebKit::operator!=): Deleted.
803         * Shared/efl/LayerTreeContextEfl.cpp: Removed.
804         * Shared/gtk/LayerTreeContextGtk.cpp: Removed.
805         * WebKit2.xcodeproj/project.pbxproj:
806         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
807         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
808         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
809         (WebKit::LayerTreeHostGtk::initialize):
810
811 2014-04-16  Tim Horton  <timothy_horton@apple.com>
812
813         Don't build LayerTreeHost on Mac (and clean it up)
814         https://bugs.webkit.org/show_bug.cgi?id=131769
815
816         Reviewed by Simon Fraser.
817
818         * WebKit2.xcodeproj/project.pbxproj:
819         Don't include it in the project.
820
821         * WebProcess/InjectedBundle/InjectedBundle.cpp:
822         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
823         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
824         (WebKit::CoordinatedDrawingArea::updatePreferences):
825         * WebProcess/WebPage/DrawingAreaImpl.cpp:
826         (WebKit::DrawingAreaImpl::updatePreferences):
827         * WebProcess/WebPage/LayerTreeHost.h:
828         (WebKit::LayerTreeHost::setLayerHostingMode): Deleted.
829         (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Deleted.
830         * WebProcess/WebPage/WebPage.cpp:
831         (WebKit::WebPage::updatePreferences):
832         * WebProcess/WebPage/ios/WebPageIOS.mm:
833         Get rid of LayerTreeHost::supportsAcceleratedCompositing, which always returns true everywhere.
834         Remove some LayerTreeHost.h includes.
835         Remove LayerTreeHost::setLayerHostingMode, which is PLATFORM(COCOA) and not needed.
836
837 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
838
839         Failing to decode a layer tree commit message resulted in silent and mysterious failure
840         https://bugs.webkit.org/show_bug.cgi?id=131766
841         <rdar://problem/16520894>
842
843         Reviewed by Sam Weinig.
844         
845         If the message decode failed, we should have already marked the message as invalid.
846         Failing to do so indicates in a decode code coding error.
847
848         * Platform/IPC/HandleMessage.h:
849         (IPC::handleMessage):
850         (IPC::handleMessageVariadic):
851         (IPC::handleMessageDelayed):
852
853 2014-04-16  Tim Horton  <timothy_horton@apple.com>
854
855         Minor include sanity in WebPage.h
856         https://bugs.webkit.org/show_bug.cgi?id=131752
857
858         Reviewed by Simon Fraser.
859
860         * WebProcess/WebPage/WebPage.h:
861         Remove a bunch of unnecessary includes.
862         Un-indent some stuff.
863
864         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
865         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
866         * WebProcess/WebPage/FindController.cpp:
867         * WebProcess/WebPage/WebPage.cpp:
868         * WebProcess/WebPage/mac/WebPageMac.mm:
869         Add back more specific includes, into implementation files.
870         
871         * WebProcess/WebPage/WebUndoStep.cpp:
872         (WebKit::WebUndoStep::~WebUndoStep):
873         * WebProcess/WebPage/WebUndoStep.h:
874         Add an out-of-line destructor.
875
876 2014-04-16  Gavin Barraclough  <baraclough@apple.com>
877
878         REGRESSION: PCE.js is 20x slower in WebKit2 because timers are throttled
879         https://bugs.webkit.org/show_bug.cgi?id=131189
880
881         Unreviewed rollout of r166754
882
883         This change is no longer necessary.
884
885         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
886         (WebKit::connectToService):
887
888 2014-04-16  Alexey Proskuryakov  <ap@apple.com>
889
890         Updating tests after bug 131721, [GTK] Fix unused parameter warnings.
891
892         * Scripts/webkit2/LegacyMessageReceiver-expected.cpp:
893         (WebKit::WebPage::didReceiveWebPageMessage):
894         (WebKit::WebPage::didReceiveSyncWebPageMessage):
895         * Scripts/webkit2/MessageReceiver-expected.cpp:
896         (WebKit::WebPage::didReceiveMessage):
897         (WebKit::WebPage::didReceiveSyncMessage):
898
899 2014-04-16  Brendan Long  <b.long@cablelabs.com>
900
901         [GTK] Fix unused parameter warnings
902         https://bugs.webkit.org/show_bug.cgi?id=131721
903
904         Reviewed by Darin Adler.
905
906         * Scripts/webkit2/messages.py:
907         (generate_message_handler): Add UNUSED_PARAM() for a couple parameters which aren't always used.
908         * Shared/WebCoreArgumentCoders.cpp:
909         (IPC::ArgumentCoder<LinearTimingFunction>::decode): Remove unused parameters.
910         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
911         (API::InjectedBundle::FormClient::textDidChangeInTextField): Same.
912         (API::InjectedBundle::FormClient::willSubmitForm): Same.
913         (API::InjectedBundle::FormClient::willSendSubmitEvent): Same.
914         * WebProcess/Network/NetworkProcessConnection.cpp:
915         (WebKit::NetworkProcessConnection::didReceiveSyncMessage): Same.
916
917 2014-04-16  Tim Horton  <timothy_horton@apple.com>
918
919         Accidentally included some style-checker-testing changes in the last commit.
920
921         * WebProcess/Plugins/PDF/PDFPlugin.mm:
922         (WebKit::PDFPlugin::attemptToUnlockPDF):
923         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
924
925 2014-04-16  Tim Horton  <timothy_horton@apple.com>
926
927         Fix some style checker complaints in PDFPlugin
928         https://bugs.webkit.org/show_bug.cgi?id=131706
929
930         Reviewed by Darin Adler.
931
932         * WebProcess/Plugins/PDF/PDFPlugin.mm:
933         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
934         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:forParameter:]):
935         (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
936         (WebKit::PDFPlugin::attemptToUnlockPDF):
937         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
938         (WebKit::PDFPlugin::isEditingCommandEnabled):
939         (WebKit::PDFPlugin::nextMatchForString):
940         (WebKit::PDFPlugin::handleWheelEvent):
941         (WebKit::PDFPlugin::liveData):
942
943 2014-04-15  Dan Bernstein  <mitz@apple.com>
944
945         [Cocoa] Add a form delegate method corresponding to willSubmitForm
946         https://bugs.webkit.org/show_bug.cgi?id=131718
947
948         Reviewed by Tim Horton.
949
950         * UIProcess/API/Cocoa/WKWebView.mm:
951         (-[WKWebView _setFormDelegate:]): Changed to define and create a FormClient (which derives
952         from API::FormClient and messages a delegate), and set it as the form client.
953
954         * UIProcess/API/Cocoa/_WKFormDelegate.h: Declared new delegate method.
955
956         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added a
957         variant of willSubmitForm that returs a user object to pass to the delegate in the UI
958         process, giving it a temporary name with “new”.
959
960         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
961         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Changed willSubmitForm()
962         to check for the new bundle delegate method first and encode the user object as user data.
963         Moved the encoding of an NSObject <NSSecureCoding> as user data into a helper function.
964
965 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
966
967         Make page overlay functionality working on coordinated graphics.
968         https://bugs.webkit.org/show_bug.cgi?id=131425
969
970         Reviewed by Darin Adler.
971
972         Page overlay functionality did not work on coordinated graphics since r166975.
973         This patch removes deprecated code related to the PageOverlay GraphicsLayer management.
974         and makes CoordinatedLayerTreeHost use PageOverlayController.
975
976         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
977         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged):
978         (WebKit::CoordinatedDrawingArea::didInstallPageOverlay): Deleted.
979         (WebKit::CoordinatedDrawingArea::didUninstallPageOverlay): Deleted.
980         (WebKit::CoordinatedDrawingArea::setPageOverlayNeedsDisplay): Deleted.
981         (WebKit::CoordinatedDrawingArea::setPageOverlayOpacity): Deleted.
982         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
983         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
984         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
985         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
986         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
987         (WebKit::CoordinatedLayerTreeHost::didInstallPageOverlay): Deleted.
988         (WebKit::CoordinatedLayerTreeHost::didUninstallPageOverlay): Deleted.
989         (WebKit::CoordinatedLayerTreeHost::setPageOverlayNeedsDisplay): Deleted.
990         (WebKit::CoordinatedLayerTreeHost::setPageOverlayOpacity): Deleted.
991         (WebKit::CoordinatedLayerTreeHost::createPageOverlayLayer): Deleted.
992         (WebKit::CoordinatedLayerTreeHost::destroyPageOverlayLayer): Deleted.
993         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
994         * WebProcess/WebPage/LayerTreeHost.h:
995         (WebKit::LayerTreeHost::didInstallPageOverlay):
996         (WebKit::LayerTreeHost::didUninstallPageOverlay):
997         (WebKit::LayerTreeHost::setPageOverlayNeedsDisplay):
998
999 2014-04-15  Dan Bernstein  <mitz@apple.com>
1000
1001         Introduce API::FormClient
1002         https://bugs.webkit.org/show_bug.cgi?id=131714
1003
1004         Reviewed by Tim Horton.
1005
1006         * UIProcess/API/APIFormClient.h: Added.
1007         (API::FormClient::~FormClient):
1008         (API::FormClient::willSubmitForm):
1009
1010         * UIProcess/API/C/WKPage.cpp:
1011         (WKPageSetPageFormClient): Changed to create a WebFormClient and call
1012         WebPageProxy::setFormClient.
1013
1014         * UIProcess/WebFormClient.cpp:
1015         (WebKit::WebFormClient::WebFormClient): Added a constructor from WKPageFormClientBase.
1016         * UIProcess/WebFormClient.h: Added inheritance from API::FormClient, marked overrides as
1017         such.
1018
1019         * UIProcess/WebPageProxy.cpp:
1020         (WebKit::WebPageProxy::WebPageProxy): Initialize m_formClient member.
1021         (WebKit::WebPageProxy::setFormClient): Added. Updates m_formClient.
1022         (WebKit::WebPageProxy::close): Updated code to clear m_formClient.
1023         (WebKit::WebPageProxy::willSubmitForm): Updated for type change.
1024         (WebKit::WebPageProxy::initializeFormClient): Deleted.
1025         * UIProcess/WebPageProxy.h:
1026
1027         * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
1028
1029 2014-04-15  Simon Fraser  <simon.fraser@apple.com>
1030
1031         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
1032         https://bugs.webkit.org/show_bug.cgi?id=131665
1033
1034         Reviewed by Tim Horton.
1035
1036         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
1037         was triggering a compositing layer flush when called with a null rootLayer, which happens
1038         for pages going into the page cache. This would trigger a layer flush that would clobber
1039         the root layer for the visible page, resulting in missing content.
1040         
1041         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
1042         was being added to (and then removed from) every single compositing layers.
1043         
1044         Fix both these by changing to a pull model, where RenderLayerCompositor requests
1045         the overlay layer via ChromeClient, and gets it at the end of every flush,
1046         adding to the children of the root layer.
1047
1048         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1049         (WebKit::WebChromeClient::documentOverlayLayerForFrame):
1050         * WebProcess/WebCoreSupport/WebChromeClient.h:
1051         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1052         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
1053
1054 2014-04-15  Jinwoo Song  <jinwoo7.song@samsung.com>
1055
1056         [EFL][WK2] Pass Mouse movement data to WebMouseEvent
1057         https://bugs.webkit.org/show_bug.cgi?id=131663
1058
1059         Reviewed by Gyuyoung Kim.
1060
1061         Currently mouse movement data are not passed to WebMouseEvent. Instead, they are set to 0 as default.
1062         EFL port needs to send the deltaX and deltaY for PointerLock API which will be implemented later.
1063
1064         * Shared/efl/WebEventFactory.cpp:
1065         (WebKit::WebEventFactory::createWebMouseEvent):
1066
1067 2014-04-15  Commit Queue  <commit-queue@webkit.org>
1068
1069         Unreviewed, rolling out r167298.
1070         https://bugs.webkit.org/show_bug.cgi?id=131670
1071
1072         Broke CSS filters (17 test crashes) (Requested by ap on
1073         #webkit).
1074
1075         Reverted changeset:
1076
1077         "[iOS WK2] Pages often blank on first load if page loaded by
1078         typing the URL"
1079         https://bugs.webkit.org/show_bug.cgi?id=131665
1080         http://trac.webkit.org/changeset/167298
1081
1082 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1083
1084         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
1085         https://bugs.webkit.org/show_bug.cgi?id=131665
1086
1087         Reviewed by Tim Horton.
1088
1089         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
1090         was triggering a compositing layer flush when called with a null rootLayer, which happens
1091         for pages going into the page cache. This would trigger a layer flush that would clobber
1092         the root layer for the visible page, resulting in missing content.
1093         
1094         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
1095         was being added to (and then removed from) every single compositing layers.
1096         
1097         Fix both these by changing to a pull model, where RenderLayerCompositor requests
1098         the overlay layer via ChromeClient, and gets it at the end of every flush,
1099         adding to the children of the root layer.
1100
1101         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1102         (WebKit::WebChromeClient::documentOverlayLayerForFrame):
1103         * WebProcess/WebCoreSupport/WebChromeClient.h:
1104         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1105         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
1106
1107 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1108
1109         Fix the 32-bit build.
1110
1111         * UIProcess/mac/ViewGestureControllerMac.mm:
1112
1113 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1114
1115         REGRESSION (WebKit2): Programmatic scrolls in overflow-scrolling:touch don't work
1116         https://bugs.webkit.org/show_bug.cgi?id=131649
1117
1118         Reviewed by Tim Horton.
1119         
1120         Update the UIScrollView's contentOffset when we're told that the scroll position
1121         changed.
1122         
1123         Also refactor slightly to have a single exception-protected block.
1124
1125         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1126         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
1127
1128 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1129
1130         Fix the 32-bit build.
1131
1132         * UIProcess/mac/ViewGestureControllerMac.mm:
1133
1134 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1135
1136         Sometimes-crash under handleSwipeGesture after closing a window or quitting
1137         https://bugs.webkit.org/show_bug.cgi?id=131648
1138         <rdar://problem/15966106>
1139
1140         Reviewed by Simon Fraser.
1141
1142         * UIProcess/mac/ViewGestureController.h:
1143         * UIProcess/mac/ViewGestureControllerMac.mm:
1144         (WebKit::ViewGestureController::~ViewGestureController):
1145         (WebKit::ViewGestureController::trackSwipeGesture):
1146         Keep a Objective C object with a single boolean property, isCancelled, on
1147         the ViewGestureController, and also retained by the swipe-tracking block.
1148         When the ViewGestureController is destroyed, we set isCancelled to YES,
1149         and the next time the block is invoked, we will cancel the swipe without
1150         touching the destroyed ViewGestureController.
1151
1152         (WebKit::ViewGestureController::handleSwipeGesture):
1153         Don't try to handle a swipe gesture if the drawing area is missing.
1154
1155         (WebKit::ViewGestureController::endSwipeGesture):
1156         Clear the swipe cancellation tracker when the gesture completes.
1157
1158 2014-04-14  Enrica Casucci  <enrica@apple.com>
1159
1160         REGRESSION(r166027) Menu is shown and immediately hidden after doubletap gesture.
1161         https://bugs.webkit.org/show_bug.cgi?id=131646
1162         <rdar://problem/16614374>
1163
1164         Reviewed by Benjamin Poulain.
1165
1166         This is a problem with every gesture that changes the selection
1167         We don't need to delay updating the selection if the selection is
1168         being changed with a gesture.
1169
1170         * UIProcess/ios/WKContentViewInteraction.h:
1171         * UIProcess/ios/WKContentViewInteraction.mm:
1172         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]):
1173         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
1174         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
1175         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
1176         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
1177         (-[WKContentView _selectionChanged]):
1178
1179 2014-04-14  Dan Bernstein  <mitz@apple.com>
1180
1181         Let the bundle form client know whether a change in a text field was initiated by user typing
1182         https://bugs.webkit.org/show_bug.cgi?id=131643
1183
1184         Reviewed by Sam Weinig.
1185
1186         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added
1187         initiatedByUserTyping parameter to the delegate method.
1188
1189         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1190         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Updated overload of
1191         textDidChangeInTextField to take the initiatedByUserTyping parameter and pass it along to
1192         the delegate.
1193
1194         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
1195         (API::InjectedBundle::FormClient::textDidChangeInTextField): Added initiatedByUserTyping
1196         parameter.
1197
1198         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
1199         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField): Maintained the existing
1200         behavior of not calling the C SPI client if the change was not initiated by user typing.
1201         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Updated for added parameter.
1202
1203         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1204         (WebKit::WebEditorClient::textDidChangeInTextField): Changed to call the bundle client
1205         function unconditionally, but pass along whether the change was initiated by user typing.
1206
1207 2014-04-14  Dan Bernstein  <mitz@apple.com>
1208
1209         [Cocoa] Add a WKWebProcessPlugInFormDelegate method corresponding to willSendSubmitEvent
1210         https://bugs.webkit.org/show_bug.cgi?id=131639
1211
1212         Reviewed by Tim Horton.
1213
1214         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared
1215         new delegate method.
1216         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1217         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added an override
1218         of API::InjectedBundle::FormClient::willSendSubmitEvent which calls the new delegate
1219         method.
1220
1221 2014-04-14  Benjamin Poulain  <bpoulain@apple.com>
1222
1223         [iOS][WK2] Change the SPI used when starting the rotation animation
1224         https://bugs.webkit.org/show_bug.cgi?id=131638
1225
1226         Reviewed by Tim Horton.
1227
1228         Having an update block where all the properties are changed is more convenient for Safari.
1229
1230         * UIProcess/API/Cocoa/WKWebView.mm:
1231         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1232         (-[WKWebView _beginAnimatedResizeToSize:obscuredInsets:minimumLayoutSizeOverride:]): Deleted.
1233         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1234
1235 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1236
1237         [iOS WK2] Hash table assertion closing a tab
1238         https://bugs.webkit.org/show_bug.cgi?id=131640
1239
1240         Reviewed by Tim Horton.
1241         
1242         Have RemoteLayerTreeContext keep track of all PlatformCALayerRemotes,
1243         and clear their context pointer when it is being destroyed to avoid
1244         calling into a deleted object later.
1245
1246         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1247         (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
1248         (WebKit::PlatformCALayerRemote::addAnimationForKey):
1249         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1250         (WebKit::PlatformCALayerRemote::clearContext):
1251         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1252         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1253         (WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
1254         (WebKit::RemoteLayerTreeContext::layerWasCreated):
1255         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
1256
1257 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1258
1259         Allow dynamic changes of WKThumbnailView snapshot scale
1260         https://bugs.webkit.org/show_bug.cgi?id=131628
1261         <rdar://problem/16584156>
1262
1263         Reviewed by Beth Dakin.
1264
1265         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1266         (-[_WKThumbnailView _requestSnapshotIfNeeded]):
1267         Don't bail from requesting a snapshot just because we already had one; we want to resnapshot.
1268         Keep track of when we bail from requesting a snapshot because we have one in-flight, so we can request it later.
1269
1270         (-[_WKThumbnailView _didTakeSnapshot:]):
1271         Apply the scale to the bitmap size (whoops!).
1272         Make CA always resize the content to fill the thumbnail view's layer, respecting aspect ratio.
1273         Re-snapshot if we previously deferred a snapshot.
1274
1275         (-[_WKThumbnailView setScale:]):
1276         If we get a scale change, request a new snapshot.
1277
1278         (-[_WKThumbnailView setUsesSnapshot:]):
1279         Never apply thumbnail scale to the page if we're using snapshots. It's unnecessary,
1280         because scale will be applied simply when painting the software snapshot.
1281         Apply the thumbnail scale if we're going from usesSnapshot -> !usesSnapshot.
1282
1283         * WebProcess/WebPage/WebPage.cpp:
1284         (WebKit::WebPage::snapshotAtSize):
1285         Snapshots should use the greater of the two scales, so as to never leave a portion of the snapshot unpainted.
1286
1287 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1288
1289         REGRESSION (WebKit2 View Gestures): Double-tap doesn't work properly when there's no element underneath the cursor
1290         https://bugs.webkit.org/show_bug.cgi?id=131629
1291         <rdar://problem/16192821>
1292
1293         Reviewed by Dan Bernstein.
1294
1295         * UIProcess/mac/ViewGestureControllerMac.mm:
1296         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
1297         If there's nothing under the cursor, zoom towards the cursor instead of towards 0,0.
1298
1299 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1300
1301         Run filter animations in the UI process with UI-side compositing
1302         https://bugs.webkit.org/show_bug.cgi?id=131199
1303         <rdar://problem/16479487>
1304
1305         Reviewed by Sam Weinig.
1306         
1307         * Shared/WebCoreArgumentCoders.cpp: Removed lots of WebCore::
1308         (IPC::ArgumentCoder<SelectionRect>::decode):
1309         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
1310         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
1311         (IPC::ArgumentCoder<PasteboardImage>::encode):
1312         (IPC::ArgumentCoder<PasteboardImage>::decode):
1313         (IPC::ArgumentCoder<URL>::decode):
1314         (IPC::ArgumentCoder<UserStyleSheet>::encode):
1315         (IPC::ArgumentCoder<UserStyleSheet>::decode):
1316         (IPC::ArgumentCoder<UserScript>::encode):
1317         (IPC::ArgumentCoder<UserScript>::decode):
1318         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
1319         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
1320         (IPC::ArgumentCoder<FixedPositionViewportConstraints>::encode):
1321         (IPC::ArgumentCoder<FixedPositionViewportConstraints>::decode):
1322         (IPC::ArgumentCoder<StickyPositionViewportConstraints>::encode):
1323         (IPC::ArgumentCoder<StickyPositionViewportConstraints>::decode):
1324         (IPC::ArgumentCoder<FilterOperation>::encode):
1325         (IPC::decodeFilterOperation):
1326         (IPC::ArgumentCoder<FilterOperations>::encode):
1327         (IPC::ArgumentCoder<WebCore::UserStyleSheet>::encode): Deleted.
1328         (IPC::ArgumentCoder<WebCore::UserStyleSheet>::decode): Deleted.
1329         (IPC::ArgumentCoder<WebCore::UserScript>::encode): Deleted.
1330         (IPC::ArgumentCoder<WebCore::UserScript>::decode): Deleted.
1331         (IPC::ArgumentCoder<WebCore::ScrollableAreaParameters>::encode): Deleted.
1332         (IPC::ArgumentCoder<WebCore::ScrollableAreaParameters>::decode): Deleted.
1333         (IPC::ArgumentCoder<WebCore::FixedPositionViewportConstraints>::encode): Deleted.
1334         (IPC::ArgumentCoder<WebCore::FixedPositionViewportConstraints>::decode): Deleted.
1335         (IPC::ArgumentCoder<WebCore::StickyPositionViewportConstraints>::encode): Deleted.
1336         (IPC::ArgumentCoder<WebCore::StickyPositionViewportConstraints>::decode): Deleted.
1337         (IPC::encodeFilterOperation): Deleted.
1338         Add encoding/decoding support for FilterOperation.
1339         decodeFilterOperation() has to be a bare function because of the RefPtr
1340         out parameter.
1341         REFERENCE filters should never be encoded, since they have CachedSVGDocumentReferences.
1342
1343         * Shared/WebCoreArgumentCoders.h:
1344
1345         * Shared/mac/RemoteLayerTreeTransaction.mm:
1346         (WebKit::RemoteLayerTreeTextStream::operator<<):
1347         Add logging for filter animations to the RemoteLayerTree log output.
1348
1349         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1350         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
1351         (WebKit::GraphicsLayerCARemote::addAnimation): Deleted. We can run
1352         filter animations now.
1353
1354         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
1355         KeyValues have a RefPtr<WebCore::FilterOperation> now (which can't be part of
1356         the union because we need its constructor to get called).
1357         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1358         (WebKit::PlatformCAAnimationRemote::KeyframeValue::encode): Encode the filter.
1359         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode): Decode the filter.
1360         (WebKit::PlatformCAAnimationRemote::setFromValue): Implement.
1361         (WebKit::PlatformCAAnimationRemote::setToValue): Implement.
1362         (WebKit::PlatformCAAnimationRemote::setValues): Implement.
1363         (WebKit::animationValueFromKeyframeValue): Handle filters.
1364
1365 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1366
1367         Fix the build.
1368
1369         * UIProcess/mac/PageClientImpl.h:
1370
1371 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1372
1373         [WK2 iOS] Scrolling to anchor links is broken
1374         https://bugs.webkit.org/show_bug.cgi?id=131618
1375         <rdar://problem/16599144>
1376
1377         Reviewed by Tim Horton.
1378         
1379         The RemoteScrollingTree implements scrollingTreeNodeRequestsScroll
1380         to get informed about requested scroll position updates, and passes
1381         them along via the RemoteScrollingCoordinatorProxy, WebPageProxy and PageClient
1382         to the WKWebView, which performs a scroll.
1383
1384         * UIProcess/API/Cocoa/WKWebView.mm:
1385         (-[WKWebView _scrollToContentOffset:WebCore::]): Scroll to content offset,
1386         taking page scale and insets into account.
1387         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1388         * UIProcess/CoordinatedGraphics/WebView.cpp:
1389         (WebKit::WebView::requestScroll):
1390         * UIProcess/CoordinatedGraphics/WebView.h:
1391         * UIProcess/PageClient.h:
1392         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1393         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll):
1394         Pass scrolls along to the WebPageProxy for the root node. We will also need
1395         to handle programmatic scrolls for overflow soon.
1396         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1397         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1398         (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll):
1399         * UIProcess/Scrolling/RemoteScrollingTree.h:
1400         * UIProcess/WebPageProxy.cpp:
1401         (WebKit::WebPageProxy::requestScroll):
1402         * UIProcess/WebPageProxy.h:
1403         * UIProcess/ios/PageClientImplIOS.h:
1404         * UIProcess/ios/PageClientImplIOS.mm:
1405         (WebKit::PageClientImpl::canScrollView):
1406         (WebKit::PageClientImpl::requestScroll):
1407         * UIProcess/mac/PageClientImpl.mm:
1408         (WebKit::PageClientImpl::requestScroll):
1409
1410 2014-04-12  Antti Koivisto  <antti@apple.com>
1411
1412         Keep secondary tile grid for zoomed-out scale
1413         https://bugs.webkit.org/show_bug.cgi?id=131586
1414
1415         Reviewed by Darin Adler.
1416
1417         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
1418         (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
1419         (WebKit::PlatformCALayerRemoteTiledBacking::customSublayers):
1420         
1421             Always request new sublayer list from tile controller.
1422
1423         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
1424
1425 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1426
1427         Make WK(Web)View magnification setters actually use view-relative positions
1428         https://bugs.webkit.org/show_bug.cgi?id=131611
1429         <rdar://problem/15965239>
1430
1431         Reviewed by Darin Adler.
1432
1433         * UIProcess/API/mac/WKView.mm:
1434         (-[WKView setMagnification:centeredAtPoint:]):
1435         (-[WKView setMagnification:]):
1436         Use scalePageInViewCoordinates instead.
1437
1438         * UIProcess/WebPageProxy.cpp:
1439         (WebKit::WebPageProxy::scalePageInViewCoordinates):
1440         * UIProcess/WebPageProxy.h:
1441         * WebProcess/WebPage/WebPage.cpp:
1442         (WebKit::WebPage::scalePageInViewCoordinates):
1443         (WebKit::WebPage::pageScaleFactor):
1444         * WebProcess/WebPage/WebPage.h:
1445         * WebProcess/WebPage/WebPage.messages.in:
1446         Add scalePageInViewCoordinates, which turns the scale centerpoint within the view
1447         into what scalePage expects: a post-scale scroll offset.
1448
1449 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1450
1451         Support setting a background color on page overlays
1452         https://bugs.webkit.org/show_bug.cgi?id=131600
1453
1454         Reviewed by Darin Adler.
1455
1456         * WebProcess/WebPage/PageOverlay.cpp:
1457         (WebKit::PageOverlay::PageOverlay):
1458         (WebKit::PageOverlay::bounds):
1459         (WebKit::PageOverlay::startFadeInAnimation):
1460         (WebKit::PageOverlay::startFadeOutAnimation):
1461         (WebKit::PageOverlay::startFadeAnimation):
1462         (WebKit::PageOverlay::fadeAnimationTimerFired):
1463         Minor style adjustments.
1464         Use more references everywhere.
1465
1466         (WebKit::PageOverlay::setBackgroundColor):
1467         (WebKit::PageOverlay::setNeedsDisplay):
1468         * WebProcess/WebPage/PageOverlay.h:
1469         (WebKit::PageOverlay::backgroundColor):
1470         Keep track of our background color, and push it down to the page overlay controller if we have one.
1471
1472         * WebProcess/WebPage/PageOverlayController.cpp:
1473         (WebKit::updateOverlayGeometry):
1474         (WebKit::PageOverlayController::clearPageOverlay):
1475         Page overlays will always have the right size, and just use drawsContents to determine
1476         whether or not they should tile/have backing store/etc.
1477
1478         (WebKit::PageOverlayController::installPageOverlay):
1479         (WebKit::PageOverlayController::didChangeOverlayBackgroundColor):
1480         Set the background color of the layer.
1481
1482         * WebProcess/WebPage/PageOverlayController.h:
1483
1484         * WebProcess/WebPage/WebPage.cpp:
1485         (WebKit::WebPage::WebPage):
1486         References!
1487
1488 2014-04-13  Andy Estes  <aestes@apple.com>
1489
1490         [QuickLook] Move file system-related code into WebKit
1491         https://bugs.webkit.org/show_bug.cgi?id=131597
1492
1493         Reviewed by Dan Bernstein.
1494
1495         * WebProcess/Network/WebResourceLoader.h: Made m_quickLookHandle a unique_ptr.
1496         * WebProcess/ios/WebResourceLoaderIOS.mm:
1497         (WebKit::WebResourceLoader::setUpQuickLookHandleIfNeeded):
1498
1499 2014-04-13  Andy Estes  <aestes@apple.com>
1500
1501         REGRESSION (r167164): -[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:] _block_invoke can access a deallocated completionHandler
1502         https://bugs.webkit.org/show_bug.cgi?id=131595
1503
1504         Reviewed by Dan Bernstein.
1505
1506         Make a copy of completionHandler and release it after we're done with it.
1507
1508         * Shared/mac/CookieStorageShim.mm:
1509         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
1510
1511 2014-04-13  Pratik Solanki  <psolanki@apple.com>
1512
1513         Don't use ImportanceAssertion on iOS
1514         https://bugs.webkit.org/show_bug.cgi?id=131481
1515         <rdar://problem/16575830>
1516
1517         Reviewed by Darin Adler.
1518
1519         We have other API to mark processes as being in use on iOS. No need to use ImportanceAssertion.
1520
1521         * Platform/IPC/MessageDecoder.cpp:
1522         * Platform/IPC/MessageDecoder.h:
1523         * Platform/IPC/mac/ConnectionMac.cpp:
1524         (IPC::Connection::receiveSourceEventHandler):
1525         * Platform/IPC/mac/ImportanceAssertion.h:
1526
1527 2014-04-13  Commit Queue  <commit-queue@webkit.org>
1528
1529         Unreviewed, rolling out r167168 and r167194.
1530         https://bugs.webkit.org/show_bug.cgi?id=131589
1531
1532         Caused massive ASSERTION failures on the GTK Debug bot
1533         (Requested by philn on #webkit).
1534
1535         Reverted changesets:
1536
1537         "[GTK] Add HighDPI support for non-accelerated compositing
1538         contents"
1539         https://bugs.webkit.org/show_bug.cgi?id=131562
1540         http://trac.webkit.org/changeset/167168
1541
1542         "Unreviewed. Fix GTK+ build with recent cairo and GTK+ after
1543         r167168."
1544         http://trac.webkit.org/changeset/167194
1545
1546 2014-04-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1547
1548         Unreviewed. Fix GTK+ build with recent cairo and GTK+ after r167168.
1549
1550         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1551         (webkitWebViewBaseCreateWebPage):
1552
1553 2014-04-12  Andy Estes  <aestes@apple.com>
1554
1555         [iOS] Move QuickLookHandle from ResourceLoader to WebResourceLoader
1556         https://bugs.webkit.org/show_bug.cgi?id=131580
1557
1558         Reviewed by Darin Adler.
1559
1560         There's no need to bloat WebKit1's ResourceLoader with a pointer that
1561         only WebKit2's WebResourceLoader cares about.
1562
1563         * WebProcess/Network/WebResourceLoader.cpp:
1564         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
1565         (WebKit::WebResourceLoader::didReceiveData):
1566         (WebKit::WebResourceLoader::didFinishResourceLoad):
1567         (WebKit::WebResourceLoader::didFailResourceLoad):
1568         * WebProcess/Network/WebResourceLoader.h:
1569         * WebProcess/ios/WebResourceLoaderIOS.mm:
1570         (WebKit::WebResourceLoader::setUpQuickLookHandleIfNeeded):
1571
1572 2014-04-11  Alexey Proskuryakov  <ap@apple.com>
1573
1574         [Mac] Crashes when copying or pasting huge images
1575         https://bugs.webkit.org/show_bug.cgi?id=131576
1576         <rdar://problem/12131833>
1577         <rdar://problem/14427398>
1578
1579         Reviewed by Darin Adler.
1580
1581         Added a few null checks for SharedMemory::create() return value in pasteboard code.
1582         Error handling feels a bit sketchy, but
1583         - I'm not sure what it should look like ideally;
1584         - it matches the kind of error handling we already have in these functions;
1585         - it appears to work reasonably well in practice. We get empty content, which
1586         is not nice, but not particularly problematic either. When copying an animated GIF,
1587         we also get the GIF in RTFD flavor, so even pasting into NSTextViews works!
1588
1589         * Platform/mac/SharedMemoryMac.cpp:
1590         (WebKit::SharedMemory::createFromVMBuffer):
1591         * UIProcess/mac/WebContextMac.mm:
1592         (WebKit::WebContext::getPasteboardBufferForType):
1593         (WebKit::WebContext::readBufferFromPasteboard):
1594         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1595         (WebKit::WebPlatformStrategies::setBufferForType):
1596
1597         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage):
1598         Also renamed some variables to prevent name collisions with with nested scope.
1599
1600 2014-04-11  Ryuan Choi  <ryuan.choi@samsung.com>
1601
1602         Unreviewed build fix on the EFL port after r167152
1603
1604         * WebProcess/WebPage/PageOverlay.cpp:
1605         (WebKit::PageOverlay::bounds):
1606
1607 2014-04-11  Hyowon Kim  <hw1008.kim@samsung.com>
1608
1609         [WK2] WebProcess crashes, when closing window after opening page by means of context menu
1610         https://bugs.webkit.org/show_bug.cgi?id=131439
1611
1612         Reviewed by Tim Horton.
1613
1614         CoordinatedGraphicsLayer calls notifyFlushRequired() through its client when destroyed.
1615         When PageOverlayController::notifyFlushRequired() is called, the DrawingArea could be null
1616         because it's destoryed in WebPage::close().
1617
1618         * WebProcess/WebPage/PageOverlayController.cpp:
1619         (WebKit::PageOverlayController::notifyFlushRequired): Add null check of m_webPage->drawingArea().
1620
1621 2014-04-11  Tim Horton  <timothy_horton@apple.com>
1622
1623         Lots of compositing test failures after r167152
1624         https://bugs.webkit.org/show_bug.cgi?id=131574
1625
1626         Reviewed by Simon Fraser.
1627
1628         * WebProcess/WebPage/PageOverlayController.h:
1629         Skip page overlay layers in layer tree dumps, for consistency between platforms.
1630
1631 2014-04-11  Beth Dakin  <bdakin@apple.com>
1632
1633         Need WK2 API to disable rubber-banding
1634         https://bugs.webkit.org/show_bug.cgi?id=131567
1635
1636         Reviewed by Simon Fraser.
1637
1638         New API allows the client to enable/disable horizontal or vertical rubber-banding. 
1639         By default, rubber-banding is enabled.
1640         * UIProcess/API/C/WKPage.cpp:
1641         (WKPageVerticalRubberBandingIsEnabled):
1642         (WKPageSetEnableVerticalRubberBanding):
1643         (WKPageHorizontalRubberBandingIsEnabled):
1644         (WKPageSetEnableHorizontalRubberBanding):
1645         * UIProcess/API/C/WKPage.h:
1646         * UIProcess/WebPageProxy.cpp:
1647         (WebKit::WebPageProxy::WebPageProxy):
1648         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
1649         (WebKit::WebPageProxy::verticalRubberBandingIsEnabled):
1650         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
1651         (WebKit::WebPageProxy::horizontalRubberBandingIsEnabled):
1652         * UIProcess/WebPageProxy.h:
1653         * WebProcess/WebPage/WebPage.cpp:
1654         (WebKit::WebPage::setEnableVerticalRubberBanding):
1655         (WebKit::WebPage::setEnableHorizontalRubberBanding):
1656         * WebProcess/WebPage/WebPage.h:
1657         * WebProcess/WebPage/WebPage.messages.in:
1658
1659 2014-04-11  Tim Horton  <timothy_horton@apple.com>
1660
1661         Fix the Mac build.
1662
1663         * WebProcess/WebPage/FindController.cpp:
1664         (WebKit::FindController::updateFindIndicator):
1665
1666 2014-04-11  Tim Horton  <timothy_horton@apple.com>
1667
1668         [iOS WebKit2] Find-in-page indicator
1669         https://bugs.webkit.org/show_bug.cgi?id=131510
1670         <rdar://problem/16547777>
1671
1672         Reviewed by Simon Fraser and Enrica Casucci.
1673
1674         * WebKit2.xcodeproj/project.pbxproj:
1675         * WebProcess/WebPage/FindController.cpp:
1676         (WebKit::FindController::updateFindUIAfterPageScroll):
1677         WebKit2 will clear the selection if we reveal it while not enabling selection painting.
1678         So, avoid revealing it.
1679
1680         (WebKit::FindController::findString):
1681         (WebKit::FindController::hideFindIndicator):
1682         (WebKit::FindController::willFindString):
1683         (WebKit::FindController::didFailToFindString):
1684         (WebKit::FindController::didHideFindIndicator):
1685         #if out the cross-platform find indicator code on iOS; it will be replaced
1686         by the code in FindControllerIOS.
1687
1688         * WebProcess/WebPage/FindController.h:
1689
1690         * WebProcess/WebPage/ios/FindControllerIOS.mm: Added.
1691         (highlightColor):
1692         (WebKit::FindIndicatorOverlayClientIOS::drawRect):
1693         Paint the selection (with black text forced on), and the yellow rounded rect
1694         into the indicator page overlay.
1695
1696         (WebKit::FindController::updateFindIndicator):
1697         Create or update a small document-relative page overlay in the selection rect.
1698
1699         (WebKit::FindController::hideFindIndicator):
1700         (WebKit::FindController::willFindString):
1701         (WebKit::FindController::didFailToFindString):
1702         (WebKit::FindController::didHideFindIndicator):
1703         Add willFindString, didFailToFindString, and didHideFindIndicator functions.
1704         They do nothing, except on iOS where they are used to prevent selection change
1705         messages from being dispatched while using find-in-page, and to force
1706         WebCore to compute a selection rect (via updateAppearance) despite the selection not being painted.
1707
1708         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
1709         (WebKit::FindIndicatorOverlayClientIOS::setFrame):
1710
1711 2014-04-11  Owen Taylor  <otaylor@redhat.com>
1712
1713         [GTK] Add HighDPI support for non-accelerated compositing contents
1714         https://bugs.webkit.org/show_bug.cgi?id=131562
1715
1716         Reviewed by Martin Robinson.
1717
1718         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1719         (scaleFactorChanged): Added this callback to pass scale changes to the page proxy.
1720         (webkitWebViewBaseCreateWebPage): Attach the callback to the notify signal.
1721         * UIProcess/cairo/BackingStoreCairo.cpp:
1722         (WebKit::createBackingStoreForGTK): Pass the scale factor to the WebCore backing store.
1723         (WebKit::BackingStore::incorporateUpdate): Ditto.
1724
1725 2014-04-10  Jer Noble  <jer.noble@apple.com>
1726
1727         [WK2] Dispatch to main thread's run loop to handle cookie requests.
1728         https://bugs.webkit.org/show_bug.cgi?id=131524
1729
1730         Reviewed by Brady Eidson.
1731
1732         When using synchronous network APIs from the main thread (e.g., -[NSImage
1733         initWithContentsOfURL:]) our cookie shim would attempt to dispath_async
1734         to the main thread to handle the cookie request, and block against the original
1735         request. CFNetwork is still servicing the run loop however, so rather than
1736         dispatch_async to the main queue, use the RunLoop to dispatch to the main thread.
1737
1738         * Shared/mac/CookieStorageShim.mm:
1739         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
1740
1741 2014-04-11  Tim Horton  <timothy_horton@apple.com>
1742
1743         Make the stylebot happier with r167154.
1744
1745         * UIProcess/PageClient.h:
1746         * UIProcess/WebPageProxy.h:
1747         * UIProcess/ios/PageClientImplIOS.h:
1748
1749 2014-04-11  Tim Horton  <timothy_horton@apple.com>
1750
1751         [iOS WebKit2] Expose a simplified zoom-to-rect to the WebProcess
1752         https://bugs.webkit.org/show_bug.cgi?id=131563
1753
1754         Reviewed by Simon Fraser.
1755
1756         * UIProcess/PageClient.h:
1757         * UIProcess/WebPageProxy.h:
1758         * UIProcess/WebPageProxy.messages.in:
1759         * UIProcess/ios/PageClientImplIOS.h:
1760         * UIProcess/ios/PageClientImplIOS.mm:
1761         (WebKit::PageClientImpl::zoomToRect):
1762         * UIProcess/ios/WebPageProxyIOS.mm:
1763         (WebKit::WebPageProxy::zoomToRect):
1764         * WebProcess/WebPage/WebPage.h:
1765         * WebProcess/WebPage/ios/WebPageIOS.mm:
1766         (WebKit::WebPage::zoomToRect):
1767         Add a simple message that calls WKContentView's zoom-to-rect code given just a rect and min/max scale.
1768         We will use the center of the rect as the zoom origin, and will try to show the whole rect.
1769
1770 2014-04-10  Jer Noble  <jer.noble@apple.com>
1771
1772         [iOS][WK2] Videos should animate into and out of fullscreen.
1773         https://bugs.webkit.org/show_bug.cgi?id=131497
1774
1775         Reviewed by Simon Fraser.
1776
1777         Pass a starting rect for the enterFullscreen animation and an ending rect
1778         for the exitFullscreen animation.
1779
1780         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1781         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
1782         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1783         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): Pass initialFrame.
1784         * WebProcess/ios/WebVideoFullscreenManager.mm:
1785         (WebKit::screenRectOfContents): Casts node -> element and returns its screenRect().
1786         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Pass initialFrame.
1787         (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): Pass finalFrame.
1788
1789 2014-04-11  Tim Horton  <timothy_horton@apple.com>
1790
1791         Support document-relative and custom-frame page overlays
1792         https://bugs.webkit.org/show_bug.cgi?id=131560
1793         <rdar://problem/16595556>
1794
1795         Reviewed by Simon Fraser.
1796
1797         Add "document-relative" overlays, which attach to (and scroll with) the document,
1798         and can be given a frame rect within the document to avoid overallocation of backing store.
1799
1800         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1801         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
1802         * WebProcess/WebPage/WebPage.cpp:
1803         (WebKit::WebPage::mainFrame):
1804         (WebKit::WebPage::mainFrameView):
1805         (WebKit::WebPage::didChangeScrollOffsetForFrame):
1806         * WebProcess/WebPage/WebPage.h:
1807         Let the PageOverlayController know *which* frame scrolled, instead of "any frame".
1808
1809         * WebProcess/WebPage/FindController.cpp:
1810         (WebKit::FindController::updateFindUIAfterPageScroll):
1811         Factor out shared code.
1812
1813         (WebKit::FindController::willMoveToWebPage):
1814         (WebKit::FindController::drawRect):
1815         We can use clearRect() instead of a transparency layer and fillRect().
1816         I've looked through all the other overlay clients I know of and none of them
1817         depend on having a transparency layer at the overlay level.
1818
1819         * WebProcess/WebPage/PageOverlay.cpp:
1820         (WebKit::PageOverlay::create):
1821         (WebKit::PageOverlay::PageOverlay):
1822         (WebKit::PageOverlay::bounds):
1823         (WebKit::PageOverlay::frame):
1824         (WebKit::PageOverlay::setFrame):
1825         (WebKit::PageOverlay::drawRect):
1826         Add OverlayType, which allows creation of Document or View relative overlays.
1827         All overlays up to this point are View relative, so we default to that.
1828         Document-relative overlays scroll with the page instead of repainting as
1829         the page scrolls. They can also be given an explicit frame, allowing them
1830         to be smaller than the entire document.
1831
1832         * WebProcess/WebPage/PageOverlay.h:
1833         (WebKit::PageOverlay::overlayType):
1834         (WebKit::PageOverlay::webPage):
1835         (WebKit::PageOverlay::client): Deleted.
1836         * WebProcess/WebPage/PageOverlayController.cpp:
1837         (WebKit::PageOverlayController::initialize):
1838         (WebKit::PageOverlayController::installPageOverlay):
1839         (WebKit::PageOverlayController::uninstallPageOverlay):
1840         (WebKit::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
1841         (WebKit::updateOverlayGeometry):
1842         (WebKit::PageOverlayController::setPageOverlayNeedsDisplay):
1843         (WebKit::PageOverlayController::didChangeViewSize):
1844         (WebKit::PageOverlayController::didChangeDocumentSize):
1845         (WebKit::PageOverlayController::didChangeDeviceScaleFactor):
1846         (WebKit::PageOverlayController::didScrollFrame):
1847         (WebKit::PageOverlayController::flushPageOverlayLayers):
1848         (WebKit::PageOverlayController::didChangeOverlayFrame):
1849         Keep two overlay root layers - one for view-relative
1850         and one for document-relative overlays.
1851         Don't force synchronous scrolling if we only have document-relative overlays.
1852         Update the overlay's position as well as its size whenever necessary.
1853         Update document-relative overlay geometry when the document size changes.
1854         Only explicitly flush view-relative overlays; document-relative ones
1855         are plugged into the WebCore layer tree and flushed along with the page.
1856
1857         * WebProcess/WebPage/PageOverlayController.h:
1858         (WebKit::PageOverlayController::documentOverlayRootLayer):
1859         (WebKit::PageOverlayController::viewOverlayRootLayer):
1860         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1861         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1862         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
1863         (WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
1864         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1865         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
1866         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
1867         Let the PageOverlay controller know when the document size changes.
1868         When we set up compositing, push the document overlay root layer
1869         down into WebCore.
1870
1871 2014-04-11  Pratik Solanki  <psolanki@apple.com>
1872
1873         [iOS WebKit2]: Share NSURLCache directory for webkit processes
1874         https://bugs.webkit.org/show_bug.cgi?id=131513
1875         <rdar://problem/16420859>
1876
1877         Reviewed by Alexey Proskuryakov.
1878
1879         Use iOS specific NSURLCache API to share the cache directory used by the networking process,
1880         web process and Safari.
1881
1882         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1883         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1884         * WebProcess/cocoa/WebProcessCocoa.mm:
1885         (WebKit::WebProcess::platformInitializeWebProcess):
1886
1887 2014-04-11  Alexey Proskuryakov  <ap@apple.com>
1888
1889         [Mac] Add IconServices to WebProcess sandbox profile
1890         https://bugs.webkit.org/show_bug.cgi?id=131558
1891         <rdar://problem/16552397>
1892
1893         Reviewed by Brady Eidson.
1894
1895         * WebProcess/com.apple.WebProcess.sb.in:
1896
1897 2014-04-11  Antti Koivisto  <antti@apple.com>
1898
1899         Pipe initial scale factor to TileController
1900         https://bugs.webkit.org/show_bug.cgi?id=131521
1901
1902         Reviewed by Tim Horton.
1903
1904         * WebProcess/WebPage/ios/WebPageIOS.mm:
1905         (WebKit::WebPage::viewportConfigurationChanged):
1906
1907 2014-04-10  Chris Fleizach  <cfleizach@apple.com>
1908
1909         AX: WebProcess at com.apple.WebCore: WebCore::AXObjectCache::rootObject + 18
1910         https://bugs.webkit.org/show_bug.cgi?id=131522
1911
1912         Reviewed by Anders Carlsson.
1913
1914         Protect against documents that have had their render tree destroyed, and no longer return a valid cache.
1915
1916         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1917
1918 2014-04-11  Brent Fulgham  <bfulgham@apple.com>
1919
1920         [Mac] Prevent crash when exiting fullscreen mode
1921         https://bugs.webkit.org/show_bug.cgi?id=131528
1922
1923         Reviewed by Jer Noble.
1924
1925         * UIProcess/mac/WKFullScreenWindowController.mm:
1926         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
1927         Clean up the _scaleAnimation controller, not just the _fadeAnimation controller.
1928         (-[WKFullScreenWindowController close]): If we are doing an immediate
1929         close of the view, we need to stop animations so we avoid any
1930         final timer events from interacting with invalid window handles.
1931
1932 2014-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1933
1934         wk2-gtk does not display anything
1935         https://bugs.webkit.org/show_bug.cgi?id=125558
1936
1937         Reviewed by Martin Robinson.
1938
1939         Remove fcntl call to set access mode flags on the duplicated files
1940         descriptor. Those flags are ignored in Linux and make fcntl to
1941         fail in FreeBSD. We should handle the case where the passed
1942         protection is ReadOnly.
1943         Thanks to Raphael Kubo da Costa who proposed the solution.
1944
1945         * Platform/unix/SharedMemoryUnix.cpp:
1946         (WebKit::SharedMemory::createHandle):
1947         (WebKit::accessModeFile): Deleted.
1948
1949 2014-04-11  Zan Dobersek  <zdobersek@igalia.com>
1950
1951         [GTK][WK2] Move Vector objects into WebEditorClient::executePendingEditorCommands() invocations
1952         https://bugs.webkit.org/show_bug.cgi?id=131454
1953
1954         Reviewed by Carlos Garcia Campos.
1955
1956         * WebProcess/WebCoreSupport/WebEditorClient.h:
1957         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1958         (WebKit::WebEditorClient::executePendingEditorCommands): Take a const reference of the Vector
1959         object to avoid unnecessary copies. Also deploy two range-based for loops and efficiently move
1960         the Editor::Command objects into the other Vector.
1961
1962 2014-04-10  Dan Bernstein  <mitz@apple.com>
1963
1964         <rdar://problem/16582465> [Cocoa] Avoid casts from CF types to unrelated Objective-C types
1965         https://bugs.webkit.org/show_bug.cgi?id=131529
1966
1967         Reviewed by Mark Rowe.
1968
1969         * Shared/API/c/cf/WKStringCF.mm:
1970         (WKStringCreateWithCFString): Cast the CFStringRef into its toll-free-bridged counterpart,
1971         NSString, then cast the NSString into a WKNSString.
1972         * Shared/API/c/cf/WKURLCF.mm:
1973         (WKURLCreateWithCFURL): Cast the CFURLRef into its toll-free-bridged counterpart, NSURL,
1974         then cast the NSURL into a WKNSURL.
1975
1976 2014-04-10  Dan Bernstein  <mitz@apple.com>
1977
1978         BundlePageDiagnosticLoggingClient leaks every string passing through it.
1979         https://bugs.webkit.org/show_bug.cgi?id=130140
1980
1981         Reviewed by Brent Fulgham.
1982
1983         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp:
1984         (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessage): Don’t copy the
1985         strings passed into the bundle client.
1986
1987 2014-04-10  Benjamin Poulain  <bpoulain@apple.com>
1988
1989         Try to fix the debug bots after r167102
1990
1991         * WebProcess/cocoa/WebProcessCocoa.mm:
1992         (WebKit::WebProcess::platformInitializeWebProcess):
1993
1994 2014-04-10  Gavin Barraclough  <barraclough@apple.com>
1995
1996         Add user default for FTL JIT
1997         https://bugs.webkit.org/show_bug.cgi?id=131520
1998
1999         Reviewed by Benjamin Poulain.
2000
2001         * Shared/WebProcessCreationParameters.cpp:
2002         (WebKit::WebProcessCreationParameters::decode):
2003         * UIProcess/mac/WebContextMac.mm:
2004         (WebKit::registerUserDefaultsIfNeeded):
2005         (WebKit::WebContext::platformInitializeWebProcess):
2006             - D'oh, whitespace.
2007
2008 2014-04-10  Gavin Barraclough  <barraclough@apple.com>
2009
2010         Add user default for FTL JIT
2011         https://bugs.webkit.org/show_bug.cgi?id=131520
2012
2013         Reviewed by Benjamin Poulain.
2014
2015         * Shared/WebProcessCreationParameters.cpp:
2016         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
2017         (WebKit::WebProcessCreationParameters::encode):
2018         (WebKit::WebProcessCreationParameters::decode):
2019         * Shared/WebProcessCreationParameters.h:
2020             - pass setting to WebContent process.
2021         * UIProcess/mac/WebContextMac.mm:
2022         (WebKit::registerUserDefaultsIfNeeded):
2023         (WebKit::WebContext::platformInitializeWebProcess):
2024             - read user default.
2025         * WebProcess/cocoa/WebProcessCocoa.mm:
2026         (WebKit::WebProcess::platformInitializeWebProcess):
2027             - set JSC::Option.
2028
2029 2014-04-10  Dan Bernstein  <mitz@apple.com>
2030
2031         [Cocoa] Notify the form delegate when the custom button in the form accessory view is tapped
2032         https://bugs.webkit.org/show_bug.cgi?id=131518
2033
2034         Reviewed by Tim Horton.
2035
2036         * UIProcess/API/Cocoa/_WKFormDelegate.h: Declared new delegate method.
2037         * UIProcess/ios/WKContentViewInteraction.mm:
2038         (-[WKContentView accessoryAutoFill]): Call the new delegate method.
2039
2040 2014-04-10  Commit Queue  <commit-queue@webkit.org>
2041
2042         Unreviewed, rolling out r167097.
2043         https://bugs.webkit.org/show_bug.cgi?id=131519
2044
2045         there was already a mechanism for this, and this was
2046         incomplete anyway (Requested by thorton on #webkit).
2047
2048         Reverted changeset:
2049
2050         "[iOS WebKit2] Disable the find overlay for now"
2051         https://bugs.webkit.org/show_bug.cgi?id=131509
2052         http://trac.webkit.org/changeset/167097
2053
2054 2014-04-10  Tim Horton  <timothy_horton@apple.com>
2055
2056         [iOS WebKit2] Disable the find overlay for now
2057         https://bugs.webkit.org/show_bug.cgi?id=131509
2058
2059         Reviewed by Adele Peterson.
2060
2061         * Shared/WebPreferencesStore.h:
2062         * WebProcess/WebPage/FindController.cpp:
2063         (WebKit::FindController::FindController):
2064         (WebKit::FindController::hideFindOverlay):
2065         (WebKit::FindController::hideFindUI):
2066         (WebKit::FindController::setShouldShowOverlay):
2067         * WebProcess/WebPage/FindController.h:
2068         * WebProcess/WebPage/WebPage.cpp:
2069         (WebKit::WebPage::updatePreferences):
2070         Add a setting allowing us to turn off the find-in-page overlay on iOS.
2071
2072 2014-04-10  Sergio Villar Senin  <svillar@igalia.com>
2073
2074         Unreviewed GTK build fix after r167074.
2075
2076         This involves replacing resetDragSession() by
2077         resetCurrentDragInformation() and dragSession().operation by
2078         currentDragOperation().
2079
2080         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2081         (webkitWebViewBaseDragDataReceived):
2082         (webkitWebViewBaseDragMotion):
2083         (dragExitedCallback):
2084
2085 2014-04-10  Owen Taylor  <otaylor@redhat.com>
2086
2087         [Cairo] Implement ShareableBitmap::paint() with scale factor
2088         https://bugs.webkit.org/show_bug.cgi?id=64665
2089
2090         Reviewed by Martin Robinson.
2091
2092         * Shared/cairo/ShareableBitmapCairo.cpp (WebKit::ShareableBitmap::paint):
2093
2094 2014-04-10  Enrica Casucci  <enrica@apple.com>
2095
2096         [iOS WebKit2] Support phraseboundary gesture recognizer for CJK.
2097         https://bugs.webkit.org/show_bug.cgi?id=131493
2098         <rdar://problem/16319583>
2099
2100         Reviewed by Benjamin Poulain.
2101
2102         On iOS it is possible with a gesture to change the selection
2103         within the marked text.
2104         Changing the selection triggers also the update of the inline candidates
2105         over the keyboard area.
2106         The patch adds the logic to decide whether the gesture can begin
2107         as well as the code for the movement of
2108         the selection within the marked range.
2109         The gesture is allowed to start within a given radius from the marked
2110         area.
2111
2112         * Shared/InteractionInformationAtPosition.cpp:
2113         (WebKit::InteractionInformationAtPosition::encode):
2114         (WebKit::InteractionInformationAtPosition::decode):
2115         * Shared/InteractionInformationAtPosition.h:
2116         (WebKit::InteractionInformationAtPosition::InteractionInformationAtPosition):
2117         * Shared/ios/GestureTypes.h:
2118         * UIProcess/WebPageProxy.cpp:
2119         (WebKit::WebPageProxy::editorStateChanged):
2120         * UIProcess/ios/WKContentViewInteraction.mm:
2121         (-[WKContentView pointIsNearMarkedText:]):
2122         (toGestureType):
2123         (toUIWKGestureType):
2124         * WebProcess/WebPage/ios/WebPageIOS.mm:
2125         (WebKit::WebPage::selectWithGesture):
2126         (WebKit::WebPage::getPositionInformation):
2127
2128 2014-04-10  Enrica Casucci  <enrica@apple.com>
2129
2130         Unreviewed iOS build fix after http://trac.webkit.org/changeset/167074
2131
2132         * UIProcess/WebPageProxy.cpp:
2133         (WebKit::WebPageProxy::WebPageProxy):
2134
2135 2014-04-10  Alexey Proskuryakov  <ap@apple.com>
2136
2137         Gtk build fix.
2138
2139         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction):
2140
2141 2014-04-09  Alexey Proskuryakov  <ap@apple.com>
2142
2143         Eliminate DragSession structure
2144         https://bugs.webkit.org/show_bug.cgi?id=131465
2145
2146         Reviewed by Benjamin Poulain.
2147
2148         * Scripts/webkit2/messages.py:
2149         (struct_or_class):
2150         * Shared/WebCoreArgumentCoders.cpp:
2151         (IPC::ArgumentCoder<DragSession>::encode): Deleted.
2152         (IPC::ArgumentCoder<DragSession>::decode): Deleted.
2153         * Shared/WebCoreArgumentCoders.h:
2154         * UIProcess/API/mac/WKView.mm:
2155         (-[WKView draggingEntered:]):
2156         (-[WKView draggingUpdated:]):
2157         * UIProcess/WebPageProxy.cpp:
2158         (WebKit::WebPageProxy::WebPageProxy):
2159         (WebKit::WebPageProxy::didPerformDragControllerAction):
2160         * UIProcess/WebPageProxy.h:
2161         (WebKit::WebPageProxy::currentDragOperation):
2162         (WebKit::WebPageProxy::currentDragIsOverFileInput):
2163         (WebKit::WebPageProxy::currentDragNumberOfFilesToBeAccepted):
2164         (WebKit::WebPageProxy::resetCurrentDragInformation):
2165         (WebKit::WebPageProxy::dragSession): Deleted.
2166         (WebKit::WebPageProxy::resetDragSession): Deleted.
2167         * UIProcess/WebPageProxy.messages.in:
2168         * WebProcess/WebPage/WebPage.cpp:
2169         (WebKit::WebPage::performDragControllerAction):
2170
2171 2014-04-10  Martin Robinson  <mrobinson@igalia.com>
2172
2173         [GTK] LayerTreeHostGtk is creating a software scene graph
2174         https://bugs.webkit.org/show_bug.cgi?id=131471
2175
2176         Reviewed by Sergio Villar Senin.
2177
2178         At some point, a regression was introduced that sent the GTK+ WebKit2 scenegraph down the
2179         software route. The rest of the file depends on the fact that the TextureMapper is the OpenGL
2180         variety, so we should force that explicitly. This is causing crashes locally and soon we
2181         should be able to test this directly.
2182
2183         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2184         (WebKit::LayerTreeHostGtk::initialize): Force the use of the OpenGL scenegraph.
2185
2186 2014-04-09  Jeremy Jones  <jeremyj@apple.com>
2187
2188         Fix build failure when #if USE(XPC_SERVICES) is false.
2189         https://bugs.webkit.org/show_bug.cgi?id=131474
2190
2191         Reviewed by Dan Bernstein.
2192
2193         Fix build. 
2194
2195         * UIProcess/ios/WebProcessProxyIOS.mm:
2196         Add #if around BackgroundTabFlags ForegroundTabFlags to prevent unused variable error.
2197
2198 2014-04-09  Ryuan Choi  <ryuan.choi@samsung.com>
2199
2200         [EFL][WK2] Add API to set preferred languages
2201         https://bugs.webkit.org/show_bug.cgi?id=131435
2202
2203         Reviewed by Gyuyoung Kim.
2204
2205         Add ewk_context_preferred_languages_set to change the list of "Accept-Language".
2206         This list is used to receive alternative version of contents, which is related
2207         to specified languages from the contents provider.
2208
2209         * UIProcess/API/efl/ewk_context.cpp:
2210         (ewk_context_preferred_languages_set):
2211         * UIProcess/API/efl/ewk_context.h:
2212         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
2213         (serverCallback):
2214         (TEST_F): Added test case for ewk_context_preferred_languages_set
2215
2216 2014-04-09  Benjamin Poulain  <bpoulain@apple.com>
2217
2218         [iOS][WK2] Add the initial WebProcess handling of animated resize for rotation
2219         https://bugs.webkit.org/show_bug.cgi?id=131469
2220
2221         Reviewed by Tim Horton.
2222
2223         Add the basic handling of dynamic resize from the WebProcess.
2224
2225         On animated resize, the UIProcess decides new target rects and scale. The information
2226         is then passed to the WebProcess to update the content.
2227
2228         For various reason, the target rects and scale computed by the UIProcess can be incorrect
2229         (for example, if viewport constraints limit the scale).
2230
2231         In those cases, the WebProcess has all the information to compute a better target. This patch
2232         adds such a basic update mechanism.
2233
2234         Once the new values are computed, they are sent back to the UIProcess. If the rotation animation
2235         is still ongoing, we do not want mess with it. What we do is set a temporary transform on the subviews
2236         and restore the real value after the animation. The key is to have the two matrix multiplying to the end
2237         value so that there is no visual difference.
2238
2239         * UIProcess/API/Cocoa/WKWebView.mm:
2240         (-[WKWebView _didCommitLayerTree:WebKit::]):
2241         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
2242         (setViewportConfigurationMinimumLayoutSize):
2243         (-[WKWebView _frameOrBoundsChanged]):
2244         (-[WKWebView _setMinimumLayoutSizeOverride:]):
2245         (-[WKWebView _beginAnimatedResizeToSize:obscuredInsets:minimumLayoutSizeOverride:]):
2246         (-[WKWebView _endAnimatedResize]):
2247         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2248         * UIProcess/API/ios/WKViewIOS.mm:
2249         (-[WKView _frameOrBoundsChanged]):
2250         (-[WKView setMinimumLayoutSizeOverride:]):
2251         * UIProcess/PageClient.h:
2252         * UIProcess/WebPageProxy.h:
2253         * UIProcess/WebPageProxy.messages.in:
2254         * UIProcess/ios/PageClientImplIOS.h:
2255         * UIProcess/ios/PageClientImplIOS.mm:
2256         (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
2257         * UIProcess/ios/WKContentView.h:
2258         * UIProcess/ios/WKContentView.mm:
2259         (-[WKContentView setMinimumLayoutSize:]): Deleted.
2260         * UIProcess/ios/WebPageProxyIOS.mm:
2261         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2262         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
2263         * WebProcess/WebPage/WebPage.h:
2264         * WebProcess/WebPage/WebPage.messages.in:
2265         * WebProcess/WebPage/ios/WebPageIOS.mm:
2266         (WebKit::WebPage::dynamicViewportSizeUpdate):
2267
2268 2014-04-09  Martin Robinson  <mrobinson@igalia.com>
2269
2270         Try to fix the GTK+ build after resetDragOperation rename
2271
2272         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2273         (webkitWebViewBaseDragDataReceived): Rename resetDragOperation to resetDragSession.
2274         (dragExitedCallback): Ditto.
2275
2276 2014-04-09  Jeremy Jones  <jeremyj@apple.com>
2277
2278         Enable fullscreen captions selection
2279         https://bugs.webkit.org/show_bug.cgi?id=131069
2280
2281         Reviewed by Eric Carlson.
2282
2283         Enable media selection in fullscreen.
2284         setLegibleMediaSelectionOptions/setAudioMediaSelectionOptions provide a list of options.
2285         selectAudioMediaOption/selectLegibleMediaOption change the selected option.
2286
2287         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2288         Add selectAudioMediaOption/selectLegibleMediaOption
2289
2290         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
2291         Add selectAudioMediaOption/selectLegibleMediaOption
2292
2293         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2294         (WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption):
2295         Add selectAudioMediaOption
2296
2297         (WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption):
2298         Add selectLegibleMediaOption
2299
2300         * WebProcess/ios/WebVideoFullscreenManager.h:
2301         Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions
2302
2303         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2304         Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions
2305
2306         * WebProcess/ios/WebVideoFullscreenManager.mm:
2307         (WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions):
2308         Add setAudioMediaSelectionOptions
2309
2310         (WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions):
2311         Add setLegibleMediaSelectionOptions
2312
2313 2014-04-09  Alexey Proskuryakov  <ap@apple.com>
2314
2315         Rename some dragging functions
2316         https://bugs.webkit.org/show_bug.cgi?id=131460
2317
2318         Reviewed by Tim Horton.
2319
2320         Renamed performDrag to performDragOperation.
2321
2322         Also renamed resetDragOperation to resetDragSession, because it's m_dragSession
2323         that it resets.
2324
2325         * Shared/DragControllerAction.h:
2326         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2327         (webkitWebViewBaseDragDrop):
2328         * UIProcess/API/mac/WKView.mm:
2329         (-[WKView draggingEntered:]):
2330         (-[WKView draggingExited:]):
2331         (-[WKView performDragOperation:]):
2332         * UIProcess/WebPageProxy.cpp:
2333         (WebKit::WebPageProxy::performDragOperation):
2334         (WebKit::WebPageProxy::performDrag): Deleted.
2335         * UIProcess/WebPageProxy.h:
2336         (WebKit::WebPageProxy::resetDragSession):
2337         (WebKit::WebPageProxy::resetDragOperation): Deleted.
2338         * WebProcess/WebPage/WebPage.cpp:
2339         (WebKit::WebPage::performDragControllerAction):
2340
2341 2014-04-09  Gavin Barraclough  <baraclough@apple.com>
2342
2343         Update SPI for managing tabs
2344         https://bugs.webkit.org/show_bug.cgi?id=131453
2345
2346         Reviewed by Alexey Proskuryakov.
2347
2348         * Configurations/WebKit2.xcconfig:
2349             - added AssertionServices
2350         * UIProcess/WebProcessProxy.h:
2351             - added m_assertion, m_assertionState.
2352         * UIProcess/ios/WebProcessProxyIOS.mm:
2353         (WebKit::WebProcessProxy::updateProcessState):
2354             - create BKSProcessAssertion to take an assertion.
2355
2356 2014-04-09  Enrica Casucci  <enrica@apple.com>
2357
2358         WK2: Dictated words disappear after being inserted.
2359         https://bugs.webkit.org/show_bug.cgi?id=131458
2360         <rdar://problem/16395011>
2361
2362         Reviewed by Benjamin Poulain.
2363
2364         The dictation engine treats selected text as text to be
2365         removed. We need to ensure that the range selected to insert the
2366         new text isn't reflected in the UI process until we are done
2367         inserting the text.
2368
2369         * WebProcess/WebPage/ios/WebPageIOS.mm:
2370         (WebKit::WebPage::replaceDictatedText):
2371
2372 2014-04-09  Brady Eidson  <beidson@apple.com>
2373
2374         Don't offer "contact" actions in telephone number menus
2375         <rdar://problem/16556907> and https://bugs.webkit.org/show_bug.cgi?id=131451
2376
2377         Reviewed by Tim Horton.
2378
2379         * UIProcess/mac/WebPageProxyMac.mm:
2380         (WebKit::WebPageProxy::showTelephoneNumberMenu): Skip actions that have to do with contacts,
2381           and skip separators too!
2382
2383 2014-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2384
2385         Unreviewed. Fix GTK+ build after r166975.
2386
2387         Do not use WebPage removed API to fix the build. Page overlays are
2388         no broken, see https://bugs.webkit.org/show_bug.cgi?id=131433.
2389
2390         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2391         (WebKit::DrawingAreaImpl::display):
2392         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2393         (WebKit::LayerTreeHostGtk::initialize):
2394         (WebKit::LayerTreeHostGtk::paintContents):
2395
2396 2014-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2397
2398         Unreviewed. Fix GTK+ build after r166965.
2399
2400         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2401         (WebKit::WebDragClient::startDrag): Rename Clipboard to DataTransfer.
2402
2403 2014-04-08  Hyowon Kim  <hw1008.kim@samsung.com>
2404
2405         Fix EFL Build errors since r166975.
2406         https://bugs.webkit.org/show_bug.cgi?id=131421
2407
2408         Reviewed by Gyuyoung Kim.
2409
2410         This patch is just for fixing EFL build errors.
2411         The page overlay functionality is not working yet.
2412
2413         * CMakeLists.txt:
2414         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2415         (WebKit::CoordinatedDrawingArea::display):
2416         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2417         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2418         (WebKit::CoordinatedLayerTreeHost::paintLayerContents):
2419         * WebProcess/WebPage/PageOverlayController.cpp:
2420         * WebProcess/WebPage/TapHighlightController.cpp:
2421         (WebKit::TapHighlightController::hideHighlight):
2422
2423 2014-04-08  Jon Lee  <jonlee@apple.com>
2424
2425         Turn MSE on by default
2426         https://bugs.webkit.org/show_bug.cgi?id=131313
2427         <rdar://problem/16525223>
2428
2429         Reviewed by Jer Noble.
2430
2431         * Configurations/FeatureDefines.xcconfig:
2432         * Shared/WebPreferencesStore.h: Set default to true.
2433         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2434
2435 2014-04-08  Ryosuke Niwa  <rniwa@webkit.org>
2436
2437         Fix the typo in the previous commit.
2438
2439         * WebProcess/WebPage/WebPage.cpp:
2440         (WebKit::WebPage::close):
2441
2442 2014-04-08  Ryosuke Niwa  <rniwa@webkit.org>
2443
2444         REGRESSION(r 166890): Crash inside WebKit::WebEditorClient::textFieldDidEndEditing
2445         https://bugs.webkit.org/show_bug.cgi?id=131409
2446
2447         Reviewed by Anders Carlsson.
2448
2449         Create an empty API::InjectedBundle::FormClient to avoid crashing inside
2450         m_mainFrame->coreFrame()->loader().detachFromParent().
2451
2452         * WebProcess/WebPage/WebPage.cpp:
2453         (WebKit::WebPage::close):
2454
2455 2014-04-08  Tim Horton  <timothy_horton@apple.com>
2456
2457         Unify and factor out page overlay implementations
2458         https://bugs.webkit.org/show_bug.cgi?id=131353
2459
2460         Reviewed by Anders Carlsson.
2461
2462         * WebProcess/WebPage/PageOverlayController.cpp:
2463         (WebKit::PageOverlayController::uninstallPageOverlay):
2464         Don't turn fast scrolling back off unless the last overlay is removed.
2465
2466 2014-04-08  Anders Carlsson  <andersca@apple.com>
2467
2468         Add a WKNavigationAction property indicating whether it resulted from processing a user gesture
2469         https://bugs.webkit.org/show_bug.cgi?id=131405
2470         <rdar://problem/16535453>
2471
2472         Reviewed by Tim Horton.
2473
2474         * Shared/NavigationActionData.cpp:
2475         (WebKit::NavigationActionData::NavigationActionData):
2476         (WebKit::NavigationActionData::encode):
2477         (WebKit::NavigationActionData::decode):
2478         * Shared/NavigationActionData.h:
2479         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
2480         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2481         * UIProcess/Cocoa/NavigationState.mm:
2482         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2483         * UIProcess/Cocoa/UIDelegate.mm:
2484         (WebKit::UIDelegate::UIClient::createNewPage):
2485         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2486         (WebKit::WebChromeClient::createWindow):
2487         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2488         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2489         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2490
2491 2014-04-08  Tim Horton  <timothy_horton@apple.com>
2492
2493         Unify and factor out page overlay implementations
2494         https://bugs.webkit.org/show_bug.cgi?id=131353
2495
2496         Reviewed by Anders Carlsson.
2497
2498         Bring all of the PageOverlay code together in a single cross-platform
2499         PageOverlayController, including hit-testing code from WebPage and painting
2500         and layer-tree manipulation code from the DrawingArea.
2501
2502         This also makes all PageOverlays a single GraphicsLayer tree which can be
2503         flushed and plugged into any DrawingArea in a straightforward manner.
2504         We no longer have to watch for individual layers flipping into/out of tiling,
2505         because they're hidden underneath the root PageOverlay GraphicsLayer.
2506         Additionally, because GraphicsLayer is cross-platform, we can share
2507         all of the fairly trivial but oft-repeated overlay management code.
2508
2509         * WebKit2.xcodeproj/project.pbxproj:
2510         * WebProcess/WebPage/PageOverlayController.cpp: Added.
2511         * WebProcess/WebPage/PageOverlayController.h: Added.
2512         (WebKit::PageOverlayController::rootLayer):
2513         Add PageOverlayController.
2514
2515         * WebProcess/WebPage/DrawingArea.h:
2516         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2517         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2518         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2519         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2520         Remove PageOverlay-related code from the DrawingAreas.
2521
2522         * WebProcess/WebPage/PageOverlay.cpp:
2523         (WebKit::PageOverlay::setNeedsDisplay):
2524         (WebKit::PageOverlay::fadeAnimationTimerFired):
2525         (WebKit::PageOverlay::clear):
2526         * WebProcess/WebPage/PageOverlay.h:
2527         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2528         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
2529         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2530         (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
2531         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
2532         Use PageOverlayController instead of the DrawingArea/WebPage to manipulate page overlays.
2533
2534         * WebProcess/WebPage/WebPage.cpp:
2535         * WebProcess/WebPage/WebPage.h:
2536         (WebKit::WebPage::pageOverlayController):
2537         Remove PageOverlay-related code from WebPage.
2538
2539         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2540         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2541         (WebKit::RemoteLayerTreeContext::outOfTreeLayerWasAdded): Deleted.
2542         (WebKit::RemoteLayerTreeContext::outOfTreeLayerWillBeRemoved): Deleted.
2543         (WebKit::RemoteLayerTreeContext::flushOutOfTreeLayers): Deleted.
2544         Remove the no-longer-necessary out-of-tree layer code.
2545
2546         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2547         (WKBundlePageInstallPageOverlayWithAnimation):
2548         (WKBundlePageUninstallPageOverlayWithAnimation):
2549         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2550         (WebKit::WebInspectorClient::highlight):
2551         (WebKit::WebInspectorClient::hideHighlight):
2552         * WebProcess/WebPage/FindController.cpp:
2553         (WebKit::FindController::updateFindUIAfterPageScroll):
2554         (WebKit::FindController::hideFindUI):
2555         * WebProcess/WebPage/TelephoneNumberOverlayController.cpp:
2556         (WebKit::TelephoneNumberOverlayController::createOverlayIfNeeded):
2557         (WebKit::TelephoneNumberOverlayController::destroyOverlay):
2558         Make use of the FadeMode enum.
2559
2560 2014-04-08  Anders Carlsson  <andersca@apple.com>
2561
2562         Change WebPageProxy::CreateNewPage to take a NavigationActionData object
2563         https://bugs.webkit.org/show_bug.cgi?id=131401
2564
2565         Reviewed by Dan Bernstein.
2566
2567         * UIProcess/API/APIUIClient.h:
2568         (API::UIClient::createNewPage):
2569         * UIProcess/API/C/WKPage.cpp:
2570         (WKPageSetPageUIClient):
2571         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2572         (toWKNavigationType):
2573         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
2574         * UIProcess/Cocoa/NavigationState.mm:
2575         (WebKit::toWKNavigationType): Deleted.
2576         * UIProcess/Cocoa/UIDelegate.h:
2577         * UIProcess/Cocoa/UIDelegate.mm:
2578         (WebKit::UIDelegate::UIClient::createNewPage):
2579         * UIProcess/WebPageProxy.cpp:
2580         (WebKit::WebPageProxy::createNewPage):
2581         * UIProcess/WebPageProxy.h:
2582         * UIProcess/WebPageProxy.messages.in:
2583         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2584         (WebKit::WebChromeClient::createWindow):
2585
2586 2014-04-08  Anders Carlsson  <andersca@apple.com>
2587
2588         Fix build.
2589
2590         * WebKit2Prefix.h:
2591
2592 2014-04-08  Anders Carlsson  <andersca@apple.com>
2593
2594         Use an explicit class when decoding individual bundle parameters
2595         https://bugs.webkit.org/show_bug.cgi?id=131392
2596         <rdar://problem/16213914>
2597
2598         Reviewed by Dan Bernstein.
2599
2600         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2601         (WebKit::InjectedBundle::setBundleParameter):
2602
2603 2014-04-08  Anders Carlsson  <andersca@apple.com>
2604
2605         Move a Mountain Lion declaration to the WebKit2 prefix header
2606         https://bugs.webkit.org/show_bug.cgi?id=131391
2607
2608         Reviewed by Tim Horton.
2609
2610         * UIProcess/API/Cocoa/WKProcessPool.mm:
2611         * UIProcess/ios/PageClientImplIOS.mm:
2612         * UIProcess/mac/WebContextMac.mm:
2613         * WebKit2Prefix.h:
2614         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2615         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2616
2617 2014-04-08  Antti Koivisto  <antti@apple.com>
2618
2619         Remove exposedRect from TileController
2620         https://bugs.webkit.org/show_bug.cgi?id=131378
2621
2622         Reviewed by Simon Fraser.
2623
2624         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2625         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
2626         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2627         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
2628         
2629             Update the visible rect for pageOverlayLayers by calling flushCompositingState. This way
2630             tile controller visible rect updates always happens via compositing flush (we assert
2631             for this in TileController::setVisibleRect).
2632
2633 2014-04-08  Alexey Proskuryakov  <ap@apple.com>
2634
2635         Rename Clipboard to DataTransfer
2636         https://bugs.webkit.org/show_bug.cgi?id=131371
2637
2638         Reviewed by Anders Carlsson.
2639
2640         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2641         (WebKit::WebDragClient::willPerformDragSourceAction):
2642         (WebKit::WebDragClient::startDrag):
2643         * WebProcess/WebCoreSupport/WebDragClient.h:
2644         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2645         (WebKit::WebDragClient::startDrag):
2646
2647 2014-04-08  Alexey Proskuryakov  <ap@apple.com>
2648
2649         FlagsChanged events are not delivered to input methods when using async text input
2650         https://bugs.webkit.org/show_bug.cgi?id=131383
2651
2652         Reviewed by Anders Carlsson.
2653
2654         * UIProcess/API/mac/WKView.mm: (-[WKView _interpretKeyEvent:completionHandler:]):
2655         The early return is no longer needed.
2656
2657 2014-04-08  Tim Horton  <timothy_horton@apple.com>
2658
2659         WebKit2 View Gestures (Swipe): Swipe-start hysteresis
2660         https://bugs.webkit.org/show_bug.cgi?id=127393
2661         <rdar://problem/15876822>
2662
2663         Reviewed by Anders Carlsson.
2664
2665         We shouldn't start a swipe immediately upon very small scrolls in the correct direction,
2666         because we don't want to get the user trapped in a swipe when they want to scroll.
2667
2668         We'll accumulate the scroll deltas and wait until the user has scrolled at least 15px horizontally.
2669         In addition, we'll drop the swipe completely if any event has a vertical delta equal to half (or more)
2670         of the horizontal delta.
2671
2672         * UIProcess/mac/ViewGestureController.h:
2673         * UIProcess/mac/ViewGestureControllerMac.mm:
2674         (WebKit::ViewGestureController::ViewGestureController):
2675         (WebKit::ViewGestureController::deltaIsSufficientToBeginSwipe):
2676         (WebKit::ViewGestureController::handleScrollWheelEvent):
2677         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
2678
2679 2014-04-07  Jer Noble  <jer.noble@apple.com>
2680
2681         [Mac][WK2] Videos do not have access to session cookies
2682         https://bugs.webkit.org/show_bug.cgi?id=129687
2683
2684         Reviewed by Eric Carlson.
2685
2686         Update the CookieStorageShim to track changes in underlying networking stack.
2687
2688         * Shared/mac/CookieStorageShim.mm:
2689         (WebKit::CookieStorageShim::initialize):
2690         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
2691
2692 2014-04-08  Dan Bernstein  <mitz@apple.com>
2693
2694         [Cocoa] Add a way to tell whether a WKWebProcessPlugInNodeHandle is a text-type HTML input element
2695         https://bugs.webkit.org/show_bug.cgi?id=131374
2696
2697         Reviewed by Anders Carlsson.
2698
2699         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2700         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2701         (-[WKWebProcessPlugInNodeHandle isTextField]): Added this getter. Calls
2702         InjectedBundleNodeHandle::isTextField.
2703         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2704         (WebKit::InjectedBundleNodeHandle::isTextField): Added. Uses
2705         WebCore::HTMLInputElement::isText, which is consistent with what
2706         WebChromeClient::focusedElementChanged uses to decide whether to call didFocusTextField.
2707         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2708
2709 2014-04-08  Dan Bernstein  <mitz@apple.com>
2710
2711         [Cocoa] Add a _certificateChain property to WKWebProcessPlugInFrame
2712         https://bugs.webkit.org/show_bug.cgi?id=131370
2713
2714         Reviewed by Anders Carlsson.
2715
2716         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
2717         (-[WKWebProcessPlugInFrame _certificateChain]): Added this getter, which uses the new
2718         WebFrame::certificateInfo.
2719         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
2720         * WebProcess/WebPage/WebFrame.cpp:
2721         (WebKit::WebFrame::certificateInfo): Added this getter.
2722         * WebProcess/WebPage/WebFrame.h:
2723
2724 2014-04-08  Dan Bernstein  <mitz@apple.com>
2725
2726         [Cocoa] Add a bundle form delegate method corresponding to textDidChangeInTextField
2727         https://bugs.webkit.org/show_bug.cgi?id=131369
2728
2729         Reviewed by Anders Carlsson.
2730
2731         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared
2732         new delegate method.
2733         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2734         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added an override
2735         of API::InjectedBundle::FormClient::textDidChangeInTextField which calls the new delegate
2736         method.
2737
2738 2014-04-08  Dan Bernstein  <mitz@apple.com>
2739
2740         [Cocoa] Add WKFormDelegate
2741         https://bugs.webkit.org/show_bug.cgi?id=131343
2742
2743         Reviewed by Anders Carlsson.
2744
2745         * UIProcess/API/Cocoa/WKWebView.mm:
2746         (-[WKWebView _formDelegate]): Added this accessor.
2747         (-[WKWebView _setFormDelegate:]): Ditto.
2748         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _formDelegate property.
2749
2750         * UIProcess/API/Cocoa/_WKFormDelegate.h: Added.
2751
2752         * UIProcess/API/Cocoa/_WKFormInputSession.h: Added.
2753
2754         * UIProcess/ios/WKContentView.h: Moved _webView ivar into the @interface…
2755         * UIProcess/ios/WKContentView.mm: …from the @implementation.
2756
2757         * UIProcess/ios/WKContentViewInteraction.h: Added _formInputSession ivar and
2758         formAccessoryView property.
2759         * UIProcess/ios/WKContentViewInteraction.mm:
2760         (-[WKFormInputSession initWithContentView:userObject:]): Added.
2761         (-[WKFormInputSession dealloc]): Added.
2762         (-[WKFormInputSession userObject]): Added.
2763         (-[WKFormInputSession isValid]): Added.
2764         (-[WKFormInputSession accessoryViewCustomButtonTitle]): Added.
2765         (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]): Added.
2766         (-[WKFormInputSession invalidate]): Added.
2767         (-[WKContentView cleanupInteraction]): Invalidate and release the input session.
2768         (-[WKContentView formAccessoryView]): Added this accessor.
2769         (-[WKContentView _startAssistingNode:userObject:]): Create an input session and message the
2770         form delegate.
2771         (-[WKContentView _stopAssistingNode]): Invalidate and release the input session.
2772
2773         * WebKit2.xcodeproj/project.pbxproj: Added references to new files.
2774
2775         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added
2776         comment.
2777
2778 2014-04-08  Daniel Bates  <dabates@apple.com>
2779
2780         Fallback to default storage session when there isn't a valid session ID
2781         https://bugs.webkit.org/show_bug.cgi?id=131326
2782         <rdar://problem/16231679>
2783
2784         Reviewed by Alexey Proskuryakov.
2785
2786         Fixes and issue where we may use the wrong storage session after disabling
2787         a private browsing session.
2788
2789         Currently WebKit1 and WebKit2 without NetworkProcess assume that there
2790         is always a non-null private browsing storage session so long as the page
2791         has a non-default session ID. Instead we should only use the private browsing
2792         storage session when it's non-null and the page has a non-default session ID;
2793         otherwise, we should use the default storage session. This change will make
2794         the behavior in WebKit1 and WebKit2 without NetworkProcess consistent with
2795         the behavior in WebKit2 with NetworkProcess.
2796
2797         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2798         (WebKit::WebFrameNetworkingContext::storageSession):
2799
2800 2014-04-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2801
2802         [SOUP] Control cookie management according ResourceRequest.allowCookies()
2803         https://bugs.webkit.org/show_bug.cgi?id=131026
2804
2805         Reviewed by Sergio Villar Senin.
2806
2807         Added setting of accept cookies policy for the current soup network session cookie jar and all tracked sessions.
2808         Moved the implementation of cookie policy setting from WebCookieManager to WebFrameNetworkingContext.
2809
2810         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2811         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Moved implementation to WebCookieManager::platformSetHTTPCookieAcceptPolicy.
2812         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2813         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Moved implementation from WebCookieManager::platformSetHTTPCookieAcceptPolicy and set the cookie jar accept policy to the cookie jars of all sessions in addition to the default cookie jar.
2814         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: Added method prototype.
2815
2816 2014-04-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2817
2818         [WK2] Fix unused parameter compile warning
2819         https://bugs.webkit.org/show_bug.cgi?id=131260
2820
2821         Reviewed by Darin Adler.
2822
2823         Remove the arguments name without UNUSED_PARAM().
2824
2825         * UIProcess/API/APIDownloadClient.h:
2826         (API::DownloadClient::didReceiveData):
2827         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
2828         (API::DownloadClient::decideDestinationWithSuggestedFilename):
2829         (API::DownloadClient::didCreateDestination):
2830         * UIProcess/API/APIFindClient.h:
2831         (API::FindClient::didCountStringMatches):
2832         (API::FindClient::didFindString):
2833         * UIProcess/API/APIHistoryClient.h:
2834         (API::HistoryClient::didPerformClientRedirect):
2835         (API::HistoryClient::didPerformServerRedirect):
2836         (API::HistoryClient::didUpdateHistoryTitle):
2837         * UIProcess/API/APILoaderClient.h:
2838         (API::LoaderClient::didStartProvisionalLoadForFrame):
2839         (API::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
2840         (API::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
2841         (API::LoaderClient::didCommitLoadForFrame):
2842         (API::LoaderClient::didFinishLoadForFrame):
2843         (API::LoaderClient::didFailLoadWithErrorForFrame):
2844         (API::LoaderClient::didChangeBackForwardList):
2845         * UIProcess/API/APIPolicyClient.h:
2846         (API::PolicyClient::decidePolicyForNavigationAction):
2847         (API::PolicyClient::decidePolicyForNewWindowAction):
2848         (API::PolicyClient::decidePolicyForResponse):
2849         (API::PolicyClient::unableToImplementPolicy):
2850
2851 2014-04-07  Alexey Proskuryakov  <ap@apple.com>
2852
2853         [Mac] Allow com.apple.ViewBridge preferences reading in plug-in sandbox profile
2854         https://bugs.webkit.org/show_bug.cgi?id=131306
2855         <rdar://problem/16359865>
2856
2857         Reviewed by Sam Weinig.
2858
2859         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Do it.
2860
2861 2014-04-07  Stephanie Lewis  <slewis@apple.com>
2862
2863         Crash in com.apple.WebKit.Plugin.Development at com.apple.WebKit2: WebKit::PluginControllerProxy::pluginInstanceID
2864         <rdar://problem/16479432>
2865         https://bugs.webkit.org/show_bug.cgi?id=131203
2866
2867         Reviewed by Geoff Garen.
2868
2869         pluginController was being removed before accessing the pluginInstanceID.
2870
2871         * PluginProcess/WebProcessConnection.cpp:
2872         (WebKit::WebProcessConnection::removePluginControllerProxy):
2873
2874 2014-04-07  Dan Bernstein  <mitz@apple.com>
2875
2876         More Mountain Lion build fix.
2877
2878         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2879
2880 2014-04-07  Benjamin Poulain  <bpoulain@apple.com>
2881
2882         [iOS][WK2] Implement the update of content offset on animated resize
2883         https://bugs.webkit.org/show_bug.cgi?id=131329
2884
2885         Reviewed by Tim Horton.
2886
2887         Compute a reasonable target offset on rotation. This goes in 3 steps:
2888         1) Move the page so that the center does not move during scaling.
2889         2) Limit the range to keep the page in scrollview without rubberbanding.
2890         3) The horizontal content stays the same but the vertical area changes. When on the top or bottom
2891            edge, stick to the edge.
2892
2893         The code is moved inside _beginAnimatedResizeToSize:obscuredInsets:minimumLayoutSizeOverride: so that we can tell
2894         the WebProcess where the scroll position will be at the end of the animation.
2895
2896         * UIProcess/API/Cocoa/WKWebView.mm:
2897         (-[WKWebView _frameOrBoundsChangedFrom:]):
2898         (-[WKWebView _updateVisibleContentRects]):
2899         (-[WKWebView _beginAnimatedResizeToSize:obscuredInsets:minimumLayoutSizeOverride:]):
2900
2901 2014-04-07  Dan Bernstein  <mitz@apple.com>
2902
2903         Mountain Lion build fix.
2904
2905         * UIProcess/ios/PageClientImplIOS.mm:
2906         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2907
2908 2014-04-07  Anders Carlsson  <andersca@apple.com>
2909
2910         Handle decoding of nil invocation arguments
2911         https://bugs.webkit.org/show_bug.cgi?id=131335
2912         <rdar://problem/16528449>
2913
2914         Reviewed by Tim Horton.
2915
2916         * Shared/APIArray.h:
2917         Don't crash if the array element is null.
2918
2919 2014-04-07  Dan Bernstein  <mitz@apple.com>
2920
2921         Add bundle client function corresponding to startAssistingNode
2922         https://bugs.webkit.org/show_bug.cgi?id=131332
2923
2924         Reviewed by Anders Carlsson.
2925
2926         * UIProcess/PageClient.h: Added userData parameter to startAssistingNode.
2927
2928         * UIProcess/WebPageProxy.h: Added message decoder parameter to startAssistingNode.
2929         * UIProcess/WebPageProxy.messages.in: Added message decoder parameter to StartAssistingNode.
2930
2931         * UIProcess/ios/PageClientImplIOS.h: Updated startAssistingNode override.
2932         * UIProcess/ios/PageClientImplIOS.mm:
2933         (WebKit::PageClientImpl::startAssistingNode): Decode the user data into an NSObject and pass
2934         it on to the content view.
2935
2936         * UIProcess/ios/WKContentViewInteraction.h: Added userObject parameter to
2937         -_startAssitingNode:.
2938         * UIProcess/ios/WKContentViewInteraction.mm:
2939         (-[WKContentView _startAssistingNode:userObject:]): Added userObject parameter. We will pass
2940         it to a future delegate method.
2941
2942         * UIProcess/ios/WebPageProxyIOS.mm:
2943         (WebKit::WebPageProxy::startAssistingNode): Decode the user data and pass it to the client.
2944
2945         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared new
2946         delegate method.
2947         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2948         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added an implementation
2949         of API::InjectedBundle::FormClient::willBeginInputSession which calls the new delegate
2950         method, and encodes the user object into userData.
2951
2952         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
2953         (API::InjectedBundle::FormClient::willBeginInputSession): Added willBeginInputSession.
2954
2955         * WebProcess/WebPage/ios/WebPageIOS.mm:
2956         (WebKit::WebPage::elementDidFocus): Call willBeginInputSession and send the user data along
2957         with the StartAssistingNode message to the UI process.
2958
2959 2014-04-07  Jinwoo Song  <jinwoo7.song@samsung.com>
2960
2961         Unreviewed. Fixing the EFL build.
2962
2963         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Include the Document header from WebCore
2964         to avoid operating on an incomplete type.
2965
2966 2014-04-07  Tim Horton  <timothy_horton@apple.com>
2967
2968         [iOS WebKit2] WKPDFView fades in tiles, PDFs load very flashily
2969         https://bugs.webkit.org/show_bug.cgi?id=131325
2970         <rdar://problem/16382960>
2971
2972         Reviewed by Anders Carlsson.
2973
2974         * UIProcess/API/Cocoa/WKWebView.mm:
2975         (-[WKWebView scrollViewDidScroll:]):
2976         Forward scroll events to the current custom content provider.
2977
2978         * UIProcess/Cocoa/WKWebViewContentProvider.h:
2979         Make content providers UIScrollViewDelegates (though we only forward didScroll for now).
2980
2981         * UIProcess/ios/WKPDFView.mm:
2982         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2983         (-[WKPDFView web_setMinimumSize:]):
2984         (-[WKPDFView web_setScrollView:]):
2985         (-[WKPDFView scrollViewDidScroll:]):
2986         (-[WKPDFView _revalidateViews]):
2987         (-[WKPDFView _computePageAndDocumentFrames]):
2988         (-[WKPDFView layoutViews]): Deleted.
2989         Keep track of each UIPDFPage, UIPDFPageView, and its frame (in unscaled/document coordinates).
2990         Compute all the rects up front (and re-compute upon rotation, loading, etc.).
2991         When scrolling, find all the pages that intersect the view (inflated by 1.5x in each
2992         vertical direction), and ensure that pages that are inside that rect have
2993         UIPDFPageViews installed, and ones that are outside that rect do not.
2994         Use setUseBackingLayer to ensure that we have a low-resolution layer behind the
2995         tiled layer to avoid flashiness.
2996
2997 2014-04-07  Dan Bernstein  <mitz@apple.com>
2998
2999         Add API::InjectedBundle::FormClient
3000         https://bugs.webkit.org/show_bug.cgi?id=131317
3001
3002         Reviewed by Anders Carlsson.
3003
3004         * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
3005
3006         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3007         (WKBundlePageSetFormClient):
3008         * WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h:
3009         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3010         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Changed to define and
3011         create a FormClient (which derives from API::InjectedBundle::FormClient and messages a
3012         delegate), and set it as the form client.
3013         (didFocusTextField): Deleted.
3014         (willSubmitForm): Deleted.
3015         (setUpFormClient): Deleted.
3016
3017         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: Added.
3018         (API::InjectedBundle::FormClient::~FormClient):
3019         (API::InjectedBundle::FormClient::didFocusTextField):
3020         (API::InjectedBundle::FormClient::textFieldDidBeginEditing):
3021         (API::InjectedBundle::FormClient::textFieldDidEndEditing):
3022         (API::InjectedBundle::FormClient::textDidChangeInTextField):
3023         (API::InjectedBundle::FormClient::textDidChangeInTextArea):
3024         (API::InjectedBundle::FormClient::shouldPerformActionInTextField):
3025         (API::InjectedBundle::FormClient::willSubmitForm):
3026         (API::InjectedBundle::FormClient::willSendSubmitEvent):
3027         (API::InjectedBundle::FormClient::didAssociateFormControls):
3028         (API::InjectedBundle::FormClient::shouldNotifyOnFormChanges):
3029
3030         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
3031         (WebKit::InjectedBundlePageFormClient::InjectedBundlePageFormClient): Added a constructor
3032         from WKBundlePageFormClientBase.
3033         (WebKit::toWKInputFieldActionType): Added helper to convert from internal enum to C SPI
3034         enum.
3035         (WebKit::InjectedBundlePageFormClient::shouldPerformActionInTextField): Use helper.
3036         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Added inheritance from
3037         API::InjectedBundle::FormClient, marked overrides as such.
3038
3039         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: Removed unused forward
3040         declarations.
3041
3042         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3043         (WebKit::toInputFieldAction): Added helper to convert from C SPI enum to internal enum.
3044         (WebKit::WebEditorClient::doTextFieldCommandFromEvent): Use helper.
3045         (WebKit::WebEditorClient::textWillBeDeletedInTextField): Ditto.
3046
3047         * WebProcess/WebPage/WebPage.cpp:
3048         (WebKit::WebPage::WebPage): Initialize m_formClient member.
3049         (WebKit::WebPage::setInjectedBundleFormClient): Added. Updates m_formClient. 
3050         (WebKit::WebPage::close): Updated code to clear m_formClient.
3051         (WebKit::WebPage::initializeInjectedBundleFormClient): Deleted.
3052         * WebProcess/WebPage/WebPage.h:
3053         (WebKit::WebPage::injectedBundleFormClient): Updated return type.
3054
3055 2014-04-07  Hyowon Kim  <hw1008.kim@samsung.com>
3056
3057         Move to using std::unique_ptr for opengl, texmap, transforms and efl in WebCore/platform/graphics.
3058         https://bugs.webkit.org/show_bug.cgi?id=131276
3059
3060         Reviewed by Darin Adler.
3061
3062         Replace uses of OwnPtr for TextureMapper in LayerTreeHostGtk with std::unique_ptr.
3063
3064         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
3065
3066 2014-04-07  Joseph Pecoraro  <pecoraro@apple.com>
3067
3068         Make Mac only parts of TelephoneNumberOverlayController PLATFORM(MAC).
3069
3070         Unreviewed build fix for r166881.
3071
3072         * UIProcess/WebPageProxy.h:
3073         * UIProcess/WebPageProxy.messages.in:
3074         * UIProcess/mac/WebPageProxyMac.mm:
3075         (WebKit::WebPageProxy::showTelephoneNumberMenu): Deleted.
3076         * WebProcess/WebPage/TelephoneNumberOverlayController.cpp:
3077         (WebKit::TelephoneNumberOverlayController::drawRect):
3078         (WebKit::TelephoneNumberOverlayController::mouseEvent):
3079         * WebProcess/WebPage/TelephoneNumberOverlayController.h:
3080         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
3081
3082 2014-04-07  Zan Dobersek  <zdobersek@igalia.com>
3083
3084         Unreviewed. Fixing the GTK build.
3085
3086         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: Include the Document header from WebCore
3087         to avoid operating on an incomplete type.
3088         * WebProcess/WebPage/TapHighlightController.cpp: Include the RenderElement instead of RenderObject
3089         to make the RenderObject::style() inline accessible.
3090         * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp: Include the Document header from WebCore
3091
3092 2014-04-07  Tim Horton  <timothy_horton@apple.com>
3093
3094         [iOS WebKit2] Make back-buffers purgeable when possible
3095         https://bugs.webkit.org/show_bug.cgi?id=131213
3096         <rdar://problem/15373906>
3097
3098         Reviewed by Simon Fraser.
3099
3100         We should make back-buffers volatile when their owning
3101         layer falls out of use (either stops being repainted or
3102         is unparented), as they are inherently recreatable.
3103
3104         * Shared/mac/RemoteLayerBackingStore.h:
3105         (WebKit::RemoteLayerBackingStore::volatility):
3106         (WebKit::RemoteLayerBackingStore::lastDisplayTime):
3107         Add storage and a getter for the backing store's last paint time.
3108         Add setter/getter for volatility of backing store.
3109         Add RemoteLayerTreeContext param to constructor.
3110
3111         * Shared/mac/RemoteLayerBackingStore.mm:
3112         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
3113         (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore):
3114         Inform the RemoteLayerTreeContext when backing store
3115         is created and destroyed. Since we only have a Context in
3116         the Web process, this will only happen there.
3117
3118         (WebKit::RemoteLayerBackingStore::encode):
3119         (WebKit::RemoteLayerBackingStore::decode):
3120         Move some assertions out of #else blocks which are preceded by returns.
3121
3122         (WebKit::RemoteLayerBackingStore::display):
3123         Update the last display time.
3124         If the backing store was volatile, make it non-volatile.
3125
3126         (WebKit::RemoteLayerBackingStore::setVolatility):
3127         Mark the relevant surfaces as volatile or not.
3128         setVolatility:
3129             - fails and returns false if any surfaces weren't marked
3130               volatile because they were in use
3131             - marks the whole backing store for repaint if the front
3132               surface was purged
3133
3134         * Shared/mac/RemoteLayerTreeTransaction.mm:
3135         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
3136         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
3137         Make it possible to remove the RemoteLayerBackingStore on layers
3138         that went from drawing contents to not drawing contents.
3139
3140         * UIProcess/ios/ViewGestureControllerIOS.mm:
3141         (WebKit::ViewGestureController::beginSwipeGesture):
3142         (WebKit::ViewGestureController::removeSwipeSnapshot):
3143         * UIProcess/mac/ViewGestureControllerMac.mm:
3144         (WebKit::ViewGestureController::beginSwipeGesture):
3145         (WebKit::ViewGestureController::removeSwipeSnapshot):
3146         * UIProcess/mac/ViewSnapshotStore.mm:
3147         (WebKit::ViewSnapshotStore::recordSnapshot):
3148         Adopt the new names from WebCore.
3149
3150         * WebKit2.xcodeproj/project.pbxproj:
3151         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3152         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
3153         Clear the backing store if the layer doesn't want to draw contents anymore.
3154
3155         (WebKit::PlatformCALayerRemote::ensureBackingStore):
3156
3157         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
3158         (WebKit::RemoteLayerTreeContext::backingStoreCollection):
3159         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3160         (WebKit::RemoteLayerTreeContext::RemoteLayerTreeContext):
3161         (WebKit::RemoteLayerTreeContext::backingStoreWasCreated):
3162         (WebKit::RemoteLayerTreeContext::backingStoreWillBeDestroyed):
3163         Keep a RemoteLayerBackingStoreCollection, which just keeps track
3164         of all backing store (even unparented) created for layers in a
3165         particular context. Forward backing store creation/deletion to it.
3166         Remove a unused m_rootLayer member.
3167
3168         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3169         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3170         If any layers had backing store changes, start the timer
3171         on the RemoteLayerBackingStoreCollection that will mark them
3172         purgeable once they are no longer needed.
3173
3174         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
3175         * Shared/mac/RemoteLayerBackingStoreCollection.h:
3176         Keep track of all backing store for our context.
3177         When the timer fires, run through the backing store, finding
3178         backing store that was last painted more than 1 second ago,
3179         and mark them purgeable. If there was more recently-painted
3180         backing store, let the timer fire again in another second;
3181         otherwise, stop it.
3182
3183 2014-04-07  Ryosuke Niwa  <rniwa@webkit.org>
3184
3185         Another build fix after r166879.
3186
3187         * WebProcess/WebPage/mac/WebPageMac.mm:
3188
3189 2014-04-07  Dan Bernstein  <mitz@apple.com>
3190
3191         Tried to fix the Mac build.
3192
3193         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3194
3195 2014-04-07  Brady Eidson  <beidson@apple.com>
3196
3197         Handle clicks on DataDetectors UI for scanned phone numbers
3198         <rdar://problem/16379588> and https://bugs.webkit.org/show_bug.cgi?id=131309
3199
3200         Reviewed by Tim Horton.
3201
3202         WebContextMenuItemDatas never need to know about a ContextMenu, so remove that concept.
3203         Also add the concept of a selection handler for UIProcess-native menu items.
3204         * Shared/WebContextMenuItemData.cpp:
3205         (WebKit::WebContextMenuItemData::WebContextMenuItemData): 
3206         (WebKit::WebContextMenuItemData::encode):
3207         (WebKit::kitItems):
3208         (WebKit::WebContextMenuItemData::decode):
3209         * Shared/WebContextMenuItemData.h:
3210         (WebKit::WebContextMenuItemData::selectionHandler):
3211
3212         * UIProcess/WebPageProxy.cpp:
3213         (WebKit::WebPageProxy::showContextMenu):
3214         (WebKit::WebPageProxy::internalShowContextMenu): Make the decoder argument optional. Make consulting the client optional.
3215         * UIProcess/WebPageProxy.h:
3216         * UIProcess/WebPageProxy.messages.in:
3217         * UIProcess/mac/WebPageProxyMac.mm:
3218         (WebKit::WebPageProxy::showTelephoneNumberMenu):
3219
3220         * UIProcess/mac/WebContextMenuProxyMac.mm:
3221         (-[WKSelectionHandlerWrapper initWithSelectionHandler:std::]):
3222         (-[WKSelectionHandlerWrapper executeSelectionHandler]):
3223         (-[WKMenuTarget forwardContextMenuAction:]):
3224         (WebKit::nsMenuItemVector):
3225         (WebKit::WebContextMenuProxyMac::contextMenuItemSelected): If the represented object is a WKSelectionHandlerWrapper,
3226           execute the selection handler. Do nothing else.
3227
3228         Instead of getting rects from ranges, creating highlights, and storing those highlights,
3229         work in terms of a TelephoneNumberData object that wraps both a range and a highlight.
3230         This makes it easier to track where the mouse is down and to know what phone number we should act on when clicked.
3231         * WebProcess/WebPage/TelephoneNumberOverlayController.cpp:
3232         (WebKit::TelephoneNumberOverlayController::rectsForDrawing): Deleted.
3233         * WebProcess/WebPage/TelephoneNumberOverlayController.h:
3234         (WebKit::TelephoneNumberData::create):
3235         (WebKit::TelephoneNumberData::range):
3236         (WebKit::TelephoneNumberData::highlight):
3237         (WebKit::TelephoneNumberData::TelephoneNumberData):
3238         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
3239         (WebKit::TelephoneNumberOverlayController::drawRect):
3240         (WebKit::TelephoneNumberOverlayController::handleTelephoneClick): Pass the phone number text and the point to WebPage.
3241         (WebKit::TelephoneNumberOverlayController::mouseEvent):
3242         (WebKit::TelephoneNumberOverlayController::clearMouseDownInformation):
3243         (WebKit::TelephoneNumberOverlayController::clearHighlights):
3244
3245         * WebProcess/WebPage/WebContextMenu.cpp:
3246         (WebKit::WebContextMenu::menuItemsWithUserData):
3247
3248         * WebProcess/WebPage/WebPage.h:
3249         * WebProcess/WebPage/mac/WebPageMac.mm:
3250         (WebKit::WebPage::handleTelephoneNumberClick): Message the phone number and coordinate to the UIProcess.
3251
3252 2014-04-07  Dan Bernstein  <mitz@apple.com>
3253
3254         Introduce API::InjectedBundle::PageUIClient
3255         https://bugs.webkit.org/show_bug.cgi?id=131310
3256
3257         Reviewed by Anders Carlsson.
3258
3259         * WebKit2.xcodeproj/project.pbxproj: Added references to new files.
3260
3261         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: Added #include that
3262         became necessary.
3263
3264         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: Added.
3265         (API::InjectedBundle::PageUIClient::~PageUIClient):
3266         (API::InjectedBundle::PageUIClient::willAddMessageToConsole):
3267         (API::InjectedBundle::PageUIClient::willSetStatusbarText):
3268         (API::InjectedBundle::PageUIClient::willRunJavaScriptAlert):
3269         (API::InjectedBundle::PageUIClient::willRunJavaScriptConfirm):
3270         (API::InjectedBundle::PageUIClient::willRunJavaScriptPrompt):
3271         (API::InjectedBundle::PageUIClient::mouseDidMoveOverElement):
3272         (API::InjectedBundle::PageUIClient::pageDidScroll):
3273         (API::InjectedBundle::PageUIClient::shouldGenerateFileForUpload):
3274         (API::InjectedBundle::PageUIClient::generateFileForUpload):
3275         (API::InjectedBundle::PageUIClient::statusBarIsVisible):
3276         (API::InjectedBundle::PageUIClient::menuBarIsVisible):
3277         (API::InjectedBundle::PageUIClient::toolbarsAreVisible):
3278         (API::InjectedBundle::PageUIClient::didReachApplicationCacheOriginQuota):
3279         (API::InjectedBundle::PageUIClient::didExceedDatabaseQuota):
3280         (API::InjectedBundle::PageUIClient::plugInStartLabelTitle):
3281         (API::InjectedBundle::PageUIClient::plugInStartLabelSubtitle):
3282         (API::InjectedBundle::PageUIClient::plugInExtraStyleSheet):
3283         (API::InjectedBundle::PageUIClient::plugInExtraScript):
3284
3285         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3286         (WKBundlePageSetUIClient): Changed to create an InjectedBundlePageUIClient and set it on
3287         the WebPage.
3288
3289         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
3290         (WebKit::InjectedBundlePageUIClient::InjectedBundlePageUIClient): Added constructor from
3291         WKBundlePageUIClient.
3292         (WebKit::toUIElementVisibility): Added helper to convert from C SPI enum to internal enum.
3293         (WebKit::InjectedBundlePageUIClient::statusBarIsVisible): Changed to use the above.
3294         (WebKit::InjectedBundlePageUIClient::menuBarIsVisible): Ditto.
3295         (WebKit::InjectedBundlePageUIClient::toolbarsAreVisible): Ditto.
3296         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: Added inheritance from
3297         API::InjectedBundle::PageUIClient, marked overrides as such.
3298
3299         * WebProcess/Storage/StorageAreaMap.cpp: Added #include that became necessary.
3300         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3301         (WebKit::WebChromeClient::toolbarsVisible): Updated to use new internal enum.
3302         (WebKit::WebChromeClient::statusbarVisible): Ditto.
3303         (WebKit::WebChromeClient::menubarVisible): Ditto.
3304
3305         * WebProcess/WebPage/WebPage.cpp:
3306         (WebKit::WebPage::WebPage): Initialized m_uiClient member.
3307         (WebKit::WebPage::setInjectedBundleUIClient): Added. Updates m_uiClient.
3308         (WebKit::WebPage::close): Updated for change in m_uiClient.
3309         (WebKit::WebPage::pageDidScroll): Ditto.
3310         (WebKit::WebPage::initializeInjectedBundleUIClient): Deleted.
3311         * WebProcess/WebPage/WebPage.h:
3312         (WebKit::WebPage::injectedBundleUIClient): Updated return type.
3313
3314         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: Added #include that became
3315         necessary.
3316
3317 2014-04-06  Dan Bernstein  <mitz@apple.com>
3318
3319         Clean up WKGestureTypes.h
3320         https://bugs.webkit.org/show_bug.cgi?id=131286
3321
3322         Reviewed by Sam Weinig.
3323
3324         Renamed WKGestureTypes.h to GestureTypes.h, dropped the useless “WK” prefixes and changed
3325         into scoped enums, with the exception of SelectionFlags.
3326
3327         * Shared/ios/GestureTypes.h: Copied from Source/WebKit2/Shared/ios/WKGestureTypes.h.
3328         * Shared/ios/WKGestureTypes.h: Removed.
3329         * UIProcess/API/Cocoa/_WKElementAction.mm:
3330         (copyElement):
3331         (saveImage):
3332         * UIProcess/ios/PageClientImplIOS.mm:
3333         (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch):
3334         * UIProcess/ios/WKContentViewInteraction.h:
3335         * UIProcess/ios/WKContentViewInteraction.mm:
3336         (-[WKContentView _performAction:]):
3337         (toGestureType):
3338         (toUIWKGestureType):
3339         (toSelectionTouch):
3340         (toUIWKSelectionTouch):
3341         (toGestureRecognizerState):
3342         (toUIGestureRecognizerState):
3343         (toUIWKSelectionFlags):
3344         (toSelectionHandlePosition):
3345         (selectionChangedWithGesture):
3346         (selectionChangedWithTouch):
3347         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]):
3348         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
3349         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
3350         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
3351         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
3352         * WebKit2.xcodeproj/project.pbxproj:
3353         * WebProcess/WebPage/WebPage.h:
3354         * WebProcess/WebPage/ios/WebPageIOS.mm:
3355         (WebKit::WebPage::rangeForWebSelectionAtPosition):
3356         (WebKit::WebPage::selectWithGesture):
3357         (WebKit::distanceBetweenRectsForPosition):
3358         (WebKit::computeEdgeCenter):
3359         (WebKit::WebPage::expandedRangeFromHandle):
3360         (WebKit::WebPage::contractedRangeFromHandle):
3361         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
3362         (WebKit::shouldExpand):
3363         (WebKit::WebPage::changeBlockSelection):
3364         (WebKit::WebPage::updateBlockSelectionWithTouch):
3365         (WebKit::WebPage::updateSelectionWithTouches):
3366         (WebKit::WebPage::performActionOnElement):
3367
3368 2014-04-06  Sam Weinig  <sam@webkit.org>
3369
3370         Document user content related APIs..
3371
3372         Reviewed by Anders Carlsson.
3373
3374         - Also demote WKScriptWorld to SPI.
3375
3376         * UIProcess/API/Cocoa/WKScriptMessage.h:
3377         * UIProcess/API/Cocoa/WKScriptMessage.mm:
3378         (-[WKScriptMessage _scriptWorld]):
3379         (-[WKScriptMessage scriptWorld]): Deleted.
3380         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
3381         * UIProcess/API/Cocoa/WKScriptMessagePrivate.h: Added.
3382         * UIProcess/API/Cocoa/WKScriptWorld.h: Removed.
3383         * UIProcess/API/Cocoa/WKScriptWorld.mm: Removed.
3384         * UIProcess/API/Cocoa/WKUserContentController.h:
3385         * UIProcess/API/Cocoa/WKUserContentController.mm:
3386         (-[WKUserContentController addScriptMessageHandler:name:]):
3387         (-[WKUserContentController removeScriptMessageHandlerForName:]):
3388         (-[WKUserContentController _addScriptMessageHandler:name:world:]):
3389         (-[WKUserContentController _removeScriptMessageHandlerForName:world:]):
3390         (-[WKUserContentController addScriptMessageHandler:name:world:]): Deleted.
3391         (-[WKUserContentController removeScriptMessageHandlerForName:world:]): Deleted.
3392         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Added.
3393         * UIProcess/API/Cocoa/_WKScriptWorld.h: Copied from WebKit2/UIProcess/API/Cocoa/WKScriptWorld.h.
3394         * UIProcess/API/Cocoa/_WKScriptWorld.mm: Copied from WebKit2/UIProcess/API/Cocoa/WKScriptWorld.mm.
3395         (+[_WKScriptWorld defaultWorld]):
3396         (+[WKScriptWorld defaultWorld]): Deleted.
3397         * WebKit2.xcodeproj/project.pbxproj:
3398
3399 2014-04-04  Brian J. Burg  <burg@cs.washington.edu>
3400
3401         Enable WEB_REPLAY for PLATFORM(MAC)
3402         https://bugs.webkit.org/show_bug.cgi?id=130700
3403
3404         Reviewed by Timothy Hatcher.
3405
3406         * Configurations/FeatureDefines.xcconfig:
3407
3408 2014-04-05  Miyoung Shin  <myid.m.shin@gmail.com>
3409
3410         [WK2] Fix unused parameter compile warning.
3411         https://bugs.webkit.org/show_bug.cgi?id=131260
3412
3413         Reviewed by Gyuyoung Kim.
3414
3415         fix unused parameter warning in the WebKit2 build.
3416
3417         * UIProcess/API/APIDownloadClient.h:
3418         (API::DownloadClient::didReceiveData):
3419         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
3420         (API::DownloadClient::decideDestinationWithSuggestedFilename):
3421         (API::DownloadClient::didCreateDestination):
3422
3423 2014-04-05  Alexey Proskuryakov  <ap@apple.com>
3424
3425         REGRESSION (NetworkProcess): Subresources fail to load from AppCache
3426         https://bugs.webkit.org/show_bug.cgi?id=131262
3427         <rdar://problem/15370653>
3428
3429         Reviewed by Sam Weinig.
3430
3431         * WebProcess/Network/WebResourceLoadScheduler.cpp:
3432         (WebKit::WebResourceLoadScheduler::scheduleLoad): Check application cache,
3433         as done in ResourceLoader::start() for in-process loads.
3434
3435 2014-04-05  Alexey Proskuryakov  <ap@apple.com>
3436
3437         Frequent PluginProcess crashes at libsqlite3.dylib: openDatabase
3438         https://bugs.webkit.org/show_bug.cgi?id=131264
3439         <rdar://problem/14165329>
3440
3441         Reviewed by Sam Weinig.
3442
3443         Don't create NSURLCache until after having called setenv.
3444
3445         * PluginProcess/PluginProcess.h: Added m_nsurlCacheDirectory.
3446
3447         * PluginProcess/mac/PluginProcessMac.mm:
3448         (WebKit::PluginProcess::platformInitializePluginProcess): Compute NSURL cache path
3449         on our own. This does not match CFNetwork's result in most cases, but should work
3450         equally well.
3451         (WebKit::PluginProcess::initializeSandbox): Create a cache with our path and best
3452         guess for capacity.
3453
3454 2014-04-04  Joseph Pecoraro  <pecoraro@apple.com>
3455
3456         Unreviewed. iOS Build fix after r166818.
3457
3458         These member variables / declarations are accessed by iOS
3459         in shared code in TelephoneNumberOverlayControllerMac.
3460
3461         * WebProcess/WebPage/TelephoneNumberOverlayController.h:
3462
3463 2014-04-04  Joseph Pecoraro  <pecoraro@apple.com>
3464
3465         Unreviewed. Rollout r166812, breaks 32-bit Mavericks build.
3466
3467         * Shared/mac/CookieStorageShim.mm:
3468         (WebKit::CookieStorageShim::initialize):
3469         (-[WKNSURLSessionLocal _copyCookiesForRequestUsingAllAppropriateStorageSemantics:]):
3470
3471 2014-04-04  Brady Eidson  <beidson@apple.com>
3472
3473         Show DataDetector UI on scanned phone numbers.
3474         <rdar://problem/16379588> and https://bugs.webkit.org/show_bug.cgi?id=131247
3475
3476         Reviewed by Tim Horton.