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