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