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