[iOS WK2] Bottom-relative position:fixed elements are misplaced on page load
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-05-08  Simon Fraser  <simon.fraser@apple.com>
2
3         [iOS WK2] Bottom-relative position:fixed elements are misplaced on page load
4         https://bugs.webkit.org/show_bug.cgi?id=132719
5         <rdar://problem/16860837>
6
7         Reviewed by Benjamin Poulain.
8         
9         If we haven't received visible rects from the web process, compute the
10         fixed position rect, but only after scale has been set.
11
12         * WebProcess/WebPage/ios/WebPageIOS.mm:
13         (WebKit::WebPage::viewportConfigurationChanged):
14
15 2014-05-08  Jer Noble  <jer.noble@apple.com>
16
17         [Mac, iOS] Add source application accounting to AVURLAsset.
18         https://bugs.webkit.org/show_bug.cgi?id=132637
19
20         Reviewed by Eric Carlson.
21
22         Add accessor for sourceApplicationIdentifier.
23
24         * NetworkProcess/RemoteNetworkingContext.h:
25         * NetworkProcess/mac/RemoteNetworkingContext.mm:
26         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier):
27         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
28         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
29         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier):
30
31 2014-05-08  Tim Horton  <timothy_horton@apple.com>
32
33         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
34         ​https://bugs.webkit.org/show_bug.cgi?id=132667
35         <rdar://problem/16861454>
36
37         Rubber-stamped by Simon Fraser.
38
39         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
40         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
41         Add a null check to fix a crash on layers which lose backing store.
42
43 2014-05-08  Beth Dakin  <bdakin@apple.com>
44
45         REGRESSION (r168053): Phone number detection boxes are wrong when scrolled
46         https://bugs.webkit.org/show_bug.cgi?id=132706
47         -and corresponding-
48         <rdar://problem/16787957>
49
50         Reviewed by Tim Horton.
51
52         We need to paint the boxes in Document coordinates. Range::boundingRect() was 
53         giving us a point that took scroll position into account, and that’s not what we 
54         want. Here we use Range::textQuads() instead so that we can get something in 
55         Document coordinates, and then we need to convert that up to the main Document’s 
56         coordinates.
57         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
58         (WebKit::textQuadsToBoundingRectForRange):
59         (WebKit::TelephoneNumberOverlayController::drawRect):
60
61         The telephone click function wants a point in Window coordinates.
62         (WebKit::TelephoneNumberOverlayController::mouseEvent):
63
64 2014-05-08  Tim Horton  <timothy_horton@apple.com>
65
66         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
67         https://bugs.webkit.org/show_bug.cgi?id=132667
68         <rdar://problem/15349483>
69
70         Reviewed by Darin Adler.
71
72         * Shared/mac/RemoteLayerBackingStore.h:
73         * Shared/mac/RemoteLayerBackingStore.mm:
74         (WebKit::RemoteLayerBackingStore::takeFrontContextPendingFlush):
75         (WebKit::RemoteLayerBackingStore::flush): Deleted.
76         Add takeFrontContextPendingFlush, which returns the painted-but-not-yet-flushed front context,
77         and drops our reference to it. This needs to be called on all backing store between paints.
78
79         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
80         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::hasFlushed):
81         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
82         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
83         (WebKit::RemoteLayerTreeDrawingArea::~RemoteLayerTreeDrawingArea):
84         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
85         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
86         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::BackingStoreFlusher):
87         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
88         (WebKit::flushBackingStoreChangesInTransaction): Deleted.
89         Flush backing store and send the layer tree commit to the UI process from a dispatch queue.
90         We will only ever have a single commit in flight at a time, and there's a new
91         RELEASE_ASSERT to ensure that is the case.
92         We package up the commit on the main thread; the queue calls CGContextFlush
93         on all of the newly painted contexts and then tosses the commit over to the UI process.
94         This is a win in many cases because the Web process main thread can go ahead
95         and do other non-painting tasks while the queue is blocked on painting.
96
97 2014-05-08  Tim Horton  <timothy_horton@apple.com>
98
99         [wk2] Don't use the XPC-based plugin process for Adobe Reader
100         https://bugs.webkit.org/show_bug.cgi?id=132701
101         <rdar://problem/16792692>
102
103         Reviewed by Anders Carlsson.
104
105         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
106         (WebKit::shouldUseXPC):
107         Rename the debugging default to a more modern and accurate name.
108         Don't use XPC for Adobe Reader.
109
110         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
111         Move the check for plugins that need an executable heap into shouldUseXPC.
112
113 2014-05-08  Benjamin Poulain  <benjamin@webkit.org>
114
115         [iOS][WK2] Remove an incorrect assertion on asynchronous touch dispatch
116         https://bugs.webkit.org/show_bug.cgi?id=132660
117
118         Reviewed by Enrica Casucci.
119
120         This assertion no longer make sense after r168393. Now the asynchronous behavior is maintained
121         until the last finger leaves the screen.
122
123         * UIProcess/WebPageProxy.cpp:
124         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
125
126 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
127
128         Make BlobDataFileReference manage its sandbox extension
129         https://bugs.webkit.org/show_bug.cgi?id=132689
130
131         Reviewed by Anders Carlsson.
132
133         * CMakeLists.txt:
134         * PlatformGTK.cmake:
135         * WebKit2.xcodeproj/project.pbxproj:
136         Added BlobDataFileReferenceWithSandboxExtension.
137
138         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
139         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
140         (WebKit::NetworkBlobRegistry::registerBlobURL):
141         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
142         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
143         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
144         (WebKit::NetworkBlobRegistry::filesInBlob):
145         (WebKit::NetworkBlobRegistry::sandboxExtensions): Deleted.
146         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
147         We no longer track sandbox extensions here. Instead, provide a way to get files
148         for a blob, which contain extensions and can allow access to themselves.
149
150         * NetworkProcess/NetworkResourceLoader.cpp:
151         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
152         (WebKit::NetworkResourceLoader::consumeSandboxExtensions):
153         (WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
154         * NetworkProcess/NetworkResourceLoader.h:
155         Allow/revoke access to files in blob, just like we do for explicitly passed extensions.
156
157         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp: Added.
158         (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
159         (WebKit::BlobDataFileReferenceWithSandboxExtension::~BlobDataFileReferenceWithSandboxExtension):
160         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
161         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
162         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added.
163         (WebKit::BlobDataFileReferenceWithSandboxExtension::create):
164         A subclass of BlobDataFileReference that also contains a sandbox extension. NetworkProcess
165         always uses it in BlobRegistryImpl.
166
167         * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL):
168         * WebProcess/FileAPI/BlobRegistryProxy.h:
169         Updated for BlobRegistry interface changes. BlobRegistryProxy doesn't really need
170         a BlobDataFileReference here, as it only uses a path, but it needs to implement the same interface
171         as BlobRegistryImpl.
172
173 2014-05-08  Brady Eidson  <beidson@apple.com>
174
175         "shouldKeepCurrentBackForwardListItemInList" API should pass clientInfo to the callback
176         <rdar://problem/16855357> and https://bugs.webkit.org/show_bug.cgi?id=132692
177
178         Reviewed by Tim Horton.
179
180         * UIProcess/API/C/WKPage.cpp:
181         (WKPageSetPageLoaderClient):
182         * UIProcess/API/C/WKPageLoaderClient.h:
183
184 2014-05-08  Antti Koivisto  <antti@apple.com>
185
186         [iOS WebKit2] Can't activate text fields on Facebook
187         https://bugs.webkit.org/show_bug.cgi?id=132682
188
189         Reviewed by Enrica Casucci.
190
191         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
192         (WebKit::WebChromeClient::observedContentChange):
193         
194             Implement content change observer callback.
195
196         * WebProcess/WebPage/WebPage.h:
197         * WebProcess/WebPage/ios/WebPageIOS.mm:
198         (WebKit::WebPage::handleSyntheticClick):
199         
200             If the event gets canceled by a potential change (a started short-duration timer)
201             save the position and node so we can continue later.
202
203         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
204         
205             If it turns out the observed timer changed nothing continue the click event.
206
207         (WebKit::WebPage::completeSyntheticClick):
208         
209             Factored click event dispatch part of handleSyntheticClick here.
210
211 2014-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
212
213         [CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load
214         https://bugs.webkit.org/show_bug.cgi?id=126022
215
216         Reviewed by Benjamin Poulain.
217
218         Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim.
219
220         When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown
221         with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics
222         and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913.
223
224         This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation.
225
226         * UIProcess/CoordinatedGraphics/WebView.cpp:
227         (WebKit::WebView::didCommitLoadForMainFrame):
228
229 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
230
231         Put a better version of the assertion back, and add one when we ensureBackingStore.
232
233         Reviewed by Tim Horton.
234
235         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
236         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
237         (WebKit::PlatformCALayerRemote::ensureBackingStore):
238
239 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
240
241         This assertion was wrong and fired every time. Remove it.
242
243         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
244         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
245
246 2014-05-07  Enrica Casucci  <enrica@apple.com>
247
248         WK2: Programatic scroll requests during scroll or zoom animation to reveal focused element are ignored.
249         https://bugs.webkit.org/show_bug.cgi?id=132657
250         <rdar://problem/16468462>
251
252         Reviewed by Benjamin Poulain.
253
254         With the scrolling model we use on iOS, a programatic scroll
255         request can be received while we are still animating to reveal
256         the focused input element. Changing the scroll offset while animating
257         leads to unpredictable results. We now cancel the animation if
258         a programatic scroll request is received.
259
260         * UIProcess/API/Cocoa/WKWebView.mm:
261         (-[WKWebView _scrollToContentOffset:WebCore::]):
262         * WebProcess/WebPage/ios/WebPageIOS.mm:
263         (WebKit::WebPage::getAssistedNodeInformation):
264
265 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
266
267         [iOS WK2] Speculative fix for crash in PlatformCALayerRemote::recursiveBuildTransaction
268         https://bugs.webkit.org/show_bug.cgi?id=132666
269
270         Reviewed by Tim Horton.
271         
272         Crash reports suggest that owner() can be null. Assert and protect
273         against this.
274
275         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
276         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
277
278 2014-05-07  Dan Bernstein  <mitz@apple.com>
279
280         <rdar://problem/16831276> [iOS] Unparenting a WKWebView that’s loading pauses it
281         https://bugs.webkit.org/show_bug.cgi?id=132659
282
283         Reviewed by Tim Horton.
284
285         * UIProcess/Cocoa/NavigationState.h: Added a member variable.
286         * UIProcess/Cocoa/NavigationState.mm:
287         (WebKit::NavigationState::didChangeIsLoading): When transitioning into loading state,
288         acquire a background activity token. When transitioning out of loading state, dispose of
289         the token.
290
291 2014-05-07  Jeremy Jones  <jeremyj@apple.com>
292
293         HTMLMediaElement should exitFullscreen when view is removed from the window.
294         https://bugs.webkit.org/show_bug.cgi?id=132506
295
296         Reviewed by Tim Horton.
297
298         * UIProcess/WebPageProxy.cpp:
299         (WebKit::WebPageProxy::viewStateDidChange):
300         Request WebVideoFUllscreenManagerProxy to exitFullscreen when removed from the window.
301         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
302         Make requestExitFullscreen() public instead of private.
303
304 2014-05-07  Alexey Proskuryakov  <ap@apple.com>
305
306         Make blob size computation lazy
307         https://bugs.webkit.org/show_bug.cgi?id=132653
308
309         Reviewed by Anders Carlsson.
310
311         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
312         (WebKit::NetworkBlobRegistry::registerBlobURL):
313         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
314         (WebKit::NetworkBlobRegistry::blobSize):
315         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
316         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
317         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
318         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
319         (WebKit::NetworkConnectionToWebProcess::blobSize):
320         * NetworkProcess/NetworkConnectionToWebProcess.h:
321         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
322         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
323         (WebKit::BlobRegistryProxy::registerBlobURL):
324         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
325         (WebKit::BlobRegistryProxy::blobSize):
326         * WebProcess/FileAPI/BlobRegistryProxy.h:
327
328 2014-05-06  Simon Fraser  <simon.fraser@apple.com>
329
330         Add scrolling tree logging to RemoteLayerTree output
331         https://bugs.webkit.org/show_bug.cgi?id=132640
332
333         Reviewed by Beth Dakin.
334         
335         Support scrolling tree logging in the RemoteLayerTree log channel
336         output.
337         
338         Encode/decode ScrollingStateTree::hasChangedProperties() so we can use
339         it to avoid logging. Log all the things.
340
341         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
342         (WebKit::RemoteScrollingCoordinatorTransaction::encode):
343         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
344         (WebKit::RemoteScrollingTreeTextStream::RemoteScrollingTreeTextStream):
345         (WebKit::RemoteScrollingTreeTextStream::increaseIndent):
346         (WebKit::RemoteScrollingTreeTextStream::decreaseIndent):
347         (WebKit::RemoteScrollingTreeTextStream::writeIndent):
348         (WebKit::dumpProperty):
349         (WebKit::RemoteScrollingTreeTextStream::operator<<):
350         (WebKit::RemoteScrollingTreeTextStream::dump):
351         (WebKit::RemoteScrollingTreeTextStream::recursiveDumpNodes):
352         (WebKit::RemoteScrollingCoordinatorTransaction::description):
353         (WebKit::RemoteScrollingCoordinatorTransaction::dump):
354         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h:
355         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
356         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
357
358 2014-05-07  Hyowon Kim  <hw1008.kim@samsung.com>
359
360         GraphicsLayer::client() should return a reference.
361         https://bugs.webkit.org/show_bug.cgi?id=126372
362
363         Reviewed by Simon Fraser.
364
365         GraphicsLayers always have a GraphicsLayerClient attached,
366         so make client() a reference and remove some unnecessary branches.
367         The author of the changes in the mac port is Andreas Kling <akling@apple.com>.
368
369         * WebProcess/WebPage/PageOverlayController.cpp:
370         (WebKit::PageOverlayController::initialize):
371         (WebKit::PageOverlayController::installPageOverlay):
372         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
373         (WebKit::LayerTreeHostGtk::initialize):
374         (WebKit::LayerTreeHostGtk::createPageOverlayLayer):
375         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
376         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
377         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
378         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
379         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
380         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
381         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
382
383 2014-05-07  Shivakumar JM  <shiva.jm@samsung.com>
384
385         Cleanup the build from unused parameter in UIProcess Module
386         https://bugs.webkit.org/show_bug.cgi?id=131969
387
388         Reviewed by Csaba Osztrogonác.
389
390         Fixed unused parameter by omitting the parameter name
391
392         * UIProcess/API/C/WKPage.cpp:
393         (WKPageSetPageFindClient):
394         * UIProcess/WebFindClient.cpp:
395         (WebKit::WebFindClient::didFindString):
396
397 2014-05-07  Manuel Rego Casasnovas  <rego@igalia.com>
398
399         [CSS Grid Layout] Remove runtime feature
400         https://bugs.webkit.org/show_bug.cgi?id=132382
401
402         Reviewed by Benjamin Poulain.
403
404         Remove cssGridLayoutEnabled setting usage.
405
406         * Shared/WebPreferencesStore.h:
407         * UIProcess/API/C/WKPreferences.cpp:
408         (WKPreferencesSetCSSGridLayoutEnabled): Deleted.
409         (WKPreferencesGetCSSGridLayoutEnabled): Deleted.
410         * UIProcess/API/C/WKPreferencesRefPrivate.h:
411         * UIProcess/API/gtk/WebKitSettings.cpp:
412         (webKitSettingsConstructed):
413         * UIProcess/gtk/ExperimentalFeatures.cpp:
414         * UIProcess/gtk/ExperimentalFeatures.h:
415         * WebProcess/InjectedBundle/InjectedBundle.cpp:
416         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
417         * WebProcess/WebPage/WebPage.cpp:
418         (WebKit::WebPage::updatePreferences):
419         * mac/WebKit2.order:
420
421 2014-05-07  Csaba Osztrogonác  <ossy@webkit.org>
422
423         URTBF after r168393 to fix !IOS builds.
424
425         * Shared/WebEvent.h:
426
427 2014-05-06  Brady Eidson  <beidson@apple.com>
428
429         Followup to "Add WK2 SPI to prevent the previous back/forward item from remaining in the list"
430         <rdar://problem/16248710> and https://bugs.webkit.org/show_bug.cgi?id=132636
431
432         Reviewed by NOBODY (My mistake while addressing previous review feedback)
433
434         * UIProcess/API/C/WKPage.cpp:
435         (WKPageSetPageLoaderClient): During review feedback, this client switched from default negative to default
436           positve, so when the client isn't implemented...  return true instead of false.
437
438         * UIProcess/WebBackForwardList.cpp:
439         (WebKit::WebBackForwardList::addItem): Fix nonsensical comments while I'm at it.
440
441 2014-05-06  Brady Eidson  <beidson@apple.com>
442
443         Add WK2 SPI to prevent the previous back/forward item from remaining in the list
444         <rdar://problem/16248710> and https://bugs.webkit.org/show_bug.cgi?id=132636
445
446         Reviewed by Sam Weinig.
447
448         Add new PageLoaderClient SPI to keep the current back/forward item from remaining in the list:
449         * UIProcess/API/APILoaderClient.h:
450         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
451         * UIProcess/API/C/WKPage.cpp:
452         (WKPageSetPageLoaderClient):
453         * UIProcess/API/C/WKPageLoaderClient.h:
454         * UIProcess/WebPageProxy.cpp:
455         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
456         * UIProcess/WebPageProxy.h:
457
458         * UIProcess/WebBackForwardList.cpp:
459         (WebKit::WebBackForwardList::addItem): Use that SPI to determine whether we should insert the new item after
460         the previous item, or simply replace the previous item.
461         (WebKit::WebBackForwardList::goToItem): Use that SPI to determine whether the previous item stays or goes.
462
463 2014-05-06  Dan Bernstein  <mitz@apple.com>
464
465         -[WKWebView isLoading] is NO immediately after -loadRequest: until the provisional load starts
466         https://bugs.webkit.org/show_bug.cgi?id=132639
467
468         Reviewed by Darin Adler.
469
470         * UIProcess/PageLoadState.cpp:
471         (WebKit::PageLoadState::commitChanges): Updated for change from isLoadingState to isLoading.
472         (WebKit::PageLoadState::isLoading): Renamed from isLoadingState, changed to take Data and
473         check whether there is a non-null pending API request URL. If so, return true.
474         * UIProcess/PageLoadState.h:
475
476 2014-05-06  Dean Jackson  <dino@apple.com>
477
478         [Mac] Allow focus rings to redraw themselves if necessary
479         https://bugs.webkit.org/show_bug.cgi?id=132593
480
481         Reviewed by Simon Fraser.
482
483         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
484         (InitWebCoreSystemInterface): Add DrawFocusRingAtTime and DrawCellFocusRingWithFrameAtTime.
485
486 2014-05-06  Benjamin Poulain  <benjamin@webkit.org>
487
488         <rdar://problem/16833442> [iOS WebKit2]: Keep the order of contentView in _scrollView after rotation
489         https://bugs.webkit.org/show_bug.cgi?id=132634
490
491         Reviewed by Enrica Casucci.
492
493         Nice idea of Yongjun.
494
495         * UIProcess/API/Cocoa/WKWebView.mm:
496         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
497         (-[WKWebView _endAnimatedResize]):
498
499 2014-05-06  Timothy Hatcher  <timothy@apple.com>
500
501         Take WKView's topContentInset into account when docking Web Inspector to the right.
502
503         https://bugs.webkit.org/show_bug.cgi?id=132631
504
505         Reviewed by Joseph Pecoraro.
506
507         * UIProcess/mac/WebInspectorProxyMac.mm:
508         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Subtract topContentInset
509         from the height of the frame for the Inspector.
510
511 2014-05-06  Benjamin Poulain  <bpoulain@apple.com>
512
513         [iOS][WK2] WebKit2 does not set CanPreventNativeGestures on the platform events
514         https://bugs.webkit.org/show_bug.cgi?id=132594
515
516         Reviewed by Simon Fraser.
517
518         Set CanPreventNativeGestures on the plaform event.
519         Change the tracking of WKContentView to be similar to WebPageProxy.
520
521         * Shared/WebEvent.h:
522         (WebKit::WebTouchEvent::WebTouchEvent):
523         (WebKit::WebTouchEvent::canPreventNativeGestures):
524         (WebKit::WebTouchEvent::setCanPreventNativeGestures):
525         * Shared/WebEventConversion.cpp:
526         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
527         * Shared/ios/WebTouchEventIOS.cpp:
528         (WebKit::WebTouchEvent::encode):
529         (WebKit::WebTouchEvent::decode):
530         * UIProcess/ios/WKContentViewInteraction.mm:
531         (-[WKContentView _webTouchEventsRecognized:]):
532
533 2014-05-06  Benjamin Poulain  <bpoulain@apple.com>
534
535         [iOS][WK2] Add tap highlight on the simple UITapGestureRecognizer
536         https://bugs.webkit.org/show_bug.cgi?id=132623
537         <rdar://problem/16709507>
538
539         Reviewed by Enrica Casucci.
540
541         Add a low latency highlight for tap/click.
542
543         * UIProcess/PageClient.h:
544         * UIProcess/WebPageProxy.h:
545         * UIProcess/WebPageProxy.messages.in:
546         * UIProcess/ios/PageClientImplIOS.h:
547         * UIProcess/ios/PageClientImplIOS.mm:
548         (WebKit::PageClientImpl::commitPotentialTapFailed):
549         * UIProcess/ios/WKContentViewInteraction.h:
550         * UIProcess/ios/WKContentViewInteraction.mm:
551         (-[WKContentView setupInteraction]):
552         (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
553         (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
554         (-[WKContentView _finishInteraction]):
555         (-[WKContentView _highlightLongPressRecognized:]):
556         (-[WKContentView _singleTapRecognized:]):
557         (-[WKContentView _singleTapDidReset:]):
558         (-[WKContentView _commitPotentialTapFailed]):
559         (-[WKContentView _singleTapCommited:]):
560         (-[WKContentView _attemptClickAtLocation:]):
561         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h: Added.
562         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m: Added.
563         (-[WKSyntheticClickTapGestureRecognizer setGestureRecognizedTarget:action:]):
564         (-[WKSyntheticClickTapGestureRecognizer setResetTarget:action:]):
565         (-[WKSyntheticClickTapGestureRecognizer setState:]):
566         (-[WKSyntheticClickTapGestureRecognizer reset]):
567         * UIProcess/ios/WebPageProxyIOS.mm:
568         (WebKit::WebPageProxy::potentialTapAtPosition):
569         (WebKit::WebPageProxy::commitPotentialTap):
570         (WebKit::WebPageProxy::cancelPotentialTap):
571         (WebKit::WebPageProxy::tapHighlightAtPosition):
572         (WebKit::WebPageProxy::commitPotentialTapFailed):
573         * WebKit2.xcodeproj/project.pbxproj:
574         * WebProcess/WebPage/WebPage.h:
575         * WebProcess/WebPage/WebPage.messages.in:
576         * WebProcess/WebPage/ios/WebPageIOS.mm:
577         (WebKit::WebPage::handleSyntheticClick):
578         (WebKit::WebPage::handleTap):
579         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
580         (WebKit::WebPage::potentialTapAtPosition):
581         (WebKit::WebPage::commitPotentialTap):
582         (WebKit::WebPage::cancelPotentialTap):
583         (WebKit::WebPage::tapHighlightAtPosition):
584
585 2014-05-06  Anders Carlsson  <andersca@apple.com>
586
587         Put WebArchive and WebArchiveResource in the API namespace.
588
589         Rubber-stamped by Dan Bernstein.
590
591         * Shared/API/c/WKSharedAPICast.h:
592         * Shared/API/c/mac/WKWebArchive.cpp:
593         (WKWebArchiveGetTypeID):
594         (WKWebArchiveCreate):
595         (WKWebArchiveCreateWithData):
596         (WKWebArchiveCreateFromRange):
597         (WKWebArchiveCopyMainResource):
598         * Shared/API/c/mac/WKWebArchiveResource.cpp:
599         (WKWebArchiveResourceGetTypeID):
600         (WKWebArchiveResourceCreate):
601         * Shared/APIWebArchive.cpp: Renamed from Source/WebKit2/Shared/WebArchive.cpp.
602         (API::WebArchive::create):
603         (API::WebArchive::WebArchive):
604         (API::WebArchive::~WebArchive):
605         (API::WebArchive::mainResource):
606         (API::WebArchive::subresources):
607         (API::WebArchive::subframeArchives):
608         (API::releaseCFData):
609         (API::WebArchive::data):
610         (API::WebArchive::coreLegacyWebArchive):
611         * Shared/APIWebArchive.h: Renamed from Source/WebKit2/Shared/WebArchive.h.
612         * Shared/APIWebArchiveResource.cpp: Renamed from Source/WebKit2/Shared/WebArchiveResource.cpp.
613         (API::WebArchiveResource::create):
614         (API::WebArchiveResource::WebArchiveResource):
615         (API::WebArchiveResource::~WebArchiveResource):
616         (API::releaseCFData):
617         (API::WebArchiveResource::data):
618         (API::WebArchiveResource::URL):
619         (API::WebArchiveResource::MIMEType):
620         (API::WebArchiveResource::textEncoding):
621         (API::WebArchiveResource::coreArchiveResource):
622         * Shared/APIWebArchiveResource.h: Renamed from Source/WebKit2/Shared/WebArchiveResource.h.
623         * WebKit2.xcodeproj/project.pbxproj:
624
625 2014-05-06  Alex Christensen  <achristensen@webkit.org>
626
627         Removed unnecessary notImplemented.h includes.
628         https://bugs.webkit.org/show_bug.cgi?id=132587
629
630         Reviewed by Anders Carlsson.
631
632         * UIProcess/ios/WKContentViewInteraction.mm:
633         * UIProcess/mac/WebContextMenuProxyMac.mm:
634         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
635         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
636         Removed notImplemented from list of includes.
637
638 2014-05-05  Jeremy Jones  <jeremyj@apple.com>
639
640         Implement scan backward and forward in video fullscreen.
641         https://bugs.webkit.org/show_bug.cgi?id=132517
642
643         Reviewed by Simon Fraser.
644
645         Plumb through scanning/seeking functions.
646
647         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
648         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
649         (WebKit::WebVideoFullscreenManagerProxy::fastSeek):
650         (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
651         (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
652         (WebKit::WebVideoFullscreenManagerProxy::endScanning):
653         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
654
655 2014-05-05  Benjamin Poulain  <bpoulain@apple.com>
656
657         [iOS][WK2] Prefetch DNS hostnames on tap highlight
658         https://bugs.webkit.org/show_bug.cgi?id=132509
659
660         Reviewed by Alexey Proskuryakov.
661
662         * WebProcess/WebPage/ios/WebPageIOS.mm:
663         (WebKit::WebPage::tapHighlightAtPosition):
664
665 2014-05-05  Simon Fraser  <simon.fraser@apple.com>
666
667         [iOS WK2] Flickery scrolling inside overflow-scrolling: touch
668         https://bugs.webkit.org/show_bug.cgi?id=132591
669         <rdar://problem/16760466>
670
671         Reviewed by Tim Horton.
672         
673         Avoid triggering layer tree commits that touch the layer's boundsOrigin
674         while the user is scrolling in the UI process.
675         
676         Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
677         flag to the ScrollingTree to say that we're in the middle of a user interaction
678         (and also to send a final non-interactive update). That gets passed along
679         to the web process, and turned into "SyncScrollingLayerPosition" update.
680         AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
681         this, and uses it to set a flag on the ScrollableArea to say that the scroll
682         is a user scroll.
683         
684         RenderLayerBacking then makes use of this (in existing code, shared with WK1)
685         to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
686         which updates the GraphicsLayer without touching platform layers. This is necessary
687         so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
688         computations).
689         
690         Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
691         for WebKit1 by checking the type of platform layer.
692
693         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
694         (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
695         (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion):
696         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
697         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
698         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
699         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
700         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
701         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
702         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
703         (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]):
704         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
705         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
706         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
707         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
708         * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in:
709         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
710         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
711
712 2014-05-05  Alexey Proskuryakov  <ap@apple.com>
713
714         Stop using BlobData on client side
715         https://bugs.webkit.org/show_bug.cgi?id=132582
716
717         Reviewed by Sam Weinig.
718
719         Update for WebCore changes.
720
721         * CMakeLists.txt:
722         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
723         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
724         (WebKit::NetworkBlobRegistry::registerBlobURL):
725         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
726         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
727         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
728         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
729         * NetworkProcess/NetworkConnectionToWebProcess.h:
730         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
731         * Shared/FileAPI/BlobRegistrationData.cpp: Removed.
732         * Shared/FileAPI/BlobRegistrationData.h: Removed.
733         * Shared/WebCoreArgumentCoders.cpp:
734         (IPC::ArgumentCoder<BlobPart>::encode):
735         (IPC::ArgumentCoder<BlobPart>::decode):
736         * Shared/WebCoreArgumentCoders.h:
737         * WebKit2.xcodeproj/project.pbxproj:
738         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
739         (WebKit::BlobRegistryProxy::registerFileBlobURL):
740         (WebKit::BlobRegistryProxy::registerBlobURL):
741         * WebProcess/FileAPI/BlobRegistryProxy.h:
742
743 2014-05-05  Beth Dakin  <bdakin@apple.com>
744
745         Need a delegate that informs the UI process when the page's pin state changes
746         https://bugs.webkit.org/show_bug.cgi?id=132583
747         -and corresponding-
748         <rdar://problem/16806231>
749
750         Reviewed by Anders Carlsson.
751
752         New UIClient function pinnedStateDidChange. 
753
754         * UIProcess/API/APIUIClient.h:
755         (API::UIClient::pinnedStateDidChange):
756
757         Create WKPageUIClientV3 to add this function.
758         * UIProcess/API/C/WKPage.cpp:
759         (WKPageSetPageUIClient):
760         * UIProcess/API/C/WKPageUIClient.h:
761
762         Change default initialization to true instead of false, which makes more sense for 
763         this API.
764         * UIProcess/WebPageProxy.cpp:
765         (WebKit::WebPageProxy::WebPageProxy):
766         (WebKit::WebPageProxy::didCommitLoadForFrame):
767         (WebKit::WebPageProxy::resetState):
768         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
769         * WebProcess/WebPage/WebPage.cpp:
770         (WebKit::WebPage::WebPage):
771
772 2014-05-05  Anders Carlsson  <andersca@apple.com>
773
774         Add SPI to provide the WebCrypto master key
775         https://bugs.webkit.org/show_bug.cgi?id=132586
776         <rdar://problem/16091460>
777
778         Reviewed by Dan Bernstein.
779
780         * UIProcess/API/APILoaderClient.h:
781         (API::LoaderClient::webCryptoMasterKey):
782         * UIProcess/API/C/WKPage.cpp:
783         (WKPageSetPageLoaderClient):
784         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
785         * UIProcess/Cocoa/NavigationState.h:
786         * UIProcess/Cocoa/NavigationState.mm:
787         (WebKit::NavigationState::setNavigationDelegate):
788         (WebKit::NavigationState::LoaderClient::webCryptoMasterKey):
789         * UIProcess/WebPageProxy.cpp:
790         (WebKit::WebPageProxy::wrapCryptoKey):
791
792 2014-05-05  Gavin Barraclough  <baraclough@apple.com>
793
794         https://bugs.webkit.org/show_bug.cgi?id=132522
795         Clean up ProcessThrottler
796
797         Unreviewed: bad build fix. Will work out what the right include is asap.
798
799         * UIProcess/ios/WebProcessProxyIOS.mm:
800
801 2014-05-05  Sam Weinig  <sam@webkit.org>
802
803         [Cocoa WebKit2] Add SPI to clear all visited links in a VisitedLinkProvider
804         https://bugs.webkit.org/show_bug.cgi?id=132573
805
806         Reviewed by Dan Bernstein.
807
808         * Shared/VisitedLinkTable.cpp:
809         (WebKit::VisitedLinkTable::VisitedLinkTable):
810         (WebKit::VisitedLinkTable::clear):
811         * Shared/VisitedLinkTable.h:
812         Add functions to clear the visited link table.
813
814         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
815         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
816         (-[_WKVisitedLinkProvider removeAll]):
817         Add SPI.
818
819         * UIProcess/VisitedLinkProvider.cpp:
820         (WebKit::VisitedLinkProvider::removeAll):
821         * UIProcess/VisitedLinkProvider.h:
822         A remove all resets the provider and notifies all the attached processes.
823
824         * WebProcess/WebPage/VisitedLinkTableController.cpp:
825         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
826         * WebProcess/WebPage/VisitedLinkTableController.h:
827         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
828         Add message to clear the visited links for a process.
829
830 2014-05-05  Benjamin Poulain  <benjamin@webkit.org>
831
832         [iOS][WK2] Special case ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture() for image documents
833         https://bugs.webkit.org/show_bug.cgi?id=132553
834
835         Reviewed by Tim Horton.
836
837         When collecting the geometry for the smart magnification gesture, always return the image of an image document
838         on iOS. On iOS, it does not make much sense to return the whole document rect when the gesture is not over the image.
839
840         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
841         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
842
843 2014-05-02  Gavin Barraclough  <baraclough@apple.com>
844
845         https://bugs.webkit.org/show_bug.cgi?id=132522
846         Clean up ProcessThrottler
847
848         Reviewed by Geoffrey Garen.
849
850         The initial implementation of ProcessThrottler relied on the reply from the
851         SetViewState message to ensure the page visibility notifications have a chance
852         to be delivered. This resulted in:
853             - unnecessarily complicated interface to ProcessThrottler (in VisibilityState class)
854             - complexity bleeding out into WebPageProxy (handling 'hiding' state).
855             - for cases other than view hiding, no suspension notification in the WebContent.
856
857         To fix these issues add an explicit handshake from the ProcessThrottler to the WebPage.
858         This gives us two things:
859             - All previously posted messages (e.g. SetViewState) will be processed before suspension.
860             - WebContent is always (bar timeout) notified before suspension.
861
862         Since this interlock ensures the SetViewState message will be processed, the WKContentView no
863         longer needs to request a reply from SetViewState, and WebPageProxy can lose all the 'hiding'
864         state tracking. In turn, we can simplify VisibilityToken to a couple of simpler types, without
865         the interface to change state - just acquire/release to keep the process runnable or permit
866         suspension.
867
868         * UIProcess/API/Cocoa/WKWebView.mm:
869         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
870             - VisibilityToken -> BackgroundActivityToken
871         * UIProcess/WebPageProxy.cpp:
872         (WebKit::WebPageProxy::WebPageProxy):
873             - m_visibilityToken -> m_activityToken, remove m_pendingViewStateUpdates
874               updateVisibilityToken -> updateActivityToken
875         (WebKit::WebPageProxy::reattachToWebProcess):
876             - updateVisibilityToken -> updateActivityToken
877         (WebKit::WebPageProxy::viewStateDidChange):
878             - remove m_pendingViewStateUpdates, updateActivityToken after sending SetViewState
879         (WebKit::WebPageProxy::updateActivityToken):
880             - m_visibilityToken -> m_activityToken, no need to handle 'hiding' state.
881         (WebKit::WebPageProxy::updateVisibilityToken): Deleted.
882             - renamed to updateActivityToken
883         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
884             - implementation moved back into header.
885         * UIProcess/WebPageProxy.h:
886         (WebKit::WebPageProxy::didUpdateViewState):
887             - implementation moved back into header.
888         * UIProcess/WebProcessProxy.cpp:
889         (WebKit::WebProcessProxy::WebProcessProxy):
890             - ProcessThrottler constructor now passed WebProcessProxy.
891         * UIProcess/WebProcessProxy.h:
892             - added ProcessWillSuspend/ProcessReadyToSuspend
893         * UIProcess/WebProcessProxy.messages.in:
894             - added ProcessWillSuspend/ProcessReadyToSuspend
895         * UIProcess/ios/ProcessAssertion.h:
896         (WebKit::ProcessAssertion::state):
897             - accessor
898         * UIProcess/ios/ProcessThrottler.h:
899         (WebKit::ProcessThrottler::VisibilityToken::visibility): Deleted.
900         (WebKit::ProcessThrottler::VisibilityToken::setVisibility): Deleted.
901             - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken.
902         (WebKit::ProcessThrottler::ProcessThrottler): Deleted.
903         (WebKit::ProcessThrottler::visibilityToken): Deleted.
904         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
905         (WebKit::ProcessThrottler::assertionState): Deleted.
906         (WebKit::ProcessThrottler::updateAssertion): Deleted.
907             - moved implementations to .mm.
908         * UIProcess/ios/ProcessThrottler.mm:
909         (WebKit::ProcessThrottler::ForegroundActivityToken::ForegroundActivityToken):
910         (WebKit::ProcessThrottler::ForegroundActivityToken::~ForegroundActivityToken):
911         (WebKit::ProcessThrottler::BackgroundActivityToken::BackgroundActivityToken):
912         (WebKit::ProcessThrottler::BackgroundActivityToken::~BackgroundActivityToken):
913             - new, simpler replacement for VisibilityToken. Instantiate to keep a processes running, release to suspend.
914         (WebKit::ProcessThrottler::ProcessThrottler):
915             - constructor, now initializes WebProcessProxy pointer & timer mechanism
916         (WebKit::ProcessThrottler::assertionState):
917             - select the appropriate AssertionState give current ActivityTokens.
918         (WebKit::ProcessThrottler::updateAssertionNow):
919             - update the current ProcessAssertion.
920         (WebKit::ProcessThrottler::updateAssertion):
921             - update the current ProcessAssertion, delay running->suspended transitions to give the process a chance to clean up.
922         (WebKit::ProcessThrottler::didConnnectToProcess):
923             - moved from header.
924         (WebKit::ProcessThrottler::suspendTimerFired):
925             - timeout to prevent processes from running in the background for too long.
926         (WebKit::ProcessThrottler::processReadyToSuspend):
927             - handshake from the WebContent process to acknowledge it is ready to suspend.
928         (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken): Deleted.
929         (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken): Deleted.
930         (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired): Deleted.
931         (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal): Deleted.
932             - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken.
933         * UIProcess/ios/WKContentView.mm:
934         (-[WKContentView didMoveToWindow]):
935             - no longer necessary to request a response from SetViewState; this interlock is now managed by the ProcessThrottler.
936         * UIProcess/ios/WebProcessProxyIOS.mm:
937         (WebKit::WebProcessProxy::sendProcessWillSuspend):
938         (WebKit::WebProcessProxy::processReadyToSuspend):
939             - added ProcessWillSuspend/ProcessReadyToSuspend
940         * WebProcess/WebProcess.cpp:
941         (WebKit::WebProcess::processWillSuspend):
942             - notification from the WebContent process that we will be suspended; for now just send back an ack.
943         * WebProcess/WebProcess.h:
944             - added ProcessWillSuspend/ProcessReadyToSuspend
945         * WebProcess/WebProcess.messages.in:
946             - added ProcessWillSuspend/ProcessReadyToSuspend
947
948 2014-05-05  Jeremy Jones  <jeremyj@apple.com>
949
950         Implement beginScrubbing and endScrubbing for video fullscreen.
951         https://bugs.webkit.org/show_bug.cgi?id=132520
952
953         Reviewed by Eric Carlson.
954
955         Plumb through beginScrubbing and endScrubbing.
956
957         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
958         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
959         (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
960         (WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
961         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
962
963 2014-05-05  Tim Horton  <timothy_horton@apple.com>
964
965         Use a layer delegate instead of web_disableAllActions wherever possible
966         https://bugs.webkit.org/show_bug.cgi?id=132560
967         <rdar://problem/16459284>
968
969         Reviewed by Simon Fraser.
970
971         * UIProcess/API/mac/WKView.mm:
972         (-[WKView _setAcceleratedCompositingModeRootLayer:]):
973         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
974         (WebKit::RemoteLayerTreeHost::createLayer):
975         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
976         (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator):
977         * UIProcess/mac/RemoteLayerTreeHost.mm:
978         (WebKit::RemoteLayerTreeHost::createLayer):
979         * UIProcess/mac/ViewGestureControllerMac.mm:
980         (WebKit::ViewGestureController::beginSwipeGesture):
981         Make use of WebActionDisablingCALayerDelegate where possible.
982         Also, UIKit disables actions for us, so don't bother doing anything on iOS.
983
984 2014-05-05  Martin Hock  <mhock@apple.com>
985
986         Session-aware plugin autostart data
987         https://bugs.webkit.org/show_bug.cgi?id=131758
988         <rdar://problem/15906540>
989
990         Reviewed by Alexey Proskuryakov.
991
992         * Shared/WebProcessCreationParameters.cpp:
993         * Shared/WebProcessCreationParameters.h:
994         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
995         (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider):
996         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
997         (WebKit::PlugInAutoStartProvider::autoStartOriginHashesCopy):
998         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
999         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
1000         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray):
1001         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
1002         * UIProcess/Plugins/PlugInAutoStartProvider.h:
1003         * UIProcess/WebContext.cpp:
1004         (WebKit::WebContext::addPlugInAutoStartOriginHash):
1005         (WebKit::WebContext::plugInDidReceiveUserInteraction):
1006         * UIProcess/WebContext.h:
1007         * UIProcess/WebContext.messages.in:
1008         * WebProcess/Plugins/PluginView.cpp:
1009         (WebKit::PluginView::pluginDidReceiveUserInteraction):
1010         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
1011         (WebKit::WebPlugInClient::didStartFromOrigin):
1012         * WebProcess/WebCoreSupport/WebPlugInClient.h:
1013         * WebProcess/WebProcess.cpp:
1014         (WebKit::WebProcess::WebProcess):
1015         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
1016         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
1017         (WebKit::WebProcess::plugInDidStartFromOrigin):
1018         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
1019         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
1020         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
1021         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
1022         * WebProcess/WebProcess.h:
1023         * WebProcess/WebProcess.messages.in:
1024
1025 2014-05-05  Andy Estes  <aestes@apple.com>
1026
1027         Another iOS build fix after r168260.
1028
1029         Removed an unnecessary 'using namespace WebCore'.
1030
1031         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp:
1032
1033 2014-05-05  Tim Horton  <timothy_horton@apple.com>
1034
1035         Fix the iOS build.
1036
1037         * UIProcess/API/Cocoa/WKWebView.mm:
1038
1039 2014-05-05  Ryuan Choi  <ryuan.choi@samsung.com>
1040
1041         [EFL][WK2] Refactor favicon database APIs
1042         https://bugs.webkit.org/show_bug.cgi?id=132519
1043
1044         Reviewed by Gyuyoung Kim.
1045
1046         ewebkit2 has two options to get favicon.
1047
1048         The first option is ewk_view_favicon_get with "favicon,changed" signal.
1049         It's simple to use but it always adds the callback to EwkView although applications does not use favicon.
1050
1051         The other option is ewk_favicon_database_icon_get with ewk_favicon_database_icon_change_callback_add API.
1052         But the callback doesn't have information about Ewk_Favicon_Database to call ewk_favicon_database_icon_get.
1053
1054         This patch removed ewk_view_favicon_get and "favicon,changed" signal.
1055         In addition, improved ewk_favicon_database_icon_change_callback.
1056
1057         * UIProcess/API/efl/EwkView.cpp: Remove ewk_favicon_database related code.
1058         (EwkView::EwkView):
1059         (EwkView::~EwkView):
1060         (EwkView::informURLChange):
1061         (EwkView::handleFaviconChanged):
1062         (EwkView::createFavicon): Deleted.
1063         * UIProcess/API/efl/EwkViewCallbacks.h:
1064         * UIProcess/API/efl/ewk_favicon_database.cpp:
1065         (EwkFaviconDatabase::iconDataReadyForPageURL):
1066         (EwkFaviconDatabase::didChangeIconForPageURL): Deleted. dead code.
1067         * UIProcess/API/efl/ewk_favicon_database.h:
1068         Refactor Ewk_Favicon_Database_Icon_Change_Cb and improve doxygen.
1069         * UIProcess/API/efl/ewk_favicon_database_private.h:
1070         * UIProcess/API/efl/ewk_view.cpp:
1071         (ewk_view_favicon_get): Deleted.
1072         * UIProcess/API/efl/ewk_view.h:
1073         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
1074         (EWK2FaviconDatabaseTest::requestFaviconData):
1075         (TEST_F):
1076
1077 2014-05-05  Tim Horton  <timothy_horton@apple.com>
1078
1079         [iOS WebKit2] Swipe snapshots should be taken asynchronously
1080         https://bugs.webkit.org/show_bug.cgi?id=132417
1081         <rdar://problem/16535921>
1082
1083         Reviewed by Anders Carlsson.
1084
1085         Reorganize takeViewSnapshot to return a ViewSnaphot with the image
1086         filled in (the other properties are filled in by ViewSnapshotStore).
1087
1088         Make ViewSnapshotStore use a fixed size instead of count for the snapshot cache.
1089         iOS doesn't use purgeable snapshots, so make the cache much smaller there.
1090
1091         Use CARenderServerCaptureLayerWithTransform to achieve async snapshotting.
1092
1093         Rename WebKit::ViewSnapshotStore::Snapshot to WebKit::ViewSnapshot so that
1094         it can be forward-declared in a bunch of places.
1095
1096         * UIProcess/API/Cocoa/WKWebView.mm:
1097         (-[WKWebView _takeViewSnapshot:]):
1098         Use CARenderServerCaptureLayerWithTransform.
1099
1100         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1101         * UIProcess/API/mac/WKView.mm:
1102         (createIOSurfaceFromImage):
1103         (-[WKView _takeViewSnapshot:]):
1104         Adjust to the new push model.
1105
1106         * UIProcess/API/mac/WKViewInternal.h:
1107         * UIProcess/PageClient.h:
1108         * UIProcess/WebPageProxy.cpp:
1109         (WebKit::WebPageProxy::takeViewSnapshot):
1110         * UIProcess/WebPageProxy.h:
1111         * UIProcess/ios/PageClientImplIOS.h:
1112         * UIProcess/ios/PageClientImplIOS.mm:
1113         (WebKit::PageClientImpl::takeViewSnapshot):
1114         * UIProcess/mac/PageClientImpl.h:
1115         * UIProcess/mac/PageClientImpl.mm:
1116         (WebKit::PageClientImpl::takeViewSnapshot):
1117         Plumbing.
1118
1119         * UIProcess/ios/ViewGestureControllerIOS.mm:
1120         (WebKit::ViewGestureController::beginSwipeGesture):
1121         (WebKit::ViewGestureController::endSwipeGesture):
1122         Realize an object that can be used as the layer contents from the slot ID.
1123
1124         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp:
1125         (WebKit::WebMemoryPressureHandler::sharedHandler):
1126         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
1127         * UIProcess/WebMemoryPressureHandlerIOS.h:
1128         Add a memory pressure handler for the UI process. This does not use
1129         WebCore's platform independent memory pressure handler because that
1130         mechanism only allows for one handler per process, and we don't want to
1131         stomp on any handlers installed by WebKit1 in a process where the WebKits coexist.
1132
1133         * UIProcess/ios/WKContentView.h:
1134         * UIProcess/ios/WKContentView.mm:
1135         (-[WKContentView _takeViewSnapshot]): Deleted.
1136         Get rid of an unnecessary bounce through WKContentView.
1137
1138         * UIProcess/mac/ViewGestureControllerMac.mm:
1139         (WebKit::ViewGestureController::retrieveSnapshotForItem):
1140         (WebKit::ViewGestureController::endSwipeGesture):
1141         Use the new name, ViewSnapshot.
1142
1143         * UIProcess/mac/ViewSnapshotStore.h:
1144         (WebKit::ViewSnapshot::ViewSnapshot):
1145         * UIProcess/mac/ViewSnapshotStore.mm:
1146         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
1147         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1148         (WebKit::ViewSnapshotStore::snapshottingContext):
1149         Use a custom CAContext for snapshotting so that snapshots don't
1150         disappear when the main context is destroyed on hibernation.
1151
1152         (WebKit::ViewSnapshotStore::removeSnapshotImage):
1153         (WebKit::ViewSnapshotStore::pruneSnapshots):
1154         (WebKit::ViewSnapshotStore::recordSnapshot):
1155         (WebKit::ViewSnapshotStore::getSnapshot):
1156         (WebKit::ViewSnapshotStore::discardSnapshots):
1157         (WebKit::ViewSnapshot::clearImage):
1158         (WebKit::ViewSnapshot::hasImage):
1159         (WebKit::createIOSurfaceFromImage): Deleted.
1160         (WebKit::ViewSnapshotStore::Snapshot::clearImage): Deleted.
1161         (WebKit::ViewSnapshotStore::Snapshot::hasImage): Deleted.
1162         Cache by image size instead of counts.
1163
1164         * WebKit2.xcodeproj/project.pbxproj:
1165
1166 2014-05-04  Pratik Solanki  <psolanki@apple.com>
1167
1168         Reduce calls to CFURLCacheCopySharedURLCache
1169         https://bugs.webkit.org/show_bug.cgi?id=132464
1170         <rdar://problem/16806694>
1171
1172         Address review comments by collapsing multi-line code into a single ASSERT.
1173
1174         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1175         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
1176
1177 2014-05-04  Pratik Solanki  <psolanki@apple.com>
1178
1179         Shortcircuit shouldUseCredentialStorage callback
1180         https://bugs.webkit.org/show_bug.cgi?id=132308
1181         <rdar://problem/16806708>
1182
1183         Reviewed by Alexey Proskuryakov.
1184
1185         If we are going to return true from the shouldUseCredentialStorage callback then we don't
1186         really need to have CFNetwork/Foundation call us. We can just disable the callback and
1187         CFNetwork will assume true. Add a separate subclass that implements this callback when we
1188         need to return false. We can also eliminate the corresponding async callbacks. This avoids
1189         pingponging between dispatch queue and main thread in the common case.
1190
1191         No new tests because no change in functionality.
1192
1193         * NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks.
1194         * NetworkProcess/NetworkResourceLoader.h:
1195
1196 2014-05-04  Beth Dakin  <bdakin@apple.com>
1197
1198         Top content inset: Margin tiles should not display in the inset area when pinned 
1199         to the top of the page
1200         https://bugs.webkit.org/show_bug.cgi?id=132535
1201         -and corresponding-
1202         <rdar://problem/16613039>
1203
1204         Reviewed by Simon Fraser.
1205
1206         Encode and decode the ScrollingStateScrollingNode’s m_topContentInset even though 
1207         we don’t use it for anything yet. Since the headerLayer and footerLayer are not 
1208         encoded or decoded yet, I did not encode/decode the insetClipLayer yet, which, 
1209         like the header and footer layers, would not yet be used. 
1210         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1211         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
1212         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
1213
1214 2014-05-03  Commit Queue  <commit-queue@webkit.org>
1215
1216         Unreviewed, rolling out r168232.
1217         https://bugs.webkit.org/show_bug.cgi?id=132543
1218
1219         broke ~15 tests on WK2 debug (Requested by kling on #webkit).
1220
1221         Reverted changeset:
1222
1223         "Shortcircuit shouldUseCredentialStorage callback"
1224         https://bugs.webkit.org/show_bug.cgi?id=132308
1225         http://trac.webkit.org/changeset/168232
1226
1227 2014-05-03  Tim Horton  <timothy_horton@apple.com>
1228
1229         [iOS] REGRESSION (WebKit2): Page isn't clipped properly during back/forward swipe
1230         https://bugs.webkit.org/show_bug.cgi?id=132538
1231         <rdar://problem/16266027>
1232
1233         Reviewed by Simon Fraser.
1234
1235         * UIProcess/ios/ViewGestureControllerIOS.mm:
1236         (WebKit::ViewGestureController::beginSwipeGesture):
1237         (WebKit::ViewGestureController::endSwipeGesture):
1238         * UIProcess/mac/ViewGestureController.h:
1239         Add a clipping layer above the live swipe layer, which explicitly clips to bounds.
1240
1241 2014-05-02  Pratik Solanki  <psolanki@apple.com>
1242
1243         Shortcircuit shouldUseCredentialStorage callback
1244         https://bugs.webkit.org/show_bug.cgi?id=132308
1245         <rdar://problem/16806708>
1246
1247         Reviewed by Alexey Proskuryakov.
1248
1249         If we are going to return true from the shouldUseCredentialStorage callback then we don't
1250         really need to have CFNetwork/Foundation call us. We can just disable the callback and
1251         CFNetwork will assume true. Add a separate subclass that implements this callback when we
1252         need to return false. We can also eliminate the corresponding async callbacks. This avoids
1253         pingponging between dispatch queue and main thread in the common case.
1254
1255         No new tests because no change in functionality.
1256
1257         * NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks.
1258         * NetworkProcess/NetworkResourceLoader.h:
1259
1260 2014-05-02  Pratik Solanki  <psolanki@apple.com>
1261
1262         Reduce calls to CFURLCacheCopySharedURLCache
1263         https://bugs.webkit.org/show_bug.cgi?id=132464
1264         <rdar://problem/16806694>
1265
1266         Reviewed by Alexey Proskuryakov.
1267
1268         CFURLCacheCopySharedURLCache grabs a mutex and can sometimes block. Avoid that by stashing
1269         the cache reference in a static.
1270
1271         * NetworkProcess/NetworkResourceLoader.h: Coalesce ifdef'd code.
1272         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1273         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
1274         (WebKit::NetworkResourceLoader::willCacheResponseAsync): Use more correct ifdef for
1275         Foundation based callback.
1276
1277 2014-05-03  Sam Weinig  <sam@webkit.org>
1278
1279         [Cocoa WebKit2] Add basic _WKWebsiteDataStore implementation
1280         https://bugs.webkit.org/show_bug.cgi?id=132526
1281
1282         Reviewed by Anders Carlsson.
1283
1284         - Renames WKSession to _WKWebsiteDataStore to better reflect its intended use (renaming
1285           the implementation object will come later).
1286         - Makes _WKWebsiteDataStore work as a wrapped Objective-C object.
1287         - Adds the ability to set a _WKWebsiteDataStore on the WKWebViewConfiguration.
1288
1289         * Shared/Cocoa/APIObject.mm:
1290         (API::Object::newObject):
1291         * UIProcess/API/Cocoa/WKSession.h:
1292         * UIProcess/API/Cocoa/WKSession.mm:
1293         (-[WKSession dealloc]): Deleted.
1294         (-[WKSession ephemeral]): Deleted.
1295         (-[WKSession API::]): Deleted.
1296         * UIProcess/API/Cocoa/WKSessionInternal.h:
1297         (WebKit::wrapper): Deleted.
1298         * UIProcess/API/Cocoa/WKWebView.mm:
1299         (-[WKWebView initWithFrame:configuration:]):
1300         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1301         (-[WKWebViewConfiguration copyWithZone:]):
1302         (-[WKWebViewConfiguration _websiteDataStore]):
1303         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
1304         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1305         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.h.
1306         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.mm.
1307         (+[_WKWebsiteDataStore nonPersistentDataStore]):
1308         (-[_WKWebsiteDataStore isNonPersistentDataStore]):
1309         (-[WKSession ephemeral]): Deleted.
1310         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSessionInternal.h.
1311         * WebKit2.xcodeproj/project.pbxproj:
1312
1313 2014-05-03  Simon Fraser  <simon.fraser@apple.com>
1314
1315         [UI-side compositing] Assertion in PlatformCAFilters::setFiltersOnLayer with animated reference filter
1316         https://bugs.webkit.org/show_bug.cgi?id=132528
1317         <rdar://problem/16671660>
1318
1319         Reviewed by Tim Horton.
1320         
1321         Allow PASSTHROUGH filters to be encoded and sent to the UI process; they can be set
1322         on layers as the result of a filter animation using a reference filter, and just get
1323         ignored anyway, but encoding them maintains consistency of the filters list.
1324
1325         * Shared/WebCoreArgumentCoders.cpp:
1326         (IPC::ArgumentCoder<FilterOperation>::encode): Assert during encoding if
1327         we try to encode a NONE or REFERENCE filter (to match the decoding assertions).
1328         (IPC::decodeFilterOperation): Allow decoding of PASSTHROUGH filters. Have
1329         trying to decode a NONE or REFERENCE filter mark the message as invalid.
1330         (IPC::ArgumentCoder<IDBKeyData>::decode): Mark the message invalid when receiving
1331         unexpected key types.
1332         * Shared/mac/RemoteLayerTreeTransaction.mm:
1333         (WebKit::RemoteLayerTreeTextStream::operator<<): Have the logging not crash if
1334         a filter is null (should never happen).
1335
1336 2014-05-02  Dan Bernstein  <mitz@apple.com>
1337
1338         [Cocoa] Remove unused WKErrorRecoveryAttempting
1339         https://bugs.webkit.org/show_bug.cgi?id=132503
1340
1341         Reviewed by Anders Carlsson.
1342
1343         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1344         (didFailProvisionalLoadWithErrorForFrame):
1345         (didFailLoadWithErrorForFrame):
1346         (createErrorWithRecoveryAttempter): Deleted.
1347         (-[WKBrowsingContextController attemptRecoveryFromError:]): Deleted.
1348         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.m: Removed.
1349         * UIProcess/API/Cocoa/_WKFormDelegate.h:
1350         * WebKit2.xcodeproj/project.pbxproj:
1351
1352 2014-05-02  Enrica Casucci  <enrica@apple.com>
1353
1354         REGRESSION (WebKit2) Need to support reanalyze button for Chinese Traditional.
1355         https://bugs.webkit.org/show_bug.cgi?id=132504
1356         <rdar://problem/16778862>
1357
1358         Reviewed by Benjamin Poulain.
1359
1360         For traditional Chinese we support reanalyzing of the text to perform
1361         transformations on the text based on the selected language and keyboard.
1362         This is done by pressing the Reanalyze button on the system
1363         menu. This patch adds the necessary code to canPerformAction to enable
1364         the button when appropriate as well as the implementation of the action
1365         itself.
1366
1367         * UIProcess/ios/WKContentViewInteraction.mm:
1368         (-[WKContentView _reanalyze:]):
1369         (-[WKContentView canPerformAction:withSender:]):
1370
1371 2014-05-02  Enrica Casucci  <enrica@apple.com>
1372
1373         REGRESSION (WebKit2) Need to support transliterate chinese button (简⇄繁) for Traditional Chinese.
1374         https://bugs.webkit.org/show_bug.cgi?id=132500
1375         <rdar://problem/16778870>
1376
1377         Reviewed by Benjamin Poulain.
1378
1379         For traditional Chinese we support the transliterate to simplified Chinese.
1380         This is done by pressing the 简⇄繁 button on the system
1381         menu. This patch adds the necessary code to canPerformAction to enable
1382         the button when appropriate as well as the implementation of the action
1383         itself.
1384
1385         * UIProcess/ios/WKContentViewInteraction.mm:
1386         (-[WKContentView _transliterateChinese:]):
1387         (-[WKContentView canPerformAction:withSender:]):
1388
1389 2014-05-02  Jeremy Jones  <jeremyj@apple.com>
1390
1391         Fullscreen UI does not appear after WebProcess has crashed
1392         https://bugs.webkit.org/show_bug.cgi?id=132442
1393
1394         Reviewed by Darin Adler.
1395
1396         Cleanup WebVideoFullscreenManagerProxy after a WebProcess crash.
1397
1398         * UIProcess/WebPageProxy.cpp:
1399         (WebKit::WebPageProxy::reattachToWebProcess):
1400         recreate WebVideoFullscreenManagerProxy after a WebProcess crash.
1401
1402         (WebKit::WebPageProxy::resetState):
1403         invalidate and release WebVideoFullscreenManagerProxy on crash.
1404
1405         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1406         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1407         (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy):
1408         don't assume m_page is valid.
1409
1410         (WebKit::WebVideoFullscreenManagerProxy::invalidate):
1411         do cleanup invalidation in reponse to a WebProcess crash.
1412
1413 2014-05-02  Benjamin Poulain  <bpoulain@apple.com>
1414
1415         [iOS][WK2] More animation madness for when the extendedBackground is modified in an animation block
1416         https://bugs.webkit.org/show_bug.cgi?id=132497
1417
1418         Reviewed by Beth Dakin.
1419
1420         * UIProcess/API/Cocoa/WKWebView.mm:
1421         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary):
1422         Do not early return when _extendedBackgroundExclusionInsets.left is empty. That way, if executed in an animation block,
1423         the top of bottom view will animate from their current size to an empty width.
1424
1425         When creating the layer, set up their height without animation. Otherwise it is possible to see the height animating
1426         while the left inset is animating.
1427
1428         (-[WKWebView _setExtendedBackgroundExclusionInsets:]):
1429         When replacing the scrollview, make sure the frame and color are not animated. Otherwise the transition between
1430         scrollView and _mainExtendedBackgroundView can be visible if _setExtendedBackgroundExclusionInsets: is invoked
1431         in an animation block.
1432
1433         (-[WKWebView _endAnimatedResize]):
1434         Nuke the top and bottom insets when possible. [WKWebView _endAnimatedResize] is unfrequent, so it is a good opportunity
1435         to free the memory.
1436
1437 2014-05-02  Alexey Proskuryakov  <ap@apple.com>
1438
1439         Remove Blob contentDisposition handling
1440         https://bugs.webkit.org/show_bug.cgi?id=132490
1441
1442         Reviewed by Sam Weinig.
1443
1444         * Shared/FileAPI/BlobRegistrationData.cpp:
1445         (WebKit::BlobRegistrationData::encode):
1446         (WebKit::BlobRegistrationData::decode):
1447
1448 2014-05-02  Benjamin Poulain  <benjamin@webkit.org>
1449
1450         [iOS][WK2] Adapt the rubberband constraints when the page get smaller than the scrollview - insets
1451         https://bugs.webkit.org/show_bug.cgi?id=132457
1452
1453         Reviewed by Enrica Casucci.
1454
1455         It is quite common for us to have a WKContentView that is scalled smaller than the WKWebView, content
1456         insets included.
1457
1458         In those cases, update the constraints to fit the content properly in the view.
1459
1460         * UIProcess/ios/WKScrollView.mm:
1461         (valuesAreWithinOnePixel):
1462         (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
1463
1464 2014-05-02  Mark Rowe  <mrowe@apple.com>
1465
1466         -[_WKThumbnailView _requestSnapshotIfNeeded] assumes that taking a snapshot will always succeed
1467         <https://webkit.org/b/132489> / <rdar://problem/16704660>
1468
1469         Reviewed by Tim Horton.
1470
1471         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1472         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Don't attempt to create a CGImageRef if we failed
1473         to create a ShareableBitmap. This handles both the callback receiving a null Handle and a failure
1474         within ShareableBitmap::create.
1475
1476 2014-05-02  Anders Carlsson  <andersca@apple.com>
1477
1478         Clean up FormDataElement
1479         https://bugs.webkit.org/show_bug.cgi?id=132483
1480
1481         Reviewed by Sam Weinig.
1482
1483         * NetworkProcess/NetworkResourceLoader.cpp:
1484         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1485         * Shared/Network/NetworkResourceLoadParameters.cpp:
1486         (WebKit::NetworkResourceLoadParameters::encode):
1487
1488 2014-05-02  Anders Carlsson  <andersca@apple.com>
1489
1490         Add and implement KeyedDecoder::decodeBytes
1491         https://bugs.webkit.org/show_bug.cgi?id=132479
1492
1493         Reviewed by Tim Horton.
1494
1495         * Shared/cf/KeyedDecoder.cpp:
1496         (WebKit::KeyedDecoder::decodeBytes):
1497         * Shared/cf/KeyedDecoder.h:
1498
1499 2014-05-02  Joseph Pecoraro  <pecoraro@apple.com>
1500
1501         [iOS] WebKit2 File Upload Support
1502         https://bugs.webkit.org/show_bug.cgi?id=132024
1503
1504         Reviewed by Enrica Casucci.
1505
1506         * Configurations/WebKit2.xcconfig:
1507         Include MobileCoreServices on iOS for kUTTypeImage/kUTTypeMovie.
1508
1509         * WebKit2.xcodeproj/project.pbxproj:
1510         Add new files.
1511
1512         * UIProcess/WebOpenPanelResultListenerProxy.h:
1513         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
1514         (WebKit::filePathsFromFileURLs):
1515         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
1516         * UIProcess/WebPageProxy.h:
1517         * UIProcess/WebPageProxy.cpp:
1518         (WebKit::WebPageProxy::runOpenPanel):
1519         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
1520         * WebProcess/WebPage/WebOpenPanelResultListener.h:
1521         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
1522         (WebKit::WebOpenPanelResultListener::didChooseFilesWithDisplayStringAndIcon):
1523         * WebProcess/WebPage/WebPage.h:
1524         * WebProcess/WebPage/WebPage.messages.in:
1525         * WebProcess/WebPage/WebPage.cpp:
1526         (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
1527         Message forwarding for choosing files and providing a display string and icon,
1528         leading down to the existing WebCore FileChooser method.
1529
1530         * UIProcess/PageClient.h:
1531         * UIProcess/ios/PageClientImplIOS.h:
1532         * UIProcess/ios/PageClientImplIOS.mm:
1533         (WebKit::PageClientImpl::handleRunOpenPanel):
1534         Add a default handler for file open panel on iOS.
1535         Forwards to the content view.
1536
1537         * UIProcess/ios/WKContentViewInteraction.h:
1538         * UIProcess/ios/WKContentViewInteraction.mm:
1539         (-[WKContentView lastInteractionLocation]):
1540         (-[WKContentView _webTouchEventsRecognized:]):
1541         (-[WKContentView _highlightLongPressRecognized:]):
1542         (-[WKContentView _longPressRecognized:]):
1543         (-[WKContentView _singleTapRecognized:]):
1544         (-[WKContentView _doubleTapRecognized:]):
1545         (-[WKContentView _twoFingerDoubleTapRecognized:]):
1546         Keep track of the last interaction location. This matches previous behavior
1547         of showing the file upload popover where the user tapped, to handle
1548         cases where the <input> is hidden.
1549
1550         (-[WKContentView _showRunOpenPanel:resultListener:]):
1551         (-[WKContentView fileUploadPanelDidDismiss:]):
1552         Handle showing the cleaning up after the file upload panel.
1553
1554         * UIProcess/ios/forms/WKFileUploadPanel.h:
1555         * UIProcess/ios/forms/WKFileUploadPanel.mm: Added.
1556         (squareCropRectForSize):
1557         (squareImage):
1558         (thumbnailSizedImageForImage):
1559         (-[_WKFileUploadItem isVideo]):
1560         (-[_WKFileUploadItem fileURL]):
1561         (-[_WKFileUploadItem displayImage]):
1562         (-[_WKImageFileUploadItem initWithFilePath:originalImage:]):
1563         (-[_WKImageFileUploadItem isVideo]):
1564         (-[_WKImageFileUploadItem fileURL]):
1565         (-[_WKImageFileUploadItem displayImage]):
1566         (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]):
1567         (-[_WKVideoFileUploadItem isVideo]):
1568         (-[_WKVideoFileUploadItem fileURL]):
1569         (-[_WKVideoFileUploadItem displayImage]):
1570         Helper class for each image picker selection. Knows how to get
1571         a file URL and thumbnail display image for the item.
1572
1573         (-[WKFileUploadPanel initWithView:]):
1574         (-[WKFileUploadPanel dealloc]):
1575         (-[WKFileUploadPanel _dispatchDidDismiss]):
1576         (-[WKFileUploadPanel _cancel]):
1577         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
1578         Lifetime of the upload panel requires that either cancel or choose
1579         must happen as we go through the file picking process.
1580
1581         (-[WKFileUploadPanel presentWithParameters:WebKit::resultListener:WebKit::]):
1582         (-[WKFileUploadPanel dismiss]):
1583         API to show or dismiss the panel.
1584
1585         (-[WKFileUploadPanel _dismissDisplayAnimated:]):
1586         Helper to clean up the UI as it progresses or completes no matter the device idiom.
1587
1588         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
1589         (-[WKFileUploadPanel _presentFullscreenViewController:animated:]):
1590         UI presentation for the appropriate idiom.
1591
1592         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
1593         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
1594         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
1595         Showing the action sheet or image picker.
1596
1597         (-[WKFileUploadPanel popoverControllerDidDismissPopover:]):
1598         (-[WKFileUploadPanel _willMultipleSelectionDelegateBeCalled]):
1599         (-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]):
1600         (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
1601         (-[WKFileUploadPanel imagePickerControllerDidCancel:]):
1602         Action sheet or image picker handlers.
1603
1604         (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
1605         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
1606         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
1607         (-[WKFileUploadPanel _displayStringForPhotos:videos:]):
1608         Processing selections from the image picker to FileUploadItems.
1609
1610 2014-05-01  Simon Fraser  <simon.fraser@apple.com>
1611
1612         [iOS WK2] Animations on vox.com look wrong
1613         https://bugs.webkit.org/show_bug.cgi?id=132462
1614         <rdar://problem/16731884>
1615
1616         Reviewed by Sam Weinig.
1617         
1618         PlatformCALayerRemote was managing animations incorrectly; aninations
1619         would stick around in m_properties.addedAnimations and get added a second
1620         time by mistake.
1621         
1622         Animations have to be managed a little differently to other properties,
1623         since they are not steady-state things. A given commit has to send over
1624         the added and removed animations, and then clear the layer properties.
1625         
1626         Do this by adding PlatformCALayerRemote::didCommit(), which is called
1627         after the layer properties have been encoded, and have it clear the lists
1628         of added and removed animations.
1629         
1630         removeAnimationForKey() also has to remove the animation from addedAnimations
1631         so that an add/remove in the same commit doesn't send the animation to the
1632         UI process.
1633
1634         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1635         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1636         (WebKit::PlatformCALayerRemote::didCommit):
1637         (WebKit::PlatformCALayerRemote::removeAnimationForKey):
1638         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1639         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1640         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1641
1642 2014-05-01  Simon Fraser  <simon.fraser@apple.com>
1643
1644         [iOS WK2] Can't scroll on gatesnotes.com 
1645         https://bugs.webkit.org/show_bug.cgi?id=132459
1646         <rdar://problem/16770909>
1647
1648         Reviewed by Benjamin Poulain.
1649         
1650         The custom UIView hit-testing code was finding views that were created by
1651         the compositing code for clipping, above the UIScrollViews. We only ever
1652         need to find UIScrollViews here for touch overflow-scrolling, so constrain
1653         the hit-testing code to only return UIScrollViews.
1654
1655         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1656         (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]):
1657         (-[UIView _findDescendantViewAtPoint:withEvent:]):
1658         (-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]): Deleted.
1659
1660 2014-05-02  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1661
1662         REGRESSION(r168118): [GTK] build broken due to shouldTrackVisitedLinks
1663         https://bugs.webkit.org/show_bug.cgi?id=132447
1664
1665         Unreviewed GTK build fix.
1666
1667         shouldTrackVisitedLinks was removed on r168118.
1668         Visited link coloring works as expected after this change.
1669
1670         * UIProcess/gtk/WebContextGtk.cpp:
1671         (WebKit::WebContext::platformInitializeWebProcess): Remove
1672         shouldTrackVisitedLinks parameter.
1673
1674 2014-05-01  Enrica Casucci  <enrica@apple.com>
1675
1676         REGRESSION (WebKit2) Need to support Learn button.
1677         https://bugs.webkit.org/show_bug.cgi?id=132454
1678         <rdar://problem/16778889>
1679
1680         Reviewed by Benjamin Poulain.
1681
1682         For traditional Chinese we support the ability to add shortcuts
1683         for typing. This is done by pressing the Learn button on the system
1684         menu. This patch adds the necessary code to canPerformAction to enable
1685         the button when appropriate as well as the implementation of the action
1686         itself.
1687         It also adds a check for the Replace button not to be shown when the
1688         selection only contains CJ characters.
1689
1690         * UIProcess/ios/WKContentViewInteraction.mm:
1691         (-[WKContentView _addShortcut:]):
1692         (-[WKContentView canPerformAction:withSender:]):
1693
1694 2014-05-01  Benjamin Poulain  <bpoulain@apple.com>
1695
1696         [iOS][WK2] Tweak the extended background exclusion for MobileSafari
1697         https://bugs.webkit.org/show_bug.cgi?id=132449
1698
1699         Reviewed by Beth Dakin.
1700
1701         Some tweaks for Mobile:
1702         -Use UIViews instead of CALayers to have the same animation timing as the top views.
1703         -The left extended background insets should not exclude the top and bottom insets.
1704
1705         Since this code is in the middle of 2 hot paths, also added some performance tweaks.
1706
1707         * UIProcess/API/Cocoa/WKWebView.mm:
1708         (-[WKWebView initWithFrame:configuration:]):
1709         In the normal case, we do not have extended background exclusion. To avoid creating a background view, we use
1710         the scrollview to render the background.
1711         The separate background view is created lazily if needed.
1712
1713         (-[WKWebView _updateScrollViewBackground]):
1714         (-[WKWebView _frameOrBoundsChanged]):
1715         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary):
1716         This create the top and bottom extended background view as needed and update their frames for the current insets.
1717
1718         (-[WKWebView _setObscuredInsets:]):
1719         (-[WKWebView _setExtendedBackgroundExclusionInsets:]):
1720         When an exclusion inset is needed, create a view for it, transfer the color from the ScrollView, and reset the color
1721         of the scrollview.
1722
1723 2014-05-01  Alexey Proskuryakov  <ap@apple.com>
1724
1725         Move size computation for Blob constructor into BlobRegistryImpl
1726         https://bugs.webkit.org/show_bug.cgi?id=132439
1727
1728         Reviewed by Sam Weinig.
1729
1730         Plumbing to make this version of registerBlobURL synchronous for now.
1731         I expect to make it async again when data structures on client side are simplified.
1732
1733         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1734         (WebKit::NetworkBlobRegistry::registerBlobURL):
1735         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1736         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1737         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
1738         * NetworkProcess/NetworkConnectionToWebProcess.h:
1739         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1740         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1741         (WebKit::BlobRegistryProxy::registerBlobURL):
1742         * WebProcess/FileAPI/BlobRegistryProxy.h:
1743
1744 2014-05-01  Beth Dakin  <bdakin@apple.com>
1745
1746         REGRESSION(168053): Repro crash navigating to another page after selecting phone 
1747         numbers on a page
1748         https://bugs.webkit.org/show_bug.cgi?id=132444
1749         -and corresponding-
1750         <rdar://problem/16787285>
1751
1752         Reviewed by Darin Adler.
1753
1754         Missing null-check.
1755         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
1756         (WebKit::TelephoneNumberOverlayController::drawRect):
1757
1758 2014-05-01  Anders Carlsson  <andersca@apple.com>
1759
1760         Remove WKBundleSetShouldTrackVisitedLinks and associate code
1761         https://bugs.webkit.org/show_bug.cgi?id=132441
1762
1763         Reviewed by Sam Weinig.
1764
1765         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1766         (WKBundleSetShouldTrackVisitedLinks): Deleted.
1767         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1768         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1769         (WebKit::InjectedBundle::setShouldTrackVisitedLinks): Deleted.
1770         * WebProcess/InjectedBundle/InjectedBundle.h:
1771         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1772         (WebKit::VisitedLinkTableController::addVisitedLink):
1773         * WebProcess/WebProcess.cpp:
1774         (WebKit::WebProcess::WebProcess):
1775         (WebKit::WebProcess::setShouldTrackVisitedLinks): Deleted.
1776         * WebProcess/WebProcess.h:
1777         (WebKit::WebProcess::shouldTrackVisitedLinks): Deleted.
1778
1779 2014-05-01  Anders Carlsson  <andersca@apple.com>
1780
1781         window.testRunner.keepWebHistory() should update the UI process state
1782         https://bugs.webkit.org/show_bug.cgi?id=132440
1783
1784         Reviewed by Dan Bernstein.
1785
1786         * UIProcess/API/C/WKPage.cpp:
1787         (WKPageGetAddsVisitedLinks):
1788         (WKPageSetAddsVisitedLinks):
1789         * UIProcess/API/C/WKPagePrivate.h:
1790
1791 2014-05-01  Filip Pizlo  <fpizlo@apple.com>
1792
1793         Roll out r60161.
1794
1795         Rubber stamped by Mark Hahnenberg.
1796         
1797         This breaks our debugging workflow.
1798
1799         * Shared/WebProcessCreationParameters.cpp:
1800         (WebKit::WebProcessCreationParameters::decode):
1801         * UIProcess/mac/WebContextMac.mm:
1802         (WebKit::registerUserDefaultsIfNeeded):
1803         (WebKit::WebContext::platformInitializeWebProcess):
1804
1805 2014-05-01  Anders Carlsson  <andersca@apple.com>
1806
1807         WKWebView doesn't track visited links (for visited link coloring)
1808         https://bugs.webkit.org/show_bug.cgi?id=132438
1809         <rdar://problem/16704519>
1810
1811         Reviewed by Dan Bernstein.
1812
1813         * Shared/WebProcessCreationParameters.cpp:
1814         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1815         (WebKit::WebProcessCreationParameters::encode):
1816         (WebKit::WebProcessCreationParameters::decode):
1817         * Shared/WebProcessCreationParameters.h:
1818         * UIProcess/API/APIHistoryClient.h:
1819         (API::HistoryClient::addsVisitedLinks):
1820         (API::HistoryClient::shouldTrackVisitedLinks): Deleted.
1821         * UIProcess/API/C/WKContext.cpp:
1822         (WKContextSetHistoryClient):
1823         * UIProcess/API/Cocoa/WKWebView.mm:
1824         (-[WKWebView _addsVisitedLinks]):
1825         (-[WKWebView _setAddsVisitedLinks:]):
1826         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1827         * UIProcess/API/mac/WKView.mm:
1828         (-[WKView initWithFrame:context:configuration:webView:]):
1829         * UIProcess/Cocoa/HistoryClient.h:
1830         * UIProcess/Cocoa/HistoryClient.mm:
1831         (WebKit::HistoryClient::shouldTrackVisitedLinks): Deleted.
1832         * UIProcess/VisitedLinkProvider.cpp:
1833         (WebKit::VisitedLinkProvider::addVisitedLinkHashFromPage):
1834         * UIProcess/VisitedLinkProvider.h:
1835         * UIProcess/VisitedLinkProvider.messages.in:
1836         * UIProcess/WebContext.cpp:
1837         (WebKit::WebContext::setHistoryClient):
1838         (WebKit::WebContext::createNewWebProcess):
1839         * UIProcess/WebContext.h:
1840         (WebKit::WebContext::processes):
1841         * UIProcess/WebPageProxy.cpp:
1842         (WebKit::WebPageProxy::WebPageProxy):
1843         * UIProcess/WebPageProxy.h:
1844         (WebKit::WebPageProxy::addsVisitedLinks):
1845         (WebKit::WebPageProxy::setAddsVisitedLinks):
1846         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1847         (WebKit::VisitedLinkTableController::addVisitedLink):
1848         * WebProcess/WebProcess.cpp:
1849         (WebKit::WebProcess::initializeWebProcess):
1850         * WebProcess/WebProcess.h:
1851         * WebProcess/WebProcess.messages.in:
1852
1853 2014-05-01  Benjamin Poulain  <bpoulain@apple.com>
1854
1855         [iOS][WK2] The highlight view needs to be in WKWebView coordinates
1856         https://bugs.webkit.org/show_bug.cgi?id=132435
1857         <rdar://problem/16708861>
1858
1859         Reviewed by Tim Horton.
1860
1861         _UIHighlightView needs to be in WKWebView coordinates so that it render unscaled for any page scale factor.
1862         The view needs to be a child of WKContentView so that it moves/scales with the page.
1863
1864         To fix the issue, add an inverse transform root layer for the hightlight, and scale the coordinates to their
1865         inverse scaled counterpart.
1866
1867         The scale is not updated live with the scaling of WKContentView but that should be fine since the view disappear
1868         on any scaling operation (and I would prefer not add live painting during scaling animation).
1869
1870         * UIProcess/ios/WKContentViewInteraction.h:
1871         * UIProcess/ios/WKContentViewInteraction.mm:
1872         (-[WKContentView cleanupInteraction]):
1873         (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
1874         (-[WKContentView _cancelInteraction]):
1875
1876 2014-05-01  Ryuan Choi  <ryuan.choi@samsung.com>
1877
1878         [EFL] There are many warnings with software backend
1879         https://bugs.webkit.org/show_bug.cgi?id=132422
1880
1881         Reviewed by Gyuyoung Kim.
1882
1883         * UIProcess/API/efl/EwkView.cpp:
1884         (EwkView::updateCursor):
1885         (EwkView::transformToScreen):
1886
1887 2014-04-30  Alexey Proskuryakov  <ap@apple.com>
1888
1889         Roll out fix for https://bugs.webkit.org/show_bug.cgi?id=131637:
1890         Clean up unnecessary methods in the BackForwardClient interface
1891
1892         It broke a regression test and an API test.
1893
1894         * WebKit2.xcodeproj/project.pbxproj:
1895         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
1896         (WebKit::InjectedBundleBackForwardList::clear):
1897         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1898         (WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
1899         (WebKit::WebBackForwardListProxy::addItem):
1900         (WebKit::WebBackForwardListProxy::goToItem):
1901         (WebKit::WebBackForwardListProxy::itemAtIndex):
1902         (WebKit::WebBackForwardListProxy::backListCount):
1903         (WebKit::WebBackForwardListProxy::forwardListCount):
1904         (WebKit::WebBackForwardListProxy::close):
1905         (WebKit::WebBackForwardListProxy::clear):
1906         * WebProcess/WebPage/WebBackForwardListProxy.h:
1907         (WebKit::WebBackForwardListProxy::create):
1908         * WebProcess/WebPage/WebPage.cpp:
1909         (WebKit::WebPage::WebPage):
1910         * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Copied from Source/WebKit2/WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm.
1911
1912 2014-04-30  Brady Eidson  <beidson@apple.com>
1913
1914         Only reveal selection service UI after a short delay.
1915         <rdar://problem/16777346> and https://bugs.webkit.org/show_bug.cgi?id=132418
1916
1917         Reviewed by Sam Weinig.
1918
1919         * WebProcess/WebPage/SelectionOverlayController.cpp:
1920         (WebKit::SelectionOverlayController::SelectionOverlayController):
1921         (WebKit::SelectionOverlayController::destroyOverlay): Also stop the hover timer.
1922         (WebKit::SelectionOverlayController::selectionRectsDidChange): Mark the highlight as dirty.
1923         (WebKit::SelectionOverlayController::hoverTimerFired): If the mouse is still over the highlight,
1924           set the visible flag and setNeedsDisplay().
1925         * WebProcess/WebPage/SelectionOverlayController.h:
1926
1927         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
1928         (WebKit::SelectionOverlayController::drawRect): Recreate the highlight if it exists but
1929           is marked as dirty. After doing that, possibly reset the hover timer.
1930           Also, only performing the actual drawing if the visible flag is set.
1931         (WebKit::SelectionOverlayController::mouseEvent): If the mouse moves on or off the highlight,
1932           start or stop the hover timer accordingly.
1933         (WebKit::SelectionOverlayController::mouseHoverStateChanged): Handle starting/stopping the
1934           hover timer.
1935         (WebKit::SelectionOverlayController::clearHighlight): Deleted.
1936
1937 2014-04-30  Benjamin Poulain  <benjamin@webkit.org>
1938
1939         [iOS][WK2] Animated resize incorrectly assumes the layout width is the same as the view width
1940         https://bugs.webkit.org/show_bug.cgi?id=132373
1941         <rdar://problem/16762178>
1942
1943         Reviewed by Tim Horton.
1944
1945         * UIProcess/API/Cocoa/WKWebView.mm:
1946         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1947         Fix a couple of bugs when the left/right obscured insets change, and/or when the minimum layout size
1948         is narrower than the view itself.
1949
1950         In order:
1951         -We need to perfom and update if the insets change since the unobscuredRect will also change.
1952         -The min/max zoom scale should be based on the minimum layout size, that's the definition of minimum layout size
1953          in scrollview coordinate :)
1954         -The old web view width in content coordinate could be narrower than the old view bounds if there are left or right
1955          insets.
1956
1957 2014-04-30  Simon Fraser  <simon.fraser@apple.com>
1958
1959         Remove ENABLE_PLUGIN_PROXY_FOR_VIDEO
1960         https://bugs.webkit.org/show_bug.cgi?id=132396
1961
1962         Reviewed by Eric Carlson.
1963         
1964         Remove ENABLE_PLUGIN_PROXY_FOR_VIDEO and related code.
1965
1966         * Configurations/FeatureDefines.xcconfig:
1967         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1968         (WebKit::WebFrameLoaderClient::createMediaPlayerProxyPlugin): Deleted.
1969         (WebKit::WebFrameLoaderClient::hideMediaPlayerProxyPlugin): Deleted.
1970         (WebKit::WebFrameLoaderClient::showMediaPlayerProxyPlugin): Deleted.
1971         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1972         * WebProcess/WebPage/WebPage.cpp:
1973         (WebKit::WebPage::updatePreferences):
1974
1975 2014-04-30  Brady Eidson  <beidson@apple.com>
1976
1977         If there are no services available, do not show the service controls UI
1978         <rdar://problem/16735665> and https://bugs.webkit.org/show_bug.cgi?id=132410
1979
1980         Reviewed by Tim Horton.
1981
1982         Add a lightweight class that lazily polls the appropriate APIs for whether or not appropriate services
1983         are installed and usable on the system:
1984         * UIProcess/mac/ServicesController.h: Added.
1985         (WebKit::ServicesController::imageServicesExist):
1986         (WebKit::ServicesController::selectionServicesExist):
1987         * UIProcess/mac/ServicesController.mm: Added.
1988         (WebKit::ServicesController::shared):
1989         (WebKit::ServicesController::ServicesController):
1990         (WebKit::ServicesController::refreshExistingServices):
1991         (WebKit::ServicesController::refreshExistingServicesTimerFired):
1992
1993         Add "image services exist" and "selection services exist" parameters:
1994         * Shared/WebProcessCreationParameters.cpp:
1995         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1996         (WebKit::WebProcessCreationParameters::encode):
1997         (WebKit::WebProcessCreationParameters::decode):
1998         * Shared/WebProcessCreationParameters.h:
1999
2000         * UIProcess/WebContext.cpp:
2001         (WebKit::WebContext::createNewWebProcess):
2002         (WebKit::WebContext::refreshExistingServices): Called when the context menu proxy realizes that
2003           services no longer exist.
2004         * UIProcess/WebContext.h:
2005
2006         Each WebProcess hangs on to its own copy of the flags for whether or not the services exist:
2007         * WebProcess/WebProcess.cpp:
2008         (WebKit::WebProcess::WebProcess):
2009         (WebKit::WebProcess::initializeWebProcess):
2010         (WebKit::WebProcess::setEnabledServices):
2011         * WebProcess/WebProcess.h:
2012         (WebKit::WebProcess::imageServicesExist):
2013         (WebKit::WebProcess::selectionServicesExist):
2014
2015         * UIProcess/mac/WebContextMenuProxyMac.mm:
2016         (WebKit::WebContextMenuProxyMac::setupServicesMenu): If the menu creation failed, the set of services
2017           on the system must have changed. So ask the WebContext to refresh them.
2018
2019         * WebProcess/WebPage/SelectionOverlayController.cpp:
2020         (WebKit::SelectionOverlayController::selectionRectsDidChange): If services don't exist, don't create an
2021           overlay (and destroy any existing overlay!)
2022
2023         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
2024         (WebKit::SelectionOverlayController::drawRect): If services don't exist, don't draw, and destroy the overlay.
2025
2026         * WebProcess/WebProcess.messages.in:
2027         * WebKit2.xcodeproj/project.pbxproj:
2028
2029 2014-04-30  Gavin Barraclough  <baraclough@apple.com>
2030
2031         https://bugs.webkit.org/show_bug.cgi?id=132415
2032         Fix snapshotting on WebKit2
2033
2034         Reviewed by Geoff Garen
2035
2036         * UIProcess/API/Cocoa/WKWebView.mm:
2037         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2038             - Use a VisibilityToken to keep the process runnable.
2039
2040 2014-04-30  Gavin Barraclough  <baraclough@apple.com>
2041
2042         Fix PageVisibility on iOS
2043         https://bugs.webkit.org/show_bug.cgi?id=132393
2044
2045         Rubber stamped by Tim Horton
2046
2047         * UIProcess/ios/PageClientImplIOS.mm:
2048         (WebKit::PageClientImpl::isViewWindowActive):
2049         (WebKit::PageClientImpl::isViewFocused):
2050         (WebKit::PageClientImpl::isViewVisible):
2051         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
2052         (WebKit::PageClientImpl::isVisuallyIdle):
2053             - m_contentView -> m_webView
2054
2055 2014-04-30  Benjamin Poulain  <benjamin@webkit.org>
2056
2057         [iOS][WK2] Add a SPI to exclude the extended background from some areas of WKWebView
2058         https://bugs.webkit.org/show_bug.cgi?id=132406
2059         <rdar://problem/16762197>
2060
2061         Reviewed by Beth Dakin.
2062
2063         Move the extended background to a separate layer bellow the UIScrollView.
2064
2065         The geometry of that layer is then changed based on ExtendedBackgroundExclusionInsets
2066         as needed.
2067
2068         * UIProcess/API/Cocoa/WKWebView.mm:
2069         (-[WKWebView initWithFrame:configuration:]):
2070         (-[WKWebView _updateScrollViewBackground]):
2071         (-[WKWebView _frameOrBoundsChanged]):
2072         (-[WKWebView _setExtendedBackgroundExclusionInsets:]):
2073         (-[WKWebView _extendedBackgroundExclusionInsets]):
2074         (-[WKWebView pageExtendedBackgroundColor]): Deleted.
2075         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2076
2077 2014-04-30  Simon Fraser  <simon.fraser@apple.com>
2078
2079         Fix build error when building for iOS simulator.
2080
2081         * UIProcess/ios/ProcessAssertion.mm:
2082
2083 2014-04-30  Alexey Proskuryakov  <ap@apple.com>
2084
2085         Move Blob.slice() implementation into BlobRegistryImpl
2086         https://bugs.webkit.org/show_bug.cgi?id=132402
2087
2088         Reviewed by Anders Carlsson.
2089
2090         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2091         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
2092         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2093         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2094         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
2095         * NetworkProcess/NetworkConnectionToWebProcess.h:
2096         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2097         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2098         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
2099         * WebProcess/FileAPI/BlobRegistryProxy.h:
2100
2101 2014-04-30  Beth Dakin  <bdakin@apple.com>
2102
2103         Phone number data detection UI is offset for iframes, pages with topContentInset
2104         https://bugs.webkit.org/show_bug.cgi?id=132372
2105         -and corresponding-
2106         <rdar://problem/16651235>
2107
2108         Reviewed by Tim Horton.
2109
2110         Make the overlay an OverlayType::Document, which will keep everything relative to 
2111         the main Document’s coordinates. 
2112         * WebProcess/WebPage/TelephoneNumberOverlayController.cpp:
2113         (WebKit::TelephoneNumberOverlayController::createOverlayIfNeeded):
2114
2115         Make frames work by converting to the main  document’s coordinate space.
2116         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
2117         (WebKit::TelephoneNumberOverlayController::drawRect):
2118
2119 2014-04-30  Roger Fong  <roger_fong@apple.com>
2120
2121         Unreviewed. Unnecessary explicit initialization of LayoutUnit from r167985.
2122
2123         * WebProcess/WebPage/WebPage.cpp:
2124         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2125         Darin points out that I can just use “/2” instead of “/LayoutUnit(2.0)”.
2126
2127 2014-04-30 David Hyatt  <hyatt@apple.com>
2128
2129         [New Multicolumn] Enable new multi-column mode
2130         https://bugs.webkit.org/show_bug.cgi?id=131825
2131
2132         Reviewed by Simon Fraser.
2133
2134         * Shared/WebPreferencesStore.h:
2135
2136 2014-04-30  Brian J. Burg  <burg@cs.washington.edu>
2137
2138         Clean up unnecessary methods in the BackForwardClient interface
2139         https://bugs.webkit.org/show_bug.cgi?id=131637
2140
2141         Reviewed by Andreas Kling.
2142
2143         Remove stubs for iOS-specific methods in the BackForwardClient interface.
2144
2145         Construct a WebBackForwardListProxy directly, and make the WebCore page
2146         own the BackForwardClient instance. Convert uses of backForward().client()
2147         to accept references instead of raw pointers.
2148
2149         * WebKit2.xcodeproj/project.pbxproj:
2150         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
2151         (WebKit::InjectedBundleBackForwardList::clear):
2152         * WebProcess/WebPage/WebBackForwardListProxy.cpp: Store a reference to
2153         WebCore::Page instead of a pointer.
2154         (WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
2155         (WebKit::WebBackForwardListProxy::create): Deleted.
2156         (WebKit::WebBackForwardListProxy::addItem):
2157         (WebKit::WebBackForwardListProxy::goToItem):
2158         (WebKit::WebBackForwardListProxy::itemAtIndex):
2159         (WebKit::WebBackForwardListProxy::backListCount):
2160         (WebKit::WebBackForwardListProxy::forwardListCount):
2161         (WebKit::WebBackForwardListProxy::close):
2162         (WebKit::WebBackForwardListProxy::clear):
2163         (WebKit::WebBackForwardListProxy::isActive):
2164         * WebProcess/WebPage/WebBackForwardListProxy.h:
2165         * WebProcess/WebPage/WebPage.cpp:
2166         (WebKit::WebPage::WebPage):
2167         * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed.
2168
2169 2014-04-30  Gavin Barraclough  <baraclough@apple.com>
2170
2171         Fix PageVisibility on iOS
2172         https://bugs.webkit.org/show_bug.cgi?id=132393
2173
2174         Reviewed by Andreas Kling.
2175
2176         Currently page visibility API doesn't work correctly on WK2 iOS for a few reasons,
2177         the most significant of which being that the moment a WKWebView leaves the window
2178         we'll suspend the content process, which removes the possibility for any notification
2179         to be delivered. This patch addresses this issue, by allowing the process to run for
2180         long enough for the notification to be delivered.
2181
2182         1) Introduce a new class, ProcessThrottler, to encapsulate the process suspension logic.
2183         2) WebPageProxy uses ProcessThrottler::VisibilityToken to communicate visibility to the throttler.
2184         3) WebPageProxy tracks pending didUpdateViewState messages to detect when the view state update in
2185            the web content process has completed.
2186         4) Distiguish between 'Background' and 'Suspended' states in the ProcessAssertion.
2187
2188         * Shared/ChildProcessProxy.h:
2189             - moved m_assertion to NetworkProcessProxy / WebProcessProxy.
2190         * UIProcess/Network/NetworkProcessProxy.h:
2191             - added m_assertion.
2192         * UIProcess/WebPageProxy.cpp:
2193         (WebKit::WebPageProxy::WebPageProxy):
2194             - initialize VisibilityToken state.
2195         (WebKit::WebPageProxy::reattachToWebProcess):
2196             - reinitialize VisibilityToken state.
2197         (WebKit::WebPageProxy::viewStateDidChange):
2198             - update VisibilityToken, increment m_pendingViewStateUpdates as necessary.
2199         (WebKit::WebPageProxy::updateVisibilityToken):
2200             - update the VisibiliyToken based on page visibility, and whether an update is still pending.
2201         (WebKit::WebPageProxy::didUpdateViewState):
2202             - detect when a view state change has completed in the web process, and update throttle state as necessary.
2203         * UIProcess/WebPageProxy.h:
2204         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
2205             - moved to .cpp.
2206         * UIProcess/WebProcessProxy.cpp:
2207         (WebKit::WebProcessProxy::WebProcessProxy):
2208             - initialize m_throttler.
2209         (WebKit::WebProcessProxy::didFinishLaunching):
2210             - notify the PageThrottler of the new connection.
2211         * UIProcess/WebProcessProxy.h:
2212         (WebKit::WebProcessProxy::throttler):
2213             - added accessor.
2214         (WebKit::WebProcessProxy::updateProcessState): Deleted.
2215             - moved trottling login to ProcessThrottler.
2216         * UIProcess/ios/PageClientImplIOS.h:
2217         * UIProcess/ios/PageClientImplIOS.mm:
2218         (WebKit::PageClientImpl::isViewWindowActive):
2219         (WebKit::PageClientImpl::isViewFocused):
2220         (WebKit::PageClientImpl::isViewVisible):
2221         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
2222             - these should only be true when the view is in a window.
2223         (WebKit::PageClientImpl::isVisuallyIdle):
2224             - this should only be true when the view is not in a window.
2225         * UIProcess/ios/ProcessAssertion.h:
2226         * UIProcess/ios/ProcessAssertion.mm:
2227         (WebKit::flagsForState):
2228             - map from enum -> BKSAssertion flags values.
2229         (WebKit::ProcessAssertion::ProcessAssertion):
2230             - use flagsForState (add support for Suspended state).
2231         (WebKit::ProcessAssertion::setState):
2232             - use flagsForState (add support for Suspended state).
2233         * UIProcess/ios/ProcessThrottler.h: Added.
2234         (WebKit::ProcessThrottler::VisibilityToken::visibility):
2235             - accessor.
2236         (WebKit::ProcessThrottler::VisibilityToken::setVisibility):
2237             - update Visibility value; update the token as necessary.
2238         (WebKit::ProcessThrottler::ProcessThrottler):
2239             - constructor; does not take an assention until didConnnectToProcess is called.
2240         (WebKit::ProcessThrottler::visibilityToken):
2241             - create a VisibilityToken.
2242         (WebKit::ProcessThrottler::didConnnectToProcess):
2243             - take an assertion.
2244         (WebKit::ProcessThrottler::weakPtr):
2245             - create a weak pointer, used for references from VisibilityToken to the throttler.
2246         (WebKit::ProcessThrottler::assertionState):
2247             - determine the correct AssertionState for the process, based on current visibility.
2248         (WebKit::ProcessThrottler::updateAssertion):
2249             - update assertion, called in response to visibility change.
2250         * UIProcess/ios/ProcessThrottler.mm: Added.
2251         (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken):
2252             - constructor.
2253         (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken):
2254             - set visibility to hidden to reset.
2255         (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired):
2256             - automatically decay from Hiding -> Hidden on a timeout.
2257         (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal):
2258             - update counters tracking visibility in ProcessThrottler.
2259         * UIProcess/ios/WKContentView.mm:
2260         (-[WKContentView didMoveToWindow]):
2261             - This affects all view state flags, not just the 'InWindow' state.
2262               If the view moves out of a window request a reply from the WebContent - we use this
2263               to detect when the page visibility event has completed.
2264         * UIProcess/ios/WebProcessProxyIOS.mm:
2265         (WebKit::WebProcessProxy::updateProcessState): Deleted.
2266             - removed.
2267         * WebKit2.xcodeproj/project.pbxproj:
2268             - added new files.
2269
2270 2014-04-30  Anders Carlsson  <andersca@apple.com>
2271
2272         Preemptive header fixes for when WebKit.framework is going to provide the modern API
2273         https://bugs.webkit.org/show_bug.cgi?id=132394
2274
2275         Reviewed by Dan Bernstein.
2276
2277         * UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h:
2278         (NS_ENUM):
2279         Delete WKNavigationType for now. Ultimately the entire delegate should be removed.
2280
2281         * UIProcess/API/Cocoa/WKPreferences.h:
2282         Add a header guard so we can avoid importing WKPreferences.h more than once.
2283
2284         * WebKit2.xcodeproj/project.pbxproj:
2285         _WKScriptWorld.h should be private, not public.
2286         WKScriptMessagePrivate.h and WKUserContentControllerPrivate.h should be private, not project.
2287
2288 2014-04-30  Joseph Pecoraro  <pecoraro@apple.com>
2289
2290         Web Inspector: Ensure UIProcess checks in to webinspectord after spawning a WebProcess
2291         https://bugs.webkit.org/show_bug.cgi?id=132389
2292
2293         Reviewed by Timothy Hatcher.
2294
2295         We aggregate WebProcess WebView's under the UIProcess. If the UIProcess
2296         didn't connect to webinspectord these WebViews would have remained
2297         hidden. Always have the UIProcess connect to webinspectord when it
2298         spawns a WebProcess and may have a child process holding views that
2299         it ultimately owns and should display under the UIProcess name.
2300
2301         * UIProcess/WebContext.cpp:
2302         (WebKit::WebContext::createNewWebProcess):
2303
2304 2014-04-30  Zalan Bujtas  <zalan@apple.com>
2305
2306         [iOS]Subpixel rendering: Extra line of pixels next to the YouTube loading indicator.
2307         https://bugs.webkit.org/show_bug.cgi?id=132391
2308
2309         Reviewed by Simon Fraser.
2310
2311         CG and GraphicsContext clipping should use the same coordinates. Snapping either one
2312         while leaving the other unsnapped results in clipping mismatch and that may produce
2313         unpainted areas.
2314
2315         Not testable.
2316
2317         * Shared/mac/RemoteLayerBackingStore.mm:
2318         (WebKit::RemoteLayerBackingStore::drawInContext):
2319
2320 2014-04-30  Alexey Proskuryakov  <ap@apple.com>
2321
2322         https://bugs.webkit.org/show_bug.cgi?id=132363
2323         Make Blob RawData immutable
2324
2325         Reviewed by Anders Carlsson.
2326
2327         * Shared/FileAPI/BlobRegistrationData.cpp: (WebKit::BlobRegistrationData::decode):
2328         Create RawData in one step.
2329
2330 2014-04-30  Brady Eidson  <beidson@apple.com>
2331
2332         Followup to: Handle selection services menu.
2333         <rdar://problem/16727798> and https://bugs.webkit.org/show_bug.cgi?id=132362
2334
2335         * UIProcess/mac/WebContextMenuProxyMac.mm:
2336         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Remove an ASSERT from previous version of the patch
2337           that landed. I’d forgotten to add this stray change to my staging area.
2338
2339 2014-04-30  Manuel Rego Casasnovas  <rego@igalia.com>
2340
2341         [CSS Grid Layout] Enable runtime feature by default
2342         https://bugs.webkit.org/show_bug.cgi?id=132189
2343
2344         Reviewed by Benjamin Poulain.
2345
2346         * Shared/WebPreferencesStore.h: Remove unneeded changes that
2347         enable/disable the runtime feature depending on the compilation flag.
2348         And set it to true by default.
2349         * UIProcess/gtk/ExperimentalFeatures.cpp: Set it to true by default.
2350
2351 2014-04-30  Roger Fong  <roger_fong@apple.com>
2352
2353         Unreviewed. Wrong units used in offset calculation from r167961.
2354
2355         * WebProcess/WebPage/WebPage.cpp:
2356         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2357         I accidentally mixed and matches LayoutUnits with Ints in offset calculation here.
2358         It should all just be in LayoutUnits.
2359
2360 2014-04-29  Benjamin Poulain  <bpoulain@apple.com>
2361
2362         [iOS][WK2] When pageScaleFactor * deviceScaleFactor = 1, the tile grid is completely messed up
2363         https://bugs.webkit.org/show_bug.cgi?id=132368
2364
2365         Reviewed by Simon Fraser.
2366
2367         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2368         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2369         PlatformCALayerRemote always initialized the content scale to 1. Since contentsScale is supposed to reflect
2370         zoomScale * deviceScaleFactor, the value should be 2.
2371
2372         This was causing bugs whenever the page scale factor was 1/2 on retina device (device scale factor = 2).
2373
2374         When the page is initialized, GraphicsLayerCA::updateContentsScale(0.5) computes a contentsScale of 1. There is an early
2375         return on if (contentsScale == m_layer->contentsScale()). Since PlatformCALayerRemote->contentsScale() was incorreclty
2376         returning one, we were leaving the tile backing unmodified.
2377
2378         Later, when the transaction is commited, the tile backing would still be default initialized and would render everything
2379         at the wrong scale.
2380
2381 2014-04-29  Eric Carlson  <eric.carlson@apple.com>
2382
2383         [Mac] tag the video layers with descriptive name to aid debugging
2384         https://bugs.webkit.org/show_bug.cgi?id=132371
2385
2386         Reviewed by Darin Adler.
2387
2388         * WebProcess/ios/WebVideoFullscreenManager.mm:
2389         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Set the 
2390             fullscreen host layer name in a debug build.
2391
2392 2014-04-29  Brady Eidson  <beidson@apple.com>
2393
2394         Handle selection services menu.
2395         <rdar://problem/16727798> and https://bugs.webkit.org/show_bug.cgi?id=132362
2396
2397         Reviewed by Tim Horton.
2398
2399         Add members for the relevant info for showing a service menu for a selection:
2400         * Shared/ContextMenuContextData.cpp:
2401         (WebKit::ContextMenuContextData::ContextMenuContextData):
2402         (WebKit::ContextMenuContextData::controlledDataIsEditable):
2403         * Shared/ContextMenuContextData.h:
2404         (WebKit::ContextMenuContextData::ContextMenuContextData):
2405         (WebKit::ContextMenuContextData::controlledSelectionData):
2406         (WebKit::ContextMenuContextData::needsServicesMenu):
2407
2408         * UIProcess/WebPageProxy.h:
2409         * UIProcess/WebPageProxy.messages.in:
2410         * UIProcess/mac/WebPageProxyMac.mm:
2411         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard.
2412         (WebKit::WebPageProxy::showSelectionServiceMenu):
2413
2414         Update the services menu code to know the difference between an image service and a selection service:
2415         * UIProcess/mac/WebContextMenuProxyMac.h:
2416         * UIProcess/mac/WebContextMenuProxyMac.mm:
2417         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
2418         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
2419         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
2420         (WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
2421         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
2422         (WebKit::WebContextMenuProxyMac::clearServicesMenu):
2423         (WebKit::WebContextMenuProxyMac::populate):
2424         (WebKit::WebContextMenuProxyMac::showContextMenu):
2425         (WebKit::WebContextMenuProxyMac::setupImageServicesMenu): Deleted.
2426         (WebKit::WebContextMenuProxyMac::clearImageServicesMenu): Deleted.
2427
2428         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
2429         (WebKit::WebPasteboardOverrides::getDataForOverride):
2430
2431         * WebProcess/WebPage/WebPage.h:
2432         * WebProcess/WebPage/WebPage.messages.in:
2433         * WebProcess/WebPage/mac/WebPageMac.mm:
2434         (WebKit::WebPage::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard.
2435         (WebKit::WebPage::handleSelectionServiceClick): Pass the relevant selection data through to the UIProcess as RTFD data.
2436
2437         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
2438         (WebKit::SelectionOverlayController::handleClick): Notify the WebPage of the click.
2439
2440 2014-04-29  Dan Bernstein  <mitz@apple.com>
2441
2442         <rdar://problem/16745596> [Cocoa] Crash when invoking a method with an unsigned parameter on a remote object
2443         https://bugs.webkit.org/show_bug.cgi?id=132366
2444
2445         Reviewed by Anders Carlsson.
2446
2447         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2448         (encodeInvocation): Handle the 'I' type code. Interpret the 'q' and 'Q' type codes in an
2449         architecture-independent manner.
2450         (decodeInvocationArguments): Ditto.
2451
2452 2014-04-29  Roger Fong  <roger_fong@apple.com>
2453
2454         Don't immediately snapshot plugin to allow for proper dominant plugin detection.
2455         https://bugs.webkit.org/show_bug.cgi?id=132294.
2456         <rdar://problem/16745679>
2457
2458         Reviewed by Dean Jackson.
2459
2460         * WebProcess/Plugins/PluginView.cpp:
2461         (WebKit::PluginView::didInitializePlugin):
2462         Instead of immediately setting the display state to DisplaySnapshot,
2463         put it on a timer to let the page fully layout and get hit test properly.
2464
2465 2014-04-28  Roger Fong  <roger_fong@apple.com>
2466
2467         Plugins hidden by images should autoplay.
2468         https://bugs.webkit.org/show_bug.cgi?id=132222.
2469         <rdar://problem/16653536>
2470
2471         Reviewed by Jon Lee and Darin Adler.
2472
2473         * WebProcess/WebPage/WebPage.cpp:
2474         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2475         If the image on top of the plugin is similarly sized and similarly positioned as the plugin rect,
2476         set the plugin to autoplay. This is assuming that the previous snapshot checks have passed as well.
2477
2478 2014-04-29  Filip Pizlo  <fpizlo@apple.com>
2479
2480         Use LLVM as a backend for the fourth-tier DFG JIT (a.k.a. the FTL JIT)
2481         https://bugs.webkit.org/show_bug.cgi?id=112840
2482
2483         Rubber stamped by Geoffrey Garen.
2484
2485         * Configurations/FeatureDefines.xcconfig:
2486
2487 2014-04-29  Brady Eidson  <beidson@apple.com>
2488
2489         Change Image Controls replacement to use selection and paste
2490         <rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992
2491
2492         Reviewed by Tim Horton.
2493
2494         Add a "pasteboard override" mechanism which allows WebKit to keep pasteboard content local
2495         to the WebProcess and access it there without having to message up to the UI process:
2496         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Added.
2497         (WebKit::WebPasteboardOverrides::sharedPasteboardOverrides):
2498         (WebKit::WebPasteboardOverrides::WebPasteboardOverrides):
2499         (WebKit::WebPasteboardOverrides::addOverride):
2500         (WebKit::WebPasteboardOverrides::removeOverride):
2501         (WebKit::WebPasteboardOverrides::overriddenTypes):
2502         (WebKit::WebPasteboardOverrides::getDataForOverride):
2503         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: Added.
2504
2505         Change the pasteboard strategy to consult the pasteboard overrides before consulting the native pasteboard:
2506         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2507         (WebKit::WebPlatformStrategies::getTypes):
2508         (WebKit::WebPlatformStrategies::bufferForType):
2509
2510         Add "replaceSelectionWithPasteboardData" which uses the new pasteboard overrides mechanism
2511         and then has WebCore perform the replacement:
2512         * WebProcess/WebPage/WebPage.h:
2513         * WebProcess/WebPage/WebPage.messages.in:
2514         * WebProcess/WebPage/mac/WebPageMac.mm:
2515         (WebKit::replaceSelectionPasteboardName):
2516         (WebKit::WebPage::replaceSelectionWithPasteboardData):
2517
2518         * UIProcess/mac/WebPageProxyMac.mm:
2519         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
2520
2521         * UIProcess/mac/WebContextMenuProxyMac.h:
2522         (WebKit::WebContextMenuProxyMac::page):
2523         * UIProcess/mac/WebContextMenuProxyMac.mm:
2524         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Use "replaceSelectionWithPasteboardData".
2525         (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
2526         (WebKit::WebContextMenuProxyMac::replaceControlledImage): Deleted.
2527
2528         Remain other remnants of "replaceControlledImage":
2529         * UIProcess/WebPageProxy.cpp:
2530         (WebKit::WebPageProxy::replaceControlledImage): Deleted.
2531         * UIProcess/WebPageProxy.h:
2532         * WebProcess/WebPage/WebContextMenu.cpp:
2533         (WebKit::WebContextMenu::replaceControlledImage): Deleted.
2534         * WebProcess/WebPage/WebContextMenu.h:
2535         * WebProcess/WebPage/WebPage.cpp:
2536         (WebKit::WebPage::replaceControlledImage): Deleted.
2537
2538         * WebKit2.xcodeproj/project.pbxproj:
2539
2540 2014-04-29  Tim Horton  <timothy_horton@apple.com>
2541
2542         Build fix.
2543
2544         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
2545
2546 2014-04-29  Alexey Proskuryakov  <ap@apple.com>
2547
2548         [WK2] DatabaseProcess should be sandboxed
2549         https://bugs.webkit.org/show_bug.cgi?id=132324
2550         <rdar://problem/15961708>
2551
2552         Reviewed by Darin Adler.
2553
2554         * Configurations/WebKit2.xcconfig: Added the profile to the list of files skipped
2555         on iOS.
2556
2557         * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess):
2558         Consume a sandbox extension for IndexedDB directory (which we get with initialization
2559         message after entering sandbox).
2560
2561         * DatabaseProcess/ios: Added.
2562         * DatabaseProcess/ios/DatabaseProcessIOS.mm: Copied from Source/WebKit2/DatabaseProcess/mac/DatabaseProcessMac.mm.
2563         Separated from Mac version to match how other processes are implemented.
2564
2565         * DatabaseProcess/mac/DatabaseProcessMac.mm: (WebKit::DatabaseProcess::initializeProcessName):
2566         Removed ifdefs.
2567
2568         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Added.
2569
2570         * DerivedSources.make: Generate the profile from .sb.in.
2571
2572         * Shared/Databases/DatabaseProcessCreationParameters.cpp:
2573         (WebKit::DatabaseProcessCreationParameters::encode):
2574         (WebKit::DatabaseProcessCreationParameters::decode):
2575         * Shared/Databases/DatabaseProcessCreationParameters.h:
2576         Added a sandbox extension for indexedDatabaseDirectory.
2577
2578         * Shared/SecurityOriginData.h: Added an unrelated FIXME.
2579
2580         * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureDatabaseProcess): Create
2581         a sandbox extension for indexedDatabaseDirectory.
2582
2583         * WebKit2.xcodeproj/project.pbxproj: Added new files.
2584
2585 2014-04-28  Andy Estes  <aestes@apple.com>
2586
2587         [iOS] Introduce -didNotHandleTapAsClickAtPoint: to WKUIDelegatePrivate
2588         https://bugs.webkit.org/show_bug.cgi?id=132316
2589
2590         Reviewed by Darin Adler.
2591
2592         One WebKit2 client is interested to know if a tap was not handled by an element that responds to clicks.
2593         Introduce a new, private WKUIDelegate method telling it that a tap at a location was not handled as a click on
2594         an element.
2595
2596         * UIProcess/API/APIUIClient.h:
2597         (API::UIClient::didNotHandleTapAsClick):
2598         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2599         * UIProcess/Cocoa/UIDelegate.h:
2600         * UIProcess/Cocoa/UIDelegate.mm:
2601         (WebKit::UIDelegate::setDelegate):
2602         (WebKit::UIDelegate::UIClient::didNotHandleTapAsClick):
2603         * UIProcess/WebPageProxy.h:
2604         * UIProcess/WebPageProxy.messages.in:
2605         * UIProcess/ios/WebPageProxyIOS.mm:
2606         (WebKit::WebPageProxy::didNotHandleTapAsClick):
2607         * WebProcess/WebPage/ios/WebPageIOS.mm:
2608         (WebKit::WebPage::handleTap): Sent Messages::WebPageProxy::DidNotHandleTapAsClick if the tap wasn't handled, no
2609         node responded to the click event, or the responding node wasn't an element.
2610
2611 2014-04-29  Zan Dobersek  <zdobersek@igalia.com>
2612
2613         [GTK][WK2] Avoid Vector copies in WebViewBaseInputMethodFilter::setPreedit()
2614         https://bugs.webkit.org/show_bug.cgi?id=132323
2615
2616         Reviewed by Carlos Garcia Campos.
2617
2618         * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp:
2619         (WebKit::WebViewBaseInputMethodFilter::setPreedit): Inline the Vector object construction into
2620         the WebPageProxy::setComposition() call to avoid extra Vector copies and moves.
2621
2622 2014-04-28  Dan Bernstein  <mitz@apple.com>
2623
2624         <rdar://problem/16750708> REGRESSION (r159358): Crash in InjectedBundleHitTestResult::frame
2625         https://bugs.webkit.org/show_bug.cgi?id=132318
2626
2627         Reviewed by Andy Estes.
2628
2629         * UIProcess/Cocoa/NavigationState.mm:
2630         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): Fixed a typo: set
2631         the source frame, not the destination frame.
2632
2633         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2634         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Changed to get the
2635         frame for the action not from a hit test result, because some link activation actions are
2636         not mouse events, but rather from the event’s target.
2637
2638 2014-04-28  Benjamin Poulain  <bpoulain@apple.com>
2639
2640         [iOS][WK2] Restore the scroll position and scale from the HistoryItem (mostly)
2641         https://bugs.webkit.org/show_bug.cgi?id=132307
2642         <rdar://problem/16031704>
2643
2644         Reviewed by Simon Fraser.
2645
2646         Restore the scroll position and scale on back-forward by restoring the values from HistoryItem.
2647         This covers the common cases, see <rdar://problem/16031704>.
2648
2649         * UIProcess/API/Cocoa/WKWebView.mm:
2650         (-[WKWebView _didCommitLayerTree:WebKit::]):
2651         (-[WKWebView _didCommitLoadForMainFrame]): Deleted.
2652         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2653         * UIProcess/ios/WKContentView.mm:
2654         (-[WKContentView _didCommitLoadForMainFrame]):
2655         Get rid of the old code restoring the scroll position. This is now done by the WebProcess.
2656
2657         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2658         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2659         Update the scrolling tree after invoking didCommitLayerTree() on the WebPageProxy.
2660
2661         WKContentView and WKWebView states are updated in response to didCommitLayerTree(), the content size
2662         and scale in particular are set there.
2663
2664         After that, the content size/scale is in the same state as the layerTree update, and we can scroll
2665         the content as needed.
2666
2667         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2668         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
2669         (WebKit::WebFrameLoaderClient::restoreViewState):
2670         iOS WebKit1 uses a custom restoreViewState(), do the same for WebKit2 since the generic code is #ifdefed out.
2671         This is also necessary for the main frame's state update.
2672
2673         * WebProcess/WebPage/WebPage.h:
2674         * WebProcess/WebPage/ios/WebPageIOS.mm:
2675         (WebKit::WebPage::restorePageState):
2676         Restore the scale and position of the main frame. For now, we assume m_userHasChangedPageScaleFactor is set otherwise
2677         the initial-scale would override the restored value. We will need to fix that, the value should probably be saved with
2678         the history.
2679
2680 2014-04-28  Benjamin Poulain  <bpoulain@apple.com>
2681
2682         [iOS][WK2] iOS fix after r167867
2683         https://bugs.webkit.org/show_bug.cgi?id=132302
2684
2685         Reviewed by Simon Fraser.
2686
2687         iOS Touch Points uses "phase" for describing the touch points state for historical reasons.
2688         This patch adds state() as a synonym for phase, and revert r167893.
2689
2690         * Shared/WebEvent.h:
2691         (WebKit::WebPlatformTouchPoint::state):
2692         * UIProcess/WebPageProxy.cpp:
2693         (WebKit::areAllTouchPointsReleased):
2694
2695 2014-04-28  Andy Estes  <aestes@apple.com>
2696
2697         Fix a transcription error from r167901.
2698
2699         When addressing Darin's review feedback, I moved the iteration of dataArray from
2700         QuickLookDocumentData::append() to WebQuickLookHandleClient::didReceiveDataArray(),
2701         but I forgot to update the context argument to CFArrayApplyFunction() accordingly.
2702
2703         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
2704         (WebKit::WebQuickLookHandleClient::didReceiveDataArray):
2705
2706 2014-04-28  Enrica Casucci  <enrica@apple.com>
2707
2708         [WK2 iOS] Need to show title in the action sheet for images not inside an anchor element.
2709         https://bugs.webkit.org/show_bug.cgi?id=132304
2710         <rdar://problem/16535227>
2711
2712         Reviewed by Benjamin Poulain.
2713
2714         If the image in not inside an anchor tag, we must use the title attribute as
2715         title for the action sheet.
2716
2717         * UIProcess/ios/WKActionSheetAssistant.mm:
2718         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
2719
2720 2014-04-28  Tim Horton  <timothy_horton@apple.com>
2721
2722         WebKit2 View Gestures (Swipe): Discard snapshots made with a different view size/pixel density
2723         https://bugs.webkit.org/show_bug.cgi?id=132115
2724
2725         Reviewed by Simon Fraser.
2726
2727         We shouldn't try to use snapshots if they no longer match the destination view size.
2728         To do this, we need an accurate understanding of the topContentInset, both for the Web view,
2729         and for any custom views, because we don't want to include the inset area in the snapshot,
2730         and we don't want to reject snapshots that differ from the current view only because they have an inset or not.
2731
2732         * UIProcess/API/Cocoa/WKViewPrivate.h:
2733         * UIProcess/API/mac/WKView.mm:
2734         (-[WKView _takeViewSnapshot]):
2735         (-[WKView _setCustomSwipeViewsTopContentInset:]):
2736         Add and plumb through a topContentInset property to apply to the custom swipe views.
2737         For simplicitly's sake in the multi-view case, it is applied in window coordinates,
2738         so clients will have to do conversions if necessary.
2739         Don't include the top content inset in the snapshot that is taken.
2740
2741         * UIProcess/mac/ViewGestureController.h:
2742         (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
2743         * UIProcess/mac/ViewGestureControllerMac.mm:
2744         (WebKit::ViewGestureController::ViewGestureController):
2745         (WebKit::ViewGestureController::windowRelativeBoundsForCustomSwipeViews):
2746         Apply the aforementioned custom swipe view top content inset.
2747
2748         (WebKit::ViewGestureController::determineSnapshotLayerParent):
2749         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
2750         Factor these out of beginSwipeGesture.
2751
2752         (WebKit::ViewGestureController::retrieveSnapshotForItem):
2753         Don't return a snapshot if the current deviceScaleFactor doesn't match that
2754         at which the snapshot was taken, or if the size of the snapshot doesn't match
2755         the unobscured part of the snapshot layer (the layer's size sans top content inset).
2756
2757         (WebKit::layerGeometryFlippedToRoot): Added.
2758         Determine whether geometry flipping occurs between a layer and the root of the tree it is in.
2759
2760         (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews):
2761         Factor out debugging layer properties, and add some borders and backgrounds to our layers.
2762         I switched to invert instead of blur because blur makes the borders hard to use.
2763
2764         (WebKit::ViewGestureController::beginSwipeGesture):
2765         Add an additional layer, the swipeLayer, which is the parent of the swipeSnapshotLayer.
2766         We use this layer to compensate for geometry flipping, since we don't necessarily
2767         know the structure of the layer tree ahead of time when inserting snapshots into the
2768         client's layer tree, in the custom swipe view case.
2769         The swipe layer is always the full size of the view, including topContentInset, and
2770         has a white background in order to fill in that space. The snapshot layer is the size
2771         of the view *excluding* the topContentInset, which should match the size of the snapshot image
2772         itself (and we reject the image and just paint white if this is not the case).
2773
2774         (WebKit::ViewGestureController::handleSwipeGesture):
2775         (WebKit::ViewGestureController::removeSwipeSnapshot):
2776         Move and remove the new swipeLayer.
2777
2778         * UIProcess/mac/ViewSnapshotStore.h:
2779         * UIProcess/mac/ViewSnapshotStore.mm:
2780         (WebKit::ViewSnapshotStore::recordSnapshot):
2781         Store the deviceScaleFactor at the time the snapshot was taken.
2782         Fix a bug where the count of snapshots with live images was too high
2783         because we were failing to decrement it when replacing a snapshot of
2784         an existing item with a fresh one.
2785
2786 2014-04-28  Enrica Casucci  <enrica@apple.com>
2787
2788         WK2 iOS: crash when handling a synthetic keyboard event.
2789         https://bugs.webkit.org/show_bug.cgi?id=132296
2790         <rdar://problem/16469726>
2791
2792         Reviewed by Benjamin Poulain.
2793
2794         Adding a null check, since synthetic keyboard events do not
2795         have a corresponding platform event. We already do this on OS X.
2796
2797         * WebProcess/WebPage/ios/WebPageIOS.mm:
2798         (WebKit::WebPage::handleEditingKeyboardEvent):
2799
2800 2014-04-24  Andy Estes  <aestes@apple.com>
2801
2802         [iOS] Implement WebQuickLookHandleClient for WebKit2
2803         https://bugs.webkit.org/show_bug.cgi?id=132157
2804
2805         Reviewed by Darin Adler.
2806
2807         * Shared/API/Cocoa/_WKNSFileManagerExtras.h: Added.
2808         * Shared/API/Cocoa/_WKNSFileManagerExtras.mm: Added.
2809         (+[NSFileManager _web_createTemporaryFileForQuickLook:]): Called WebCore::createTemporaryFileForQuickLook().
2810         * Shared/ios/QuickLookDocumentData.cpp: Added.
2811         (WebKit::QuickLookDocumentData::QuickLookDocumentData):
2812         (WebKit::QuickLookDocumentData::append): Appened each CFDataRef to m_data and added their sizes to m_size.
2813         (WebKit::QuickLookDocumentData::decodedData): Returned the combined CFDataRef created by decode().
2814         Named this method 'decodedData' to indicate that it should only be called on objects populated by decode().
2815         (WebKit::QuickLookDocumentData::clear): Cleared m_data and reset m_size to 0.
2816         (WebKit::QuickLookDocumentData::encode): Implemented a custom encoding function to avoid having to combine
2817         m_data into contiguous memory at encoding time. Encoded m_size then sequentially encoded each member of m_data.
2818         (WebKit::QuickLookDocumentData::decode): Decoded the byte stream into a single CFDataRef. Eagerly copied the
2819         decoded data rather than using a DataReference since we know this will outlive the decoder.
2820         * Shared/ios/QuickLookDocumentData.h: Added.
2821         * UIProcess/API/APILoaderClient.h:
2822         (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
2823         (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
2824         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2825         * UIProcess/Cocoa/NavigationState.h:
2826         * UIProcess/Cocoa/NavigationState.mm:
2827         (WebKit::NavigationState::setNavigationDelegate):
2828         (WebKit::NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
2829         (WebKit::NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
2830         * UIProcess/WebPageProxy.h:
2831         * UIProcess/WebPageProxy.messages.in:
2832         * UIProcess/ios/WebPageProxyIOS.mm:
2833         (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame):
2834         (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):
2835         * WebKit2.xcodeproj/project.pbxproj:
2836         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2837         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
2838         (WebKit::WebFrameLoaderClient::didCreateQuickLookHandle):
2839         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: Added.
2840         (WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Sent DidStartLoadForQuickLookDocumentInMainFrame
2841         to WebPageProxy.
2842         (WebKit::WebQuickLookHandleClient::didReceiveDataArray): Appended dataArray to m_data.
2843         (WebKit::WebQuickLookHandleClient::didFinishLoading): Sent DidFinishLoadForQuickLookDocumentInMainFrame to
2844         WebPageProxy and then cleared m_data.
2845         (WebKit::WebQuickLookHandleClient::didFail): Cleared m_data.
2846         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Added.
2847         (WebKit::WebQuickLookHandleClient::create):
2848
2849 2014-04-28  Brady Eidson  <beidson@apple.com>
2850
2851         Hide service controls for selection behind a runtime switch
2852         <rdar://problem/16736616> and https://bugs.webkit.org/show_bug.cgi?id=132291
2853
2854         Reviewed by Tim Horton.
2855
2856         * Shared/WebPreferencesStore.h:
2857
2858         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2859         (WebKit::WebEditorClient::selectionRectsDidChange): Do nothing if the UI is disabled.
2860
2861         * WebProcess/WebPage/WebPage.cpp:
2862         (WebKit::WebPage::WebPage):
2863         (WebKit::WebPage::updatePreferences):
2864
2865         * WebProcess/WebPage/WebPage.h:
2866         (WebKit::WebPage::serviceControlsEnabled):
2867
2868 2014-04-28  Commit Queue  <commit-queue@webkit.org>
2869
2870         Unreviewed, rolling out r167853.
2871         https://bugs.webkit.org/show_bug.cgi?id=132288
2872
2873         caused crashes+timeouts+layout test failures described in the
2874         bug (Requested by thorton on #webkit).
2875
2876         Reverted changeset:
2877
2878         "Coalesce responses on network process side"
2879         https://bugs.webkit.org/show_bug.cgi?id=132229
2880         http://trac.webkit.org/changeset/167853
2881
2882 2014-04-28  Simon Fraser  <simon.fraser@apple.com>
2883
2884         Fix the iOS buld.
2885
2886         * UIProcess/WebPageProxy.cpp:
2887         (WebKit::areAllTouchPointsReleased):
2888
2889 2014-04-24  Simon Fraser  <simon.fraser@apple.com>
2890
2891         [iOS WK2] Make subview rebuilding more incremental
2892         https://bugs.webkit.org/show_bug.cgi?id=132162
2893         <rdar://problem/16718916>
2894
2895         Reviewed by Sam Weinig.
2896         
2897         Previously we did bulk replacement of subviews, but that triggers
2898         UIKit to send spurious will/DidMoveToWindow messages, which can
2899         interfere with UIScrollView scrolling.
2900         
2901         Make _web_setSubviews more incremental, only removing
2902         deleted subviews, adding new ones, and moving existing ones
2903         into the correct order.
2904
2905         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2906         (-[UIView _web_setSubviews:]):
2907
2908 2014-04-24  Simon Fraser  <simon.fraser@apple.com>
2909
2910         [iOS WK2] flickery scrolling with overflow-scrolling:touch
2911         https://bugs.webkit.org/show_bug.cgi?id=132150
2912         <rdar://problem/16683006>
2913
2914         Reviewed by Tim Horton.
2915         
2916         Maintain a flag that tells us if the user is interacting
2917         with the UIScrollView, and while set, don't clobber the contentOffset
2918         via scrolling tree updates.
2919
2920         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2921         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:WebKit::]):
2922         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
2923         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
2924         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): We need this one,
2925         not scrollViewDidEndScrollingAnimation:, to detect the end of decleration.
2926         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
2927         (-[WKOverflowScrollViewDelegate scrollViewDidEndScrollingAnimation:]): Deleted.
2928
2929 2014-04-28  Krzysztof Wolanski  <k.wolanski@samsung.com>
2930
2931         [X11] Add missing case for mime type application/x-webkit-test-netscape
2932         https://bugs.webkit.org/show_bug.cgi?id=132278
2933
2934         Reviewed by Darin Adler.
2935
2936         Case for x-webkit-test-netscape has been omitted along with r167759.
2937
2938         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2939         (WebKit::NetscapePlugin::initialize):
2940
2941 2014-04-28  Zan Dobersek  <zdobersek@igalia.com>
2942
2943         [WK2][X11] NetscapePluginModule::scanPlugin() should write UTF-8 strings to stdout
2944         https://bugs.webkit.org/show_bug.cgi?id=132245
2945
2946         Reviewed by Carlos Garcia Campos.
2947
2948         NetscapePluginModule::scanPlugin(), in the helper writeLine function, takes each character
2949         of the given string and writes it out as a UChar, doing two fputc calls for each byte of the
2950         16-bit type.
2951
2952         This fails badly with characters with integer value less than 256 as the most significant byte
2953         of the UChar is written out as a null character. This effectively chops the output that's gathered
2954         in the UIProcess and is parsed in PluginProcessProxy::scanPlugin().
2955
2956         To avoid all this, the UTF-8 encoding of the string is written out in the PluginProcess, and
2957         String::fromUTF8() is called in the UIProcess to properly decode the received string.
2958
2959         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
2960         (WebKit::writeCharacter):
2961         (WebKit::writeLine):
2962         (WebKit::writeByte): Deleted.
2963         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2964         (WebKit::PluginProcessProxy::scanPlugin):
2965
2966 2014-04-28  Zan Dobersek  <zdobersek@igalia.com>
2967
2968         [GTK][WK2] Missing return statement in webkit_plugin_get_description()
2969         https://bugs.webkit.org/show_bug.cgi?id=132263
2970
2971         Reviewed by Carlos Garcia Campos.
2972
2973         * UIProcess/API/gtk/WebKitPlugin.cpp:
2974         (webkit_plugin_get_description): Actually return the data of the cached
2975         plugin description CString.
2976
2977 2014-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2978
2979         [GTK] Crash in debug build with removing windowed plugin child widgets from the view
2980         https://bugs.webkit.org/show_bug.cgi?id=132252
2981
2982         Reviewed by Philippe Normand.
2983
2984         It crashes due to an assert in HashTable that checks the iterators
2985         validity. The problem is that we are iterating the children map
2986         and the callback called on every iteration might modify the map,
2987         making the iterators invalid. This happens when the WebView is
2988         destroyed, GtkContainer calls gtk_container_foreach() with
2989         gtk_widget_destroy as callback. When a widget inside a container
2990         is destroyed, it's removed from the container, and in our case,
2991         the child widget is removed from the map. This fixes several
2992         crashes when running layout tests in debug bot.
2993
2994         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2995         (webkitWebViewBaseContainerForall): Use copyKeysToVector() instead
2996         of using a range iterator for the map keys and check in every
2997         iteration that the child widget from the keys vector is still
2998         present in the map before calling the callback.
2999
3000 2014-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3001
3002         [GTK] GObject introspection links to installed libs when using jhbuild
3003         https://bugs.webkit.org/show_bug.cgi?id=132220
3004
3005         Reviewed by Martin Robinson.
3006
3007         The problem is that gobject-introspection is linking the temporary
3008         binaries adding the library paths present LDFLAGS environment
3009         variable first, taking precedence over the libraries in the build
3010         dir. Since the libraries paths of the dependencies are already
3011         correctly deduced by gobject-introspection using ldd, we can
3012         just unset the LDFLAGS variable before calling g-ir-scanner to
3013         make sure the libraries in the build dir take predence.
3014
3015         * PlatformGTK.cmake:
3016
3017 2014-04-27  Tim Horton  <timothy_horton@apple.com>
3018
3019         REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes
3020         https://bugs.webkit.org/show_bug.cgi?id=132239
3021         <rdar://problem/16192842>
3022
3023         Reviewed by Darin Adler.
3024
3025         * WebProcess/WebPage/WebPage.cpp:
3026         (WebKit::WebPage::scalePage):
3027         The change in r167864 broke iOS animated resize, because it was depending on
3028         the dynamic size update code not running if the scale wasn't going to change.
3029         So, as a band-aid we should bail from doing that work if the scales aren't different.
3030         In the long term we should try to untangle this code and make it less platform dependent.
3031
3032 2014-04-27  Eunmi Lee  <eunmi15.lee@samsung.com>
3033
3034         TouchEvent is not handled after releasing any point among touched points.
3035         https://bugs.webkit.org/show_bug.cgi?id=132043
3036
3037         Reviewed by Benjamin Poulain.
3038
3039         Handle TouchEvent until all touched points are released by setting
3040         trackingTouchEvents variable to false when all points are released.
3041
3042         * UIProcess/WebPageProxy.cpp:
3043         (WebKit::areAllTouchPointsReleased):
3044         (WebKit::WebPageProxy::handleTouchEventSynchronously):
3045         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
3046         (WebKit::WebPageProxy::handleTouchEvent):
3047
3048 2014-04-27  Alexey Proskuryakov  <ap@apple.com>
3049
3050         Don't use DispatchMessageEvenWhenWaitingForSyncReply for messages from NetworkProcess
3051         https://bugs.webkit.org/show_bug.cgi?id=132144
3052
3053         Reviewed by Darin Adler.
3054
3055         * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
3056         (WebKit::AsynchronousNetworkLoaderClient::willSendRequest):
3057         (WebKit::AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace):
3058         Dont use the IPC::DispatchMessageEvenWhenWaitingForSyncReply flag. It's not needed,
3059         almost never works in NetworkProcess, but may cause trouble if it did.
3060
3061         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3062         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): Removed
3063         setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage()
3064         function call, because there are no more any messages in NetworkProcess it could affect.
3065
3066         * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchMessage): Added a FIXME
3067         for an unrelated bug Anders and myself noticed while looking into this.
3068
3069 2014-04-27  Dan Bernstein  <mitz@apple.com>
3070
3071         [Cocoa] -[WKWebProcessPlugInController parameters] returns nil if no parameters have been set yet
3072         https://bugs.webkit.org/show_bug.cgi?id=132223
3073
3074         Reviewed by Sam Weinig.
3075
3076         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
3077         (WebKit::InjectedBundle::bundleParameters): Create the WKWebProcessBundleParameters if
3078         needed.
3079
3080 2014-04-27  Tim Horton  <timothy_horton@apple.com>
3081
3082         REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes
3083         https://bugs.webkit.org/show_bug.cgi?id=132239
3084         <rdar://problem/16192842>
3085
3086         Reviewed by Sam Weinig.
3087
3088         * WebProcess/WebPage/WebPage.cpp:
3089         (WebKit::WebPage::scalePage):
3090         The early-return added to WebPage::scalePage breaks callers who depend
3091         on being able to call scalePage() with the same scale but a different
3092         origin and having that change take effect.
3093
3094         Page::setPageScaleFactor already has the requisite logic, so move
3095         the early return down after that call, and guard only notification
3096         of page scale changes.
3097
3098 2014-04-25  Andy Estes  <aestes@apple.com>
3099
3100         [iOS] Stop creating a WKWebResourceQuickLookDelegate for every WebResourceLoader
3101         https://bugs.webkit.org/show_bug.cgi?id=132215
3102
3103         Reviewed by Dan Bernstein.
3104
3105         * WebKit2.xcodeproj/project.pbxproj:
3106         * WebProcess/Network/WebResourceLoader.cpp:
3107         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): Called QuickLookHandle::create() directly.
3108         * WebProcess/Network/WebResourceLoader.h:
3109         * WebProcess/ios/WebResourceLoaderIOS.mm: Removed.
3110
3111 2014-04-27  Sam Weinig  <sam@webkit.org>
3112
3113         [iOS WebKit2] Add support for text autosizing
3114         <rdar://problem/16545245>
3115         https://bugs.webkit.org/show_bug.cgi?id=132237
3116
3117         Reviewed by Tim Horton.
3118
3119         * Shared/WebPageCreationParameters.cpp:
3120         (WebKit::WebPageCreationParameters::encode):
3121         (WebKit::WebPageCreationParameters::decode):
3122         * Shared/WebPageCreationParameters.h:
3123         * UIProcess/WebPageProxy.cpp:
3124         (WebKit::WebPageProxy::creationParameters):
3125         * UIProcess/WebPageProxy.h:
3126         * UIProcess/ios/WebPageProxyIOS.mm:
3127         (WebKit::WebPageProxy::textAutosizingWidth):
3128         * WebProcess/WebPage/WebPage.cpp:
3129         (WebKit::WebPage::WebPage):
3130         Pass the text autosizing width from the UIProcess to WebProcess.
3131
3132 2014-04-27  Tim Horton  <timothy_horton@apple.com>
3133
3134         WebKit2 View Gestures (Zoom): Pages with 'background-attachment: fixed' don't behave correctly when zoomed
3135         https://bugs.webkit.org/show_bug.cgi?id=132225
3136         <rdar://problem/15729975>
3137
3138         Reviewed by Darin Adler.
3139
3140         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3141         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3142         (WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom):
3143         (WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom):
3144         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
3145         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
3146         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
3147         Factor out code to choose which layer (and shadow layer) to apply the transient zoom to.
3148         If we have a contentsContainmentLayer (because we have composited background-attachment: fixed),
3149         it applies page scale, so we should apply the transient zoom to that layer
3150         instead of the RenderView's main GraphicsLayer.
3151
3152 2014-04-27  Pratik Solanki  <psolanki@apple.com>
3153
3154         Unreviewed. iOS build fix.
3155
3156         * UIProcess/ios/SmartMagnificationController.h:
3157
3158 2014-04-27  Zan Dobersek  <zdobersek@igalia.com>
3159
3160         Move cross-port WebKit2 code to std::unique_ptr
3161         https://bugs.webkit.org/show_bug.cgi?id=129670
3162
3163         Reviewed by Darin Adler.
3164
3165         Replace uses of OwnPtr, PassOwnPtr in cross-port WebKit2 code with std::unique_ptr.
3166
3167         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3168         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
3169         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
3170         * NetworkProcess/NetworkProcess.h:
3171         (WebKit::NetworkProcess::addSupplement):
3172         * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
3173         (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
3174         * NetworkProcess/SynchronousNetworkLoaderClient.h:
3175         * Platform/IPC/Connection.cpp:
3176         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
3177         * Platform/IPC/Connection.h:
3178         * Platform/IPC/MessageReceiver.h:
3179         * Platform/Module.h:
3180         * Platform/WorkQueue.h:
3181         * Platform/efl/ModuleEfl.cpp:
3182         (WebKit::Module::load):
3183         * Platform/mac/LayerHostingContext.mm:
3184         * Shared/APIURL.h:
3185         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
3186         * Shared/Plugins/NPRemoteObjectMap.cpp:
3187         * Shared/ShareableBitmap.h:
3188         * UIProcess/DrawingAreaProxyImpl.h:
3189         * UIProcess/InspectorServer/WebSocketServer.cpp:
3190         (WebKit::WebSocketServer::didAcceptConnection):
3191         (WebKit::WebSocketServer::didCloseWebSocketServerConnection):
3192         * UIProcess/InspectorServer/WebSocketServer.h:
3193         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
3194         (WebKit::connectionCallback):
3195         * UIProcess/Network/NetworkProcessProxy.cpp:
3196         (WebKit::NetworkProcessProxy::createDownloadProxy):
3197         * UIProcess/Network/NetworkProcessProxy.h:
3198         * UIProcess/Notifications/WebNotificationManagerProxy.h:
3199         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
3200         (WebKit::WebPluginSiteDataManager::getSitesWithData):
3201         (WebKit::WebPluginSiteDataManager::clearSiteData):
3202         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins):
3203         (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins):
3204         * UIProcess/Plugins/WebPluginSiteDataManager.h:
3205         * UIProcess/Storage/StorageManager.cpp:
3206         (WebKit::callCallbackFunction):
3207         (WebKit::StorageManager::getOriginsInternal):
3208         * UIProcess/WebPageProxy.cpp:
3209         (WebKit::ExceededDatabaseQuotaRecords::areBeingProcessed):
3210         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
3211         (WebKit::ExceededDatabaseQuotaRecords::add):
3212         (WebKit::ExceededDatabaseQuotaRecords::next):
3213         (WebKit::WebPageProxy::handleMouseEvent):
3214         (WebKit::WebPageProxy::handleWheelEvent):
3215         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
3216         (WebKit::WebPageProxy::internalShowContextMenu):
3217         * UIProcess/WebPageProxy.h:
3218         * UIProcess/WebProcessProxy.cpp:
3219         (WebKit::WebProcessProxy::createDownloadProxy):
3220         * UIProcess/WebProcessProxy.h:
3221         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3222         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
3223         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
3224         (WebKit::NetscapePluginStream::deliverData):
3225         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
3226         * WebProcess/Plugins/PluginProcessConnectionManager.h:
3227         * WebProcess/Plugins/PluginProxy.cpp:
3228         (WebKit::PluginProxy::initialize):
3229         (WebKit::PluginProxy::didCreatePluginInternal):
3230         (WebKit::PluginProxy::didFailToCreatePluginInternal):
3231         * WebProcess/Plugins/PluginProxy.h:
3232         * WebProcess/Plugins/PluginView.cpp:
3233         (WebKit::PluginView::createWebEvent):
3234         (WebKit::PluginView::handleEvent):
3235         * WebProcess/Plugins/PluginView.h:
3236         * WebProcess/WebCoreSupport/WebPopupMenu.h:
3237         * WebProcess/WebPage/EventDispatcher.cpp:
3238         (WebKit::EventDispatcher::EventDispatcher):
3239         * WebProcess/WebPage/EventDispatcher.h:
3240         * WebProcess/WebPage/WebPage.cpp:
3241         (WebKit::WebPage::WebPage):
3242         (WebKit::WebPage::beginPrinting):
3243         * WebProcess/WebPage/WebPage.h:
3244         * WebProcess/WebProcess.h:
3245         (WebKit::WebProcess::addSupplement):
3246
3247 2014-04-27  Antti Koivisto  <antti@apple.com>
3248
3249         Coalesce responses on network process side
3250         https://bugs.webkit.org/show_bug.cgi?id=132229
3251
3252         Reviewed by Andreas Kling.
3253         
3254         To reduce IPC we should coalesce response data in the network process and send it over with single IPC call.
3255
3256         * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
3257         (WebKit::AsynchronousNetworkLoaderClient::AsynchronousNetworkLoaderClient):
3258         (WebKit::AsynchronousNetworkLoaderClient::didReceiveResponse):
3259         (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer):
3260         (WebKit::AsynchronousNetworkLoaderClient::didFinishLoading):
3261         (WebKit::AsynchronousNetworkLoaderClient::didFail):
3262         (WebKit::AsynchronousNetworkLoaderClient::dispatchPartialCoalescedResponse):
3263         (WebKit::AsynchronousNetworkLoaderClient::clearCoalescedResponse):
3264         (WebKit::AsynchronousNetworkLoaderClient::responseCoalesceTimerFired):
3265         
3266             Coalesce the response. Completed response is sent on didFinishLoading. If the coalesce timer fires
3267             before that the data accumulated so far is dispatched.
3268
3269         * NetworkProcess/AsynchronousNetworkLoaderClient.h:
3270         * NetworkProcess/NetworkResourceLoader.h:
3271         * WebProcess/Network/WebResourceLoader.cpp:
3272         (WebKit::WebResourceLoader::didReceiveCompleteResponse):
3273         * WebProcess/Network/WebResourceLoader.h:
3274         * WebProcess/Network/WebResourceLoader.messages.in:
3275         
3276             Add a new message type that covers didReceiveResponse, didReceiveBuffer and didFinishLoading in a single message.
3277
3278 2014-04-26  Tim Horton  <timothy_horton@apple.com>
3279
3280         REGRESSION (r167775): Safari crashes in ViewSnapshotStore::pruneSnapshots after loading 20 pages
3281         https://bugs.webkit.org/show_bug.cgi?id=132204
3282         <rdar://problem/16735622>
3283
3284         Reviewed by Dan Bernstein and Sam Weinig.
3285
3286         * UIProcess/mac/ViewSnapshotStore.mm:
3287         (WebKit::ViewSnapshotStore::pruneSnapshots):
3288         (WebKit::ViewSnapshotStore::recordSnapshot):
3289         Fix a bug where the count of snapshots with live images was too high
3290         because we were failing to decrement it when replacing a snapshot of
3291         an existing item with a fresh one.
3292
3293 2014-04-26  Dan Bernstein  <mitz@apple.com>
3294
3295         [Cocoa] Rename a bundle form delegate method
3296         https://bugs.webkit.org/show_bug.cgi?id=132221
3297
3298         Reviewed by Adele Peterson.
3299
3300         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Renamed.
3301         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3302         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Check for the method
3303         under the old (“new”) name and under the new name.
3304
3305 2014-04-25  Dan Bernstein  <mitz@apple.com>
3306
3307         [Cocoa] Synthesized getter for WKNavigationAction's _userInitiated property has the wrong name
3308         https://bugs.webkit.org/show_bug.cgi?id=132219
3309
3310         Reviewed by Sam Weinig.
3311
3312         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
3313
3314 2014-04-25  Simon Fraser  <simon.fraser@apple.com>
3315
3316         [iOS] getAssistedNodeInformation crashes getting the bounding box if it doesn't have a renderer
3317         https://bugs.webkit.org/show_bug.cgi?id=132217
3318         <rdar://problem/16671662>
3319
3320         Reviewed by Dean Jackson.
3321
3322         * WebProcess/WebPage/ios/WebPageIOS.mm:
3323         (WebKit::WebPage::getAssistedNodeInformation): Check that m_assistedNode has
3324         a renderer before asking for its bounding box.
3325
3326 2014-04-25  Benjamin Poulain  <bpoulain@apple.com>
3327
3328         [iOS][WK2] Add an intermediary view to do the target transform and adjustment transform
3329         https://bugs.webkit.org/show_bug.cgi?id=132175
3330
3331         Reviewed by Enrica Casucci.
3332
3333         Some utility views of WKContentView account for the transforms between the content view
3334         and the utility view.
3335
3336         Since the dynamic resize relies on setting subLayerTransforms, it is getting in the way.
3337
3338         This patch adds a layer in between for the animation. That way the content view remains
3339         unscaled.
3340
3341         * UIProcess/API/Cocoa/WKWebView.mm:
3342         (-[WKWebView _didCommitLayerTree:WebKit::]):
3343         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
3344         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3345         (-[WKWebView _endAnimatedResize]):
3346
3347 2014-04-25  Enrica Casucci  <enrica@apple.com>
3348
3349         REGRESSION (iOS WebKit2): Selection is not being repainted during live resize.
3350         https://bugs.webkit.org/show_bug.cgi?id=132216
3351         <rdar://problem/16628819>
3352
3353         Reviewed by Benjamin Poulain.
3354
3355         Since the selection is drawn in the UIProcess on iOS,
3356         we need to update the selection rects and force a repaint
3357         during a live resize.
3358
3359         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3360         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
3361         * WebProcess/WebPage/WebPage.h:
3362         * WebProcess/WebPage/ios/WebPageIOS.mm:
3363         (WebKit::WebPage::updateSelectionAppearance):
3364
3365 2014-04-25  Brady Eidson  <beidson@apple.com>
3366
3367         Add a selection overlay.
3368         <rdar://problem/16727797> and https://bugs.webkit.org/show_bug.cgi?id=132200
3369
3370         Reviewed by David Hyatt.
3371
3372         * WebKit2.xcodeproj/project.pbxproj:
3373
3374         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3375         (WebKit::WebEditorClient::selectionRectsDidChange): Pass the new selection rects on
3376           to the selection overlay controller.
3377         * WebProcess/WebCoreSupport/WebEditorClient.h:
3378
3379         * WebProcess/WebPage/SelectionOverlayController.cpp: Added.
3380         (WebKit::SelectionOverlayController::SelectionOverlayController):
3381         (WebKit::SelectionOverlayController::createOverlayIfNeeded):
3382         (WebKit::SelectionOverlayController::destroyOverlay):
3383         (WebKit::SelectionOverlayController::pageOverlayDestroyed):
3384         (WebKit::SelectionOverlayController::willMoveToWebPage):
3385         (WebKit::SelectionOverlayController::didMoveToWebPage):
3386         (WebKit::SelectionOverlayController::selectionRectsDidChange):
3387         (WebKit::SelectionOverlayController::drawRect):
3388         (WebKit::SelectionOverlayController::mouseEvent):
3389         * WebProcess/WebPage/SelectionOverlayController.h: Added.
3390         (WebKit::SelectionOverlayController::create):
3391         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Added.
3392         (WebKit::SelectionOverlayController::drawRect):
3393         (WebKit::SelectionOverlayController::mouseEvent):
3394         (WebKit::SelectionOverlayController::handleClick):
3395         (WebKit::SelectionOverlayController::clearHighlight):
3396
3397         * WebProcess/WebPage/WebPage.cpp:
3398         (WebKit::WebPage::selectionOverlayController):
3399         * WebProcess/WebPage/WebPage.h:
3400
3401 2014-04-25  Enrica Casucci  <enrica@apple.com>
3402
3403         Remove duplicate member variable in WKAutocorrectionRects and WKAutocorrectionContext.
3404         https://bugs.webkit.org/show_bug.cgi?id=132206
3405
3406         Reviewed by Benjamin Poulain.
3407
3408         * UIProcess/ios/WKContentViewInteraction.mm:
3409
3410 2014-04-25  Dean Jackson  <dino@apple.com>
3411
3412         Allow a platform-specific size enumeration to be passed into popup-menu display
3413         https://bugs.webkit.org/show_bug.cgi?id=132195
3414
3415         Reviewed by Brent Fulgham. With some in-person review comments from Sam Weinig.
3416
3417         Platforms like OS X use a set of predefined sizes for built-in controls
3418         used for <select>: normal, small and mini. Expose that information to
3419         the PopupMenuClient via the PopupMenuStyle, allowing it to be passed
3420         into the platform code in WebKitSystemInterface.
3421
3422         * Shared/PlatformPopupMenuData.cpp: Encode and decode the PopupMenuSize enum.
3423         (WebKit::PlatformPopupMenuData::encode):
3424         (WebKit::PlatformPopupMenuData::decode):
3425         * Shared/PlatformPopupMenuData.h: Add PopupMenuSize member variable.
3426         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3427         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Convert the PopupMenuSize
3428         into a WKControlSize, and pass that into WKPopupMenu.
3429         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
3430         (WebKit::WebPopupMenu::setUpPlatformData): Add the PopupMenuSize to
3431         the PlatformPopupMenuData.