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