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