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