2cb4dafc753b53d16b2cfc93b34ba8cf2570ada2
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-07-21  Andy Estes  <aestes@apple.com>
2
3         [iOS] Handle QuickLook ResourceLoaders in the web process
4         https://bugs.webkit.org/show_bug.cgi?id=135113
5
6         Reviewed by David Kilzer.
7
8         The QuickLook framework registers a NSURLProtocol to handle loading subresources of the HTML documents it
9         generates. In order for these loads to succeed, we need to start them in the same process in which QuickLook
10         generated the main resource.
11
12         * WebProcess/Network/WebResourceLoadScheduler.cpp:
13         (WebKit::WebResourceLoadScheduler::scheduleLoad):
14
15 2014-07-21  Brady Eidson  <beidson@apple.com>
16
17         DatabaseProcess doesn't relaunch after crashing.
18         <rdar://problem/17717343> and https://bugs.webkit.org/show_bug.cgi?id=135117
19
20         Reviewed by Alexey Proskuryakov.
21
22         * UIProcess/Databases/DatabaseProcessProxy.cpp:
23         (WebKit::DatabaseProcessProxy::didClose): Tell the WebContext.
24
25         * UIProcess/WebContext.cpp:
26         (WebKit::WebContext::databaseProcessCrashed): Notify supplements, then clear the DatabaseProcessProxy pointer.
27         * UIProcess/WebContext.h:
28
29         * UIProcess/WebContextSupplement.h:
30         (WebKit::WebContextSupplement::processDidClose): Added. No users right now, but the patch in bug 135035 will need this.
31
32 2014-07-20  KwangHyuk Kim  <hyuki.kim@samsung.com>
33
34         Fix warnings caused by unused parameter.
35         https://bugs.webkit.org/show_bug.cgi?id=134975
36
37         Reviewed by Gyuyoung Kim.
38
39         Fix warnings on EwkView.cpp and LegacySessionStateCodingNone.cpp that are caused by unused parameter data.
40
41         * UIProcess/API/efl/EwkView.cpp:
42         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
43         * UIProcess/LegacySessionStateCodingNone.cpp:
44         (WebKit::decodeLegacySessionState):
45
46 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
47
48         Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
49         https://bugs.webkit.org/show_bug.cgi?id=134894
50
51         Reviewed by Darin Adler.
52
53         Add setCanPlayFastReverse
54
55         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
56         * WebProcess/ios/WebVideoFullscreenManager.h: ditto
57         * WebProcess/ios/WebVideoFullscreenManager.mm: ditto
58         (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): ditto
59
60 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
61
62         Decrease flicker when enter and exit fullscreen.
63         https://bugs.webkit.org/show_bug.cgi?id=134919
64
65         Reviewed by Simon Fraser.
66
67         Change the sequence of tear down and use transparency to prevent flicker when entering and exiting fullscreen.
68
69         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: wait to remove layerHost until didCleanupFullscreen
70         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): removed from here
71         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): added here
72         * WebProcess/ios/WebVideoFullscreenManager.mm:
73         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): use transparent background during transition
74
75 2014-07-20  Dan Bernstein  <mitz@apple.com>
76
77         <rdar://problem/17739526> REGRESSION (r171057): Crash in WebPage::getPositionInformation()
78         https://bugs.webkit.org/show_bug.cgi?id=135099
79
80         Reviewed by David Kilzer.
81
82         * WebProcess/WebPage/ios/WebPageIOS.mm:
83         (WebKit::WebPage::getPositionInformation): Added a null check.
84
85 2014-07-19  Zan Dobersek  <zdobersek@igalia.com>
86
87         Consistently use uint64_t as the handle parameter type for the SetAcceleratedCompositingWindowId message
88         https://bugs.webkit.org/show_bug.cgi?id=135047
89
90         Reviewed by Darin Adler.
91
92         UIProcess' WebPageProxy is handling this parameter as an uint64_t, it should be handled as such
93         in WebProcess as well.
94
95         * WebProcess/WebPage/WebPage.h:
96         * WebProcess/WebPage/WebPage.messages.in: Also changed the parameter name to match other places.
97         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
98         (WebKit::WebPage::setAcceleratedCompositingWindowId):
99
100 2014-07-18  Oliver Hunt  <oliver@apple.com>
101
102         We don't provide an extension to the temp file used for uploads
103         https://bugs.webkit.org/show_bug.cgi?id=135079
104
105         Reviewed by Sam Weinig.
106
107         Make sure didChooseFilesForOpenPanelWithDisplayStringAndIcon vends
108         extensions for the files passed to the content process.
109
110         * UIProcess/WebPageProxy.cpp:
111         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
112
113 2014-07-18  Tim Horton  <timothy_horton@apple.com>
114
115         ASSERTion failures in ViewGestureController indicating that we're copying WebBackForwardList
116         https://bugs.webkit.org/show_bug.cgi?id=135080
117         <rdar://problem/17734714>
118
119         Reviewed by Sam Weinig.
120
121         * UIProcess/ios/ViewGestureControllerIOS.mm:
122         (WebKit::ViewGestureController::beginSwipeGesture):
123         (WebKit::ViewGestureController::canSwipeInDirection):
124
125 2014-07-18  Yongjun Zhang  <yongjun_zhang@apple.com>
126
127         _WKActivatedElementInfo.title should fallback to innerText if the link doesn't have title attribute.
128         https://bugs.webkit.org/show_bug.cgi?id=135077
129
130         When populate InteractionInformationAtPosition's title value, use a link element's innerText if it
131         doesn't have title attribute.
132
133         Reviewed by Dan Bernstein.
134
135         * WebProcess/WebPage/ios/WebPageIOS.mm:
136         (WebKit::WebPage::getPositionInformation):
137
138 2014-07-18  Andy Estes  <aestes@apple.com>
139
140         [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
141         https://bugs.webkit.org/show_bug.cgi?id=135072
142         <rdar://problem/17528188>
143
144         Reviewed by David Kilzer.
145
146         * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter.
147         * Shared/mac/WebCoreArgumentCodersMac.mm:
148         (IPC::ArgumentCoder<ContentFilter>::encode): Encoded the ContentFilter using a NSKeyedArchiver.
149         (IPC::ArgumentCoder<ContentFilter>::decode): Decoded the ContentFilter using a NSKeyedUnarchiver.
150         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
151         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::setContentFilterForBlockedLoad().
152         * UIProcess/WebFrameProxy.cpp:
153         (WebKit::WebFrameProxy::didStartProvisionalLoad): Reset m_contentFilterForBlockedLoad to nullptr.
154         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful().
155         If the unblock is successful, reload the WebPageProxy.
156         * UIProcess/WebFrameProxy.h:
157         (WebKit::WebFrameProxy::setContentFilterForBlockedLoad):
158         * UIProcess/WebPageProxy.cpp:
159         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check if this is navigation represents an unblock
160         request and ignore if so.
161         * UIProcess/WebPageProxy.h:
162         * UIProcess/WebPageProxy.messages.in: Defined ContentFilterDidBlockLoadForFrame.
163         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
164         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): Sent ContentFilterDidBlockLoadForFrame to the WebPageProxy.
165         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
166
167 2014-07-18  Simon Fraser  <simon.fraser@apple.com>
168
169         [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
170         https://bugs.webkit.org/show_bug.cgi?id=135078
171         <rdar://problem/17401823>
172
173         Reviewed by Tim Horton.
174         
175         Fix the logging of requested scroll position and frame scale factor.
176
177         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
178         (WebKit::RemoteScrollingTreeTextStream::dump):
179
180 2014-07-18  Joseph Pecoraro  <pecoraro@apple.com>
181
182         [Cocoa] Use RetainPtr in _WKRemoteObjectInterface
183         https://bugs.webkit.org/show_bug.cgi?id=135062
184
185         Reviewed by Anders Carlsson.
186
187         Switch to RetainPtr instead of manual memory management of ivars.
188
189         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
190         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
191         (-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
192         (-[_WKRemoteObjectInterface identifier]):
193         (-[_WKRemoteObjectInterface description]):
194         (-[_WKRemoteObjectInterface dealloc]): Deleted.
195
196 2014-07-18  Tim Horton  <timothy_horton@apple.com>
197
198         Take navigation snapshots whenever the current back-forward item is going to change
199         https://bugs.webkit.org/show_bug.cgi?id=135058
200         <rdar://problem/17464515>
201
202         Reviewed by Dan Bernstein.
203
204         Instead of trying to have the UI process figure out when to take navigation snapshots by itself,
205         snapshot whenever the Web process says that the current back-forward item is going to change.
206         This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to
207         just two places instead of 5.
208
209         * UIProcess/WebPageProxy.cpp:
210         (WebKit::WebPageProxy::goForward):
211         (WebKit::WebPageProxy::goBack):
212         (WebKit::WebPageProxy::goToBackForwardItem):
213         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
214         We no longer need to special-case taking navigation snapshots
215         when the UI process changes the back forward item or upon
216         didStartProvisionalLoadForFrame, because we'll always snapshot
217         in willChangeCurrentHistoryItem in all of these cases.
218
219         * UIProcess/WebPageProxy.cpp:
220         (WebKit::WebPageProxy::willChangeCurrentHistoryItem):
221         * UIProcess/WebPageProxy.h:
222         * UIProcess/WebPageProxy.messages.in:
223         Add willChangeCurrentHistoryItem message, which comes from the Web process.
224         When it arrives, take a navigation snapshot.
225
226         * UIProcess/ios/ViewGestureControllerIOS.mm:
227         (WebKit::ViewGestureController::beginSwipeGesture):
228         Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe,
229         so that it doesn't bail from taking the snapshot because we have a snapshot up.
230
231         (WebKit::ViewGestureController::endSwipeGesture):
232         We no longer need to explicitly disable snapshotting while navigating, because
233         we will avoid taking the snapshot if there's a snapshot being displayed.
234
235         * UIProcess/mac/ViewGestureControllerMac.mm:
236         (WebKit::ViewGestureController::~ViewGestureController):
237         Remove the snapshot if it's still up when ViewGestureController is destroyed.
238         The Mac version of ViewGestureController is destroyed on Web process crashes
239         because it is a message receiver, so it is not guaranteed to have the same
240         lifetime as the WebPageProxy and friends.
241
242         (WebKit::ViewGestureController::trackSwipeGesture):
243         Make use of recordNavigationSnapshot.
244
245         (WebKit::ViewGestureController::endSwipeGesture):
246         Ditto from the Mac version.
247
248         * UIProcess/mac/ViewSnapshotStore.h:
249         (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted.
250         (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted.
251         * UIProcess/mac/ViewSnapshotStore.mm:
252         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
253         (WebKit::ViewSnapshotStore::recordSnapshot):
254         Remove the snapshot disabling mechanism and bail from snapshotting if we're
255         showing a snapshot, as mentioned above.
256
257         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
258         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
259         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
260         * WebProcess/WebPage/WebPage.cpp:
261         (WebKit::WebPage::willChangeCurrentHistoryItem):
262         * WebProcess/WebPage/WebPage.h:
263         Proxy willChangeCurrentHistoryItem from HistoryController to the UI process.
264
265 2014-07-18  Jon Honeycutt  <jhoneycutt@apple.com>
266
267         REGRESSION: Crash when typing into text field that clears itself on iOS
268
269         <https://bugs.webkit.org/show_bug.cgi?id=135044>
270         <rdar://problem/17640443>
271
272         Reviewed by Darin Adler.
273
274         * WebProcess/WebPage/ios/WebPageIOS.mm:
275         (WebKit::WebPage::requestAutocorrectionData):
276         wordRangeFromPosition() returns null in some cases; null check range
277         before dereferencing it. Moved some variable declarations around to
278         better match our style.
279
280 2014-07-18  Tim Horton  <timothy_horton@apple.com>
281
282         [WK2] Provide a mechanism to grab the back-forward list for gesture navigation purposes from another WKWebView
283         https://bugs.webkit.org/show_bug.cgi?id=134999
284         <rdar://problem/17238025>
285
286         Reviewed by Sam Weinig.
287
288         In some cases, clients may need to throw a WKWebView with no back-forward list over
289         another WKWebView, and want to participate in gesture swipe as if they were actually
290         the page being overlaid.
291
292         * UIProcess/API/Cocoa/WKWebView.mm:
293         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
294         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
295         (-[WKWebViewConfiguration copyWithZone:]):
296         (-[WKWebViewConfiguration _alternateWebViewForNavigationGestures]):
297         (-[WKWebViewConfiguration _setAlternateWebViewForNavigationGestures:]):
298         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
299         Keep an "alternate" WKWebView "for navigation gestures", which ViewGestureController
300         will use as the real source of back-forward items, and the destination of the swipe navigation.
301         All swipe delegate callbacks will also fire from the alternate view, because it owns the items
302         and will be doing the navigation.
303
304         * UIProcess/ios/ViewGestureControllerIOS.mm:
305         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView):
306         (WebKit::ViewGestureController::beginSwipeGesture):
307         Send navigationGestureDidBegin via the alternate view's WebPageProxy if it exists.
308         Record a new snapshot on the current page, but copy it to the alternate view if necessary,
309         so that when swiping forward from the alternate view, it will have the "right" snapshot.
310         Get the target back forward item from the alternate view.
311         Send navigationGestureWillEnd via the alternate view's WebPageProxy if it exists.
312
313         (WebKit::ViewGestureController::canSwipeInDirection):
314         Determine if we can swipe in a direction by looking at the alternate view's back-forward list if necessary.
315
316         (WebKit::ViewGestureController::endSwipeGesture):
317         Send navigationGestureDidEnd via the alternate view's WebPageProxy if it exists.
318         Perform the navigation on the alternate view if necessary.
319
320         (WebKit::ViewGestureController::removeSwipeSnapshot):
321         Send navigationGestureSnapshotWasRemoved via the alternate view's WebPageProxy if it exists.
322
323         * UIProcess/mac/ViewGestureController.h:
324
325 2014-07-17  David Kilzer  <ddkilzer@apple.com>
326
327         SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
328         <http://webkit.org/b/135006>
329
330         Reviewed by Darin Adler.
331
332         * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
333         WebKit.xcconfig.
334         * Configurations/DebugRelease.xcconfig: Remove empty
335         SECTORDER_FLAGS definition.
336         * Configurations/WebKit.xcconfig: Use $(CONFIGURATION) so
337         SECTORDER_FLAGS is only set on Production builds.
338
339 2014-07-17  Alexey Proskuryakov  <ap@apple.com>
340
341         REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes
342         https://bugs.webkit.org/show_bug.cgi?id=135032
343         <rdar://problem/17716602>
344
345         Reviewed by Dan Bernstein.
346
347         * UIProcess/WebPageProxy.cpp:
348         (WebKit::WebPageProxy::processDidCrash): Create a transaction, so that the nested
349         transaction in resetStateAfterProcessExited() wouldn't be committed.
350         (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't use auto - it was hiding
351         the most important fact that this is a stack object that can't be simply moved to
352         a different function.
353
354 2014-07-17  Benjamin Poulain  <bpoulain@apple.com>
355
356         [iOS][WK2] Fix the updateVisibleContentRects synchronization for load after r171154
357         https://bugs.webkit.org/show_bug.cgi?id=135036
358
359         Reviewed by Dan Bernstein.
360
361         * WebProcess/WebPage/ios/WebPageIOS.mm:
362         (WebKit::WebPage::updateVisibleContentRects):
363         I forgot to update one of the condition after changing from lastTransaction to next transaction
364         in r171154.
365
366 2014-07-17  Enrica Casucci  <enrica@apple.com>
367
368         [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
369         https://bugs.webkit.org/show_bug.cgi?id=135023
370         <rdar://problem/17617282>
371
372         Reviewed by Benjamin Poulain and Ryosuke Niwa.
373
374         WKContentView needs to implement hasContent to correctly show
375         the appropriate menu bar content. The patch adds this information
376         to the EditorState.
377
378         * Shared/EditorState.cpp:
379         (WebKit::EditorState::encode):
380         (WebKit::EditorState::decode):
381         * Shared/EditorState.h:
382         (WebKit::EditorState::EditorState):
383         * UIProcess/ios/WKContentViewInteraction.mm:
384         (-[WKContentView hasContent]):
385         * WebProcess/WebPage/WebPage.cpp:
386         (WebKit::WebPage::editorState):
387
388 2014-07-17  Benjamin Poulain  <benjamin@webkit.org>
389
390         [iOS][WK2] Add SPI to do a dynamic viewport update without showing any content
391         https://bugs.webkit.org/show_bug.cgi?id=135010
392
393         Reviewed by Darin Adler.
394
395         This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work
396         of a dynamic viewport size update, but instead of animating the old content, it is hidden.
397
398         The patch is built on top of the animated resize mechanism. Instead of having an animation driving
399         the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as
400         the WebProcess needs, and it ends when first layer tree commit with the new content is processed.
401
402         The attribute "_isAnimatingResize" is generalized to support two modes of resizing: animated and
403         hiding content.
404
405         The attribute "_hasCommittedLoadForMainFrame" is rather silly. It is only needed because
406         [WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page
407         is initialized, and doing an animated resize would trash the WebProcess state.
408         I wish I had a better solution, this is not great.
409
410         * UIProcess/API/Cocoa/WKWebView.mm:
411         (-[WKWebView _processDidExit]):
412         (-[WKWebView _didCommitLoadForMainFrame]):
413         (-[WKWebView _didCommitLayerTree:]):
414         This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave
415         exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using
416         _resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct
417         view state.
418
419         Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit
420         the synchronization path or we would be blocked there for a while, which is what we are trying to avoid.
421
422         After r171154, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are
423         executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have
424         everything we need and does not use any synchronous messages.
425
426         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
427         (-[WKWebView _restorePageStateToExposedRect:scale:]):
428         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
429         (-[WKWebView _scrollToContentOffset:]):
430         (-[WKWebView _frameOrBoundsChanged]):
431         (-[WKWebView _updateVisibleContentRects]):
432         (-[WKWebView _setMinimumLayoutSizeOverride:]):
433         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
434         (-[WKWebView _setInterfaceOrientationOverride:]):
435         (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
436         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
437         (-[WKWebView _endAnimatedResize]):
438         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
439         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
440
441 2014-07-17  Brent Fulgham  <bfulgham@apple.com>
442
443         [Mac] Full screen video not always animating in the correct Space
444         https://bugs.webkit.org/show_bug.cgi?id=135020
445         <rdar://problem/17542310>
446
447         Reviewed by Dean Jackson.
448
449        The fullscreen window can "remember" the Space it was part of the first time you enter fullscreen
450        mode. Subsequent fullscreen transitions will always start from this Space, even if you move
451        the WebKit-hosted application to a different Space.
452
453        We can help the display system know when we've moved to a new Space by calling NSWindow's
454        'orderBack' method on the fullscreen window prior to starting the transition to fullscreen mode.
455        This method call hooks the window into the current Space so everything works properly.
456
457         * UIProcess/mac/WKFullScreenWindowController.mm:
458         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): Add the
459         new fullscreen window to the current Space before starting transition to fullscreen.
460
461 2014-07-17  Timothy Hatcher  <timothy@apple.com>
462
463         Make console.profile record to the Timeline.
464
465         https://bugs.webkit.org/show_bug.cgi?id=134643
466
467         Reviewed by Joseph Pecoraro.
468
469         * WebProcess/WebPage/WebInspector.cpp:
470         (WebKit::WebInspector::setJavaScriptProfilingEnabled):
471         (WebKit::WebInspector::startJavaScriptProfiling):
472         (WebKit::WebInspector::stopJavaScriptProfiling):
473
474 2014-07-17  Brady Eidson  <beidson@apple.com>
475
476         Crash in ServicesOverlayController::~ServicesOverlayController.
477         <rdar://problem/17622172> and https://bugs.webkit.org/show_bug.cgi?id=135022
478
479         Reviewed by Tim Horton.
480
481         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
482         (WebKit::ServicesOverlayController::~ServicesOverlayController): Don’t need to uninstall the
483             PageOverlay as it has already been destroyed by this point in WebPage::~WebPage.
484
485 2014-07-17  Tim Horton  <timothy_horton@apple.com>
486
487         Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
488         https://bugs.webkit.org/show_bug.cgi?id=135018
489         <rdar://problem/17615038>
490
491         Reviewed by Simon Fraser.
492
493         * UIProcess/DrawingAreaProxy.h:
494         (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):
495         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
496         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
497         (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):
498         * UIProcess/mac/RemoteLayerTreeHost.h:
499         * UIProcess/mac/RemoteLayerTreeHost.mm:
500         (WebKit::RemoteLayerTreeHost::detachRootLayer):
501         Add a mechanism to "hide" drawing area content until the next commit,
502         by detaching the root layer. RemoteLayerTreeHost will automatically reattach
503         it at the next commit.
504
505         * UIProcess/WebPageProxy.cpp:
506         (WebKit::WebPageProxy::viewStateDidChange):
507         * UIProcess/WebPageProxy.h:
508         Add a parameter to viewStateDidChange specifying whether dispatching the change
509         to the Web process is deferrable or not. We will also automatically use "Immediate" if
510         the view is coming in-window, like we did before.
511
512         * UIProcess/ios/WKContentView.mm:
513         (-[WKContentView _applicationWillEnterForeground:]):
514         Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
515         view state changes when coming into the foreground, and will have removed the root layer
516         if a commit didn't come in while waitForDidUpdateViewState blocks.
517         
518 2014-07-17  Sanghyup Lee  <sh53.lee@samsung.com>
519
520         [EFL][WK2] Add a "focus,notfound" signal.
521         https://bugs.webkit.org/show_bug.cgi?id=134674
522
523         Reviewed by Gyuyoung Kim.
524
525         Add a "focus,notfound" signal to handover focus control to application
526         because there are no elements of webview to focus on the given direction.
527
528         Application can decide to move the focus to next widget of ewk_view or something else
529         by using this signal.
530
531         * UIProcess/API/efl/EwkViewCallbacks.h:
532         * UIProcess/API/efl/ewk_view.h:
533         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Added keyDown and keyUp function.
534         (EWK2UnitTest::EWK2UnitTestBase::waitUntilDirectionChanged):
535         (EWK2UnitTest::EWK2UnitTestBase::keyDown):
536         (EWK2UnitTest::EWK2UnitTestBase::keyUp):
537         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
538         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
539         (EWK2ViewTest::FocusNotFoundCallback):
540         (TEST_F):
541         * UIProcess/efl/PageUIClientEfl.cpp: Removed unnecessary calls to evas_object_focus_set().
542         (WebKit::PageUIClientEfl::takeFocus):
543
544 2014-07-16  Brady Eidson  <beidson@apple.com>
545
546         Reintroduce the SPI _websiteDataURLForContainerWithURL: that was removed in r171160
547         https://bugs.webkit.org/show_bug.cgi?id=134984
548
549         Reviewed by David Kilzer.
550
551         * UIProcess/API/Cocoa/WKProcessPool.mm:
552         (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
553         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
554
555 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
556
557         A test that hangs at cleanup stage confuses webkitpy hugely
558         https://bugs.webkit.org/show_bug.cgi?id=122475
559         <rdar://problem/17184354>
560
561         Reviewed by Anders Carlsson.
562
563         Reset m_pageLoadState when the process exits cleanly - otherwise messages from a
564         new process for the same WebPageProxy would hit assertions.
565
566         * UIProcess/WebPageProxy.cpp:
567         (WebKit::WebPageProxy::processDidCrash):
568         (WebKit::WebPageProxy::resetStateAfterProcessExited):
569
570 2014-07-16  David Kilzer  <ddkilzer@apple.com>
571
572         [iOS] Update order file paths for WebKit and WebKit2
573         <http://webkit.org/b/134993>
574         <rdar://problem/17557776>
575
576         Reviewed by Darin Adler.
577
578         * Configurations/Base.xcconfig: Add order file for iOS
579         named WebKit.order.
580
581 2014-07-16  Brady Eidson  <beidson@apple.com>
582
583         Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
584         <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
585
586         Reviewed by Dan Bernstein.
587
588         Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
589         * UIProcess/API/Cocoa/WKProcessPool.mm:
590         (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
591         (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
592         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
593
594         Add a big shiny comment in a few key places:
595         * DatabaseProcess/DatabaseProcess.cpp:
596         (WebKit::DatabaseProcess::initializeDatabaseProcess):
597         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
598         (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
599         * UIProcess/WebContext.cpp:
600         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
601         (WebKit::WebContext::ensureDatabaseProcess):
602
603 2014-07-16  Enrica Casucci  <enrica@apple.com>
604
605         REGRESSION (iOS WebKit2): Cannot scroll while dragging a selection.
606         https://bugs.webkit.org/show_bug.cgi?id=134992
607         <rdar://problem/17528020>
608
609         Reviewed by Benjamin Poulain.
610
611         This patch exposes the scroller and the visible content rect so that
612         UIKit can implement autoscroll when dragging the selections.
613         It also changes that way we do hit testing to allow hit test outside
614         the clipping region and fixes the way we compute the selection rectangle
615         for the block selection, ensuring that we consider also non text elements
616         like images.
617
618         * UIProcess/ios/WKContentViewInteraction.mm:
619         (-[WKContentView scroller]):
620         (-[WKContentView visibleRect]):
621         * WebProcess/WebPage/ios/WebPageIOS.mm:
622         (WebKit::selectionBoxForRange):
623         (WebKit::WebPage::rangeForWebSelectionAtPosition):
624         (WebKit::WebPage::rangeForBlockAtPoint):
625         (WebKit::WebPage::expandedRangeFromHandle):
626         (WebKit::WebPage::contractedRangeFromHandle):
627         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
628         (WebKit::WebPage::changeBlockSelection):
629
630 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
631
632         <rdar://problem/17669097> REGRESSION (r170155): Sandbox violations using a wrong
633         CFNetwork cache path in WebContent process
634
635         Rubber-stamped by Sam Weinig.
636
637         Before r170155, we incorrectly checked usesNetworkProcess(), which always returns
638         false at this point in initialization sequence. But we did the right thing, as we
639         always need to set the cache path, even when network process is used for most loading.
640
641         * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess):
642
643 2014-07-16  Timothy Horton  <timothy_horton@apple.com>
644
645         Dispatch top content inset changes immediately if synchronously waiting for view state changes
646         ​https://bugs.webkit.org/show_bug.cgi?id=134942
647         <rdar://problem/17666800>
648
649         Reviewed by Simon Fraser.
650
651         * UIProcess/API/mac/WKView.mm:
652         (-[WKView _dispatchSetTopContentInset]):
653         (-[WKView _setTopContentInset:]):
654         Move the check from _setTopContentInset: to _dispatchSetTopContentInset
655         that ensures that we only send the message if the top content inset changed.
656
657 2014-07-16  Benjamin Poulain  <bpoulain@apple.com>
658
659         [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit
660         https://bugs.webkit.org/show_bug.cgi?id=134965
661         Related to <rdar://problem/17082607>
662
663         Reviewed by Tim Horton.
664
665         Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied
666         to the page at the new size during the transition.
667
668         Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform
669         can be applied to the wrong set of tiles.
670         This is mostly a problem for unresponsive WebProcess or when the synchronization is done
671         immediately.
672
673         There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate()
674         completely fails to get the new page, the UIProcess is in a somewhat messy state.
675         I will look into that separately than the layer tree synchronization.
676
677         * UIProcess/API/Cocoa/WKWebView.mm:
678         (-[WKWebView _didCommitLayerTree:]):
679         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
680         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted.
681         * UIProcess/API/Cocoa/WKWebViewInternal.h:
682         * UIProcess/PageClient.h:
683         * UIProcess/WebPageProxy.cpp:
684         (WebKit::WebPageProxy::WebPageProxy):
685         (WebKit::WebPageProxy::resetState):
686         * UIProcess/WebPageProxy.h:
687         * UIProcess/ios/PageClientImplIOS.h:
688         * UIProcess/ios/PageClientImplIOS.mm:
689         (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
690         * UIProcess/ios/WebPageProxyIOS.mm:
691         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
692         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
693         (WebKit::WebPageProxy::didCommitLayerTree):
694         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
695         * WebProcess/WebPage/WebPage.cpp:
696         (WebKit::WebPage::WebPage):
697         (WebKit::WebPage::didCommitLoad):
698         * WebProcess/WebPage/WebPage.h:
699         * WebProcess/WebPage/WebPage.messages.in:
700         * WebProcess/WebPage/ios/WebPageIOS.mm:
701         (WebKit::WebPage::synchronizeDynamicViewportUpdate):
702         (WebKit::WebPage::updateVisibleContentRects):
703         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
704         (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID):
705         (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted.
706
707 2014-07-16  Dan Bernstein  <mitz@apple.com>
708
709         REGRESSION (r170653): Web Content service’s Info.plist has wrong format
710         https://bugs.webkit.org/show_bug.cgi?id=134973
711
712         Reviewed by Alexey Proskuryakov.
713
714         * WebKit2.xcodeproj/project.pbxproj: Updated the Add CFBundle Localization Info.plist Key
715         script build phases to convert Info.plist back to binary format if the
716         PLIST_FILE_OUTPUT_FORMAT build setting requires it.
717
718 2014-07-15  Benjamin Poulain  <bpoulain@apple.com>
719
720         Fix r171124
721
722         * UIProcess/API/Cocoa/WKWebView.mm:
723         (-[WKWebView _scrollToContentOffset:]):
724         On landing, I changed the min/max branches to shrunkTo/expandedTo, but the return value
725         of those was ignored.
726
727 2014-07-15  Dan Bernstein  <mitz@apple.com>
728
729         WKWebView’s FormClient::willSubmitForm should use CompletionHandlerCallChecker
730         https://bugs.webkit.org/show_bug.cgi?id=134951
731
732         Reviewed by Tim Horton.
733
734         * UIProcess/API/Cocoa/WKWebView.mm:
735         (-[WKWebView _setFormDelegate:]):
736
737 2014-07-15  Benjamin Poulain  <benjamin@webkit.org>
738
739         [iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document
740         https://bugs.webkit.org/show_bug.cgi?id=134952
741         <rdar://problem/17647116>
742
743         Reviewed by Enrica Casucci.
744
745         When we received a scroll request, we were taking that offset directly to set the UIScrollView
746         scroll position. This is a problem if a page request scrolling to an invalid position, we were
747         still doing it.
748
749         This patch limits the position to be inside the document.
750
751         -- Why not limit the scroll offset in the WebProcess when we receive the scroll request? --
752
753         Some pages rely on the page scale factor changing instantly, because that is how it worked
754         on WebKit1.
755
756         On WebKit2, the WebProcess cannot know the valid range because the obscured insets are changing
757         dynamically, and the page scale factor can change in response to WebProcess events (the focus
758         changing for example). To make the page works, the WebProcess does not restrict the scroll position.
759
760         In that architecture, the UIProcess has to sanitize the input, which was not done before this patch.
761
762         -- Why not use changeContentOffsetBoundedInValidRange()?
763
764         The scroll offset as seen by the page is relative to the unobscured rect. While the position used
765         for history item is a visual position. All we need in this case is a position in the view.
766
767         * UIProcess/API/Cocoa/WKWebView.mm:
768         (-[WKWebView _scrollToContentOffset:]):
769         * UIProcess/WebPageProxy.h:
770         * UIProcess/ios/WebPageProxyIOS.mm:
771         (WebKit::WebPageProxy::resendLastVisibleContentRects):
772
773 2014-07-15  Timothy Horton  <timothy_horton@apple.com>
774
775         Dispatch top content inset changes immediately if synchronously waiting for view state changes
776         https://bugs.webkit.org/show_bug.cgi?id=134942
777         <rdar://problem/17666800>
778
779         Reviewed by Simon Fraser.
780
781         * UIProcess/API/mac/WKView.mm:
782         (-[WKView endDeferringViewInWindowChanges]):
783         (-[WKView endDeferringViewInWindowChangesSync]):
784         (-[WKView _dispatchSetTopContentInset]):
785         (-[WKView _setTopContentInset:]):
786         Send top content inset changes immediately before sync-waiting for new tiles from the Web Process.
787         This will ensure that the incoming contents have the right top content inset, and we don't
788         flash between the wrong inset and the right one.
789
790 2014-07-15  Enrica Casucci  <enrica@apple.com>
791
792         REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key.
793         https://bugs.webkit.org/show_bug.cgi?id=134934
794         <rdar://problem/17224638>
795
796         Reviewed by Tim Horton.
797
798         * UIProcess/ios/WKContentViewInteraction.mm:
799         
800         Tab and back tab should be handled as special keys that have
801         a command associated. The command specifies for each key the relevant
802         action. This patch implements the commands property to create the association
803         between key and command and the relevant actions that will execute the same
804         code executed when the used taps on the < > buttons in the accessory bar.
805         
806         (-[WKContentView keyCommands]):
807         (-[WKContentView _nextAccessoryTab:]):
808         (-[WKContentView _prevAccessoryTab:]):
809
810 2014-07-15  Oliver Hunt  <oliver@apple.com>
811
812         More tidying of the webcontent sandbox profile
813         https://bugs.webkit.org/show_bug.cgi?id=134938
814
815         Reviewed by Alexey Proskuryakov.
816
817         Remove some excessive abilities from the profile and make
818         the required ones explicit.
819
820         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
821
822 2014-07-14  Andreas Kling  <akling@apple.com>
823
824         [iOS] Don't progressively re-render tiles while pinch-zooming under memory pressure.
825         <https://webkit.org/b/134915>
826
827         When we're under memory pressure, the last thing we want to be doing is
828         creating gratuitous new IOSurfaces. Just wait for the gesture to end before
829         rendering at the new scale.
830
831         Reviewed by Tim Horton.
832
833         * WebProcess/WebPage/ios/WebPageIOS.mm:
834         (WebKit::WebPage::updateVisibleContentRects):
835
836 2014-07-14  Joseph Pecoraro  <pecoraro@apple.com>
837
838         [Cocoa] _WKRemoteObjectInterface leaks NSString ivar
839         https://bugs.webkit.org/show_bug.cgi?id=134914
840
841         Reviewed by Simon Fraser.
842
843         Release our copied NSString in dealloc.
844
845         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
846         (-[_WKRemoteObjectInterface dealloc]):
847
848 2014-07-14  Dean Jackson  <dino@apple.com>
849
850         [PlugIns] Check for a non-null snapshot image before trying to decode it
851         https://bugs.webkit.org/show_bug.cgi?id=134913
852         <rdar://problem/17606033>
853
854         Reviewed by Tim Horton.
855
856         Changeset r169820 introduced a bug where we could examine the pixels of
857         an image (looking for solid colors) before checking if the image actually
858         existed.
859
860         I added a null check, and moved the code around a bit to avoid checking
861         for existence three times.
862
863         * WebProcess/Plugins/PluginView.cpp:
864         (WebKit::PluginView::pluginSnapshotTimerFired): Check that snapshotImage exists
865         before trying to look at it.
866
867 2014-07-14  Anders Carlsson  <andersca@apple.com>
868
869         Fix 32-bit build.
870
871         * UIProcess/Cocoa/SessionStateCoding.mm:
872         (WebKit::encodeSessionState):
873
874 2014-07-14  Anders Carlsson  <andersca@apple.com>
875
876         Use the legacy session coder for encoding/decoding session state
877         https://bugs.webkit.org/show_bug.cgi?id=134910
878
879         Reviewed by Beth Dakin.
880
881         * UIProcess/Cocoa/SessionStateCoding.mm:
882         (WebKit::encodeSessionState):
883         (WebKit::decodeSessionState):
884
885 2014-07-14  Oliver Hunt  <oliver@apple.com>
886
887         Restrict network process to remote connections
888         https://bugs.webkit.org/show_bug.cgi?id=134908
889
890         Reviewed by Geoffrey Garen.
891
892         Further restrict network client
893
894         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
895
896 2014-07-14  Tim Horton  <timothy_horton@apple.com>
897
898         ASSERT(isMainThread()) under OneShotDisplayLinkHandler
899         https://bugs.webkit.org/show_bug.cgi?id=134900
900
901         Reviewed by Simon Fraser.
902
903         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
904         (-[OneShotDisplayLinkHandler displayLinkFired:]):
905         isMainThread means the Web thread sometimes.
906
907 2014-07-14  Tim Horton  <timothy_horton@apple.com>
908
909         Fix the build.
910
911         * UIProcess/API/Cocoa/WKWebView.mm:
912         (-[WKWebView _frameOrBoundsChanged]):
913         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
914         * UIProcess/API/ios/WKViewIOS.mm:
915         (-[WKView _frameOrBoundsChanged]):
916
917 2014-07-14  Carlos Alberto Lopez Perez  <clopez@igalia.com>
918
919         [UNIX] Log error description when failing to create shared memory file.
920         https://bugs.webkit.org/show_bug.cgi?id=134892
921
922         Reviewed by Darin Adler.
923
924         * Platform/unix/SharedMemoryUnix.cpp:
925         (WebKit::SharedMemory::create): Print the string describing the error number (errno).
926
927 2014-07-14  Benjamin Poulain  <benjamin@webkit.org>
928
929         [iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
930         https://bugs.webkit.org/show_bug.cgi?id=134875
931
932         Reviewed by Tim Horton.
933
934         On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
935         changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
936         at the wrong orientation.
937
938         This patch fixes the issue by making a special case for animated resize:
939         -While starting animated resize, _frameOrBoundsChanged can be called several times in response to
940          the API's client changing the WKWebView. In that case, we do not update the drawing area.
941         -After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
942          is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
943          DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
944          order, and the updateGeometry() is always done after the viewport configuration has been updated.
945
946         * UIProcess/API/Cocoa/WKWebView.mm:
947         (-[WKWebView _frameOrBoundsChanged]):
948         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
949         * UIProcess/ios/WKContentView.h:
950         * UIProcess/ios/WKContentView.mm:
951         (-[WKContentView setMinimumSize:]): Deleted.
952
953 2014-07-14  Benjamin Poulain  <bpoulain@apple.com>
954
955         [iOS][WK2] Fix withinEpsilon()
956         https://bugs.webkit.org/show_bug.cgi?id=134798
957
958         Reviewed by Darin Adler.
959
960         Move the function back to WKWebView, it is no longer needed in WKContentView.
961
962         Use the real types as input to properly verify that the two inputs are within
963         a small value of the 32bit floating point.
964
965         The epsilon we use is always on 32 bits float because we want to avoid doing work for changes
966         that would not make any difference on float.
967
968         The source of those small changes comes from the fact UIProcess does a lot of processing
969         on CGFloat, which are double on 64bits architecture, while the WebProcess use 32bits floating point
970         for scale. When we are getting updates from the WebProcess, we should ignore any small differences
971         caused by the computations done with less precision.
972
973         * UIProcess/API/Cocoa/WKWebView.mm:
974         (withinEpsilon):
975         * UIProcess/ios/WKContentViewInteraction.h:
976         (withinEpsilon): Deleted.
977
978 2014-07-14  Bear Travis  <betravis@adobe.com>
979
980         [Feature Queries] Enable Feature Queries on Mac
981         https://bugs.webkit.org/show_bug.cgi?id=134404
982
983         Reviewed by Antti Koivisto.
984
985         Enable Feature Queries on Mac and resume running the
986         feature tests.
987
988         * Configurations/FeatureDefines.xcconfig: Turn on
989         ENABLE_CSS3_CONDITIONAL_RULES.
990
991 2014-07-14  Anders Carlsson  <andersca@apple.com>
992
993         Make shouldKeepCurrentBackForwardListItemInList part of WKPageLoaderClientV5 to avoid breaking ABI
994         https://bugs.webkit.org/show_bug.cgi?id=134889
995
996         Reviewed by Beth Dakin.
997
998         * UIProcess/API/C/WKPage.cpp:
999         * UIProcess/API/C/WKPageLoaderClient.h:
1000
1001 2014-07-14  Dan Bernstein  <mitz@apple.com>
1002
1003         REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordNavigationSnapshot
1004         https://bugs.webkit.org/show_bug.cgi?id=134887
1005
1006         Reviewed by Tim Horton.
1007
1008         * UIProcess/mac/PageClientImpl.mm:
1009         (WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when
1010         the client is using WKView directly.
1011         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1012         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1013         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
1014
1015 2014-07-14  Eric Carlson  <eric.carlson@apple.com>
1016
1017         [Mac] don't enable low power audio mode on external output devices
1018         https://bugs.webkit.org/show_bug.cgi?id=134877
1019
1020         Reviewed by Sam Weinig.
1021
1022         * PluginProcess/PluginProcess.h: Add an empty implementation of 
1023             AudioHardwareListener::audioOutputDeviceChanged.
1024
1025 2014-07-14  Tim Horton  <timothy_horton@apple.com>
1026
1027         [iOS] Throttle painting using a UI-process-side CADisplayLink
1028         https://bugs.webkit.org/show_bug.cgi?id=134879
1029         <rdar://problem/17641699>
1030
1031         Reviewed by Simon Fraser.
1032
1033         Just waiting for CA to commit is insufficient to actually throttle to 60fps,
1034         because nothing will block the main runloop from spinning.
1035
1036         Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess
1037         the first time it fires after we commit. This is not a guarantee that
1038         our content is on the screen, but we don't have any way to make that guarantee yet.
1039
1040         This will throttle painting, rAF, etc. to the display refresh rate.
1041
1042         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1043         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1044         (-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
1045         (-[OneShotDisplayLinkHandler dealloc]):
1046         (-[OneShotDisplayLinkHandler displayLinkFired:]):
1047         (-[OneShotDisplayLinkHandler invalidate]):
1048         (-[OneShotDisplayLinkHandler schedule]):
1049         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1050         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
1051         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1052         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1053         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
1054
1055 2014-07-14  Dan Bernstein  <mitz@apple.com>
1056
1057         <rdar://problem/17657391> [iOS] Networking process writes persistent credentials to the keychain
1058         https://bugs.webkit.org/show_bug.cgi?id=134878
1059
1060         Reviewed by Sam Weinig.
1061
1062         Route CFNetwork’s calls to Security API through to the UI process.
1063
1064         * NetworkProcess/ios/NetworkProcessIOS.mm:
1065         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Initialize SecItemShim.
1066
1067         * Shared/mac/SecItemShim.cpp:
1068         (WebKit::SecItemShim::initialize): On iOS, rather than using a shim library, supply
1069         CFNetwork with alternate functions to call.
1070
1071         * Shared/mac/SecItemShim.messages.in: Removed #if !PLATFORM(IOS).
1072         * UIProcess/mac/SecItemShimProxy.messages.in: Ditto.
1073
1074         * config.h: Define ENABLE_SEC_ITEM_SHIM to 1 on iOS as well.
1075
1076 2014-07-14  Dan Bernstein  <mitz@apple.com>
1077
1078         <rdar://problem/17398060> NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
1079         https://bugs.webkit.org/show_bug.cgi?id=134666
1080
1081         Reviewed by Tim Horton.
1082
1083         A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
1084         by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
1085         unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
1086         only decoding fails, in this case silently, simply not delivering the
1087         SecItemShim::secItemResponse message.
1088
1089         The fix is to teach ArgumentCodersCF about SecAccessControlRef.
1090
1091         * Shared/cf/ArgumentCodersCF.cpp:
1092         (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
1093         (IPC::encode): Encode the SecAccessControl serialized into CFData.
1094         (IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
1095         * Shared/cf/ArgumentCodersCF.h:
1096         * config.h: Defined HAVE_SEC_ACCESS_CONTROL.
1097
1098 2014-07-13  Dan Bernstein  <mitz@apple.com>
1099
1100         <rdar://problem/17295636> [Cocoa] Include element snapshot in _WKActivatedElementInfo
1101         https://bugs.webkit.org/show_bug.cgi?id=134872
1102
1103         Reviewed by Sam Weinig.
1104
1105         * Shared/InteractionInformationAtPosition.cpp:
1106         (WebKit::InteractionInformationAtPosition::encode): Encode the image if there is one.
1107         (WebKit::InteractionInformationAtPosition::decode): Decode the image if there is one.
1108         * Shared/InteractionInformationAtPosition.h: Added an image member to the struct.
1109
1110         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Exposed the boundingRect property and added
1111         an image property.
1112         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1113         (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Added an image
1114         parameter, which is stored in a new ivar.
1115         (-[_WKActivatedElementInfo image]): Added this getter, which converts the ShareableBitmap
1116         into a cached Cocoa image and returns it.
1117         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added image parameter to the
1118         initializer, removed _boundingRect property declaration from here.
1119
1120         * UIProcess/ios/WKActionSheetAssistant.mm:
1121         (-[WKActionSheetAssistant showImageSheet]): Pass the image from the position information
1122         into the _WKActivatedElementInfo initializer.
1123         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
1124
1125         * WebProcess/WebPage/WebPage.cpp:
1126         (WebKit::WebPage::snapshotNode): Added.
1127         * WebProcess/WebPage/WebPage.h:
1128
1129         * WebProcess/WebPage/ios/WebPageIOS.mm:
1130         (WebKit::WebPage::getPositionInformation): If the element is a link or an image, store a
1131         snapshot of it in the image member of the InteractionInformationAtPosition.
1132
1133 2014-07-13  Dan Bernstein  <mitz@apple.com>
1134
1135         [Cocoa] Clean up session state API a little
1136         https://bugs.webkit.org/show_bug.cgi?id=134871
1137
1138         Reviewed by Darin Adler.
1139
1140         * UIProcess/API/Cocoa/WKWebView.mm:
1141         (-[WKWebView _sessionState]):
1142         (-[WKWebView _restoreFromSessionState:]): Deleted.
1143         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1144
1145 2014-07-13  Javier Fernandez  <jfernandez@igalia.com>
1146
1147         REGRESSION(r171045) [GTK] Build broken.
1148         https://bugs.webkit.org/show_bug.cgi?id=134867
1149
1150         Unreviewed GTK build fix after r171045.
1151
1152         * UIProcess/API/gtk/PageClientImpl.cpp:
1153         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
1154         * UIProcess/API/gtk/PageClientImpl.h:
1155
1156 2014-07-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1157
1158         Unreviewed, EFL build fix since r171045.
1159
1160         * UIProcess/CoordinatedGraphics/WebView.h:
1161
1162 2014-07-12  Dan Bernstein  <mitz@apple.com>
1163
1164         [Cocoa] Notify the client when a navigation snapshot is taken
1165         https://bugs.webkit.org/show_bug.cgi?id=134865
1166
1167         Reviewed by Sam Weinig.
1168
1169         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
1170
1171         * UIProcess/Cocoa/NavigationState.h:
1172         * UIProcess/Cocoa/NavigationState.mm:
1173         (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in
1174         m_navigationDelegateMethods.
1175         (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new
1176         WKNavigationDelegate method.
1177
1178         * UIProcess/PageClient.h: Declared new client function.
1179
1180         * UIProcess/WebPageProxy.cpp:
1181         (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function.
1182         * UIProcess/WebPageProxy.h:
1183
1184         * UIProcess/ios/PageClientImplIOS.h:
1185         * UIProcess/ios/PageClientImplIOS.mm:
1186         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls
1187         NavigationState::willRecordNavigationSnapshot.
1188
1189         * UIProcess/mac/PageClientImpl.h:
1190         * UIProcess/mac/PageClientImpl.mm:
1191         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
1192
1193         * UIProcess/mac/ViewSnapshotStore.mm:
1194         (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to
1195         WebPageProxy::willRecordNavigationSnapshot.
1196
1197 2014-07-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1198
1199         Unreviewed, fix EFL build break since r171034.
1200
1201         * UIProcess/CoordinatedGraphics/WebView.h:
1202         * UIProcess/efl/WebContextEfl.cpp:
1203         (WebKit::WebContext::platformMediaCacheDirectory):
1204
1205 2014-07-12  Darin Adler  <darin@apple.com>
1206
1207         Try to fix 32-bit Mac build.
1208
1209         * UIProcess/mac/PageClientImpl.mm:
1210         (WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional.
1211         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1212         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1213
1214 2014-07-12  Javier Fernandez  <jfernandez@igalia.com>
1215
1216         REGRESSION(r171034) [GTK] Build broken.
1217         https://bugs.webkit.org/show_bug.cgi?id=134861
1218
1219         Unreviewed GTK build fix.
1220
1221         * UIProcess/API/gtk/PageClientImpl.cpp:
1222         (WebKit::PageClientImpl::navigationGestureDidBegin):
1223         (WebKit::PageClientImpl::navigationGestureWillEnd):
1224         (WebKit::PageClientImpl::navigationGestureDidEnd):
1225         * UIProcess/API/gtk/PageClientImpl.h:
1226
1227 2014-07-12  Javier Fernandez  <jfernandez@igalia.com>
1228
1229         REGRESSION(r171024) [GTK] Build broken.
1230         https://bugs.webkit.org/show_bug.cgi?id=134859
1231
1232         Unreviewed GTK build fix.
1233
1234         * UIProcess/gtk/WebContextGtk.cpp:
1235         (WebKit::WebContext::platformMediaCacheDirectory):
1236
1237 2014-07-12  Dan Bernstein  <mitz@apple.com>
1238
1239         <rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation gestures begin and end
1240         https://bugs.webkit.org/show_bug.cgi?id=134853
1241
1242         Reviewed by Sam Weinig.
1243
1244         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate
1245         methods.
1246
1247         * UIProcess/API/Cocoa/WKWebView.mm:
1248         (-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter.
1249
1250         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property
1251         _isShowingNavigationGestureSnapshot.
1252
1253         * UIProcess/Cocoa/NavigationState.h:
1254         * UIProcess/Cocoa/NavigationState.mm:
1255         (WebKit::NavigationState::setNavigationDelegate): Initialize new flags in
1256         m_navigationDelegateMethods.
1257         (WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new
1258         WKNavigationDelegate method.
1259         (WebKit::NavigationState::navigationGestureWillEnd): Ditto.
1260         (WebKit::NavigationState::navigationGestureDidEnd): Ditto.
1261
1262         * UIProcess/PageClient.h: Declared new client functions.
1263
1264         * UIProcess/WebPageProxy.cpp:
1265         (WebKit::WebPageProxy::WebPageProxy): Initialize new member variable.
1266         (WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot
1267         and call the new client function.
1268         (WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function.
1269         (WebKit::WebPageProxy::navigationGestureDidEnd): Ditto.
1270         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear
1271         m_isShowingNavigationGestureSnapshot.
1272         * UIProcess/WebPageProxy.h:
1273         (WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter.
1274
1275         * UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions.
1276         * UIProcess/ios/PageClientImplIOS.mm:
1277         (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
1278         NavigationState function.
1279         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1280         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1281
1282         * UIProcess/ios/ViewGestureControllerIOS.mm:
1283         (WebKit::ViewGestureController::beginSwipeGesture): Added calls to
1284         WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd.
1285         (WebKit::ViewGestureController::endSwipeGesture): Added calls to
1286         WebPageProxy::navigationGestureDidEnd.
1287         (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
1288         WebPageProxy::navigationGestureSnapshotWasRemoved.
1289
1290         * UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions.
1291         * UIProcess/mac/PageClientImpl.mm:
1292         (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
1293         NavigationState function.
1294         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1295         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1296
1297         * UIProcess/mac/ViewGestureControllerMac.mm:
1298         (WebKit::ViewGestureController::beginSwipeGesture): Added call to
1299         WebPageProxy::navigationGestureDidBegin.
1300         (WebKit::ViewGestureController::endSwipeGesture): Added calls to
1301         WebPageProxy::navigationGestureDidEnd.
1302         (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
1303         WebPageProxy::navigationGestureSnapshotWasRemoved.
1304
1305 2014-07-12  Oliver Hunt  <oliver@apple.com>
1306
1307         Fix typo in prior patch
1308         https://bugs.webkit.org/show_bug.cgi?id=134858
1309
1310         Reviewed by Sam Weinig.
1311
1312         Fix typo
1313
1314         * UIProcess/mac/WebContextMac.mm:
1315         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1316
1317 2014-07-12  Dan Bernstein  <mitz@apple.com>
1318
1319         [Cocoa] Client is not notified of same-document navigations
1320         https://bugs.webkit.org/show_bug.cgi?id=134855
1321
1322         Reviewed by Sam Weinig.
1323
1324         * UIProcess/API/APILoaderClient.h:
1325         (API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter.
1326
1327         * UIProcess/API/C/WKPage.cpp:
1328         (WKPageSetPageLoaderClient): Ditto.
1329
1330         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method.
1331
1332         * UIProcess/Cocoa/NavigationState.h: Declare override of
1333         API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in
1334         m_navigationDelegateMethods struct.
1335         * UIProcess/Cocoa/NavigationState.mm:
1336         (WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods
1337         flag.
1338         (WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API
1339         values.
1340         (WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call
1341         the delegate method, if implemented.
1342
1343         * UIProcess/WebPageProxy.cpp:
1344         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter,
1345         which is forwarded to the client.
1346         * UIProcess/WebPageProxy.h: Added navigationID parameter.
1347         * UIProcess/WebPageProxy.messages.in: Ditto.
1348
1349         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1350         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID.
1351         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto.
1352         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto.
1353         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto.
1354
1355 2014-07-12  Oliver Hunt  <oliver@apple.com>
1356
1357         Extend WebContent sandbox to allow some extra access for frameworks
1358         https://bugs.webkit.org/show_bug.cgi?id=134844
1359
1360         Reviewed by Sam Weinig.
1361
1362         Open up the webcontent sandbox a bit so that some external frameworks
1363         can work correctly.
1364
1365         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1366         * Shared/WebProcessCreationParameters.cpp:
1367         (WebKit::WebProcessCreationParameters::encode):
1368         (WebKit::WebProcessCreationParameters::decode):
1369         * Shared/WebProcessCreationParameters.h:
1370         * UIProcess/WebContext.cpp:
1371         (WebKit::WebContext::createNewWebProcess):
1372         (WebKit::WebContext::mediaCacheDirectory):
1373         * UIProcess/WebContext.h:
1374         * UIProcess/mac/WebContextMac.mm:
1375         (WebKit::WebContext::platformMediaCacheDirectory):
1376         * WebProcess/cocoa/WebProcessCocoa.mm:
1377         (WebKit::WebProcess::platformInitializeWebProcess):
1378
1379 2014-07-12  Oliver Hunt  <oliver@apple.com>
1380
1381         Temporary work around for <rdar://<rdar://problem/17513375>
1382         https://bugs.webkit.org/show_bug.cgi?id=134848
1383
1384         Reviewed by Sam Weinig.
1385
1386         Temporarily work around <rdar://<rdar://problem/17513375> by
1387         dropping the explicit cookie storage if it points out of the
1388         container.
1389
1390         * UIProcess/mac/WebContextMac.mm:
1391         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1392
1393 2014-07-11  Enrica Casucci  <enrica@apple.com>
1394
1395         Implement textStylingAtPosition in WK2.
1396         https://bugs.webkit.org/show_bug.cgi?id=134843
1397         <rdar://problem/17614981>
1398
1399         Reviewed by Benjamin Poulain.
1400
1401         Adding information about typing attributes to EditorState so
1402         that we can implement textStylingAtPosition.
1403
1404         * Shared/EditorState.cpp:
1405         (WebKit::EditorState::encode):
1406         (WebKit::EditorState::decode):
1407         * Shared/EditorState.h:
1408         (WebKit::EditorState::EditorState):
1409         * UIProcess/ios/WKContentViewInteraction.mm:
1410         (-[WKContentView textStylingAtPosition:inDirection:]):
1411         (-[WKContentView canPerformAction:withSender:]):
1412         (-[WKContentView toggleBoldface:]):
1413         (-[WKContentView toggleItalics:]):
1414         (-[WKContentView toggleUnderline:]):
1415         * WebProcess/WebPage/WebPage.cpp:
1416         (WebKit::WebPage::editorState):
1417
1418 2014-07-11  Oliver Hunt  <oliver@apple.com>
1419
1420         Tighten WebContent sandbox
1421         https://bugs.webkit.org/show_bug.cgi?id=134834
1422
1423         Reviewed by Sam Weinig.
1424
1425         Define a much tighter sandbox profile for the WebContent process
1426
1427         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1428
1429 2014-07-11  Antti Koivisto  <antti@apple.com>
1430
1431         REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F
1432         https://bugs.webkit.org/show_bug.cgi?id=134833
1433         <rdar://problem/17580021>
1434
1435         Reviewed by Zalan Bujtas.
1436         
1437         Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac.
1438
1439         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1440         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1441
1442 2014-07-11  Zalan Bujtas  <zalan@apple.com>
1443
1444         Subpixel layout: return integral results for offset*, client*, scroll* by default.
1445         https://bugs.webkit.org/show_bug.cgi?id=134651
1446
1447         Reviewed by Simon Fraser.
1448
1449         Revert to returning integral values for Element.offset* client* scroll* by default.
1450         Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
1451
1452         Since snapped dimension depends on both the original point and the width/height of the box,
1453         we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
1454
1455         Covered by existing tests
1456
1457         * Shared/WebPreferencesDefinitions.h:
1458         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1459
1460 2014-07-10  Jinwoo Song  <jinwoo7.song@samsung.com>
1461
1462         Unreviewed EFL build fix after r170970.
1463
1464         * UIProcess/efl/WebContextEfl.cpp:
1465         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1466
1467 2014-07-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1468
1469         REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
1470         https://bugs.webkit.org/show_bug.cgi?id=134825
1471
1472         Unreviewed GTK build fix.
1473
1474         * Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port.
1475         * Shared/WebBackForwardListItem.h: Idem.
1476         * UIProcess/gtk/WebContextGtk.cpp:
1477         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton.
1478
1479 2014-07-10  Benjamin Poulain  <bpoulain@apple.com>
1480
1481         [iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times
1482         https://bugs.webkit.org/show_bug.cgi?id=134820
1483
1484         Reviewed by Andreas Kling.
1485
1486         If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash,
1487         once on dealloc.
1488
1489         The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe
1490         to remove the observer if we are not already observing on that view.
1491
1492         To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup
1493         are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because
1494         the view is already nil.
1495
1496         * UIProcess/ios/WKContentViewInteraction.mm:
1497         (-[WKContentView setupInteraction]):
1498         (-[WKContentView cleanupInteraction]):
1499
1500 2014-07-10  Simon Fraser  <simon.fraser@apple.com>
1501
1502         [iOS WK2] Move WKInspectorHighlightView to its own file
1503         https://bugs.webkit.org/show_bug.cgi?id=134819
1504
1505         Reviewed by Joseph Pecoraro.
1506         
1507         WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm,
1508         so move it into its own file.
1509
1510         * UIProcess/WKInspectorHighlightView.h: Added.
1511         * UIProcess/WKInspectorHighlightView.mm: Added.
1512         (-[WKInspectorHighlightView dealloc]):
1513         (-[WKInspectorHighlightView _removeAllLayers]):
1514         (-[WKInspectorHighlightView _createLayers:]):
1515         (findIntersectionOnLineBetweenPoints):
1516         (quadIntersection):
1517         (layerPathWithHole):
1518         (layerPath):
1519         (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
1520         (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
1521         (-[WKInspectorHighlightView update:]):
1522         * UIProcess/ios/WKContentView.mm:
1523         (-[WKInspectorHighlightView initWithFrame:]): Deleted.
1524         (-[WKInspectorHighlightView dealloc]): Deleted.
1525         (-[WKInspectorHighlightView _removeAllLayers]): Deleted.
1526         (-[WKInspectorHighlightView _createLayers:]): Deleted.
1527         (findIntersectionOnLineBetweenPoints): Deleted.
1528         (quadIntersection): Deleted.
1529         (layerPathWithHole): Deleted.
1530         (layerPath): Deleted.
1531         (-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted.
1532         (-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted.
1533         (-[WKInspectorHighlightView update:]): Deleted.
1534         * WebKit2.xcodeproj/project.pbxproj:
1535
1536 2014-07-10  Tim Horton  <timothy_horton@apple.com>
1537
1538         REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit
1539         https://bugs.webkit.org/show_bug.cgi?id=134818
1540         <rdar://problem/17632468>
1541
1542         Reviewed by Anders Carlsson.
1543
1544         * UIProcess/API/Cocoa/WKWebView.mm:
1545         (scrollViewBackgroundColor):
1546         r170935 made it so that we would initialize the scroll view background color to an
1547         invalid color until the first layer tree commit. We should go with white instead.
1548
1549 2014-07-10  Enrica Casucci  <enrica@apple.com>
1550
1551         Add a mechanism to notify the UIProcess when an editing command is done executing.
1552         https://bugs.webkit.org/show_bug.cgi?id=134807
1553
1554         Reviewed by Tim Horton.
1555
1556         Some editing commands have an effect on some parts of the system that
1557         run inside the UIProcess. A good example are the cursor movement commands
1558         that require an update of the autocorrection/autosuggestion machinery.
1559         This patch adds a way to reliably know when the command has been executed
1560         in the WebProcess. A previous attempt at solving this problem was added in
1561         r170858 and was partially reverted in r170948.
1562         The change also removes the selectionWillChange notification added in r170858.
1563
1564         * UIProcess/PageClient.h:
1565         * UIProcess/WebPageProxy.cpp:
1566         (WebKit::WebPageProxy::editorStateChanged):
1567         * UIProcess/WebPageProxy.h:
1568         * UIProcess/ios/PageClientImplIOS.h:
1569         * UIProcess/ios/PageClientImplIOS.mm:
1570         (WebKit::PageClientImpl::selectionWillChange): Deleted.
1571         * UIProcess/ios/WKContentViewInteraction.h:
1572         * UIProcess/ios/WKContentViewInteraction.mm:
1573         (-[WKContentView executeEditCommandWithCallback:]):
1574         (-[WKContentView _moveUp:withHistory:]):
1575         (-[WKContentView _moveDown:withHistory:]):
1576         (-[WKContentView _moveLeft:withHistory:]):
1577         (-[WKContentView _moveRight:withHistory:]):
1578         (-[WKContentView _moveToStartOfWord:withHistory:]):
1579         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
1580         (-[WKContentView _moveToStartOfLine:withHistory:]):
1581         (-[WKContentView _moveToStartOfDocument:withHistory:]):
1582         (-[WKContentView _moveToEndOfWord:withHistory:]):
1583         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
1584         (-[WKContentView _moveToEndOfLine:withHistory:]):
1585         (-[WKContentView _moveToEndOfDocument:withHistory:]):
1586         (-[WKContentView _selectionWillChange]): Deleted.
1587         * UIProcess/ios/WebPageProxyIOS.mm:
1588         (WebKit::WebPageProxy::executeEditCommand):
1589         (WebKit::WebPageProxy::notifySelectionWillChange): Deleted.
1590         * WebProcess/WebPage/WebPage.h:
1591         * WebProcess/WebPage/WebPage.messages.in:
1592         * WebProcess/WebPage/ios/WebPageIOS.mm:
1593         (WebKit::WebPage::executeEditCommandWithCallback):
1594
1595 2014-07-10  Joseph Pecoraro  <pecoraro@apple.com>
1596
1597         [Mac] NSWindow warning: adding an unknown subview opening detached Inspector
1598         https://bugs.webkit.org/show_bug.cgi?id=134813
1599
1600         Reviewed by Timothy Hatcher.
1601
1602         * UIProcess/mac/WebInspectorProxyMac.mm:
1603         (WebKit::WebInspectorProxy::createInspectorWindow):
1604         Use a selector that will avoid the warning message.
1605
1606 2014-07-10  Oliver Hunt  <oliver@apple.com>
1607
1608         Remove use of container relative restrictions in the network process sandbox
1609         https://bugs.webkit.org/show_bug.cgi?id=134816
1610
1611         Reviewed by Anders Carlsson.
1612
1613         As i'm tidying up the various sandboxes and that's meaning we
1614         need to reduce some file restrictions in the network process.
1615
1616         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1617
1618 2014-07-10  Pratik Solanki  <psolanki@apple.com>
1619
1620         Unreviewed iOS build fix after r170974. Define id if building a non ObjC file.
1621
1622         * UIProcess/mac/ViewSnapshotStore.h:
1623
1624 2014-07-10  Tim Horton  <timothy_horton@apple.com>
1625
1626         Store ViewSnapshots directly on the WebBackForwardListItem
1627         https://bugs.webkit.org/show_bug.cgi?id=134667
1628         <rdar://problem/17082639>
1629
1630         Reviewed by Dan Bernstein.
1631
1632         Make ViewSnapshot a refcounted class. Store it directly on the back-forward item
1633         instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now.
1634         This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots
1635         in the page that was actively being interacted with *first* when evicting snapshots, instead of
1636         preferring older snapshots. Additionally, we would not throw away snapshots when back forward items
1637         became unreachable.
1638
1639         There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation.
1640
1641         * Shared/SessionState.h:
1642         Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState.
1643
1644         * Shared/WebBackForwardListItem.h:
1645         Fix some indented namespace contents.
1646
1647         (WebKit::WebBackForwardListItem::snapshot):
1648         (WebKit::WebBackForwardListItem::setSnapshot):
1649         (WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted.
1650         (WebKit::WebBackForwardListItem::snapshotUUID): Deleted.
1651         Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs.
1652
1653         * UIProcess/API/Cocoa/WKWebView.mm:
1654         (-[WKWebView _takeViewSnapshot]):
1655         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1656         * UIProcess/API/mac/WKView.mm:
1657         (-[WKView _takeViewSnapshot]):
1658         * UIProcess/API/mac/WKViewInternal.h:
1659         * UIProcess/PageClient.h:
1660         * UIProcess/WebPageProxy.cpp:
1661         (WebKit::WebPageProxy::takeViewSnapshot):
1662         * UIProcess/WebPageProxy.h:
1663         * UIProcess/ios/PageClientImplIOS.h:
1664         * UIProcess/ios/PageClientImplIOS.mm:
1665         (WebKit::PageClientImpl::takeViewSnapshot):
1666         * UIProcess/mac/PageClientImpl.h:
1667         * UIProcess/mac/PageClientImpl.mm:
1668         (WebKit::PageClientImpl::takeViewSnapshot):
1669         Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot.
1670
1671         * UIProcess/ios/ViewGestureControllerIOS.mm:
1672         (WebKit::ViewGestureController::beginSwipeGesture):
1673         (WebKit::ViewGestureController::endSwipeGesture):
1674         * UIProcess/mac/ViewGestureController.h:
1675         * UIProcess/mac/ViewGestureControllerMac.mm:
1676         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
1677         (WebKit::ViewGestureController::beginSwipeGesture):
1678         (WebKit::ViewGestureController::endSwipeGesture):
1679         Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions.
1680
1681         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
1682         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
1683         Rename discardSnapshots to discardSnapshotImages, because we're really only discarding
1684         the images; the render tree size/background color "snapshot" remains and is useful.
1685
1686         * UIProcess/mac/ViewSnapshotStore.h:
1687         (WebKit::ViewSnapshot::setRenderTreeSize):
1688         (WebKit::ViewSnapshot::renderTreeSize):
1689         (WebKit::ViewSnapshot::setBackgroundColor):
1690         (WebKit::ViewSnapshot::backgroundColor):
1691         (WebKit::ViewSnapshot::setDeviceScaleFactor):
1692         (WebKit::ViewSnapshot::deviceScaleFactor):
1693         (WebKit::ViewSnapshot::imageSizeInBytes):
1694         (WebKit::ViewSnapshot::surface):
1695         (WebKit::ViewSnapshot::size):
1696         (WebKit::ViewSnapshot::creationTime):
1697         Make ViewSnapshot a refcounted class.
1698         Add create functions which take an image (or slot ID), and relevant sizes.
1699         It is expected that a ViewSnapshot is created with an image, and it is only possible
1700         to remove that image, never to replace it. A new ViewSnapshot is required in that case.
1701         Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient
1702         retrieves it from the view. Add getters for things that the ViewGestureControllers need.
1703
1704         Remove removeSnapshotImage, getSnapshot, and the snapshot map.
1705
1706         * UIProcess/mac/ViewSnapshotStore.mm:
1707         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1708         (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
1709         (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
1710         Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot.
1711         willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed.
1712
1713         (WebKit::ViewSnapshotStore::pruneSnapshots):
1714         Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but
1715         this is much less broken than the previous implementation.
1716
1717         (WebKit::ViewSnapshotStore::recordSnapshot):
1718         (WebKit::ViewSnapshotStore::discardSnapshotImages):
1719         (WebKit::ViewSnapshot::create):
1720         (WebKit::ViewSnapshot::ViewSnapshot):
1721         (WebKit::ViewSnapshot::~ViewSnapshot):
1722         (WebKit::ViewSnapshot::hasImage):
1723         (WebKit::ViewSnapshot::clearImage):
1724         (WebKit::ViewSnapshot::asLayerContents):
1725         If a surface is Empty when it comes back from being volatile, throw away the surface
1726         and notify the Store to remove it from m_snapshotCacheSize (via clearImage()).
1727
1728         (WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted.
1729         (WebKit::ViewSnapshotStore::getSnapshot): Deleted.
1730         (WebKit::ViewSnapshotStore::discardSnapshots): Deleted.
1731
1732 2014-07-10  Beth Dakin  <bdakin@apple.com>
1733
1734         Need Setting/WKPreference that allows clients to prevent scrollbars from drawing 
1735         on a secondary thread
1736         https://bugs.webkit.org/show_bug.cgi?id=134778
1737         -and corresponding-
1738         <rdar://problem/17595333>
1739
1740         Reviewed by Tim Horton.
1741
1742         This is a requirement for some types of performance tests.
1743
1744         New pref.
1745         * Shared/WebPreferencesDefinitions.h:
1746
1747         PDFPlugin has to implement this new ScrollableArea virtual function to indicate 
1748         the Setting’s value.
1749         * WebProcess/Plugins/PDF/PDFPlugin.h:
1750         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1751         (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
1752
1753         New pref.
1754         * WebProcess/WebPage/WebPage.cpp:
1755         (WebKit::WebPage::updatePreferences):
1756
1757 2014-07-10  Tim Horton  <timothy_horton@apple.com>
1758
1759         [iOS] Frequent assertion failures when swiping back
1760
1761         Reviewed by Dan Bernstein.
1762
1763         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1764         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
1765         Don't create an unused VoidCallback. It will assert when destroyed without being called.
1766
1767 2014-07-10  Oliver Hunt  <oliver@apple.com>
1768
1769         Pass sandbox extension for GL cache over to webprocess
1770         https://bugs.webkit.org/show_bug.cgi?id=134806
1771
1772         Reviewed by Anders Carlsson.
1773
1774         Add additional WebProcess parameters to pass an extension
1775         that allows access to the opengl cache directory in the
1776         host application's container.
1777
1778         * Shared/WebProcessCreationParameters.cpp:
1779         (WebKit::WebProcessCreationParameters::encode):
1780         (WebKit::WebProcessCreationParameters::decode):
1781         * Shared/WebProcessCreationParameters.h:
1782         * UIProcess/WebContext.cpp:
1783         (WebKit::WebContext::createNewWebProcess):
1784         (WebKit::WebContext::openGLCacheDirectory):
1785         * UIProcess/WebContext.h:
1786         * UIProcess/mac/WebContextMac.mm:
1787         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1788         * WebProcess/cocoa/WebProcessCocoa.mm:
1789         (WebKit::WebProcess::platformInitializeWebProcess):
1790
1791 2014-07-10  Dan Bernstein  <mitz@apple.com>
1792
1793         iOS build fix.
1794
1795         * WebProcess/WebPage/ServicesOverlayController.h:
1796
1797 2014-07-09  Brady Eidson  <beidson@apple.com>
1798
1799         Phone number highlights should always be visible if the mouse hovers over.
1800         <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
1801
1802         Reviewed by Tim Horton.
1803
1804         This is a fairly extensive rewrite of ServicesOverlayController.
1805         It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
1806         If a telephone number highlight is hovered over, it wins and is painted.
1807         If no telephone number highlight is hovered but the selection highlight is, then it is painted.
1808        
1809         The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.
1810
1811         The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.
1812         
1813         * Platform/Logging.h: Add a Services logging channel.
1814
1815         * WebProcess/WebPage/ServicesOverlayController.h:
1816         (WebKit::TelephoneNumberData::TelephoneNumberData):
1817
1818         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1819         (WebKit::ServicesOverlayController::ServicesOverlayController):
1820         (WebKit::ServicesOverlayController::selectionRectsDidChange):
1821         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
1822         (WebKit::ServicesOverlayController::clearHighlightState):
1823         (WebKit::ServicesOverlayController::drawRect):
1824         (WebKit::ServicesOverlayController::drawSelectionHighlight):
1825         (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
1826         (WebKit::ServicesOverlayController::drawHighlight):
1827         (WebKit::ServicesOverlayController::clearSelectionHighlight):
1828         (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
1829         (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
1830             creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
1831             the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
1832         (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
1833         (WebKit::ServicesOverlayController::mouseEvent):
1834         (WebKit::ServicesOverlayController::handleClick):
1835         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
1836         (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.
1837
1838 2014-07-10  Timothy Horton  <timothy_horton@apple.com>
1839
1840         Assertions or crashes under _takeViewSnapshot when restoring windows
1841         https://bugs.webkit.org/show_bug.cgi?id=134792
1842
1843         Reviewed by Simon Fraser.
1844
1845         * UIProcess/API/mac/WKView.mm:
1846         (-[WKView _takeViewSnapshot]):
1847         Taking a window-server snapshot of a non-visible window tends to not succeed.
1848
1849 2014-07-09  Pratik Solanki  <psolanki@apple.com>
1850
1851         Buffer CSS and JS resources in network process before sending over to web process
1852         https://bugs.webkit.org/show_bug.cgi?id=134560
1853         <rdar://problem/16737186>
1854
1855         Reviewed by Antti Koivisto.
1856
1857         For CSS and JS resources, ask the network process to buffer the entire resource instead of
1858         sending it to web process in chunks since the web process can't do anything with a partial
1859         css or js file.
1860
1861         * NetworkProcess/NetworkResourceLoader.cpp:
1862         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1863         * Shared/Network/NetworkResourceLoadParameters.cpp:
1864         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
1865         (WebKit::NetworkResourceLoadParameters::encode):
1866         (WebKit::NetworkResourceLoadParameters::decode):
1867         * Shared/Network/NetworkResourceLoadParameters.h:
1868         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1869         (WebKit::WebResourceLoadScheduler::scheduleLoad):
1870
1871 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
1872
1873         [iOS][WK2] Disable text quantization while actively changing the page's scale factor
1874         https://bugs.webkit.org/show_bug.cgi?id=134781
1875
1876         Reviewed by Tim Horton and Myles C. Maxfield.
1877
1878         While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
1879         boundary for the current scale factor.
1880
1881         We do not want this to happen while dynamically changing the scale factor because the effect
1882         is visible. To avoid this, we disable text quantization if the page's scale factor changes
1883         in response to a non-stable contentRect update.
1884
1885         * WebProcess/WebCoreSupport/WebChromeClient.h:
1886         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1887         (WebKit::WebChromeClient::hasStablePageScaleFactor):
1888         * WebProcess/WebPage/WebPage.cpp:
1889         (WebKit::WebPage::WebPage):
1890         * WebProcess/WebPage/WebPage.h:
1891         (WebKit::WebPage::hasStablePageScaleFactor):
1892         * WebProcess/WebPage/ios/WebPageIOS.mm:
1893         (WebKit::WebPage::updateVisibleContentRects):
1894
1895 2014-07-09  Joseph Pecoraro  <pecoraro@apple.com>
1896
1897         [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
1898         https://bugs.webkit.org/show_bug.cgi?id=134777
1899
1900         Reviewed by Sam Weinig.
1901
1902         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1903         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
1904
1905 2014-07-09  Shivakumar JM  <shiva.jm@samsung.com>
1906
1907         [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
1908         https://bugs.webkit.org/show_bug.cgi?id=134759
1909
1910         Reviewed by Gyuyoung Kim.
1911
1912         Add new API in ewk_download_job.h to get size of the data already downloaded.
1913
1914         * UIProcess/API/efl/ewk_download_job.cpp:
1915         (ewk_download_job_received_data_length_get):
1916         (EwkDownloadJob::receivedData):
1917         * UIProcess/API/efl/ewk_download_job.h:
1918         * UIProcess/API/efl/ewk_download_job_private.h:
1919         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
1920         (EWK2DownloadJobTest::on_download_requested):
1921         (EWK2DownloadJobTest::on_download_finished):
1922
1923 2014-07-09  Enrica Casucci  <enrica@apple.com>
1924
1925         REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
1926         https://bugs.webkit.org/show_bug.cgi?id=134791
1927         <rdar://problem/17616971>
1928
1929         Reviewed by Benjamin Poulain.
1930
1931         After r170858 we notify the keyboard too often about
1932         the changed selection. This patch removes the notification
1933         until we find a better way to do it that doesn't cause
1934         deadlocks.
1935
1936         * UIProcess/ios/WKContentViewInteraction.mm:
1937         (-[WKContentView _selectionWillChange]):
1938         (-[WKContentView _selectionChanged]):
1939
1940 2014-07-09  Anders Carlsson  <andersca@apple.com>
1941
1942         Safari showing blank pages
1943         https://bugs.webkit.org/show_bug.cgi?id=134790
1944         <rdar://problem/17617166>
1945
1946         Reviewed by Simon Fraser.
1947
1948         * UIProcess/API/Cocoa/WKWebView.mm:
1949         (-[WKWebView initWithFrame:configuration:]):
1950         Make sure to add the content view to the scroll view.
1951
1952 2014-07-09  Anders Carlsson  <andersca@apple.com>
1953
1954         Closed web views should never create new web processes
1955         https://bugs.webkit.org/show_bug.cgi?id=134787
1956         <rdar://problem/16892526>
1957
1958         Reviewed by Simon Fraser.
1959
1960         * UIProcess/API/Cocoa/WKWebView.mm:
1961         (-[WKWebView loadHTMLString:baseURL:]):
1962         (-[WKWebView reload]):
1963         (-[WKWebView reloadFromOrigin]):
1964         Return nil if the returned navigation ID is 0.
1965
1966         * UIProcess/WebPageProxy.cpp:
1967         (WebKit::WebPageProxy::reattachToWebProcess):
1968         Assert that the page is not closed.
1969
1970         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1971         (WebKit::WebPageProxy::loadRequest):
1972         (WebKit::WebPageProxy::loadFile):
1973         (WebKit::WebPageProxy::loadData):
1974         (WebKit::WebPageProxy::loadHTMLString):
1975         (WebKit::WebPageProxy::loadAlternateHTMLString):
1976         (WebKit::WebPageProxy::loadPlainTextString):
1977         (WebKit::WebPageProxy::loadWebArchiveData):
1978         Add early returns if the page is closed.
1979
1980         * UIProcess/WebPageProxy.h:
1981
1982 2014-07-09  Anders Carlsson  <andersca@apple.com>
1983
1984         Support transparent WKWebViews
1985         https://bugs.webkit.org/show_bug.cgi?id=134779
1986         <rdar://problem/17351058>
1987
1988         Reviewed by Tim Horton.
1989
1990         * UIProcess/API/Cocoa/WKWebView.mm:
1991         (-[WKWebView initWithFrame:configuration:]):
1992         Call _updateScrollViewBackground instead of setting the background color.
1993
1994         (contentZoomScale):
1995         Use dot notation.
1996
1997         (scrollViewBackgroundColor):
1998         Helper function that returns the scroll view background color. 
1999         If the web view isn't opaque, we want the scroll view to be transparent.
2000
2001         (-[WKWebView _updateScrollViewBackground]):
2002         Call scrollViewBackgroundColor.
2003
2004         (-[WKWebView setOpaque:]):
2005         Call WebPageProxy::setDrawsBackground and update the scroll view background.
2006
2007         (-[WKWebView setBackgroundColor:]):
2008         Call setBackgroundColor on the content view.
2009
2010 2014-07-09  Andy Estes  <aestes@apple.com>
2011
2012         [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
2013         https://bugs.webkit.org/show_bug.cgi?id=134780
2014
2015         Reviewed by Tim Horton.
2016
2017         Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
2018         will match or exceed that of the CFDataRef. Copy the data instead.
2019
2020         * WebProcess/Network/WebResourceLoader.cpp:
2021         (WebKit::WebResourceLoader::didReceiveData):
2022
2023 2014-07-09  Pratik Solanki  <psolanki@apple.com>
2024
2025         Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
2026         https://bugs.webkit.org/show_bug.cgi?id=134732
2027
2028         Reviewed by Darin Adler.
2029
2030         Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
2031         is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
2032         that uses AsynchronousNetworkLoaderClient.
2033
2034         * NetworkProcess/NetworkResourceLoader.cpp:
2035         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2036         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2037         (WebKit::NetworkResourceLoader::didFinishLoading):
2038         * NetworkProcess/NetworkResourceLoader.h:
2039         (WebKit::NetworkResourceLoader::bufferedData):
2040         * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
2041         (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
2042         (WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
2043         (WebKit::SynchronousNetworkLoaderClient::didFail):
2044         (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
2045         * NetworkProcess/SynchronousNetworkLoaderClient.h:
2046
2047 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
2048
2049         [iOS][WK2] subviews of the unscaled view drift out during CA animations
2050         https://bugs.webkit.org/show_bug.cgi?id=134751
2051
2052         Reviewed by Enrica Casucci.
2053
2054         It is not possible to animate the WKContentView and the inverse view in such a way
2055         that the combined matrix remain the identity for every frame of the animation.
2056
2057         This patch solves the issue by moving the unscaled view as a sibling of WKContentView
2058         instead of a child so that we do not need to update two scales simultaneously.
2059
2060         * UIProcess/API/Cocoa/WKWebView.mm:
2061         (-[WKWebView initWithFrame:configuration:]):
2062         (-[WKWebView _processDidExit]):
2063         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
2064         Set the z scale to 1 or no coordinate transform will work with this view.
2065
2066         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2067         (-[WKWebView _endAnimatedResize]):
2068         * UIProcess/ios/WKContentView.mm:
2069         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2070         * UIProcess/ios/WKContentViewInteraction.h:
2071         * UIProcess/ios/WKContentViewInteraction.mm:
2072         (-[WKContentView setupInteraction]):
2073         Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale.
2074
2075         (-[WKContentView cleanupInteraction]):
2076         (-[WKContentView unscaledView]):
2077         (-[WKContentView inverseScale]):
2078         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
2079         We update the utility views as usual. The extra bits here are to deal with views coming in during an animation.
2080
2081         If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve
2082         to end up at the right place. To avoid any issue, we just hide the view until the animation is finished.
2083
2084         (-[WKContentView hitTest:withEvent:]):
2085         (-[WKContentView _showTapHighlight]):
2086         (-[WKContentView _updateUnscaledView]): Deleted.
2087
2088 2014-07-09  Tim Horton  <timothy_horton@apple.com>
2089
2090         Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
2091         https://bugs.webkit.org/show_bug.cgi?id=134773
2092
2093         Reviewed by Anders Carlsson.
2094
2095         * UIProcess/API/mac/WKView.mm:
2096         (-[WKView _takeViewSnapshot]):
2097         * UIProcess/mac/ViewSnapshotStore.h:
2098         * UIProcess/mac/ViewSnapshotStore.mm:
2099         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
2100         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2101         (WebKit::ViewSnapshotStore::recordSnapshot):
2102         (WebKit::ViewSnapshot::clearImage):
2103         (WebKit::ViewSnapshot::asLayerContents):
2104         (WebKit::createIOSurfaceFromImage): Deleted.
2105         (WebKit::compressImageAsJPEG): Deleted.
2106         (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
2107         (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
2108         Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
2109         Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
2110         Adopt WebCore::IOSurface::createFromImage to make that happen.
2111         Add a comment noting that if a snapshot comes back empty, we should throw it away completely.
2112
2113 2014-07-09  Anders Carlsson  <andersca@apple.com>
2114
2115         RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn
2116         https://bugs.webkit.org/show_bug.cgi?id=134772
2117
2118         Reviewed by Tim Horton.
2119
2120         * Shared/mac/RemoteLayerBackingStore.h:
2121         (WebKit::RemoteLayerBackingStore::Buffer::operator bool):
2122         * Shared/mac/RemoteLayerBackingStore.mm:
2123         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2124
2125 2014-07-09  KwangHyuk Kim  <hyuki.kim@samsung.com>
2126
2127         [EFL] Fix crash caused by invalid cursor image.
2128         https://bugs.webkit.org/show_bug.cgi?id=134663
2129
2130         Reviewed by Gyuyoung Kim.
2131
2132         Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview.
2133
2134         * UIProcess/API/efl/EwkView.cpp:
2135         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
2136
2137 2014-07-08  Tim Horton  <timothy_horton@apple.com>
2138
2139         Remove WebBackForwardListItems when their owning page goes away
2140         https://bugs.webkit.org/show_bug.cgi?id=134709
2141         <rdar://problem/17584645>
2142
2143         Reviewed by Dan Bernstein.
2144
2145         * Shared/WebBackForwardListItem.cpp:
2146         (WebKit::WebBackForwardListItem::create):
2147         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2148         * Shared/WebBackForwardListItem.h:
2149         (WebKit::WebBackForwardListItem::pageID):
2150         Add the associated PageID to the WebBackForwardListItem.
2151
2152         * UIProcess/WebBackForwardList.cpp:
2153         (WebKit::WebBackForwardList::restoreFromState):
2154         Push the current PageID onto the WebBackForwardListItem.
2155
2156         * UIProcess/WebProcessProxy.cpp:
2157         (WebKit::WebProcessProxy::removeWebPage):
2158         Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
2159         the page they are associated with is removed.
2160
2161         (WebKit::WebProcessProxy::addBackForwardItem):
2162         Push the PageID from the WebProcess onto the WebBackForwardListItem.
2163
2164         * UIProcess/WebProcessProxy.h:
2165         * UIProcess/WebProcessProxy.messages.in:
2166         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2167         (WebKit::idToHistoryItemMap):
2168         (WebKit::historyItemToIDMap):
2169         (WebKit::updateBackForwardItem):
2170         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2171         (WebKit::WK2NotifyHistoryItemChanged):
2172         (WebKit::WebBackForwardListProxy::idForItem):
2173         (WebKit::WebBackForwardListProxy::addItem):
2174         (WebKit::WebBackForwardListProxy::goToItem):
2175         (WebKit::WebBackForwardListProxy::close):
2176         * WebProcess/WebPage/WebBackForwardListProxy.h:
2177         * WebProcess/WebPage/WebPage.cpp:
2178         (WebKit::WebPage::restoreSession):
2179         Keep track of the PageID that back-forward items were created by.
2180         Pass the PageID along when registering WebBackForwardListItems.
2181
2182 2014-07-08  Tim Horton  <timothy_horton@apple.com>
2183
2184         [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
2185         https://bugs.webkit.org/show_bug.cgi?id=134645
2186
2187         Reviewed by Dan Bernstein.
2188
2189         * UIProcess/API/Cocoa/WKPreferences.mm:
2190         (-[WKPreferences _compositingBordersVisible]):
2191         (-[WKPreferences _setCompositingBordersVisible:]):
2192         (-[WKPreferences _compositingRepaintCountersVisible]):
2193         (-[WKPreferences _setCompositingRepaintCountersVisible:]):
2194         (-[WKPreferences _tiledScrollingIndicatorVisible]):
2195         (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
2196         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2197         Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
2198
2199 2014-07-08  Tim Horton  <timothy_horton@apple.com>
2200
2201         WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
2202         https://bugs.webkit.org/show_bug.cgi?id=134711
2203
2204         Reviewed by Dan Bernstein.
2205
2206         * UIProcess/API/Cocoa/WKProcessPool.mm:
2207         (-[WKProcessPool _initWithConfiguration:]):
2208         Respect the maximumProcessCount.
2209         Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
2210
2211 2014-07-08  Adrian Perez de Castro  <aperez@igalia.com>
2212
2213         [GTK] Move user style sheet API out of WebKitWebViewGroup
2214         https://bugs.webkit.org/show_bug.cgi?id=134551
2215
2216         Reviewed by Carlos Garcia Campos.
2217
2218         * PlatformGTK.cmake: Include the new source files in the build.
2219         * UIProcess/API/C/gtk/WKView.cpp:
2220         (WKViewCreate):
2221         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
2222         * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
2223         (toUserContentInjectedFrames):
2224         (toUserStyleLevel):
2225         (toStringVector):
2226         (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
2227         (webkit_user_style_sheet_ref):
2228         (webkit_user_style_sheet_unref):
2229         (webkit_user_style_sheet_new):
2230         (webkitWebKitUserStyleSheetToUserStyleSheet):
2231         * UIProcess/API/gtk/WebKitUserContent.h: Added.
2232         * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
2233         (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
2234         (webkit_user_content_manager_class_init):
2235         (webkit_user_content_manager_new):
2236         (webkit_user_content_manager_add_style_sheet):
2237         (webkit_user_content_manager_remove_all_style_sheets):
2238         (webkitUserContentManagerGetUserContentControllerProxy):
2239         * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
2240         * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
2241         * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
2242         * UIProcess/API/gtk/WebKitWebContext.cpp:
2243         (webkitWebContextCreatePageForWebView): Add a new parameter to allow
2244         passing the WebKitUserContentManager that the web view will use.
2245         * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
2246         * UIProcess/API/gtk/WebKitWebView.cpp:
2247         (webkitWebViewConstructed): Added handling of the
2248         "user-content-manager" property on construction.
2249         (webkitWebViewSetProperty): Added support for the
2250         "user-content-manager" property.
2251         (webkitWebViewGetProperty): Added support for the
2252         "user-content-manager" property.
2253         (webkit_web_view_class_init): Added the "user-content-manager"
2254         property definition to the WebKitWebView class.
2255         (webkit_web_view_new_with_related_view): Made related views share
2256         the same WebKitUserContentManager used by the view they are
2257         related to.
2258         (webkit_web_view_new_with_user_content_manager): Added.
2259         (webkit_web_view_get_user_content_manager): Added.
2260         * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
2261         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2262         (webkitWebViewBaseCreate): Added a parameter to pass the user
2263         content manager.
2264         (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
2265         content manager.
2266         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
2267         * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
2268         to user style sheet support from WebKitWebViewGroup.
2269         (webkit_web_view_group_set_settings):
2270         (toAPIArray): Deleted.
2271         (webkit_web_view_group_add_user_style_sheet): Deleted.
2272         (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
2273         * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
2274         for user style sheet handling.
2275         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
2276         functions and types, and removed the methods which are no longer
2277         available in WebKitWebViewGroup.
2278         * UIProcess/API/gtk/webkit2.h: Add the new headers.
2279         * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
2280         methods to add and remove user style sheets, alike those used for
2281         user scripts.
2282         (WebKit::WebUserContentControllerProxy::addProcess):
2283         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2284         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2285         * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
2286         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2287         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2288         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
2289         * WebProcess/UserContent/WebUserContentController.cpp: Added methods
2290         to add and remove user style sheets, alike those used for user scripts.
2291         (WebKit::WebUserContentController::addUserStyleSheets):
2292         (WebKit::WebUserContentController::removeAllUserStyleSheets):
2293         * WebProcess/UserContent/WebUserContentController.h: Ditto.
2294         * WebProcess/UserContent/WebUserContentController.messages.in:
2295         Ditto.
2296
2297 2014-07-08  Zan Dobersek  <zdobersek@igalia.com>
2298
2299         [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
2300         https://bugs.webkit.org/show_bug.cgi?id=133871
2301
2302         Reviewed by Martin Robinson.
2303
2304         Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
2305         PLATFORM(X11) build guard. This is required to properly support building the GTK
2306         port only for the Wayland target.
2307
2308         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2309         (webkitWebViewBaseConstructed):
2310         (webkitWebViewRenderAcceleratedCompositingResults):
2311         (resizeWebKitWebViewBaseFromAllocation):
2312         (webkitWebViewBaseUpdatePreferences):
2313         (webkitWebViewBaseCreateWebPage):
2314
2315 2014-07-07  Tim Horton  <timothy_horton@apple.com>
2316
2317         Turn on accelerated drawing for WebKit2 by default
2318         https://bugs.webkit.org/show_bug.cgi?id=134708
2319         <rdar://problem/17584642>
2320
2321         Reviewed by Simon Fraser.
2322
2323         * Shared/WebPreferencesDefinitions.h:
2324         Make Mac match iOS, in that accelerated drawing is on by default.
2325
2326 2014-07-07  Timothy Horton  <timothy_horton@apple.com>
2327
2328         Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
2329         https://bugs.webkit.org/show_bug.cgi?id=134703
2330
2331         Reviewed by Simon Fraser.
2332
2333         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2334         (-[WKBrowsingContextController _remoteObjectRegistry]):
2335         Adoption is important!!
2336
2337 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
2338
2339         [UI-side compositing] Support reflections on custom layers like video
2340         https://bugs.webkit.org/show_bug.cgi?id=134701
2341
2342         Reviewed by Tim Horton.
2343         
2344         For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
2345         in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
2346         which does the right gyrations to get AVPlayerLayers cloned, then makes a
2347         new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
2348         its own context hosting ID, allowing the clone to show in the UI process.
2349         
2350         Attempt to do the same for WebGL, but turn it off because it breaks.
2351
2352         * Shared/mac/RemoteLayerBackingStore.mm:
2353         (WebKit::RemoteLayerBackingStore::drawInContext):
2354         * Shared/mac/RemoteLayerTreeTransaction.mm:
2355         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
2356         the hostingContextID. It will be 0 for most layers.
2357         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2358         (WebKit::RemoteLayerTreeTransaction::description):
2359         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2360         (WebKit::RemoteLayerTreeHost::createLayer):
2361         * UIProcess/mac/RemoteLayerTreeHost.mm:
2362         (WebKit::RemoteLayerTreeHost::createLayer):
2363         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2364         (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
2365         creates a PlatformCALayerRemoteCustom.
2366         (WebKit::PlatformCALayerRemote::clone): Factor some code.
2367         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
2368         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2369         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2370         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2371         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2372         (WebKit::PlatformCALayerRemoteCustom::create):
2373         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
2374         (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the 
2375         correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
2376         around it.
2377         (WebKit::PlatformCALayerRemoteCustom::contents):
2378         (WebKit::PlatformCALayerRemoteCustom::setContents):
2379         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2380         (WebKit::RemoteLayerTreeContext::layerWasCreated):
2381         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
2382
2383 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
2384
2385         [UI-side compositing] Crash when starting a filter transition on a reflected layer
2386         https://bugs.webkit.org/show_bug.cgi?id=134694
2387
2388         Reviewed by Tim Horton.
2389         
2390         When cloned layers had animations, we would fire two animationDidStart callbacks,
2391         but the second would pass an empty animationKey string to the web process, resulting
2392         in a crash.
2393         
2394         Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
2395         since the clone would include addedAnimations, and then get the same animations
2396         added on top by the caller.
2397         
2398         Also protect against an empty animation key in the animationDidStart callback.
2399
2400         * UIProcess/mac/RemoteLayerTreeHost.mm:
2401         (WebKit::RemoteLayerTreeHost::animationDidStart):
2402         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2403         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2404         (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
2405         them manually as PlatformCALayerMac does. Only copy the big things if they don't
2406         have their default values.
2407         (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
2408         for clone() to call.
2409
2410 2014-07-07  Tim Horton  <timothy_horton@apple.com>
2411
2412         Nearly everything in the UIProcess "leaks" when WKWebView is torn down
2413         https://bugs.webkit.org/show_bug.cgi?id=134699
2414         <rdar://problem/17581777>
2415
2416         Reviewed by Simon Fraser.
2417
2418         * UIProcess/API/Cocoa/WKWebView.mm:
2419         (-[WKWebView initWithFrame:configuration:]):
2420         Adoption is important!
2421
2422 2014-07-07  Enrica Casucci  <enrica@apple.com>
2423
2424         REGRESSION(iOS WK2): arrow keys movements don't work.
2425         https://bugs.webkit.org/show_bug.cgi?id=134561
2426         <rdar://problem/16827629>
2427
2428         Reviewed by Benjamin Poulain.
2429
2430         This change add the implementations for cursor movement selectors.
2431         It also provides a mechanism to ensure that every selection
2432         change in WebKit is reflected in UIKit so that it can update the 
2433         autocorrection data. This way we ensure that the autocorraction state
2434         is consistent even when selection changes are originated by JavaScript.
2435         WebPageProxy::editorStateChanged now notifies the page client when the
2436         selection is about to change as well as when it actually changed.
2437         
2438         * UIProcess/PageClient.h:
2439         * UIProcess/WebPageProxy.cpp:
2440         (WebKit::WebPageProxy::editorStateChanged):
2441         * UIProcess/WebPageProxy.h:
2442         * UIProcess/ios/PageClientImplIOS.h:
2443         * UIProcess/ios/PageClientImplIOS.mm:
2444         (WebKit::PageClientImpl::selectionWillChange):
2445         * UIProcess/ios/WKContentViewInteraction.h:
2446         * UIProcess/ios/WKContentViewInteraction.mm:
2447         (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
2448         textDidChange.
2449         (-[WKContentView paste:]):
2450         (-[WKContentView _moveUp:withHistory:]):
2451         (-[WKContentView _moveDown:withHistory:]):
2452         (-[WKContentView _moveLeft:withHistory:]):
2453         (-[WKContentView _moveRight:withHistory:]):
2454         (-[WKContentView _moveToStartOfWord:withHistory:]):
2455         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2456         (-[WKContentView _moveToStartOfLine:withHistory:]):
2457         (-[WKContentView _moveToStartOfDocument:withHistory:]):
2458         (-[WKContentView _moveToEndOfWord:withHistory:]):
2459         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2460         (-[WKContentView _moveToEndOfLine:withHistory:]):
2461         (-[WKContentView _moveToEndOfDocument:withHistory:]):
2462         (-[WKContentView _selectionWillChange]):
2463         (-[WKContentView _selectionChanged]):
2464         * UIProcess/ios/WebPageProxyIOS.mm:
2465         (WebKit::WebPageProxy::notifySelectionWillChange):
2466
2467 2014-07-07  Anders Carlsson  <andersca@apple.com>
2468
2469         Add SPI for saving and restoring a WKWebView's _WKSessionState
2470         https://bugs.webkit.org/show_bug.cgi?id=134693
2471
2472         Reviewed by Dan Bernstein.
2473
2474         * UIProcess/API/C/WKPage.cpp:
2475         (WKPageRestoreFromSessionState):
2476         * UIProcess/API/Cocoa/WKWebView.mm:
2477         (-[WKWebView _sessionState]):
2478         (-[WKWebView _restoreFromSessionStateData:]):
2479         (-[WKWebView _restoreFromSessionState:]):
2480         (-[WKWebView _restoreSessionState:andNavigate:]):
2481         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2482         * UIProcess/API/Cocoa/_WKSessionState.mm:
2483         (-[_WKSessionState _initWithSessionState:]):
2484         * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
2485         * UIProcess/WebPageProxy.cpp:
2486         (WebKit::WebPageProxy::restoreFromSessionState):
2487         * UIProcess/WebPageProxy.h:
2488
2489 2014-07-07  Anders Carlsson  <andersca@apple.com>
2490
2491         Add a stubbed out _WKSessionState class
2492         https://bugs.webkit.org/show_bug.cgi?id=134690
2493
2494         Reviewed by Geoffrey Garen.
2495
2496         * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2497         * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2498         (-[_WKSessionState initWithData:]):
2499         (-[_WKSessionState data]):
2500         * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2501         * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2502         * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2503         (WebKit::encodeSessionState):
2504         (WebKit::decodeSessionState):
2505         * UIProcess/LegacySessionStateCoding.h:
2506         * WebKit2.xcodeproj/project.pbxproj:
2507
2508 2014-07-07  Anders Carlsson  <andersca@apple.com>
2509
2510         Some of the WKPreferences (API) property getters read like questions
2511         https://bugs.webkit.org/show_bug.cgi?id=134678
2512         <rdar://problem/17576847>
2513
2514         Reviewed by Dan Bernstein.
2515
2516         * UIProcess/API/Cocoa/WKPreferences.h:
2517         * UIProcess/API/Cocoa/WKPreferences.mm:
2518         (-[WKPreferences javaScriptIsEnabled]):
2519         (-[WKPreferences javaIsEnabled]):
2520         (-[WKPreferences plugInsAreEnabled]):
2521         (-[WKPreferences isJavaScriptEnabled]): Deleted.
2522         (-[WKPreferences isJavaEnabled]): Deleted.
2523         (-[WKPreferences arePlugInsEnabled]): Deleted.
2524
2525 2014-07-07  Brady Eidson  <beidson@apple.com>
2526
2527         ServicesOverlayController menus show up in the wrong place.
2528         <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
2529
2530         Reviewed by Tim Horton.
2531
2532         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2533         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
2534           the telephone number is in a subframe.
2535         (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
2536           coordinates, so convert it to window coordinates using the main frame’s FrameView.
2537
2538 2014-07-07  Dan Bernstein  <mitz@apple.com>
2539
2540         [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
2541         https://bugs.webkit.org/show_bug.cgi?id=134682
2542
2543         Reviewed by Tim Horton.
2544
2545         * UIProcess/Cocoa/NavigationState.mm:
2546         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
2547         assertion with a FIXME.
2548         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
2549         Ditto.
2550         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
2551         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
2552         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
2553         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
2554         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
2555
2556 2014-07-07  KwangHyuk Kim  <hyuki.kim@samsung.com>
2557
2558         [EFL] Fix cursor artifacts on naver map site.
2559         https://bugs.webkit.org/show_bug.cgi?id=134649
2560
2561         Reviewed by Gyuyoung Kim.
2562
2563         Old evas cursor and ecore x cursor are reset before new cursor is applied.
2564
2565         * UIProcess/API/efl/EwkView.cpp:
2566         (EwkView::updateCursor):
2567
2568 2014-07-06  Benjamin Poulain  <bpoulain@apple.com>
2569
2570         [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
2571         https://bugs.webkit.org/show_bug.cgi?id=134660
2572
2573         Reviewed by Darin Adler.
2574
2575         * UIProcess/ios/WKContentViewInteraction.mm:
2576         (-[WKContentView _cancelInteraction]):
2577         (-[WKContentView _finishInteraction]):
2578         (cancelPotentialTapIfNecessary):
2579         I messed that up in r170600. I only accounted for the web process being too fast.
2580
2581         If the web process is too slow, _cancelInteraction or _finishInteraction happen before
2582         _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
2583
2584 2014-07-06  Tim Horton  <timothy_horton@apple.com>
2585
2586         [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
2587         https://bugs.webkit.org/show_bug.cgi?id=134644
2588
2589         Reviewed by Darin Adler.
2590
2591         * UIProcess/DrawingAreaProxy.h:
2592         (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
2593         * UIProcess/WebPageProxy.cpp:
2594         (WebKit::WebPageProxy::preferencesDidChange):
2595         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2596         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2597         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2598         (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
2599         (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
2600         The indicator depends on the live layer tree commits coming in, including layer creation,
2601         so it can't be turned on after the root layer is created. Even a refresh is insufficient
2602         to get it working; the debug indicator really needs to exist from the first commit.
2603         So, don't even attempt to dynamically enable the indicator; create it at
2604         RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
2605
2606 2014-07-06  Yoav Weiss  <yoav@yoav.ws>
2607
2608         Turn on img@sizes compile flag
2609         https://bugs.webkit.org/show_bug.cgi?id=134634
2610
2611         Reviewed by Benjamin Poulain.
2612
2613         * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
2614
2615 2014-07-06  Brady Eidson  <beidson@apple.com>
2616
2617         Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
2618         https://bugs.webkit.org/show_bug.cgi?id=134666
2619
2620         Reviewed by Tim Horton.
2621
2622         * Shared/mac/SecItemRequestData.cpp:
2623         (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
2624         (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one. 
2625
2626         * UIProcess/mac/SecItemShimProxy.cpp:
2627         (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking 
2628           for a bug, and respond with an "invalid parameter" error.
2629
2630 2014-07-06  Antti Koivisto  <antti@apple.com>
2631
2632         Don't throttle layer flushes when the main resource is a GIF
2633         https://bugs.webkit.org/show_bug.cgi?id=134650
2634
2635         Reviewed by Simon Fraser.
2636
2637         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2638         (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
2639
2640 2014-07-04  Rohit Kumar  <kumar.rohit@samsung.com>
2641
2642         [EFL][WK2]Fix build break in EFL WK2
2643         https://bugs.webkit.org/show_bug.cgi?id=134629
2644
2645         Unreviewed build fix.
2646
2647         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2648         (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
2649         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
2650
2651 2014-07-04  Dan Bernstein  <mitz@apple.com>
2652
2653         [Cocoa] -[WKWebView _reload] is unused
2654         https://bugs.webkit.org/show_bug.cgi?id=134638
2655
2656         Reviewed by Sam Weinig.
2657
2658         * UIProcess/API/Cocoa/WKWebView.mm:
2659         (-[WKWebView _reload]): Deleted.
2660         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2661
2662 2014-07-04  Tim Horton  <timothy_horton@apple.com>
2663
2664         [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
2665         https://bugs.webkit.org/show_bug.cgi?id=134624
2666         <rdar://problem/17222041>
2667
2668         Reviewed by Sam Weinig.
2669
2670         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2671         (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
2672         Perform the same coordinate conversion we use for mouse events, which happens
2673         to take the top content inset into account.
2674
2675 2014-07-04  Philippe Normand  <pnormand@igalia.com>
2676
2677         Unreviewed, GTK WK2 build fix after r170787.
2678
2679         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2680         (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
2681         * WebProcess/WebPage/DrawingAreaImpl.h:
2682
2683 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
2684
2685         Unreviewed. Reverting the bad changes introduced in r170795.
2686
2687         * Platform/IPC/ArgumentDecoder.cpp:
2688         (IPC::ArgumentDecoder::decode): Deleted.
2689         * Platform/IPC/ArgumentDecoder.h:
2690         * Platform/IPC/ArgumentEncoder.cpp:
2691         (IPC::ArgumentEncoder::encode): Deleted.
2692         * Platform/IPC/ArgumentEncoder.h:
2693
2694 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
2695
2696         Unreviewed. Fixing the build for ports on 64-bit Linux.
2697
2698         Add IPC encoding and decoding overloads for the long long type, needed
2699         after r170755 started encoding and decoding long long variables in
2700         FormDataElement.
2701
2702         * Platform/IPC/ArgumentDecoder.cpp:
2703         (IPC::ArgumentDecoder::decode):
2704         * Platform/IPC/ArgumentDecoder.h:
2705         * Platform/IPC/ArgumentEncoder.cpp:
2706         (IPC::ArgumentEncoder::encode):
2707         * Platform/IPC/ArgumentEncoder.h:
2708
2709 2014-07-04  Timothy Horton  <timothy_horton@apple.com>
2710
2711         [iOS][WK2] Black web view after un-suspending process
2712         https://bugs.webkit.org/show_bug.cgi?id=134623
2713         <rdar://problem/17513223>
2714
2715         Reviewed by Simon Fraser.
2716
2717         * UIProcess/WebPageProxy.cpp:
2718         (WebKit::WebPageProxy::viewStateDidChange):
2719         Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
2720         to force us to wait for a synchronous reply from the Web process after performing a view state change.
2721
2722         (WebKit::WebPageProxy::dispatchViewStateChange):
2723         Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
2724         Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
2725
2726         * UIProcess/WebPageProxy.h:
2727         * UIProcess/ios/WKContentView.mm:
2728         (-[WKContentView _applicationWillEnterForeground:]):
2729         As previously mentioned, wait for a reply when foregrounding.
2730
2731         * WebProcess/WebPage/DrawingArea.h:
2732         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2733         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2734         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
2735         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2736         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
2737         Make sure to schedule a commit immediately if the UI process is waiting for a reply.
2738         Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
2739         layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
2740         all throttling in this case.
2741
2742         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2743         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2744         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
2745
2746 2014-07-03  Gavin Barraclough  <baraclough@apple.com>
2747
2748         Should not take background task assertion for NetworkProcess
2749         https://bugs.webkit.org/show_bug.cgi?id=134622
2750
2751         Reviewed by Tim Horton.
2752
2753         When the WebContent wants to complete a task in the background we take a process assertion on the child process, and also need to prevent the UI process from suspending.
2754         However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.
2755
2756         * Platform/IPC/mac/ConnectionMac.mm:
2757         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2758             - ProcessAssertion -> ProcessAndUIAssertion
2759         * UIProcess/ProcessAssertion.cpp:
2760         (WebKit::ProcessAssertion::ProcessAssertion):
2761             - assignment -> initializer list.
2762         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2763         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2764         (WebKit::ProcessAndUIAssertion::setState):
2765             - added no-op implementation.
2766         (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
2767         * UIProcess/ProcessAssertion.h:
2768             - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
2769         * UIProcess/ProcessThrottler.cpp:
2770         (WebKit::ProcessThrottler::didConnnectToProcess):
2771             - ProcessAssertion -> ProcessAndUIAssertion
2772         * UIProcess/ProcessThrottler.h:
2773             - ProcessAssertion -> ProcessAndUIAssertion
2774         * UIProcess/ios/ProcessAssertionIOS.mm:
2775         (WebKit::ProcessAssertion::ProcessAssertion):
2776             - assignment -> initializer list.
2777             - moved code to manage WKProcessAssertionBackgroundTaskManager
2778         (WebKit::ProcessAssertion::setState):
2779             - moved code to manage WKProcessAssertionBackgroundTaskManager
2780         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2781         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2782         (WebKit::ProcessAndUIAssertion::setState):
2783             - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
2784         (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
2785             - delete - moved code to manage WKProcessAssertionBackgroundTaskManager
2786
2787 2014-07-03  Simon Fraser  <simon.fraser@apple.com>
2788
2789         Clean up Brady's mess on iOS.
2790
2791         * Platform/mac/StringUtilities.h:
2792         * Platform/mac/StringUtilities.mm:
2793
2794 2014-07-03  Simon Fraser  <simon.fraser@apple.com>
2795
2796         [iOS WK2] Compositing layers draw outside page bounds
2797         https://bugs.webkit.org/show_bug.cgi?id=134619
2798         <rdar://problem/16953222>
2799
2800         Reviewed by Benjamin Poulain.
2801         
2802         With the new rubber-banding behavior, we no longer have the root content layer clipping all
2803         the web layers, but this resulted in web layers which were moved outside the viewport by CSS
2804         transforms not being clipped.
2805         
2806         Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
2807         normally has the same bounds as the content, but when rubber-banding or pinching,
2808         it takes the union of the content bounds and the rect used for fixed positioning.
2809         To make scrolling work as expected in this scenario, when it has non-zero offset, it
2810         has to compensate by setting its bounds origin.
2811
2812         The bounds of the clipping layer are updated on scrolling/zooming, and when the
2813         layer commit tells us that the content size changed.
2814
2815         * UIProcess/API/Cocoa/WKWebView.mm:
2816         (-[WKWebView _updateScrollViewBackground]):
2817         * UIProcess/ios/WKContentView.mm:
2818         (-[WKContentView initWithFrame:context:configuration:webView:]):
2819         (-[WKContentView updateFixedClippingView:]):
2820         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2821         (-[WKContentView _didCommitLayerTree:]):
2822
2823 2014-07-03  Brady Eidson  <beidson@apple.com>
2824
2825         When showing the selection menu, include menu options for all selected phone numbers.
2826         <rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613
2827
2828         Reviewed by Tim Horton.
2829
2830         Move some telephone number menu logic from WebKitSystemInterface here.
2831         Also provide utility to get just the one menu item relevant to a telephone number.
2832         * Platform/mac/MenuUtilities.h:
2833         * Platform/mac/MenuUtilities.mm: Added.
2834         (WebKit::menuItemForTelephoneNumber):
2835         (WebKit::menuItemsForTelephoneNumber):
2836
2837         * Platform/mac/StringUtilities.h:
2838         * Platform/mac/StringUtilities.mm:
2839         (WebKit::formattedPhoneNumberString): Return a localized formatted phone number.
2840
2841         Add a member to track the selected phone numbers:
2842         * Shared/ContextMenuContextData.h:
2843         (WebKit::ContextMenuContextData::ContextMenuContextData):
2844         (WebKit::ContextMenuContextData::selectedTelephoneNumbers):
2845
2846         * UIProcess/WebPageProxy.h:
2847         * UIProcess/WebPageProxy.messages.in:
2848
2849         * UIProcess/mac/WebContextMenuProxyMac.mm:
2850         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
2851           in the selection.
2852
2853         Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
2854         * UIProcess/mac/WebPageProxyMac.mm:
2855         (WebKit::WebPageProxy::showTelephoneNumberMenu):
2856         (WebKit::WebPageProxy::showSelectionServiceMenu):
2857
2858         * WebKit2.xcodeproj/project.pbxproj:
2859
2860         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2861         (WebKit::ServicesOverlayController::drawSelectionHighlight):
2862         (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.
2863
2864         * WebProcess/WebPage/WebPage.h:
2865         * WebProcess/WebPage/mac/WebPageMac.mm:
2866         (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.
2867
2868 2014-07-03  Gavin Barraclough  <baraclough@apple.com>
2869
2870         WKProcessAssertionBackgroundTaskManager should clear member if task expires
2871         https://bugs.webkit.org/show_bug.cgi?id=134618
2872
2873         Reviewed by Anders Carlson.
2874
2875         Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.
2876
2877         * UIProcess/ios/ProcessAssertionIOS.mm:
2878         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2879             - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;
2880
2881 2014-07-03  Joseph Pecoraro  <pecoraro@apple.com>
2882
2883         Unreviewed iOS build fix for r170774.
2884
2885         Remove some unnecessary WTF::moves on iOS:
2886         error: static_assert failed "T is not an lvalue reference; move() is unnecessary."
2887
2888         * WebProcess/WebPage/EventDispatcher.cpp:
2889         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
2890         (WebKit::EventDispatcher::touchEvent):
2891
2892 2014-07-03  Anders Carlsson  <andersca@apple.com>
2893
2894         Try to fix the iOS build.
2895
2896         Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
2897
2898         * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
2899         (WebKit::autosaveKey):
2900         (WebKit::WebPageProxy::saveRecentSearches):
2901         (WebKit::WebPageProxy::loadRecentSearches):
2902         * UIProcess/mac/WebPageProxyMac.mm:
2903         * WebKit2.xcodeproj/project.pbxproj:
2904
2905 2014-07-03  Dan Bernstein  <mitz@apple.com>
2906
2907         <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
2908         https://bugs.webkit.org/show_bug.cgi?id=134615
2909
2910         Reviewed by Anders Carlsson.
2911
2912         Added a _networkRequestsInProgress boolean property to WKWebView.
2913
2914         * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
2915         PageLoadStateObserver member functions.
2916
2917         * UIProcess/API/Cocoa/WKWebView.mm:
2918         (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
2919         PageLoadState.
2920         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
2921
2922         * UIProcess/Cocoa/NavigationState.h:
2923         * UIProcess/Cocoa/NavigationState.mm:
2924         (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
2925         PageLoadState::Observer member function by sending the appropriate KVO change message to the
2926         WKWebView.
2927         (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
2928
2929         * UIProcess/PageLoadState.cpp:
2930         (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
2931         and call the observers if needed.
2932         (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
2933         (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
2934         uncommitted state.
2935         * UIProcess/PageLoadState.h:
2936         (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
2937         (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
2938
2939         * UIProcess/WebPageProxy.cpp:
2940         (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
2941         * UIProcess/WebPageProxy.h:
2942         * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
2943
2944         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2945         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
2946         WebPage::addResourceRequest.
2947         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
2948         WebPage::removeResourceRequest.
2949         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
2950
2951         * WebProcess/WebPage/WebPage.cpp:
2952         (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
2953         add its identifier to the set of network resourece request identifiers. If the set was
2954         previously empty, send the WebPageProxy a message.
2955         (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
2956         becomes empty, send the WebPageProxy a message.
2957         * WebProcess/WebPage/WebPage.h:
2958
2959 2014-07-03  Anders Carlsson  <andersca@apple.com>
2960
2961         Remove two unused functions
2962         https://bugs.webkit.org/show_bug.cgi?id=134614
2963
2964         Reviewed by Andreas Kling.
2965
2966         * UIProcess/LegacySessionStateCoding.h:
2967         * UIProcess/mac/LegacySessionStateCoding.cpp:
2968         (WebKit::encodeLegacySessionHistoryEntryData): Deleted.
2969         (WebKit::decodeLegacySessionHistoryEntryData): Deleted.
2970
2971 2014-07-03  Daniel Bates  <dabates@apple.com>
2972
2973         Add WTF::move()
2974         https://bugs.webkit.org/show_bug.cgi?id=134500
2975
2976         Rubber-stamped by Anders Carlsson.
2977
2978         Substitute WTF::move() for std::move().
2979
2980         * DatabaseProcess/DatabaseProcess.cpp:
2981         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2982         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2983         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2984         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2985         * Platform/IPC/ArgumentCoders.h:
2986         * Platform/IPC/ArgumentDecoder.cpp:
2987         * Platform/IPC/Connection.cpp:
2988         * Platform/IPC/Connection.h:
2989         [...]
2990
2991 2014-07-03  Benjamin Poulain  <bpoulain@apple.com>
2992
2993         [iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target
2994         https://bugs.webkit.org/show_bug.cgi?id=134582
2995
2996         Reviewed by Tim Horton.
2997
2998         This patch fixes two small bugs that were causing "jumpiness" on animated resize:
2999         1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content.
3000         2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more
3001            than it should be.
3002
3003         The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale"
3004         was almost never true.
3005
3006         The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was
3007         impossible to determine accurately how much content is in the view.
3008         The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed.
3009
3010         Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView
3011         on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite
3012         different from the received targetScale.
3013
3014         Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors.
3015
3016         For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely
3017         valid to have an exposed rect outside the page bounds, that area is just under the obscured insets.
3018
3019         On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding
3020         position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on
3021         both rects.
3022
3023         * WebProcess/WebPage/ios/WebPageIOS.mm:
3024         (WebKit::scaleAfterViewportWidthChange):
3025         (WebKit::WebPage::dynamicViewportSizeUpdate):
3026         (WebKit::WebPage::updateVisibleContentRects):
3027
3028 2014-07-03  Anders Carlsson  <andersca@apple.com>
3029
3030         Fix build.
3031
3032         * UIProcess/mac/WebPageProxyMac.mm:
3033
3034 2014-07-03  Anders Carlsson  <andersca@apple.com>
3035
3036         Get rid of WebPageProxyCF.cpp
3037         https://bugs.webkit.org/show_bug.cgi?id=134609
3038
3039         Reviewed by Dan Bernstein.
3040
3041         * UIProcess/cf/WebPageProxyCF.cpp: Removed.
3042         * UIProcess/mac/WebPageProxyMac.mm:
3043         (WebKit::autosaveKey):
3044         (WebKit::WebPageProxy::saveRecentSearches):
3045         (WebKit::WebPageProxy::loadRecentSearches):
3046         * WebKit2.xcodeproj/project.pbxproj:
3047
3048 2014-07-03  Tim Horton  <timothy_horton@apple.com>
3049
3050         [WK2] Revise the flat find indicator secondary highlight shadows
3051         https://bugs.webkit.org/show_bug.cgi?id=134607
3052         <rdar://problem/17554828>
3053
3054         Reviewed by Brady Eidson.
3055
3056         * WebProcess/WebPage/FindController.cpp:
3057         (WebKit::FindController::drawRect):
3058         Bring back the secondary highlight shadow, with new constants.
3059
3060 2014-07-03  Tim Horton  <timothy_horton@apple.com>
3061
3062         [iOS][WK2] Sometimes the swipe snapshot stays up too long
3063         https://bugs.webkit.org/show_bug.cgi?id=134506
3064         <rdar://problem/17496803>
3065
3066         Reviewed by Simon Fraser.
3067
3068         Implement a transaction callback mechanism.
3069         The UI process can register a callback at any point, generally immediately after sending a message to the Web process.
3070         It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction
3071         (scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed.
3072         This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered.
3073         For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks.
3074         
3075         Make use of this to remove the ViewGestureControllerIOS snapshots at the right time.
3076
3077         * Shared/mac/RemoteLayerTreeTransaction.h:
3078         (WebKit::RemoteLayerTreeTransaction::callbackIDs):
3079         (WebKit::RemoteLayerTreeTransaction::setCallbackIDs):
3080         * Shared/mac/RemoteLayerTreeTransaction.mm:
3081         (WebKit::RemoteLayerTreeTransaction::encode):
3082         (WebKit::RemoteLayerTreeTransaction::decode):
3083         Add a vector of callback IDs to the transaction; encode and decode as appropriate.
3084
3085         * UIProcess/DrawingAreaProxy.h:
3086         (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
3087         (WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted.
3088         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3089         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3090         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
3091         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3092         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3093         Add dispatchAfterEnsuringDrawing, which takes a function.
3094         When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message.
3095         Perform callbacks listed in the incoming transaction's vector of callback IDs.
3096
3097         * WebProcess/WebPage/DrawingArea.h:
3098         (WebKit::DrawingArea::addTransactionCallbackID):
3099         * WebProcess/WebPage/DrawingArea.messages.in:
3100         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3101         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3102         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3103         (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
3104         Keep track of the pending callback IDs on the drawing area, and move them into the transaction.
3105         We schedule a flush when installing a transaction callback on the premise that
3106         sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred
3107         and been committed by the time the Web process receives AddTransactionCallbackID, so we need
3108         to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op.
3109
3110         * UIProcess/ios/ViewGestureControllerIOS.mm:
3111         (allViewGestureControllers):
3112         (WebKit::ViewGestureController::ViewGestureController):
3113         (WebKit::ViewGestureController::~ViewGestureController):
3114         (WebKit::ViewGestureController::endSwipeGesture):
3115         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
3116         (WebKit::ViewGestureController::setRenderTreeSize):
3117         * UIProcess/mac/ViewGestureController.h:
3118         Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to
3119         our ViewGestureController from the callback.
3120
3121         When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit,
3122         so that the commit (which is about to occur immediately after the callback returns) which calls
3123         setRenderTreeSize will (perhaps) remove the snapshot.
3124
3125         If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed.
3126
3127 2014-07-03  Brady Eidson  <beidson@apple.com>
3128
3129         Followup to "rects sent to ServicesOverlayController are wrong"
3130         https://bugs.webkit.org/show_bug.cgi?id=134568
3131
3132         Rubberstamped by Tim Horton.
3133
3134         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3135         (WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the
3136           proposed rect intersects the dirty rect. We always need to include all rects that form
3137           the selection when creating the DDHighlight.
3138
3139 2014-07-03  Tim Horton  <timothy_horton@apple.com>
3140
3141         [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
3142         https://bugs.webkit.org/show_bug.cgi?id=134586
3143
3144         Reviewed by Benjamin Poulain.
3145
3146         * UIProcess/DrawingAreaProxy.h:
3147         (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
3148         (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
3149         (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
3150         * UIProcess/WebPageProxy.cpp:
3151         (WebKit::WebPageProxy::preferencesDidChange):
3152         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3153         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3154         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3155         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3156         (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
3157         (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
3158         Check the debug indicator pref at construction time, and update the state when it changes.
3159         Checking it every commit was surprisingly expensive.
3160
3161 2014-07-03  Antti Koivisto  <antti@apple.com>
3162
3163         Ensure frame creation messages get through to UI process
3164         https://bugs.webkit.org/show_bug.cgi?id=134591
3165         <rdar://problem/16918218>
3166
3167         Reviewed by Anders Carlsson.
3168
3169         If we are middle of handling a synchronous message from UI process a frame creation message back gets delayed.
3170         The subsequent synchronous DecidePolicyForNavigationAction message expects that the frame creation
3171         message has arrived first and fails.
3172
3173         * WebProcess/WebPage/WebFrame.cpp:
3174         (WebKit::WebFrame::createWithCoreMainFrame):
3175         (WebKit::WebFrame::createSubframe):
3176         
3177             Send messages with DispatchMessageEvenWhenWaitingForSyncReply so they always go through in order.
3178
3179 2014-07-03  Anders Carlsson  <andersca@apple.com>
3180
3181         Get rid of DecoderAdapter and EncoderAdapter
3182         https://bugs.webkit.org/show_bug.cgi?id=134598
3183
3184         Reviewed by Andreas Kling.
3185
3186         * CMakeLists.txt:
3187         * WebKit2.xcodeproj/project.pbxproj:
3188         * WebProcess/WebPage/DecoderAdapter.cpp: Removed.
3189         * WebProcess/WebPage/DecoderAdapter.h: Removed.
3190         * WebProcess/WebPage/EncoderAdapter.cpp: Removed.
3191         * WebProcess/WebPage/EncoderAdapter.h: Removed.
3192         * WebProcess/WebPage/WebPage.cpp:
3193
3194 2014-07-02  Anders Carlsson  <andersca@apple.com>
3195
3196         Stop using EncoderAdapter/DecoderAdapter for FormData
3197         https://bugs.webkit.org/show_bug.cgi?id=134571
3198
3199         Reviewed by Andreas Kling.
3200
3201         * Shared/Network/NetworkResourceLoadParameters.cpp:
3202         (WebKit::NetworkResourceLoadParameters::encode):
3203         (WebKit::NetworkResourceLoadParameters::decode):
3204
3205 2014-07-03  Brady Eidson  <beidson@apple.com>
3206
3207         Selection rects sent to ServicesOverlayController are wrong.
3208         <rdar://problem/16727796> and https://bugs.webkit.org/show_bug.cgi?id=134568
3209
3210         Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa).
3211
3212         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3213         (WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController.
3214         * WebProcess/WebCoreSupport/WebEditorClient.h:
3215
3216         * WebProcess/WebPage/ServicesOverlayController.h:
3217         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3218         (WebKit::expandForGap):
3219         (WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects.
3220         (WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list.
3221         (WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this.
3222         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this.
3223         (WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore.
3224
3225 2014-07-03  Brady Eidson  <beidson@apple.com>
3226
3227         Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread
3228         <rdar://problem/17437687> and https://bugs.webkit.org/show_bug.cgi?id=134517
3229
3230         Reviewed by Eric Carlson.
3231
3232         * UIProcess/WebContext.cpp:
3233         (WebKit::WebContext::~WebContext): Instead of directly deref’ing the WebIconDatabase, ask it to
3234           deref itself when appropriate.
3235
3236         * UIProcess/WebIconDatabase.cpp:
3237         (WebKit::WebIconDatabase::WebIconDatabase):
3238         (WebKit::WebIconDatabase::didClose): If this WebIconDatabase is supposed to deref itself when
3239           appropriate, do so now.
3240         (WebKit::WebIconDatabase::derefWhenAppropriate): If the WebCore::IconDatabase is still open then
3241           defer this deref.
3242         * UIProcess/WebIconDatabase.h:
3243
3244 2014-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3245
3246         REGRESSION(r170676): [GTK] UI process crashes when the Web Process crashes
3247         https://bugs.webkit.org/show_bug.cgi?id=134541
3248
3249         Reviewed by Gyuyoung Kim.
3250
3251         It happens when attaching a new web process, because it tries to
3252         encode a null SessionState.
3253
3254         * UIProcess/LegacySessionStateCodingNone.cpp:
3255         (WebKit::encodeLegacySessionState): Return an empty API::Data
3256         object instead of nullptr.
3257         (WebKit::encodeLegacySessionHistoryEntryData): Ditto.
3258
3259 2014-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3260
3261         REGRESSION(r170743): [GTK] [EFL] Build broken.
3262         https://bugs.webkit.org/show_bug.cgi?id=134585
3263
3264         Reviewed by Philippe Normand.
3265
3266         Add ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guards where needed.
3267
3268         * WebProcess/Plugins/PluginView.cpp:
3269         (WebKit::PluginView::initializePlugin):
3270         * WebProcess/WebPage/WebPage.cpp:
3271         (WebKit::WebPage::createPlugin):
3272
3273 2014-07-02  Benjamin Poulain  <benjamin@webkit.org>
3274
3275         [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
3276         https://bugs.webkit.org/show_bug.cgi?id=134570
3277
3278         Reviewed by Enrica Casucci.
3279
3280         Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
3281         forcing a relayout and can cause synchronous operations.
3282
3283         We should not force the caller of the API to maintain their own state tracking, we should do that for them.
3284
3285         With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.
3286
3287         * UIProcess/API/Cocoa/WKWebView.mm:
3288         (activeMinimumLayoutSize):
3289         (activeMinimumLayoutSizeForMinimalUI):
3290         (activeMaximumUnobscuredSize):
3291         (activeOrientation):
3292         This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
3293         to avoid having it in two places.
3294
3295         (-[WKWebView _didRelaunchProcess]):
3296
3297         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3298         The updates now goes like this:
3299         1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
3300         2) Get all the original values before calling the update block.
3301         3) Call the update block.
3302         4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
3303             We also need to update the visible content rect because the update block may have changed something unrelated
3304             to the view size (scale, scroll position, etc).
3305         4b) If we really need to resize, proceed as usual.
3306
3307         (-[WKWebView _endAnimatedResize]):
3308         With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
3309         bail out early if that flag isn't set.
3310
3311         The remaining code is unchanged, it is just not indented due to the removal of the if() branch.
3312
3313 2014-07-02  Roger Fong  <roger_fong@apple.com>
3314
3315         Improve handling of primary offscreen plugins.
3316         https://bugs.webkit.org/show_bug.cgi?id=134528.
3317         <rdar://problem/17471864>
3318
3319         Reviewed by Dean Jackson.
3320
3321         * WebProcess/Plugins/PluginView.cpp: 
3322         Determine whether or not the plugin starts offscreen when the plugin is initialized.
3323         (WebKit::PluginView::initializePlugin):
3324         (WebKit::PluginView::pluginSnapshotTimerFired):
3325         * WebProcess/WebPage/WebPage.cpp:
3326         (WebKit::WebPage::createPlugin):
3327         Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.
3328
3329 2014-07-02  Enrica Casucci  <enrica@apple.com>
3330
3331         REGRESSION(WK2): Undo does not work in text fields in Safari.
3332         https://bugs.webkit.org/show_bug.cgi?id=134572
3333         <rdar://problem/17542238>
3334
3335         Reviewed by Benjamin Poulain.
3336         
3337         This patch adds for iOS the same implementation we have already for OS X.
3338
3339         * UIProcess/ios/PageClientImplIOS.h:
3340         * UIProcess/ios/PageClientImplIOS.mm:
3341         (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
3342         (-[WKEditCommandObjC command]):
3343         (-[WKEditorUndoTargetObjC undoEditing:]):
3344         (-[WKEditorUndoTargetObjC redoEditing:]):
3345         (WebKit::PageClientImpl::PageClientImpl):
3346         (WebKit::PageClientImpl::registerEditCommand):
3347         (WebKit::PageClientImpl::clearAllEditCommands):
3348         (WebKit::PageClientImpl::canUndoRedo):
3349         (WebKit::PageClientImpl::executeUndoRedo):
3350
3351 2014-07-02  Gavin Barraclough  <baraclough@apple.com>
3352
3353         ProcessAssertion should also prevent UIApp suspension
3354         https://bugs.webkit.org/show_bug.cgi?id=134563
3355
3356         Reviewed by Dan Bernstein.
3357
3358         If the application suspends then the child processes will, too.
3359         Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable
3360         while waiting for background tasks to complete.
3361
3362         * UIProcess/ProcessAssertion.cpp:
3363         (WebKit::ProcessAssertion::~ProcessAssertion):
3364             - Added destructor.
3365         * UIProcess/ProcessAssertion.h:
3366             - Added destructor.
3367         * UIProcess/ios/ProcessAssertionIOS.mm:
3368         (+[WKProcessAssertionBackgroundTaskManager shared]):
3369             - singleton WKProcessAssertionBackgroundTaskManager.
3370         (-[WKProcessAssertionBackgroundTaskManager init]):
3371         (-[WKProcessAssertionBackgroundTaskManager dealloc]):
3372             - register/remove notification handlers.
3373         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
3374             - if we need to be runnable make sure we're holding a BackgroundTask, if not release it.
3375         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]):
3376             - detect when the app enters/leaves foreground; calls to _updateBackgroundTask.
3377         (-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]):
3378         (-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]):
3379             - interface to update the count; calls to _updateBackgroundTask.
3380         (WebKit::ProcessAssertion::ProcessAssertion):
3381         (WebKit::ProcessAssertion::~ProcessAssertion):
3382             - count ProcessAssertions in and out of existance.
3383         (WebKit::ProcessAssertion::setState):
3384             - count when the state changes.
3385
3386 2014-07-01  Mark Rowe  <mrowe@apple.com>
3387
3388         <https://webkit.org/b/134522> Remove duplication in code that prepares the user agent string on Mac and iOS
3389
3390         Reviewed by Simon Fraser.
3391
3392         * UIProcess/ios/WebPageProxyIOS.mm:
3393         (WebKit::webKitBundleVersionString): Return the entire CFBundleVersion now that WebCore handles formatting it.
3394         (WebKit::WebPageProxy::standardUserAgent):
3395         * UIProcess/mac/WebPageProxyMac.mm:
3396         (WebKit::webKitBundleVersionString): Ditto.
3397         (WebKit::WebPageProxy::standardUserAgent):
3398
3399 2014-06-28  Oliver Hunt  <oliver@apple.com>
3400
3401        Restrict network process sandbox
3402        https://bugs.webkit.org/show_bug.cgi?id=134360
3403
3404        Reviewed by Sam Weinig.
3405
3406        Add more restrictions to the network process sandbox.
3407
3408        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3409        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3410          Always use the cache directory provided in the initialization parameters,
3411          and make sure we consume the cookie directory extension.
3412        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3413          Make the sandbox profile much more restrictive.
3414        * Shared/Network/NetworkProcessCreationParameters.cpp:
3415        (WebKit::NetworkProcessCreationParameters::encode):
3416        (WebKit::NetworkProcessCreationParameters::decode):
3417        * Shared/Network/NetworkProcessCreationParameters.h:
3418          The network process now requires an extension to access
3419          its cookie storage.
3420        * Shared/mac/SandboxUtilities.cpp:
3421        (WebKit::pathForProcessContainer):
3422        * Shared/mac/SandboxUtilities.h:
3423          We need to be able to get hold of our container so
3424          that we can get the correct cookie storage directory.
3425        * UIProcess/WebContext.cpp:
3426        (WebKit::WebContext::ensureNetworkProcess):
3427          We have to pass in the an extension for the cookie storage directory when
3428        initalising the network process
3429        * UIProcess/mac/WebContextMac.mm:
3430        (WebKit::WebContext::platformDefaultCookieStorageDirectory):
3431          Make sure we provide the correct location on IOS
3432        * WebProcess/cocoa/WebProcessCocoa.mm:
3433        (WebKit::WebProcess::platformInitializeWebProcess):
3434          Consume the cookie storage extension
3435
3436 2014-07-02  Csaba Osztrogonác  <ossy@webkit.org>
3437
3438         URTBF after r170725.
3439
3440         * CMakeLists.txt: Removed Shared/LegacySessionState.cpp.
3441
3442 2014-07-02  Csaba Osztrogonác  <ossy@webkit.org>
3443