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