Fix plugin visibility check.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-08-15  Gavin Barraclough  <barraclough@apple.com>
2
3         Fix plugin visibility check.
4         https://bugs.webkit.org/show_bug.cgi?id=135991
5
6         D'oh, more unreviewed typo fix. :-(
7
8         * PluginProcess/PluginControllerProxy.cpp:
9         (WebKit::PluginControllerProxy::visibilityDidChange):
10         (WebKit::PluginControllerProxy::windowVisibilityChanged):
11         (WebKit::PluginControllerProxy::updateVisibilityActivity):
12         (WebKit::PluginControllerProxy::updateVisiblityActivity): Deleted.
13         * PluginProcess/PluginControllerProxy.h:
14
15 2014-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
16
17         Implement snapping behavior for iOS
18         https://bugs.webkit.org/show_bug.cgi?id=135769
19
20         Reviewed by Brent Fulgham.
21
22         Added support for snap points on iOS.
23
24         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
25         (ArgumentCoder<ScrollingStateScrollingNode>::encode): Added snap offset encoding.
26         (ArgumentCoder<ScrollingStateScrollingNode>::decode): Added snap offset decoding.
27         * UIProcess/API/Cocoa/WKWebView.mm:
28         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): For mainframe scrolling, retargets the scroll destination to the appropriate snap point.
29         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: Added methods to extract relevant information for WKWebView from snap offsets in mainframe scrolling.
30         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
31         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): For overflow scrolling, retargets the scroll destination to the appropriate snap point.
32         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Sets the deceleration factor to FAST if snap points are active.
33         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
34         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping): Used by WKWebView for mainframe scrolling to retarget the scroll destination, if necessary.
35         (WebKit::RemoteScrollingCoordinatorProxy::shouldSetScrollViewDecelerationRateFast): Used by WKWebView for mainframe scrolling to determine whether to set deceleration rate to the fast value.
36         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling): Helper method.
37         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): Helper method.
38
39 2014-08-15  Gavin Barraclough  <barraclough@apple.com>
40
41         Fix plugin visibility check.
42         https://bugs.webkit.org/show_bug.cgi?id=135991
43
44         Unreviewed typo fix.
45
46         * PluginProcess/PluginControllerProxy.cpp:
47         (WebKit::PluginControllerProxy::PluginControllerProxy):
48         (WebKit::PluginControllerProxy::visibilityDidChange):
49         (WebKit::PluginControllerProxy::windowVisibilityChanged):
50         (WebKit::PluginControllerProxy::updateVisibilityActivity):
51         * PluginProcess/PluginControllerProxy.h:
52
53 2014-08-15  Gavin Barraclough  <barraclough@apple.com>
54
55         Fix plugin visibility check.
56         https://bugs.webkit.org/show_bug.cgi?id=135991
57
58         Reviewed by Andreas Kling.
59
60         We should only take a UserActivity if the plugin is in a visible window,
61         and also is itself visible.
62
63         * PluginProcess/PluginControllerProxy.cpp:
64         (WebKit::PluginControllerProxy::PluginControllerProxy):
65             - initialize member state.
66         (WebKit::PluginControllerProxy::visibilityDidChange):
67         (WebKit::PluginControllerProxy::windowVisibilityChanged):
68             - update member state & call updateVisibilityActivity.
69         (WebKit::PluginControllerProxy::updateVisibilityActivity):
70             - enable the UserActivity only if both visibilities are true.
71         * PluginProcess/PluginControllerProxy.h:
72             - added m_isVisible, m_isWindowVisible, updateVisibilityActivity.
73
74 2014-08-15  Enrica Casucci  <enrica@apple.com>
75
76         [Services with UI] Selections are incorrect when selecting three lines.
77         https://bugs.webkit.org/show_bug.cgi?id=135989
78         <rdar://problem/18032571>
79
80         Reviewed by Tim Horton.
81
82         The stitching algorithm did not handle correctly the case of selections
83         over three lines if the middle line is composed of only one rectangle.
84
85         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
86         (WebKit::stitchRects):
87
88 2014-08-15  Tim Horton  <timothy_horton@apple.com>
89
90         Service overlays stay fixed when <iframe> scrolls
91         https://bugs.webkit.org/show_bug.cgi?id=135959
92         <rdar://problem/17957716>
93
94         Reviewed by Enrica Casucci.
95
96         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
97         (WebKit::ServicesOverlayController::highlightsAreEquivalent):
98         Tiny correctness fix; highlights can only be equivalent if their
99         types are equivalent as well.
100
101 2014-08-15  Gavin Barraclough  <barraclough@apple.com>
102
103         de-PLATFORM(COCOA) a couple of methods in plugin code
104         https://bugs.webkit.org/show_bug.cgi?id=135987
105
106         Reviewed by Sam Weinig.
107
108         Pass through the visibility & focus on all platforms, to simplify & avoid
109         any weird inconsistencies between platforms.
110
111         * PluginProcess/PluginControllerProxy.cpp:
112         (WebKit::PluginControllerProxy::windowFocusChanged):
113         (WebKit::PluginControllerProxy::windowVisibilityChanged):
114         * PluginProcess/PluginControllerProxy.h:
115         * PluginProcess/PluginControllerProxy.messages.in:
116         * PluginProcess/mac/PluginControllerProxyMac.mm:
117         (WebKit::PluginControllerProxy::windowFocusChanged): Deleted.
118         (WebKit::PluginControllerProxy::windowVisibilityChanged): Deleted.
119         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
120         (WebKit::NetscapePlugin::windowFocusChanged):
121         (WebKit::NetscapePlugin::windowVisibilityChanged):
122         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
123         * WebProcess/Plugins/Plugin.h:
124         * WebProcess/Plugins/PluginProxy.cpp:
125         (WebKit::PluginProxy::windowAndViewFramesChanged):
126         * WebProcess/Plugins/PluginProxy.h:
127         * WebProcess/Plugins/PluginView.cpp:
128         (WebKit::PluginView::viewStateDidChange):
129         (WebKit::PluginView::platformViewStateDidChange): Deleted.
130         * WebProcess/Plugins/PluginView.h:
131
132 2014-08-15  Tim Horton  <timothy_horton@apple.com>
133
134         Service overlays stay fixed when <iframe> scrolls
135         https://bugs.webkit.org/show_bug.cgi?id=135959
136         <rdar://problem/17957716>
137
138         Reviewed by Enrica Casucci.
139
140         * WebProcess/WebPage/PageOverlay.cpp:
141         (WebKit::PageOverlay::didScrollFrame):
142         * WebProcess/WebPage/PageOverlay.h:
143         (WebKit::PageOverlay::Client::didScrollFrame):
144         * WebProcess/WebPage/PageOverlayController.cpp:
145         (WebKit::PageOverlayController::didScrollFrame):
146         Push didScrollFrame down to the overlays.
147
148         * WebProcess/WebPage/ServicesOverlayController.h:
149         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
150         (WebKit::ServicesOverlayController::Highlight::createForSelection):
151         Hold on to the selection's Range so we can use it to compare Highlights later.
152
153         (WebKit::ServicesOverlayController::Highlight::Highlight):
154         (WebKit::ServicesOverlayController::Highlight::setDDHighlight):
155         Factor the code to set up and paint the highlight out, so that we can
156         set a new DDHighlightRef on a Highlight and the layer moves/reshapes/repaints.
157
158         (WebKit::ServicesOverlayController::buildPhoneNumberHighlights):
159         (WebKit::ServicesOverlayController::buildSelectionHighlight):
160         (WebKit::ServicesOverlayController::replaceHighlightsOfTypePreservingEquivalentHighlights):
161         Factor replaceHighlightsOfTypePreservingEquivalentHighlights out
162         so that we can use it for buildSelectionHighlight as well.
163
164         Steal the DDHighlightRef from the new Highlight when re-using an old one
165         so that the newly computed rects are used instead of the old ones.
166
167         (WebKit::ServicesOverlayController::highlightsAreEquivalent):
168         We will always have a Range now, so we can always check equivalence using it.
169
170         (WebKit::ServicesOverlayController::didScrollFrame):
171         Rebuild all highlights upon subframe scroll, as they might have moved.
172         We could optimize this in the future, but for now it's cheap enough
173         and rare enough that it doesn't matter.
174
175 2014-08-15  Tim Horton  <timothy_horton@apple.com>
176
177         REGRESSION (WebKit2 Gestures): White flash when swiping back to cnn.com's homepage from an article
178         https://bugs.webkit.org/show_bug.cgi?id=135951
179         <rdar://problem/18006149>
180
181         Reviewed by Simon Fraser.
182
183         Wait for (the first visually non-empty layout AND the render tree size threshold to be hit),
184         OR didFinishLoadForFrame, whichever comes first. Once we've done the first visually non-empty layout,
185         we'll start the watchdog and tear down the snapshot in three seconds no matter what.
186         Also, force a repaint so we can asynchronously wait for the Web Process to paint and return to us
187         before removing the snapshot, which improves our chances that something is actually on the screen.
188
189         * UIProcess/API/mac/WKView.mm:
190         (-[WKView _didFirstVisuallyNonEmptyLayoutForMainFrame]):
191         (-[WKView _didFinishLoadForMainFrame]):
192         (-[WKView _removeNavigationGestureSnapshot]):
193         * UIProcess/API/mac/WKViewInternal.h:
194         * UIProcess/PageClient.h:
195         * UIProcess/WebPageProxy.cpp:
196         (WebKit::WebPageProxy::didFinishLoadForFrame):
197         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
198         (WebKit::WebPageProxy::removeNavigationGestureSnapshot):
199         * UIProcess/WebPageProxy.h:
200         * UIProcess/ios/PageClientImplIOS.h:
201         * UIProcess/ios/PageClientImplIOS.mm:
202         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
203         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
204         * UIProcess/mac/PageClientImpl.h:
205         * UIProcess/mac/PageClientImpl.mm:
206         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
207         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
208         (WebKit::PageClientImpl::removeNavigationGestureSnapshot):
209         Plumb didFirstVisuallyNonEmptyLayoutForMainFrame and didFinishLoadForMainFrame
210         through to ViewGestureController from WebPageProxy via the PageClient, etc.
211
212         Ditto for removeNavigationGestureSnapshot, though it is called from a
213         VoidCallback in ViewGestureController instead of from WebFrameLoaderClient and friends.
214
215         * UIProcess/mac/ViewGestureController.h:
216         * UIProcess/mac/ViewGestureControllerMac.mm:
217         (WebKit::ViewGestureController::ViewGestureController):
218         (WebKit::ViewGestureController::endSwipeGesture):
219         When finishing a swipe, we want to wait for both the first visually non-empty layout
220         and the render tree size threshold being hit.
221
222         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
223         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
224         When both of these things have happened, remove the swipe snapshot (after forcing a repaint).
225         For didFirstVisuallyNonEmptyLayoutForMainFrame, we will also start a watchdog
226         ensuring that we remove the snapshot in three seconds.
227
228         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
229         When didFinishLoadForMainFrame happens, remove the swipe snapshot (after forcing a repaint).
230
231         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
232         If the watchdog timer fires, remove the swipe snapshot (after forcing a repaint).
233
234         (WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint):
235         Force a repaint and wait for the async callback before removing the snapshot.
236         It is safe to hold on to the WebPageProxy here because it will always
237         call all of its callbacks before it is destroyed.
238         Avoid enqueuing multiple force-repaints.
239
240         (WebKit::ViewGestureController::removeSwipeSnapshot):
241
242 2014-08-15  Gavin Barraclough  <barraclough@apple.com>
243
244         Fix plugin visibility initialization
245         https://bugs.webkit.org/show_bug.cgi?id=135985
246
247         Reviewed by Geoffrey Garen.
248
249         * WebProcess/Plugins/PluginView.cpp:
250         (WebKit::PluginView::didInitializePlugin):
251             - We're not currently initializing the plugin visibility state,
252               and we're passing the wrong value for window visibility.
253
254 2014-08-15  Gavin Barraclough  <barraclough@apple.com>
255
256         Simplify visibility activity accounting for plugins
257         https://bugs.webkit.org/show_bug.cgi?id=135981
258
259         Reviewed by Dan Bernstein.
260
261         Just take one per connection, rather than implementing a counting mechanism.
262
263         * PluginProcess/PluginControllerProxy.cpp:
264         (WebKit::PluginControllerProxy::PluginControllerProxy):
265         * PluginProcess/PluginControllerProxy.h:
266             - added m_visiblityActivity.
267         * PluginProcess/PluginProcess.cpp:
268         (WebKit::PluginProcess::PluginProcess):
269         (WebKit::PluginProcess::pluginsForWebProcessDidBecomeVisible): Deleted.
270         (WebKit::PluginProcess::pluginsForWebProcessDidBecomeHidden): Deleted.
271         * PluginProcess/PluginProcess.h:
272             - removed pluginsForWebProcessDidBecomeVisible/Hidden.
273         * PluginProcess/WebProcessConnection.cpp:
274         (WebKit::WebProcessConnection::removePluginControllerProxy):
275         (WebKit::WebProcessConnection::pluginDidBecomeVisible): Deleted.
276         (WebKit::WebProcessConnection::pluginDidBecomeHidden): Deleted.
277         * PluginProcess/WebProcessConnection.h:
278             - removed pluginDidBecomeVisible/Hidden.
279         * PluginProcess/mac/PluginControllerProxyMac.mm:
280         (WebKit::PluginControllerProxy::windowVisibilityChanged):
281             - windowVisibilityChanged uses m_visiblityActivity, rather than calling to PluginControllerProxy.
282
283 2014-08-15  Carlos Garcia Campos  <cgarcia@igalia.com>
284
285         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.5.3 release.
286
287         * gtk/NEWS: Add release notes for 2.5.3.
288
289 2014-08-14  Enrica Casucci  <enrica@apple.com>
290
291         [Services with UI] Selection services don't work inside <iframes>.
292         https://bugs.webkit.org/show_bug.cgi?id=135941
293         <rdar://problem/17957690>
294
295         Reviewed by Tim Horton.
296
297         Need to map the selection rectangles using the correct FrameView.
298         When handling the click, we must use the selection from the focused frame.
299
300         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
301         (WebKit::ServicesOverlayController::buildSelectionHighlight):
302         (WebKit::ServicesOverlayController::handleClick):
303
304 2014-08-13  Mark Rowe  <mrowe@apple.com>
305
306         <https://webkit.org/b/135909> Move helper applications out of the root of the framework.
307
308         As described in <https://developer.apple.com/library/mac/technotes/tn2206/>, for bundles containing
309         a Versions directory there may be no other content at the top level of the bundle other than symlinks.
310         Upcoming changes to code signing will prevent bundles that violate this rule from being signed.
311
312         Reviewed by Sam Weinig.
313
314         * Configurations/Base.xcconfig: Define a configuration setting that points to the content directory
315         of the framework. On OS X this is Versions/A. On iOS, where frameworks are shallow, this is the top level.
316         * Configurations/BaseLegacyProcess.xcconfig: Install the legacy processes in the content directory
317         of the framework.
318         * WebKit2.xcodeproj/project.pbxproj: Copy the legacy processes into the content directory of the
319         framework during engineering builds. Generate symlinks for the legacy processes to their locations
320         in Versions/Current. This is necessary because -[NSBundle pathForAuxiliaryExecutable:] only looks
321         at the top level of the framework wrapper.
322
323 2014-08-14  Michael Catanzaro  <mcatanzaro@igalia.com>
324
325         WebKit2GTK - WebKitWebProcess assertion fails when dragging and dropping a file into the view
326         https://bugs.webkit.org/show_bug.cgi?id=127576
327
328         Reviewed by Carlos Garcia Campos.
329
330         * UIProcess/WebPageProxy.cpp:
331         (WebKit::WebPageProxy::performDragControllerAction): Assume read access
332         to any file that has been dragged into the web view when compiling for
333         GTK, since we don't support sandbox extensions.
334
335 2014-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>
336
337         Enable CSS_SCROLL_SNAP for iOS
338         https://bugs.webkit.org/show_bug.cgi?id=135915
339
340         Turn on CSS_SCROLL_SNAP for iOS and the iOS simulator.
341
342         Reviewed by Tim Horton.
343
344         * Configurations/FeatureDefines.xcconfig:
345
346 2014-08-13  Enrica Casucci  <enrica@apple.com>
347
348         [Services with UI] Use a longer delay duration for editable content.
349         https://bugs.webkit.org/show_bug.cgi?id=135918
350         <rdar://problem/17998929>
351
352         Reviewed by Tim Horton.
353
354         Use a 1 second delay for selections in editable content.
355
356         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
357         (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
358
359 2014-08-13  Mark Rowe  <mrowe@apple.com>
360
361         <https://webkit.org/b/135911> WebKit should build on Yosemite with the public SDK.
362
363         Reviewed by Darin Adler.
364
365         * Platform/IPC/mac/ImportanceAssertion.h: Forward-declare the new assertion functions we use.
366         * UIProcess/mac/WebContextMenuProxyMac.mm: Forward-declare some details related to NSSharingServicePicker.
367
368 2014-08-13  Alexey Proskuryakov  <ap@apple.com>
369
370         iOS build fix.
371
372         * UIProcess/WebContext.cpp:
373         (WebKit::WebContext::ensureNetworkProcess):
374         (WebKit::WebContext::createNewWebProcess):
375
376 2014-08-13  Joseph Pecoraro  <pecoraro@apple.com>
377
378         Opening Web Inspector causes a large amount of sandbox violations
379         https://bugs.webkit.org/show_bug.cgi?id=135908
380
381         Reviewed by Timothy Hatcher.
382
383         * WebProcess/com.apple.WebProcess.sb.in:
384         Permit the WebContent process to create file read extensions for the
385         system WebInspectorUI.framework which the Network process can already
386         read anyways.
387
388 2014-08-13  Tim Horton  <timothy_horton@apple.com>
389
390         Avoid making new active service overlay highlights while the mouse is down
391         https://bugs.webkit.org/show_bug.cgi?id=135872
392         <rdar://problem/17982341>
393
394         Reviewed by Enrica Casucci.
395
396         * WebProcess/WebPage/ServicesOverlayController.h:
397         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
398         (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
399         (WebKit::ServicesOverlayController::mouseEvent):
400         If the mouse is pressed or it's been less than 200ms since the mouse went up,
401         don't allow the highlight to change. We apply the mouse-is-pressed rule to telephone
402         number highlights as well, unlike the rest of the hysteresis logic.
403
404 2014-08-13  Timothy Hatcher  <timothy@apple.com>
405
406         Web Inspector: Workaround a NSWindow change to the title bar.
407         https://bugs.webkit.org/show_bug.cgi?id=135880
408
409         Reviewed by Joseph Pecoraro.
410
411         * UIProcess/mac/WebInspectorProxyMac.mm:
412         (WebKit::WebInspectorProxy::createInspectorWindow): Set titlebarAppearsTransparent on 10.10.
413         Only call border thickness APIs on 10.9 and earlier.
414         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Only call setDrawsBackground: on 10.9 and earlier.
415         (WebKit::WebInspectorProxy::platformSetToolbarHeight): Only call setContentBorderThickness: on 10.9 and earlier.
416
417 2014-08-13  Ryuan Choi  <ryuan.choi@samsung.com>
418
419         [EFL] Add API to set application name for the user agent
420         https://bugs.webkit.org/show_bug.cgi?id=135640
421
422         Reviewed by Gyuyoung Kim.
423
424         Add ewk_application_name_for_user_agent_set to make default user agent string
425         with application name which application passes.
426         It's useful for application to set only application information without knowledge
427         of legacy user agent components.
428
429         * UIProcess/API/efl/EwkView.cpp:
430         (EwkView::EwkView):
431         (EwkView::setApplicationNameForUserAgent):
432         * UIProcess/API/efl/EwkView.h:
433         (EwkView::applicationNameForUserAgent):
434         * UIProcess/API/efl/ewk_view.cpp:
435         (ewk_view_application_name_for_user_agent_set):
436         (ewk_view_application_name_for_user_agent_get):
437         * UIProcess/API/efl/ewk_view.h:
438         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
439         (TEST_F):
440         * UIProcess/efl/WebPageProxyEfl.cpp:
441         (WebKit::WebPageProxy::standardUserAgent):
442
443 2014-08-12  Carlos Garcia Campos  <cgarcia@igalia.com>
444
445         [CMAKE] WebProcess shouldn't need to explicitly link to JavaScriptCore and WebCore
446         https://bugs.webkit.org/show_bug.cgi?id=135832
447
448         Reviewed by Gyuyoung Kim.
449
450         Linking to WebKit2 should be enough, like Network and Plugin processes.
451
452         * CMakeLists.txt:
453
454 2014-08-12  Tim Horton  <timothy_horton@apple.com>
455
456         Document-relative page overlays drop some mouse events with non-zero top content inset
457         https://bugs.webkit.org/show_bug.cgi?id=135871
458         <rdar://problem/17982275>
459
460         Reviewed by Beth Dakin.
461
462         * WebProcess/WebPage/PageOverlay.cpp:
463         (WebKit::PageOverlay::mouseEvent):
464         Convert the mouse position into document-relative coordinates; the bounds()
465         already are! This way, we can actually compare them without being wrong sometimes.
466
467 2014-08-12  Peyton Randolph  <prandolph@apple.com>
468
469         Runtime switch for long mouse press gesture. Part of 135257 - Add long mouse press gesture
470         https://bugs.webkit.org/show_bug.cgi?id=135682
471
472         Reviewed by Tim Horton.
473
474         * Configurations/FeatureDefines.xcconfig: Remove LONG_MOUSE_PRESS feature flag.
475         * Shared/WebPreferencesDefinitions.h:
476         Add LongMousePressEnabled preference, initially false.
477         * UIProcess/API/C/WKPreferences.cpp:
478         (WKPreferencesSetLongMousePressEnabled): Added.
479         (WKPreferencesGetLongMousePressEnabled): Added.
480         * UIProcess/API/C/WKPreferencesRefPrivate.h:
481         * WebProcess/WebPage/WebPage.cpp:
482         (WebKit::WebPage::updatePreferences):
483         Reflect the WebKit long mouse press setting in WebCore.
484
485 2014-08-12  Pratik Solanki  <psolanki@apple.com>
486
487         Cached file backed resources don't make it to the Web Process when NETWORK_CFDATA_ARRAY_CALLBACK is enabled
488         https://bugs.webkit.org/show_bug.cgi?id=135727
489         <rdar://problem/17947880>
490
491         Reviewed by Darin Adler.
492
493         tryGetShareableHandleFromSharedBuffer() assumed that we have a file backed resource only if
494         we had a CFDataRef (platformData()) in SharedBuffer. This is wrong when we use the data
495         array callbacks since the file backed buffer could be in the data array. Instead of relying
496         on hasPlatformData(), explicitly ask the SharedBuffer to give us a CFDataRef if it has one
497         so that SharedBuffer can take care of the data array case.
498
499         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
500         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
501
502 2014-08-12  Alexey Proskuryakov  <ap@apple.com>
503
504         REGRESSION: WebContent process has a sandbox extension for the entirety of user's temp directory
505         https://bugs.webkit.org/show_bug.cgi?id=135853
506         <rdar://problem/17986556>
507
508         Reviewed by Oliver hunt.
509
510         Move extensions recently added for iOS benefit under PLATFORM(IOS). Removed some
511         dead code while at it (child processes don't need actual paths, they only need
512         sandbox extensions in most cases).
513
514         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
515         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
516         * Shared/Network/NetworkProcessCreationParameters.cpp:
517         (WebKit::NetworkProcessCreationParameters::encode):
518         (WebKit::NetworkProcessCreationParameters::decode):
519         * Shared/Network/NetworkProcessCreationParameters.h:
520         * Shared/WebProcessCreationParameters.cpp:
521         (WebKit::WebProcessCreationParameters::encode):
522         (WebKit::WebProcessCreationParameters::decode):
523         * Shared/WebProcessCreationParameters.h:
524         * UIProcess/WebContext.cpp:
525         (WebKit::WebContext::ensureNetworkProcess):
526         (WebKit::WebContext::createNewWebProcess):
527         (WebKit::WebContext::openGLCacheDirectory): Deleted.
528         (WebKit::WebContext::networkingHSTSDatabasePath): Deleted.
529         * UIProcess/WebContext.h:
530         * UIProcess/efl/WebContextEfl.cpp:
531         (WebKit::WebContext::containerTemporaryDirectory): Deleted.
532         (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath): Deleted.
533         * UIProcess/gtk/WebContextGtk.cpp:
534         (WebKit::WebContext::containerTemporaryDirectory): Deleted.
535         (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath): Deleted.
536         * UIProcess/mac/WebContextMac.mm:
537         (WebKit::WebContext::openGLCacheDirectory):
538         (WebKit::WebContext::parentBundleDirectory):
539         (WebKit::WebContext::networkingHSTSDatabasePath):
540         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Deleted.
541         (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath): Deleted.
542         * WebProcess/cocoa/WebProcessCocoa.mm:
543         (WebKit::WebProcess::platformInitializeWebProcess):
544
545 2014-08-12  Tim Horton  <timothy_horton@apple.com>
546
547         Small region (~1px tall) where you get the selection button instead of the phone number overlay
548         https://bugs.webkit.org/show_bug.cgi?id=135852
549         <rdar://problem/17992795>
550
551         Reviewed by Enrica Casucci.
552
553         * WebProcess/WebPage/ServicesOverlayController.h:
554         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
555         (WebKit::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
556         (WebKit::ServicesOverlayController::determineActiveHighlight):
557         If our new active highlight is a selection highlight that is completely contained
558         by one of the phone number highlights, we'll make the phone number highlight active
559         even if it's not hovered. This fixes the case where the selection highlight
560         (a subset of a telephone number) is slightly taller than the telephone number
561         highlight, and can be hovered without hovering the phone number highlight.
562
563 2014-08-12  Tim Horton  <timothy_horton@apple.com>
564
565         REGRESSION (r172424): Extra menu header in combined telephone number menu when no phone paired
566         https://bugs.webkit.org/show_bug.cgi?id=135854
567         <rdar://problem/17996339>
568
569         Reviewed by Enrica Casucci.
570
571         * UIProcess/mac/WebContextMenuProxyMac.mm:
572         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
573         Get all the menu items ahead of time, and only add the shared header
574         if there are any telephone number menu items.
575
576 2014-08-12  Enrica Casucci  <enrica@apple.com>
577
578         Crash at com.apple.WebKit.WebContent at com.apple.WebKit: WebKit::expandForGap
579         https://bugs.webkit.org/show_bug.cgi?id=135859
580         <rdar://problem/17994679>
581
582         Reviewed by Tim Horton.
583
584         expandForGap made the assumption that the selection rects were always three.
585         This was not true even before http://trac.webkit.org/changeset/172395 but
586         was more likely to happen after that change.
587         
588         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
589         (WebKit::expandForGap):
590
591 2014-08-12  Tim Horton  <timothy_horton@apple.com>
592
593         Don't show the combined menu if there are no services available
594         https://bugs.webkit.org/show_bug.cgi?id=135846
595         <rdar://problem/17582099>
596
597         Reviewed by Enrica Casucci.
598
599         * WebProcess/WebPage/ServicesOverlayController.h:
600         Add a FIXME.
601
602         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
603         (WebKit::ServicesOverlayController::determineActiveHighlight):
604         Don't allow a selection Highlight to become active if there is no
605         service available to handle it. Previously we showed the combined menu
606         with just phone numbers in it if any were detected.
607
608 2014-08-12  Tim Horton  <timothy_horton@apple.com>
609
610         Add a fade transition to services highlights
611         https://bugs.webkit.org/show_bug.cgi?id=135829
612         <rdar://problem/17935736>
613
614         Reviewed by Enrica Casucci.
615
616         Add a smooth fade to highlight installation and uninstallation.
617         To do so, we make each highlight paint into its own small layer.
618
619         * WebProcess/WebPage/PageOverlay.cpp:
620         (WebKit::PageOverlay::layer):
621         * WebProcess/WebPage/PageOverlay.h:
622         * WebProcess/WebPage/PageOverlayController.cpp:
623         (WebKit::PageOverlayController::layerForOverlay):
624         * WebProcess/WebPage/PageOverlayController.h:
625         Expose the GraphicsLayer on PageOverlay.
626
627         * WebProcess/WebPage/ServicesOverlayController.h:
628         (WebKit::ServicesOverlayController::Highlight::layer):
629         (WebKit::ServicesOverlayController::activeHighlight):
630         (WebKit::ServicesOverlayController::webPage):
631         (WebKit::ServicesOverlayController::Highlight::Highlight): Deleted.
632
633         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
634         (WebKit::ServicesOverlayController::Highlight::createForSelection):
635         (WebKit::ServicesOverlayController::Highlight::createForTelephoneNumber):
636         (WebKit::ServicesOverlayController::Highlight::Highlight):
637         Highlights now own a GraphicsLayer, which are later installed
638         as sublayers of the ServicesOverlayController's PageOverlay layer.
639         These layers are sized and positioned according to the DDHighlight's bounds.
640
641         (WebKit::ServicesOverlayController::Highlight::~Highlight):
642         (WebKit::ServicesOverlayController::Highlight::invalidate):
643         ServicesOverlayController will invalidate any remaining highlights
644         when it is torn down, so they can clear their backpointers.
645
646         (WebKit::ServicesOverlayController::Highlight::notifyFlushRequired):
647         Forward flush notifications to the DrawingArea.
648
649         (WebKit::ServicesOverlayController::Highlight::paintContents):
650         Paint the DDHighlight into the layer. Translation is done by the layer position,
651         so we zero the bounds origin when painting.
652
653         (WebKit::ServicesOverlayController::Highlight::deviceScaleFactor):
654         Forward the deviceScaleFactor so that things are painted at the right scale.
655
656         (WebKit::ServicesOverlayController::Highlight::fadeIn):
657         (WebKit::ServicesOverlayController::Highlight::fadeOut):
658         Apply a fade animation to the layer.
659
660         (WebKit::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
661         When the fade completes, unparent the layer, unless it has become active again.
662
663         (WebKit::ServicesOverlayController::ServicesOverlayController):
664         (WebKit::ServicesOverlayController::~ServicesOverlayController):
665         Invalidate all highlights, so they can clear their backpointers.
666
667         (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
668         Make remainingTimeUntilHighlightShouldBeShown act upon a particular highlight
669         instead of always the active highlight.
670
671         (WebKit::ServicesOverlayController::determineActiveHighlightTimerFired): Rename.
672
673         (WebKit::ServicesOverlayController::drawRect):
674         drawRect is no longer called and will no longer do anything; all of the
675         painting is done in sublayers.
676
677         (WebKit::ServicesOverlayController::buildPhoneNumberHighlights):
678         Ensure that phone number Highlights stay stable even while the selection
679         changes, by comparing the underlying Ranges and keeping around old Highlights
680         that match the new ones. This enables us to e.g. fade in while changing
681         the selection within a phone number.
682
683         (WebKit::ServicesOverlayController::buildSelectionHighlight):
684         (WebKit::ServicesOverlayController::didRebuildPotentialHighlights):
685         (WebKit::ServicesOverlayController::createOverlayIfNeeded):
686         Don't call setNeedsDisplay; the overlay doesn't have backing store.
687         Instead, call determineActiveHighlight, which will install/uninstall
688         highlights as necessary.
689
690         (WebKit::ServicesOverlayController::determineActiveHighlight):
691         Apply fade in/fade out to the overlays.
692         Keep track of which highlight we're going to activate, until the hysteresis
693         delay is up, then actually make it active/parent it/fade it in.
694         We now will have no active highlight between the fade out of the previous one
695         and the fade in of the new one (during the hysteresis delay).
696
697         (WebKit::ServicesOverlayController::mouseEvent):
698         The overlay now will not become active until the delay is up, so we don't
699         need to check it again here.
700
701         (WebKit::ServicesOverlayController::handleClick):
702         (WebKit::ServicesOverlayController::didCreateHighlight):
703         (WebKit::ServicesOverlayController::willDestroyHighlight):
704         (WebKit::ServicesOverlayController::repaintHighlightTimerFired): Deleted.
705         (WebKit::ServicesOverlayController::drawHighlight): Deleted.
706
707 2014-08-11  Andy Estes  <aestes@apple.com>
708
709         [iOS] Get rid of iOS.xcconfig
710         https://bugs.webkit.org/show_bug.cgi?id=135809
711
712         Reviewed by Joseph Pecoraro.
713
714         All iOS.xcconfig did was include AspenFamily.xcconfig, so there's no need for the indirection.
715
716         * Configurations/Base.xcconfig:
717         * Configurations/iOS.xcconfig: Removed.
718         * WebKit2.xcodeproj/project.pbxproj:
719
720 2014-08-12  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
721
722         [EFL] Rename ewk_private.h to EwkDebug.h
723         https://bugs.webkit.org/show_bug.cgi?id=135797
724
725         Reviewed by Gyuyoung Kim.
726
727         ewk_private.h contains only debug macros alllowing
728         logging.
729
730         * UIProcess/API/efl/EwkView.cpp:
731         * UIProcess/API/efl/ewk_main.cpp:
732         * UIProcess/efl/EwkDebug.h: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_private.h.
733         * UIProcess/efl/ViewClientEfl.cpp:
734
735 2014-08-12  Carlos Garcia Campos  <cgarcia@igalia.com>
736
737         [GTK] The plugins metadata cache doesn't work if the user cache directory doesn't exist
738         https://bugs.webkit.org/show_bug.cgi?id=135834
739
740         Reviewed by Philippe Normand.
741
742         Make sure the user cache directory exists. If creating the
743         directory fails for whatever reason, do not try to save the cache
744         to disk.
745
746         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
747         (WebKit::PluginInfoCache::PluginInfoCache):
748         (WebKit::PluginInfoCache::updatePluginInfo):
749
750 2014-08-12  Alexey Proskuryakov  <ap@apple.com>
751
752         [Mac] Allow reading CoreGraphics debugging preferences
753         https://bugs.webkit.org/show_bug.cgi?id=135821
754         <rdar://problem/11219259>
755
756         Reviewed by Darin Adler.
757
758         * WebProcess/com.apple.WebProcess.sb.in:
759
760 2014-08-11  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
761
762         [EFL] Prevent the client from creating ewk_view when EWebkit is not initialized
763         https://bugs.webkit.org/show_bug.cgi?id=135606
764
765         Reviewed by Gyuyoung Kim.
766
767         Similarly to EFL modules (eina, evas etc.), application using EWebKit
768         has to initialize it using ewk_init().
769
770         Do not allow the client to create ewk_view if ewk_init has not been called.
771         Add an appropriate logs warning the client about wrong APIs usage.
772
773         * UIProcess/API/efl/ewk_main.cpp: Add EwkMain class to control ewk lifetime.
774         (WebKit::EwkMain::EwkMain):
775         (WebKit::EwkMain::shared):
776         (WebKit::EwkMain::~EwkMain): Add logs when the client forgot to destroy EWebkit.
777         (WebKit::EwkMain::initialize):
778         (WebKit::EwkMain::finalize):
779         (WebKit::EwkMain::shutdownInitializedEFLModules):
780         (ewk_init):
781         (ewk_shutdown):
782         * UIProcess/API/efl/ewk_main_private.h: Added.
783         (WebKit::EwkMain::isInitialized):
784         (WebKit::EwkMain::logDomainId):
785         * UIProcess/API/efl/ewk_private.h:
786         * UIProcess/API/efl/ewk_view.cpp:
787         (EWKViewCreate):
788         Prevent the client from creating ewk_view when ewk_init() has not been called.
789
790 2014-08-11  Enrica Casucci  <enrica@apple.com>
791
792         Improve look and feel of combined service menu..
793         https://bugs.webkit.org/show_bug.cgi?id=135824
794         <rdar://problem/17936880>
795
796         Reviewed by Tim Horton.
797         
798         When showing the combined menu, list the phone numbers first,
799         grouped under a common header, followed by the entries relative
800         to the services.
801
802         * Platform/mac/MenuUtilities.h:
803         * Platform/mac/MenuUtilities.mm:
804         (WebKit::menuItemTitleForTelephoneNumberGroup):
805         (WebKit::menuItemForTelephoneNumber):
806         * UIProcess/mac/WebContextMenuProxyMac.mm:
807         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
808
809 2014-08-11  Joseph Pecoraro  <pecoraro@apple.com>
810
811         Add Private WKPreferences API for developer extras (show inspector)
812         https://bugs.webkit.org/show_bug.cgi?id=135811
813
814         Reviewed by Timothy Hatcher.
815
816         * UIProcess/API/Cocoa/WKPreferences.mm:
817         (-[WKPreferences _developerExtrasEnabled]):
818         (-[WKPreferences _setDeveloperExtrasEnabled:]):
819         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
820
821 2014-08-08  Enrica Casucci  <enrica@apple.com>
822
823         [Services with UI] Action menu arrow hit testing is sometimes wrong.
824         https://bugs.webkit.org/show_bug.cgi?id=135776
825         <rdar://problem/17837670>
826
827         Reviewed by Brady Eidson.
828
829         There was a problem in the algorithm that stitches together the selection rectangles
830         to be given to Data Detectors API.
831         This change adds a new function that stiches together all the rects contributing to the
832         first line, all the rects contributing to the last line and all the ones in the middle.
833         This way we can have a maximum of 3 non overlapping rectangles.
834
835         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
836         (WebKit::stitchRects):
837         (WebKit::compactRectsWithGapRects):
838
839 2014-08-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
840
841         Unreviewed, EFL build fix since r172385.
842
843         * PlatformEfl.cmake:
844
845 2014-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
846
847         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.5.2 release.
848
849         * gtk/NEWS: Add release notes for 2.5.2.
850
851 2014-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
852
853         [GTK] No IPC messages are sent when building WebKitGTK+ with VERSION_SCRIPT
854         https://bugs.webkit.org/show_bug.cgi?id=135760
855
856         Reviewed by Philippe Normand.
857
858         The problem is that the threading initialization is failing
859         because there are two copies of WTF, one in libjavascriptcoregtk
860         and the other in libwebkit2gtk. When WebKit2 is initialized in the
861         UI process, JSC::initializeThreading() is called first and then
862         WTF::initializeMainThread(). The former is calling
863         ThreadIdentifierData::initializeOnce() initializing the
864         ThreadIdentifierData::m_key symbol in libjavascriptcoregtk, while
865         the latter is using the ThreadIdentifierData API from libwebkit2gtk
866         that hasn't been initialized.
867
868         * CMakeLists.txt: Do not add WTF to the list of WebKit2 libraries,
869         WebKit2 already depends on JavaScriptCore that already links to WTF.
870
871 2014-08-10  Tim Horton  <timothy_horton@apple.com>
872
873         Yelp phone number highlights often disappear
874         https://bugs.webkit.org/show_bug.cgi?id=135789
875         <rdar://problem/17971057>
876
877         Reviewed by Brady Eidson.
878
879         Since selectedTelephoneNumberRangesChanged doesn't provide an associated
880         Frame, an incoming selectedTelephoneNumberRangesChanged from a subframe
881         would overwrite ServicesOverlayController's cached (and potentially active)
882         telephone number highlights.
883
884         This happens a lot on Yelp, because they have many subframes which are
885         doing layout on a regular basis.
886
887         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
888         (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
889         * WebProcess/WebCoreSupport/WebEditorClient.h:
890         Adjust to the new (lack of) arguments.
891
892         * WebProcess/WebPage/ServicesOverlayController.h:
893         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
894         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
895         Adjust logging; we can revisit it later.
896
897         (WebKit::ServicesOverlayController::buildPhoneNumberHighlights):
898         When building phone number highlights, walk the Frame tree and retrieve
899         them from all of the Editors.
900
901         (WebKit::ServicesOverlayController::didRebuildPotentialHighlights):
902         (WebKit::ServicesOverlayController::telephoneNumberRangesForFocusedFrame):
903         (WebKit::ServicesOverlayController::determineActiveHighlight):
904         (WebKit::ServicesOverlayController::handleClick):
905         Retrieve the detected telephone number ranges from the focused frame
906         when combining telephone numbers with selection services.
907         This ensures that we don't show combined phone number highlights from other frames.
908
909 2014-08-10  Tim Horton  <timothy_horton@apple.com>
910
911         Refactor ServiceOverlayController in preparation for fading between highlights
912         https://bugs.webkit.org/show_bug.cgi?id=135787
913         <rdar://problem/17935736>
914
915         Reviewed by Brady Eidson.
916
917         Rework ServicesOverlayController so that we always keep a set of generic
918         "potential highlights", which are refcounted Highlight objects and
919         wrap a DDHighlightRef, as well as a type (Selection or TelephoneNumber),
920         Range (only used in the case of TelephoneNumber), and potentially more
921         things in the future (like, say, fade state!).
922
923         We eagerly update the list of potential highlights when the selection or set
924         of detected telephone numbers changes, and use this information to install
925         or uninstall the page overlay as needed.
926
927         When we need to recompute the "active" highlight from this set (for example,
928         we need to handle a mouse event or paint the highlight), we look through
929         the set of potential highlights and decide. This moves the "active" highlight
930         decision logic into one small and confined place.
931
932         * WebProcess/WebPage/ServicesOverlayController.h:
933         (WebKit::ServicesOverlayController::Highlight):
934         Add the new aforementioned refcounted Highlight class.
935         Rename m_lastHoveredHighlightChangeTime to m_lastActiveHighlightChangeTime.
936         Make m_webPage a reference.
937         The rest is just added/removed/adjusted functions for the refactoring.
938
939         (WebKit::TelephoneNumberData::TelephoneNumberData): Deleted.
940         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
941         (WebKit::ServicesOverlayController::Highlight::createForSelection):
942         (WebKit::ServicesOverlayController::Highlight::createForTelephoneNumber):
943         Create Highlights for the two different highlight types.
944
945         (WebKit::ServicesOverlayController::ServicesOverlayController):
946         (WebKit::ServicesOverlayController::willMoveToWebPage):
947         Our WebPage pointer is always valid because it owns us; don't clear it.
948         We need to keep it around so that we can uninstall the overlay and
949         install it again later, anyway.
950
951         (WebKit::ServicesOverlayController::selectionRectsDidChange):
952         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
953         When selection rects or detected telephone numbers change, rebuild potential highlights.
954         This will have the side-effect of installing the overlay if needed.
955
956         (WebKit::ServicesOverlayController::mouseIsOverHighlight):
957         Make this function take a Highlight instead of a DDHighlightRef.
958
959         (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
960         Make this function take a Highlight instead of a DDHighlightRef.
961
962         (WebKit::ServicesOverlayController::drawHighlight):
963         Make this function take a Highlight instead of a DDHighlightRef.
964         There's no reason to do the translation separately from the layer blit,
965         also allowing us to avoid the StateSaver.
966
967         (WebKit::ServicesOverlayController::drawRect):
968         drawRect now always paints the active highlight, instead of duplicating
969         logic about which highlight should be active.
970         Also, it will update the active highlight before painting.
971         We no longer need to re-determine whether the active highlight's phone
972         number range is still a valid phone number range, because we rebuild
973         the potential highlights whenever the set of phone number ranges changes.
974
975         (WebKit::ServicesOverlayController::clearActiveHighlight):
976         Mostly an adoption of new names.
977
978         (WebKit::ServicesOverlayController::removeAllPotentialHighlightsOfType):
979         Run through the list of potential highlights and remove any of the given type.
980         The two highlight building functions use this helper to clear the old ones before building.
981
982         (WebKit::ServicesOverlayController::buildPhoneNumberHighlights):
983         (WebKit::ServicesOverlayController::buildSelectionHighlight):
984         Rebuild the list of potential highlights, replacing all highlights of
985         the given type with new ones.
986
987         (WebKit::ServicesOverlayController::hasRelevantSelectionServices):
988         Factor out the code that decides whether our current selection is
989         viable for servicing based on whether we have plain-text and/or rich-text services.
990
991         (WebKit::ServicesOverlayController::didRebuildPotentialHighlights):
992         When rebuilding potential highlights, if we have no potential highlights at all,
993         uninstall the page overlay; we don't need mouse tracking and don't need to
994         paint anything. This improves memory use and compositing performance significantly,
995         where previously we were leaving the overlay up forever after creating it.
996
997         If we have either detected telephone numbers or relevant selection services,
998         create and install the overlay if it doesn't already exist.
999
1000         (WebKit::ServicesOverlayController::createOverlayIfNeeded):
1001         This just moved from elsehwere, except that it now uses FadeMode::DoNotFade.
1002         It doesn't make sense to fade on install/uninstall (which happens even before hover)
1003         but not on changing the active highlight; fading will be re-addressed in the next patch.
1004
1005         (WebKit::ServicesOverlayController::highlightsAreEquivalent):
1006         Determine whether two highlights are equivalent. While we may have
1007         created a new Highlight at rebuild time, if two telephone number
1008         highlights have equivalent ranges, there's no need to 'transition' to the new one.
1009
1010         (WebKit::ServicesOverlayController::determineActiveHighlight):
1011         Run through the list of services, and try to find one that is hovered.
1012         We prefer telephone number highlights to selection highlights, and
1013         we will never make a selection highlight active if it is both
1014         not serviceable and there are no telephone numbers to show in the combined menu.
1015         This is the centralized location for determination of which highlight
1016         should be considered active. If the active highlight changed, update
1017         the time since last change and cancel the mouse-down tracking.
1018
1019         (WebKit::ServicesOverlayController::mouseEvent):
1020         Adjust some comments to be more explanatory.
1021         A bunch of code moved out of here and into determineActiveHighlight.
1022
1023         (WebKit::ServicesOverlayController::handleClick):
1024         Adjust to take a reference and use Highlight instead of DDHighlightRef.
1025
1026 2014-08-10  Timothy Hatcher  <timothy@apple.com>
1027
1028         Web Inspector: new glyphs are visible on OS X 10.9 builds
1029         https://bugs.webkit.org/show_bug.cgi?id=135743
1030
1031         Reviewed by Joseph Pecoraro.
1032
1033         * UIProcess/mac/WebInspectorProxyMac.mm:
1034         (WebKit::WebInspectorProxy::createInspectorWindow): Use 10100 instead of 1090 for the version.
1035
1036 2014-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1037
1038         [GTK] REGRESSION(r166239): The ld version script is not being used
1039         https://bugs.webkit.org/show_bug.cgi?id=135694
1040
1041         Reviewed by Martin Robinson.
1042
1043         * CMakeLists.txt: Add VERSION_SCRIPT to WebKit2 link flags if present.
1044
1045 2014-08-09  Tim Horton  <timothy_horton@apple.com>
1046
1047         REGRESSION (r172301): Combined phone number highlight doesn't appear if rich content is selected and we have no rich content services
1048         https://bugs.webkit.org/show_bug.cgi?id=135785
1049         <rdar://problem/17969843>
1050
1051         Reviewed by Brady Eidson.
1052
1053         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1054         (WebKit::ServicesOverlayController::drawSelectionHighlight):
1055         We can't early return in the rich-content-but-no-rich-services case
1056         if we have telephone numbers in the selection, because we want to offer
1057         them up in the combined menu.
1058
1059         * UIProcess/mac/WebContextMenuProxyMac.mm:
1060         If we end up with no menu, because there were no services available,
1061         make a fresh one that we can fill with combined telephone number items.
1062
1063 2014-08-08  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1064
1065         [EFL] Do not initialize g_type in WebProcessMain::platformInitialize()
1066         https://bugs.webkit.org/show_bug.cgi?id=135700
1067
1068         Reviewed by Gyuyoung Kim.
1069
1070         Inspired by r171788.
1071         Glib since 2.36 itself initializes g_type_init.
1072
1073         * WebProcess/efl/WebProcessMainEfl.cpp:
1074
1075 2014-08-08  Tim Horton  <timothy_horton@apple.com>
1076
1077         Build fix for 32-bit.
1078
1079         * UIProcess/mac/ServicesController.mm:
1080         (WebKit::ServicesController::ServicesController):
1081         Don't dynamically refresh services in 32-bit apps. It's not possible
1082         to write a 32-bit app with the Modern API, so this doesn't matter.
1083
1084 2014-08-08  Tim Horton  <timothy_horton@apple.com>
1085
1086         [mac] Dynamically update serviceability when the set of services changes
1087         https://bugs.webkit.org/show_bug.cgi?id=135738
1088         <rdar://problem/17533459>
1089
1090         Reviewed by Brady Eidson.
1091
1092         * UIProcess/WebContext.cpp:
1093         (WebKit::WebContext::createNewWebProcess):
1094         Adopt the new universal refreshExistingServices.
1095
1096         (WebKit::WebContext::refreshExistingServices): Deleted.
1097         * UIProcess/WebContext.h:
1098         Remove WebContext::refreshExistingServices; there's no need for it.
1099
1100         * UIProcess/mac/ServicesController.h:
1101         * UIProcess/mac/ServicesController.mm:
1102         Fix the build with only public headers by including NSSharingService.h itself.
1103         Place the NSSharingServicePicker (Details) category outside the #ifdef.
1104         Forward-declare and possibly import NSExtension SPI.
1105
1106         (WebKit::ServicesController::ServicesController):
1107         Register a callback to be notified whenever the set of services changes.
1108         When this occurs, call refreshExistingServices. We let refreshExistingServices
1109         coalesce updates because these notifications can come in small batches.
1110
1111         (WebKit::ServicesController::refreshExistingServices):
1112         Dispatch changes in service availability to all processes in all contexts.
1113
1114         * UIProcess/mac/WebContextMenuProxyMac.mm:
1115         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
1116         Adjust the referenced rdar:// and call ServicesController::refreshExistingServices
1117         instead of the now-removed WebContext:: variant. We can't remove this
1118         yet because our services state can still be stale because NSServiceSharingPicker
1119         can still sometimes lie about the current service state immediately after a change occurs;
1120         once that is fixed, we should get rid of this as well as the refresh in Web Process creation.
1121
1122 2014-08-08  Timothy Horton  <timothy_horton@apple.com>
1123
1124         Clients that request the selection services menu after WebKit2 will get one with different metrics than otherwise
1125         https://bugs.webkit.org/show_bug.cgi?id=135765
1126         <rdar://problem/17962180>
1127
1128         Reviewed by Brady Eidson.
1129
1130         * UIProcess/mac/WebContextMenuProxyMac.mm:
1131         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
1132         The menu is cached between clients, but we make adjustments to it.
1133         We should copy it before adjusting.
1134
1135 2014-08-08  Timothy Horton  <timothy_horton@apple.com>
1136
1137         Services overlay dropdown is often in the wrong place with zoomed pages or horizontal scrolling
1138         https://bugs.webkit.org/show_bug.cgi?id=135755
1139         <rdar://problem/17907752>
1140
1141         Reviewed by Brady Eidson.
1142
1143         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1144         (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight):
1145         (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
1146         DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection adjusts the
1147         location of the button based on the visible rect, trying to keep the button visible.
1148
1149         We're handing it the wrong visible rect, though, not taking scrolling into account.
1150
1151         This leads to pages that scroll horizontally showing the button on the left
1152         even if there's space for it on the right, or sometimes not showing it at all.
1153
1154         Instead, provide the actual main FrameView visible rect; the same coordinate
1155         space that the highlight rects are provided in.
1156
1157 2014-08-08  Timothy Horton  <timothy_horton@apple.com>
1158
1159         Additional items added to selection services menus are misaligned
1160         https://bugs.webkit.org/show_bug.cgi?id=135747
1161         <rdar://problem/17933167>
1162
1163         Reviewed by Brady Eidson.
1164
1165         * UIProcess/mac/WebContextMenuProxyMac.mm:
1166         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
1167         Use NSSharingServicePickerStyleRollover for the rollover image services menu;
1168         use NSSharingServicePickerStyleTextSelection for the selection services menu.
1169
1170         Set NSMenu's showsStateColumn to YES for selection services menus, so that
1171         other items added to the menu line up correctly.
1172
1173         Remove an unncessary .get()
1174
1175 2014-08-08  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1176
1177         [EFL] Remove unnecessary ewk_private.h includes
1178         https://bugs.webkit.org/show_bug.cgi?id=135753
1179
1180         Reviewed by Gyuyoung Kim.
1181
1182         Neither the below file uses the functionality from ewk_private.h.
1183
1184         * UIProcess/API/efl/ewk_context.cpp:
1185         * UIProcess/API/efl/ewk_context_menu_item.cpp:
1186         * UIProcess/API/efl/ewk_cookie_manager.cpp:
1187         * UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
1188         * UIProcess/API/efl/ewk_popup_menu_item.cpp:
1189         * UIProcess/API/efl/ewk_view.cpp:
1190
1191 2014-08-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1192
1193         [GTK] Do not use GtkWindow:resize-grip-visible with recent GTK+ versions
1194         https://bugs.webkit.org/show_bug.cgi?id=135699
1195
1196         Reviewed by Philippe Normand.
1197
1198         Resize grips support have been removed from GTK+ since 3.13.4, the
1199         API has been deprecated and does nothing.
1200
1201         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1202         (webkitWebViewBaseSetToplevelOnScreenWindow):
1203         (resizeWebKitWebViewBaseFromAllocation):
1204
1205 2014-08-07  Tim Horton  <timothy_horton@apple.com>
1206
1207         [Services with UI] Action menu does not appear if selection includes both text and an image
1208         https://bugs.webkit.org/show_bug.cgi?id=135731
1209         <rdar://problem/17837491>
1210
1211         Reviewed by Dean Jackson.
1212
1213         * UIProcess/WebContext.cpp:
1214         (WebKit::WebContext::createNewWebProcess):
1215         Initialize hasRichContentServices with the cached value.
1216
1217 2014-08-07  Benjamin Poulain  <bpoulain@apple.com>
1218
1219         Get rid of SCRIPTED_SPEECH
1220         https://bugs.webkit.org/show_bug.cgi?id=135729
1221
1222         Reviewed by Brent Fulgham.
1223
1224         * Configurations/FeatureDefines.xcconfig:
1225
1226 2014-08-07  Timothy Horton  <timothy_horton@apple.com>
1227
1228         setCustomSwipeViews inside didChangeBackForwardList client callback is ignored
1229         https://bugs.webkit.org/show_bug.cgi?id=135633
1230         <rdar://problem/17926507>
1231
1232         Reviewed by Sam Weinig.
1233
1234         * UIProcess/PageClient.h:
1235         * UIProcess/WebPageProxy.cpp:
1236         (WebKit::WebPageProxy::didChangeBackForwardList):
1237         * UIProcess/ios/PageClientImplIOS.h:
1238         * UIProcess/ios/PageClientImplIOS.mm:
1239         (WebKit::PageClientImpl::clearCustomSwipeViews): Deleted.
1240         * UIProcess/mac/PageClientImpl.h:
1241         * UIProcess/mac/PageClientImpl.mm:
1242         (WebKit::PageClientImpl::clearCustomSwipeViews): Deleted.
1243         WebKit clears the set of custom swipe views at the end of WebPageProxy::didChangeBackForwardList,
1244         *after* calling into the client. This means that if the client wants to setCustomSwipeViews in
1245         didChangeBackForwardList, it won't be respected.
1246
1247         Since there's only one client of this SPI, let's just stop clearing the list of custom swipe
1248         views in WebKit and leave that totally up to the client.
1249
1250 2014-08-07  Enrica Casucci  <enrica@apple.com>
1251
1252         [Services with UI] Action menu does not appear if selection includes both text and an image.
1253         https://bugs.webkit.org/show_bug.cgi?id=135731
1254         <rdar://problem/17837491>
1255
1256         Reviewed by Brady Eidson.
1257
1258         Adding a new setting to ServicesController to communicate to the WebProcess if
1259         there are services installed that can handle a combination of text and images.
1260         This way ServicesOverlayController can decide if it appropriate to show the hightlight
1261         based on the type of selection (text only or non text only). This information is retrieved
1262         when the selection rects are collected by SelectionGatherer and used by
1263         SelectionGatherer::Notifier to communicate the selection change.
1264
1265         * Shared/WebProcessCreationParameters.cpp:
1266         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1267         * Shared/WebProcessCreationParameters.h:
1268         * UIProcess/mac/ServicesController.h:
1269         (WebKit::ServicesController::hasRichContentServices):
1270         * UIProcess/mac/ServicesController.mm:
1271         (WebKit::ServicesController::ServicesController):
1272         (WebKit::ServicesController::refreshExistingServices):
1273         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1274         (WebKit::WebEditorClient::selectionRectsDidChange):
1275         * WebProcess/WebCoreSupport/WebEditorClient.h:
1276         * WebProcess/WebPage/ServicesOverlayController.h:
1277         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1278         (WebKit::ServicesOverlayController::ServicesOverlayController):
1279         (WebKit::ServicesOverlayController::selectionRectsDidChange):
1280         (WebKit::ServicesOverlayController::drawSelectionHighlight):
1281         * WebProcess/WebProcess.cpp:
1282         (WebKit::WebProcess::WebProcess):
1283         (WebKit::WebProcess::initializeWebProcess):
1284         (WebKit::WebProcess::setEnabledServices):
1285         * WebProcess/WebProcess.h:
1286         (WebKit::WebProcess::hasRichContentServices):
1287         * WebProcess/WebProcess.messages.in:
1288
1289 2014-08-07  Ryuan Choi  <ryuan.choi@samsung.com>
1290
1291         [EFL] Fix several warnings of doxygen
1292         https://bugs.webkit.org/show_bug.cgi?id=135643
1293
1294         Reviewed by Gyuyoung Kim.
1295
1296         * UIProcess/API/efl/ewk_context_menu_item.h: Removed /info which is not doxygen keyword and unnecessary to the user.
1297         * UIProcess/API/efl/ewk_cookie_manager.h: Fixed parameter name.
1298         * UIProcess/API/efl/ewk_form_submission_request.h: Removed # from Eina_List because doxygen may not know the EFL structures.
1299         * UIProcess/API/efl/ewk_page_group.h: Fixed to match with parameter name.
1300         * UIProcess/API/efl/ewk_settings.h: Fixed wrong keyword and parameter name.
1301         * UIProcess/API/efl/ewk_text_checker.h: Ditto.
1302         * UIProcess/API/efl/ewk_view.h:
1303         - Used escape string for the tag.
1304         - Used @code, @endcode for media query example.
1305
1306 2014-08-07  Benjamin Poulain  <bpoulain@apple.com>
1307
1308         Get rid of INPUT_SPEECH
1309         https://bugs.webkit.org/show_bug.cgi?id=135672
1310
1311         Reviewed by Andreas Kling.
1312
1313         * Configurations/FeatureDefines.xcconfig:
1314         * PlatformGTK.cmake:
1315
1316 2014-08-07  Timothy Hatcher  <timothy@apple.com>
1317
1318         Web Inspector: Update glyphs to be more like Xcode 6
1319         https://bugs.webkit.org/show_bug.cgi?id=135705
1320
1321         Reviewed by Joseph Pecoraro.
1322
1323         * Resources/DockBottom.pdf: Added.
1324         * Resources/DockBottomLegacy.pdf: Copied from Source/WebKit/mac/Resources/Dock.pdf.
1325         * Resources/DockRight.pdf: Added.
1326         * Resources/DockRightLegacy.pdf: Copied from Source/WebKit2/Resources/DockRight.pdf.
1327         * UIProcess/mac/WebInspectorProxyMac.mm:
1328         (WebKit::WebInspectorProxy::createInspectorWindow): Use new images.
1329         * WebKit2.xcodeproj/project.pbxproj: Added new images.
1330
1331 2014-08-07  Oliver Hunt  <oliver@apple.com>
1332
1333         WebContent needs access to HSTS database due to some networking still being performed in process
1334         https://bugs.webkit.org/show_bug.cgi?id=135711
1335         <rdar://17940220>
1336
1337         Reviewed by Alexey Proskuryakov.
1338
1339         Simple patch in the same theme as the equivalent network process
1340         extension.  Provide an extension that covers the WebContent specific
1341         HSTS file and consume it on launch.
1342
1343         * Shared/WebProcessCreationParameters.cpp:
1344         (WebKit::WebProcessCreationParameters::encode):
1345         (WebKit::WebProcessCreationParameters::decode):
1346         * Shared/WebProcessCreationParameters.h:
1347         * UIProcess/WebContext.cpp:
1348         (WebKit::WebContext::createNewWebProcess):
1349         * UIProcess/WebContext.h:
1350         * UIProcess/mac/WebContextMac.mm:
1351         (WebKit::WebContext::webContentHSTSDatabasePath):
1352         * WebProcess/cocoa/WebProcessCocoa.mm:
1353         (WebKit::WebProcess::platformInitializeWebProcess):
1354
1355 2014-08-07  Gordon Sheridan  <gordon_sheridan@apple.com>
1356
1357         Clear the m_previousItem member of HistoryControllers when it matches the HistoryItem being removed.
1358         https://bugs.webkit.org/show_bug.cgi?id=135634
1359         <rdar://problem/17388461>
1360
1361         Reviewed by Brady Eidson.
1362
1363         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1364         (WebKit::WebBackForwardListProxy::removeItem):
1365         Call WebCore::Page::clearPreviousItemFromAllPages() for each item removed from
1366         the back/forward list to ensure the page URL is released from IconDatabase.
1367
1368 2014-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1369
1370         [GTK] Use WebKitNavigationAction also for WebKitNavigationPolicyDecision
1371         https://bugs.webkit.org/show_bug.cgi?id=135695
1372
1373         Reviewed by Gustavo Noronha Silva.
1374
1375         WebKitNavigationAction was introduced to extend WebKitWebView::create signal
1376         and its API is mostly duplicated in WebKitNavigationPolicyDecision.
1377         Use WebKitNavigationAction insternally in WebKitNavigationPolicyDecision and
1378         deprecated all the duplicated API in favor of a single property navigation-action.
1379
1380         * UIProcess/API/gtk/WebKitDefines.h: Remove unused macro
1381         WEBKIT_OBSOLETE and add WEBKIT_DEPRECATED and WEBKIT_DEPRECATED_FOR.
1382         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
1383         (_WebKitNavigationPolicyDecisionPrivate::~_WebKitNavigationPolicyDecisionPrivate):
1384         Free the WebKitNavigationAction.
1385         (webkitNavigationPolicyDecisionGetProperty): Add getter for
1386         navigation-action and use WebKitNavigationAction in all other getters.
1387         (webkit_navigation_policy_decision_class_init): Add navigation-action
1388         property and deprecated all others except frame-name.
1389         (webkit_navigation_policy_decision_get_navigation_action): Return the WebKitNavigationAction.
1390         (webkit_navigation_policy_decision_get_navigation_type): Use WebKitNavigationAction.
1391         (webkit_navigation_policy_decision_get_mouse_button): Ditto.
1392         (webkit_navigation_policy_decision_get_modifiers): Ditto.
1393         (webkit_navigation_policy_decision_get_request): Ditto.
1394         (webkitNavigationPolicyDecisionCreate):
1395         (webkitNewWindowPolicyDecisionCreate):
1396         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
1397         * UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h:
1398         * UIProcess/API/gtk/WebKitPolicyClient.cpp: Use a custom
1399         PolicyClient class so that we receive a NavigationActionData in
1400         the callbacks.
1401         (attachPolicyClientToView):
1402         (toWebKitNavigationType): Deleted.
1403         (decidePolicyForNavigationAction): Deleted.
1404         (decidePolicyForNewWindowAction): Deleted.
1405         (decidePolicyForResponse): Deleted.
1406         * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
1407         (webkitResponsePolicyDecisionCreate):
1408         * UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h:
1409         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for
1410         deprecated symbols.
1411         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
1412
1413 2014-08-06  Antti Koivisto  <antti@apple.com>
1414
1415         Move Soup specific code out of WebCoreArgumentCoders.cpp
1416         https://bugs.webkit.org/show_bug.cgi?id=135665
1417
1418         Reviewed by Anders Carlsson.
1419
1420         * Shared/WebCoreArgumentCoders.cpp:
1421         (IPC::ArgumentCoder<ResourceRequest>::encode):
1422         (IPC::ArgumentCoder<ResourceRequest>::decode):
1423         (IPC::ArgumentCoder<ResourceError>::encode):
1424         (IPC::ArgumentCoder<ResourceError>::decode):
1425         * Shared/WebCoreArgumentCoders.h:
1426         
1427             Soup is the only client for this code. Move it to *Soup.cpp
1428
1429         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1430         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1431         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1432         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1433         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
1434
1435 2014-08-06  Tim Horton  <timothy_horton@apple.com>
1436
1437         Services overlay flashes a lot; should have some hysteresis before showing overlay
1438         https://bugs.webkit.org/show_bug.cgi?id=135683
1439         <rdar://problem/16878039>
1440
1441         Reviewed by Simon Fraser.
1442
1443         Don't show the highlight until it's been 200ms since the last change
1444         in selection or change in which highlight is hovered, whichever was more recent.
1445
1446         * WebProcess/WebPage/ServicesOverlayController.h:
1447         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1448         (WebKit::ServicesOverlayController::ServicesOverlayController):
1449         (WebKit::ServicesOverlayController::selectionRectsDidChange):
1450         Keep track of when the selection last changed.
1451
1452         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlightIfVisible):
1453         Make establishHoveredTelephoneHighlight take a bool instead of Boolean.
1454
1455         (WebKit::ServicesOverlayController::mouseIsOverHighlight):
1456         Factor mouseIsOverHighlight out of establishHoveredTelephoneHighlight and drawHighlight.
1457
1458         (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
1459         Return the amount of time until the highlight should be shown; this is
1460         the maximum of (the difference between the last selection change and the timeout)
1461         and (the difference between the last change in which highlight is hovered and the timeout).
1462
1463         Telephone number highlights are shown immediately, because they are already stable
1464         by virtue of being expanded to include the entire telephone number.
1465
1466         (WebKit::ServicesOverlayController::repaintHighlightTimerFired):
1467         (WebKit::ServicesOverlayController::drawHighlight):
1468         If the highlight shouldn't be shown yet (because we haven't hit the two timeouts),
1469         schedule a timer to repaint us around when we will hit the timeouts.
1470
1471         (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight):
1472         (WebKit::ServicesOverlayController::mouseEvent):
1473         Don't allow mouseUp to trigger the menu if we shouldn't be showing the overlay yet.
1474
1475 2014-08-06  Simon Fraser  <simon.fraser@apple.com>
1476
1477         [iOS WK2] www.france24.com doesn't always load the page, sections stay white
1478         https://bugs.webkit.org/show_bug.cgi?id=135684
1479         <rdar://problem/17931712>
1480
1481         Reviewed by Tim Horton.
1482         
1483         It's possible for a UIScrollView for overflow to move between one scrolling tree node
1484         and another. When this happens, we need to avoid unconditionally clearing the delegate
1485         on the node that's being destroyed, because the new node will already have set the
1486         UIScrollView delegate to its own delegate.
1487
1488         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1489         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):
1490
1491 2014-08-06  Dean Jackson  <dino@apple.com>
1492
1493         ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED is not used anywhere. Remove it.
1494         https://bugs.webkit.org/show_bug.cgi?id=135675
1495
1496         Reviewed by Sam Weinig.
1497
1498         * Configurations/FeatureDefines.xcconfig:
1499
1500 2014-08-06  Brady Eidson and Jeffrey Pfau <beidson@apple.com>
1501
1502         IDB transactions never reset if the Web Process ends before cleaning up
1503         https://bugs.webkit.org/show_bug.cgi?id=135218
1504
1505         Reviewed by Darin Adler and David Kilzer.
1506
1507         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
1508         (WebKit::DatabaseToWebProcessConnection::didReceiveMessage):
1509         (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage): Added.
1510         (WebKit::DatabaseToWebProcessConnection::didClose):
1511         * DatabaseProcess/DatabaseToWebProcessConnection.h:
1512
1513         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
1514         (WebKit::DatabaseProcessIDBConnection::resetTransactionSync): Added
1515             Wait until the reset is complete before sending the sync reply.
1516         (WebKit::DatabaseProcessIDBConnection::rollbackTransactionSync): Added.
1517             Ditto.
1518         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
1519         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
1520
1521         Keep track of all in progress transactions and make sure they’re cleaned up
1522         whenever a connection to a WebProcess is broken:
1523         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1524         (WebKit::UniqueIDBDatabase::unregisterConnection):
1525         (WebKit::UniqueIDBDatabase::didCompleteTransactionOperation):
1526         (WebKit::UniqueIDBDatabase::openBackingStoreTransaction):
1527         (WebKit::UniqueIDBDatabase::resetBackingStoreTransaction):
1528         (WebKit::UniqueIDBDatabase::didEstablishTransaction):
1529         (WebKit::UniqueIDBDatabase::didResetTransaction):
1530         (WebKit::UniqueIDBDatabase::resetAllTransactions):
1531         (WebKit::UniqueIDBDatabase::finalizeRollback):
1532         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1533
1534         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1535         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::rollbackTransaction):
1536
1537         Add sync versions of reset/rollback:
1538         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
1539         (WebKit::WebIDBServerConnection::resetTransactionSync):
1540         (WebKit::WebIDBServerConnection::rollbackTransactionSync):
1541         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
1542
1543 2014-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1544
1545         Implement parsing for CSS scroll snap points
1546         https://bugs.webkit.org/show_bug.cgi?id=134301
1547
1548         Reviewed by Dean Jackson.
1549
1550         * Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP
1551
1552 2014-08-06  Andy Estes  <aestes@apple.com>
1553
1554         [iOS] Subresources referenced in converted QuickLook documents sometimes fail to load
1555         https://bugs.webkit.org/show_bug.cgi?id=135676
1556
1557         Reviewed by David Kilzer.
1558
1559         QuickLookHandle needs to stay alive in order for its NSURLProtocol to service subresource loads originating
1560         from the converted HTML document. Some of these loads happen dynamically after the main resource finishes
1561         loading, so we cannot tie the lifetime of the QuickLookHandle to that of the main resource's ResourceLoader.
1562         Instead, give ownership of the QuickLookHandle to DocumentLoader.
1563
1564         * WebProcess/Network/WebResourceLoader.cpp:
1565         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): Stored the created QuickLookHandle in DocumentLoader.
1566         (WebKit::WebResourceLoader::didReceiveData): Accessed DocumentLoader's QuickLookHandle.
1567         (WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
1568         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
1569         (WebKit::WebResourceLoader::didReceiveResource): Ditto.
1570         * WebProcess/Network/WebResourceLoader.h: Removed m_quickLookHandle.
1571
1572 2014-08-06  Filip Pizlo  <fpizlo@apple.com>
1573
1574         Merge r171389, r171495, r171508, r171510, r171605, r171606, r171611, r171614, r171763 from ftlopt.
1575
1576     2014-08-06  Mark Hahnenberg  <mhahnenberg@apple.com>
1577     
1578             Refactor our current implementation of for-in
1579             https://bugs.webkit.org/show_bug.cgi?id=134142
1580     
1581             Reviewed by Filip Pizlo.
1582     
1583             * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1584             (WebKit::JSNPObject::invalidate): Fixed an invalid ASSERT that was crashing in debug builds.
1585     
1586 2014-08-06  Alexey Proskuryakov  <ap@apple.com>
1587
1588         REGRESSION (WebKit2): iOS Safari default encoding doesn't follow system language
1589         https://bugs.webkit.org/show_bug.cgi?id=135667
1590         <rdar://problem/17862892>
1591
1592         Reviewed by Anders Carlsson.
1593
1594         * Shared/WebPreferencesDefinitions.h: Compute the actual proper default, don't
1595         hardcode it to ISO-8859-1 hoping that someone else will correct it later.
1596
1597         * Shared/WebPreferencesStore.cpp: Added an include for WebPreferencesDefinitions.h
1598         macro expansion to compile.
1599
1600         * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults):
1601         Added a FIXME.
1602
1603         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface):
1604         We now use WKGetWebDefaultCFStringEncoding in WebCore, so it needs to be initialized.
1605
1606 2014-08-06  Adrian Perez de Castro  <aperez@igalia.com>
1607
1608         [GTK] Add support for user scripts to WebKitUserContentManager
1609         https://bugs.webkit.org/show_bug.cgi?id=134738
1610
1611         Reviewed by Carlos Garcia Campos.
1612
1613         Add support for user scripts, to complement the user style sheet
1614         support already present in WebKitUserContentManager. Most of the
1615         moving parts are already present, so this just adds a boxed type
1616         for user scripts (WebKitUserScript) and the corresponding methods
1617         to add and remove scripts from the WebKitUserContentManager.
1618
1619         * UIProcess/API/gtk/WebKitUserContent.cpp: Add a WebKitUserScript
1620         boxed type and its corresponding methods and enums.
1621         (toUserScriptInjectionTime): Needed to convert
1622         WebKitUserScriptInjectionTime values into its WebCore counterparts.
1623         (_WebKitUserScript::_WebKitUserScript): Added.
1624         (_WebKitUserScript::referenceCount): Ditto.
1625         (webkit_user_script_ref):
1626         (webkit_user_script_unref):
1627         (webkit_user_script_new):
1628         (webkitUserScriptGetUserScript): Internal method to obtain the
1629         boxed WebCore::UserScript value.
1630         * UIProcess/API/gtk/WebKitUserContent.h: Add the new public API
1631         methods.
1632         * UIProcess/API/gtk/WebKitUserContentManager.cpp: Implement the
1633         methods for adding and removing user scripts.
1634         (webkit_user_content_manager_add_script):
1635         (webkit_user_content_manager_remove_all_scripts):
1636         * UIProcess/API/gtk/WebKitUserContentManager.h: Add the new public
1637         API methods.
1638         * UIProcess/API/gtk/WebKitUserContentPrivate.h: Add the definition
1639         for the new private function.
1640         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Include the
1641         new public methods in the API documentation.
1642
1643 2014-08-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1644
1645         [GTK] Be able to disable gtk2 dependency
1646         https://bugs.webkit.org/show_bug.cgi?id=135505
1647
1648         Reviewed by Gustavo Noronha Silva.
1649
1650         * PlatformGTK.cmake: Only build WebKitPluginProcess2 when
1651         ENABLE_PLUGIN_PROCESS_GTK2 is ON.
1652         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
1653         (WebKit::ProcessLauncher::launchProcess): Do not try to launch
1654         WebKitPluginProcess2 executable when ENABLE_PLUGIN_PROCESS_GTK2 is OFF.
1655
1656 2014-08-05  Tim Horton  <timothy_horton@apple.com>
1657
1658         REGRESSION (r164337): Pages are sometimes cut off/oriented incorrectly after using WKThumbnailView
1659         https://bugs.webkit.org/show_bug.cgi?id=135622
1660         <rdar://problem/17202556>
1661
1662         Reviewed by Dan Bernstein.
1663
1664         In some cases (when the page changed scroll offset while thumbnailed),
1665         when transitioning back to thumbnail scale = 1, we would get the math
1666         wrong and end up with a non-identity sublayerTransform on the DrawingArea.
1667
1668         Luckily, none of this code is necessary anymore, as the only client
1669         of WKThumbnailView only uses its snapshotting mode.
1670
1671         * Shared/ImageOptions.h:
1672         Remove SnapshotOptionsRespectDrawingAreaTransform; DrawingArea no longer
1673         has a rootLayerTransform().
1674
1675         * UIProcess/WebPageProxy.cpp:
1676         (WebKit::WebPageProxy::setThumbnailScale): Deleted.
1677         * UIProcess/WebPageProxy.h:
1678         * WebProcess/WebPage/WebPage.cpp:
1679         (WebKit::WebPage::WebPage):
1680         (WebKit::WebPage::scaledSnapshotWithOptions):
1681         (WebKit::WebPage::snapshotAtSize):
1682         
1683         (WebKit::WebPage::setThumbnailScale): Deleted.
1684         * WebProcess/WebPage/WebPage.h:
1685         * WebProcess/WebPage/WebPage.messages.in:
1686         Remove setThumbnailScale and SnapshotOptionsRespectDrawingAreaTransform.
1687
1688         * WebProcess/WebPage/WebPage.cpp:
1689         (WebKit::WebPage::didCommitLoad):
1690         Revert this to its state before r164337, as we no longer have "thumbnail scale".
1691
1692         * UIProcess/API/Cocoa/_WKThumbnailView.h:
1693         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1694         (-[_WKThumbnailView initWithFrame:fromWKView:]):
1695         (-[_WKThumbnailView _viewWasUnparented]):
1696         (-[_WKThumbnailView _viewWasParented]):
1697         (-[_WKThumbnailView _requestSnapshotIfNeeded]):
1698         (-[_WKThumbnailView setScale:]):
1699         Clean up code assuming _shouldApplyThumbnailScale = NO, _usesSnapshot = YES.
1700
1701         (-[_WKThumbnailView setUsesSnapshot:]):
1702         (-[_WKThumbnailView usesSnapshot]):
1703         Always return YES from usesSnapshot; we only support snapshotting WKThumbnailViews.
1704         Ignore setUsesSnapshot.
1705
1706         * UIProcess/API/mac/WKView.mm:
1707         (-[WKView _setThumbnailView:]):
1708         (-[WKView _updateThumbnailViewLayer]):
1709         Stop checking usesSnapshot; it's always true.
1710
1711         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1712         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1713         (WebKit::TiledCoreAnimationDrawingArea::setRootLayerTransform): Deleted.
1714         * WebProcess/WebPage/DrawingArea.cpp:
1715         (WebKit::DrawingArea::rootLayerTransform): Deleted.
1716         * WebProcess/WebPage/DrawingArea.h:
1717         (WebKit::DrawingArea::setRootLayerTransform): Deleted.
1718         Remove rootLayerTransform() and setRootLayerTransform().
1719
1720 2014-08-05  Peyton Randolph  <prandolph@apple.com>
1721
1722         Rename MAC_LONG_PRESS feature flag to LONG_MOUSE_PRESS.
1723         https://bugs.webkit.org/show_bug.cgi?id=135276
1724
1725         Reviewed by Beth Dakin.
1726
1727         * Configurations/FeatureDefines.xcconfig:
1728
1729 2014-08-04  Andy Estes  <aestes@apple.com>
1730
1731         [iOS] The raw bytes of an iWork document's PDF preview are displayed rather than the PDF itself
1732         https://bugs.webkit.org/show_bug.cgi?id=135596
1733
1734         Reviewed by David Kilzer.
1735
1736         * WebProcess/Network/WebResourceLoader.cpp:
1737         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): If the response will be handled by
1738         QuickLook, do not call ResourceLoader::didReceiveResponse. It will be called later by
1739         WebResourceLoaderQuickLookDelegate once converted data is received.
1740
1741 2014-08-05  Alexey Proskuryakov  <ap@apple.com>
1742
1743         Build fix.
1744
1745         * UIProcess/WebContext.h:
1746
1747 2014-08-05  Oliver Hunt  <oliver@apple.com>
1748
1749         SSO expects to be able to walk parent application's bundle
1750         https://bugs.webkit.org/show_bug.cgi?id=135581
1751         <rdar://problem/17864079>
1752
1753         Reviewed by Alexey Proskuryakov.
1754
1755         SSO expects to be able to walk the parent application's
1756         bundle looking for Info plists. To allow this to actually
1757         work we provide an extension from the ui process that
1758         covers the bundle directory, and then in the profile
1759         restrict access to the ability to read directories and
1760         files named Info.plist.
1761
1762         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1763         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1764         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1765         * Shared/Network/NetworkProcessCreationParameters.cpp:
1766         (WebKit::NetworkProcessCreationParameters::encode):
1767         (WebKit::NetworkProcessCreationParameters::decode):
1768         * Shared/Network/NetworkProcessCreationParameters.h:
1769         * UIProcess/WebContext.cpp:
1770         (WebKit::WebContext::ensureNetworkProcess):
1771         (WebKit::WebContext::parentBundleDirectory):
1772         * UIProcess/WebContext.h:
1773         * UIProcess/mac/WebContextMac.mm:
1774         (WebKit::WebContext::parentBundleDirectory):
1775
1776 2014-08-04  Benjamin Poulain  <benjamin@webkit.org>
1777
1778         Add a flag for the CSS Selectors level 4 implementation
1779         https://bugs.webkit.org/show_bug.cgi?id=135535
1780
1781         Reviewed by Andreas Kling.
1782
1783         * Configurations/FeatureDefines.xcconfig:
1784
1785 2014-08-04  Benjamin Poulain  <bpoulain@apple.com>
1786
1787         Check for null frame when processing geolocation authorization request
1788         https://bugs.webkit.org/show_bug.cgi?id=135577
1789         <rdar://problem/17896295>
1790
1791         Reviewed by Geoffrey Garen.
1792
1793         I could have put the null check in GeolocationController instead of the WebKit layer,
1794         but that would be a little weird as GeolocationController knows nothing about how
1795         the WebKit layer decides what to do with requests.
1796
1797         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1798         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1799
1800 2014-08-02  Jeremy Jones  <jeremyj@apple.com>
1801
1802         Support both window and view based video fullscreen.
1803         https://bugs.webkit.org/show_bug.cgi?id=135525
1804
1805         Reviewed by Simon Fraser.
1806
1807         Parenting in the view instead of the window gives the fullscreen implementation more latitude 
1808         in how it implements the animation.
1809
1810         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1811         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Use view instead of window.
1812         * WebProcess/ios/WebVideoFullscreenManager.mm:
1813         (WebKit::clientRectForNode): Use client rect instead of screen rect.
1814         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): ditto
1815         (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): ditto
1816         (WebKit::screenRectForNode): Deleted.
1817
1818 2014-08-01  Dan Bernstein  <mitz@apple.com>
1819
1820         <rdar://problem/17891752> [iOS] WebKit links against libraries it doesn’t use
1821         https://bugs.webkit.org/show_bug.cgi?id=135536
1822
1823         Reviewed by Tim Horton.
1824
1825         * Configurations/WebKit.xcconfig: Removed -lassertion_extension and -framework MobileAsset
1826         from FRAMEWORK_AND_LIBRARY_LDFLAGS_iphonesimulator.
1827
1828 2014-08-01  Joseph Pecoraro  <pecoraro@apple.com>
1829
1830         [iOS WK2] Add extension read permission to network sandbox profile
1831         <rdar://problem/17671574>
1832
1833         Reviewed by Alexey Proskuryakov and Oliver Hunt.
1834
1835         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1836
1837 2014-08-01  Oliver Hunt  <oliver@apple.com>
1838
1839         Various frameworks may want to use the container temp directory, so our current restrictions are too tight
1840         https://bugs.webkit.org/show_bug.cgi?id=135518
1841         <rdar://17869279>
1842
1843         Reviewed by Anders Carlsson.
1844
1845         We don't (and can't) have complete knowledge of what different frameworks
1846         will want to use the container temporary directory for, and so our
1847         current attempt to heavily restrict access is simply too tight.
1848
1849         This patch recognises this by simply giving read-write access to the
1850         entire NSTemporary() directory (e.g. $container/tmp in the general case),
1851         rather than the single sub directory we wishfully thought that we would
1852         be able to get away with.
1853
1854         * Shared/WebProcessCreationParameters.cpp:
1855         (WebKit::WebProcessCreationParameters::encode):
1856         (WebKit::WebProcessCreationParameters::decode):
1857         * Shared/WebProcessCreationParameters.h:
1858         * UIProcess/WebContext.cpp:
1859         (WebKit::WebContext::createNewWebProcess):
1860         (WebKit::WebContext::mediaCacheDirectory): Deleted.
1861         * UIProcess/WebContext.h:
1862         * UIProcess/efl/WebContextEfl.cpp:
1863         (WebKit::WebContext::containerTemporaryDirectory):
1864         (WebKit::WebContext::platformMediaCacheDirectory): Deleted.
1865         * UIProcess/gtk/WebContextGtk.cpp:
1866         (WebKit::WebContext::containerTemporaryDirectory):
1867         (WebKit::WebContext::platformMediaCacheDirectory): Deleted.
1868         * UIProcess/mac/WebContextMac.mm:
1869         (WebKit::WebContext::containerTemporaryDirectory):
1870         (WebKit::WebContext::platformMediaCacheDirectory): Deleted.
1871         * WebProcess/cocoa/WebProcessCocoa.mm:
1872         (WebKit::WebProcess::platformInitializeWebProcess):
1873
1874 2014-08-01  Dan Bernstein  <mitz@apple.com>
1875
1876         <rdar://problem/17862013> REGRESSION (r169357): Disabling "allow plug-ins" doesn't stick on quit/relaunch
1877         https://bugs.webkit.org/show_bug.cgi?id=135511
1878
1879         Reviewed by Alexey Proskuryakov.
1880
1881         Since the values map in the preferences store doesn’t include values that are equal to the
1882         defaults, we need to update it when a new default is registered.
1883
1884         * UIProcess/WebPreferences.cpp:
1885         (WebKit::WebPreferences::createWithLegacyDefaults): Changed to use new member functions
1886         for registering defaults.
1887         (WebKit::WebPreferences::registerDefaultBoolValueForKey): Added. Sets an override default
1888         in the store, and sets the user default, if there is one, on top of it.
1889         (WebKit::WebPreferences::registerDefaultUInt32ValueForKey): Ditto.
1890         * UIProcess/WebPreferences.h: Declared new member functions for getting the user default
1891         value for a key.
1892
1893         * UIProcess/efl/WebPreferencesEfl.cpp:
1894         (WebKit::WebPreferences::platformGetStringUserValueForKey): Added an implementation that
1895         returns false, because the EFL port doesn’t support persistent user defaults.
1896         (WebKit::WebPreferences::platformGetBoolUserValueForKey): Ditto.
1897         (WebKit::WebPreferences::platformGetUInt32UserValueForKey): Ditto.
1898         (WebKit::WebPreferences::platformGetDoubleUserValueForKey): Ditto.
1899
1900         * UIProcess/gtk/WebPreferencesGtk.cpp:
1901         (WebKit::WebPreferences::platformGetStringUserValueForKey): Ditto for the GTK port.
1902         (WebKit::WebPreferences::platformGetBoolUserValueForKey): Ditto.
1903         (WebKit::WebPreferences::platformGetUInt32UserValueForKey): Ditto.
1904         (WebKit::WebPreferences::platformGetDoubleUserValueForKey): Ditto.
1905
1906         * UIProcess/mac/WebPreferencesMac.mm:
1907         (WebKit::WebPreferences::platformGetStringUserValueForKey): Added. Replaces
1908         setStringValueIfInUserDefaults, on which it is based.
1909         (WebKit::WebPreferences::platformGetBoolUserValueForKey): Similarly for booleans.
1910         (WebKit::WebPreferences::platformGetUInt32UserValueForKey): Similarly for integers.
1911         (WebKit::WebPreferences::platformGetDoubleUserValueForKey): Similarly for doubles.
1912         (WebKit::WebPreferences::platformInitializeStore): Changed to use the above functions.
1913
1914 2014-08-01  Brent Fulgham  <bfulgham@apple.com>
1915
1916         [Mac] Fullscreen mode for some applications shows only a black screen.
1917         https://bugs.webkit.org/show_bug.cgi?id=135493
1918         <rdar://problem/17628212>
1919
1920         Reviewed by Jer Noble.
1921
1922         In some applications, the window hosting the WKView is an InProcess layer hosting mode.
1923         The fullscreen window created by the WKFullScreenWindowController defaults to an
1924         OutOfProcess mode.
1925
1926         When this kind of mismatch is encountered, the WK2 layer in the UI process is supposed
1927         to send a message back to the WebProcess indicating that the layer hosting mode of the
1928         containing window is different, so that the WebProcess can adjust its logic accordingly.
1929         Unfortunately, the notification that this had happened was not getting sent to the
1930         WebProcess due to an optimization in window state change logic (see Bug 135509 for
1931         details).
1932
1933         The fix is to check layer hosting mode state when a WKView is added to a window, and
1934         notify the WebProcess when it needs to change state to match.
1935         
1936
1937         * UIProcess/API/mac/WKView.mm:
1938         (-[WKView viewDidMoveToWindow]): When moving to a new window, always call
1939         'layerHostingModeDidChange' to pick up any changes in the layer hosting mode.
1940
1941 2014-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1942
1943         [CMake] GTK and EFL are using PROJECT_VERSION_PATCH to define the micro version
1944         https://bugs.webkit.org/show_bug.cgi?id=135501
1945
1946         Reviewed by Gyuyoung Kim.
1947
1948         Use PROJECT_VERSION_MICRO instead.
1949
1950         * UIProcess/API/efl/EWebKit2.h.in:
1951         * UIProcess/API/gtk/WebKitVersion.h.in:
1952
1953 2014-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1954
1955         Unreviewed. Add missing sections to documentation.
1956
1957         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add
1958         WebKitUserContent and WebKitUserContentManager sections to the
1959         documentation.
1960
1961 2014-08-01  Ryuan Choi  <ryuan.choi@samsung.com>
1962
1963         [EFL] Unable to do make install since r171901
1964         https://bugs.webkit.org/show_bug.cgi?id=135497
1965
1966         Reviewed by Gyuyoung Kim.
1967
1968         * PlatformEfl.cmake: Removed ewk_defins.h from the installation list.
1969
1970 2014-07-31  Ryuan Choi  <ryuan.choi@samsung.com>
1971
1972         [EFL][WK2] MiniBrower comes to crash when combo box is pressed
1973         https://bugs.webkit.org/show_bug.cgi?id=135378
1974
1975         Reviewed by Gyuyoung Kim.
1976
1977         Added doxygen comment of popup_menu_show/popup_menu_hide not to confuse the usage.
1978
1979         * UIProcess/API/efl/ewk_view.h:
1980
1981 2014-07-31  Ryuan Choi  <ryuan.choi@samsung.com>
1982
1983         [EFL] remove ewk_defines.h
1984         https://bugs.webkit.org/show_bug.cgi?id=135456
1985
1986         Reviewed by Gyuyoung Kim.
1987
1988         * UIProcess/API/efl/ewk_context_menu.h:
1989         * UIProcess/API/efl/ewk_context_menu_item.h: Moved the declaration from ewk_defines.h
1990         * UIProcess/API/efl/ewk_defines.h: Removed.
1991
1992 2014-07-31  Brent Fulgham  <bfulgham@apple.com>
1993
1994         Unreviewed typo correction.
1995         https://bugs.webkit.org/show_bug.cgi?id=135482
1996
1997         Rename '_fullScreenIsEnabled' -> '_fullScreenEnabled'
1998
1999         * UIProcess/API/Cocoa/WKPreferences.mm:
2000         (-[WKPreferences _fullScreenEnabled]): Added
2001         (-[WKPreferences _fullScreenIsEnabled]): Deleted.
2002         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2003
2004 2014-07-31  Brent Fulgham  <bfulgham@apple.com>
2005
2006         MiniBrowser Should Support Fullscreen Videos in WebKit2 Mode
2007         https://bugs.webkit.org/show_bug.cgi?id=135482
2008
2009         Reviewed by Simon Fraser.
2010         
2011         Add accessors for the missing Fullscreen API so that MiniBrowser
2012         can use them.
2013
2014         * UIProcess/API/Cocoa/WKPreferences.mm:
2015         (-[WKPreferences _fullScreenIsEnabled]): Added.
2016         (-[WKPreferences _setFullScreenEnabled:]): Added.
2017         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Add accessor for
2018         Fullscreen mode.
2019
2020 2014-07-31  Beth Dakin  <bdakin@apple.com>
2021
2022         Hit-testing broken in WebKit 1 views with AppKit's contentInsets
2023         https://bugs.webkit.org/show_bug.cgi?id=135434
2024         -and corresponding-
2025         <rdar://problem/17850323>
2026
2027         Reviewed by Benjamin Poulain.
2028
2029         Re-named functions.
2030         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2031         (WebKit::PDFPlugin::convertFromScrollbarToContainingView):
2032         (WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
2033
2034 2014-07-31  Oliver Hunt  <oliver@apple.com>
2035
2036         Various SSO services need the networking process to be able to spoof its bundle id
2037         https://bugs.webkit.org/show_bug.cgi?id=135468
2038         <rdar://problem/17864139>
2039
2040         Reviewed by Alexey Proskuryakov.
2041
2042         Just add the entitlement required to allow the sandbox to let this happen.
2043
2044         * Configurations/Network-iOS.entitlements:
2045
2046 2014-07-31  Przemyslaw Kuczynski  <p.kuczynski@samsung.com>
2047
2048         Fix uninitialized scalar variable
2049         https://bugs.webkit.org/show_bug.cgi?id=135461
2050
2051         Reviewed by Alexey Proskuryakov.
2052
2053         If fopen fails, returned ApplicationMemoryStats structure will be uninitialized
2054
2055         * Shared/linux/WebMemorySamplerLinux.cpp:
2056         (WebKit::sampleMemoryAllocatedForApplication): Initialized applicationStats.
2057
2058 2014-07-31  Rohit Kumar  <kumar.rohit@samsung.com>
2059
2060         Clean up the WebKit build from unused parameter warning in Webkit2/WebProcess module
2061         https://bugs.webkit.org/show_bug.cgi?id=135413
2062
2063         Reviewed by Darin Adler.
2064
2065         * WebProcess/OriginData/WebOriginDataManager.cpp:
2066         (WebKit::WebOriginDataManager::getOrigins):
2067         (WebKit::WebOriginDataManager::deleteEntriesForOrigin):
2068         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates):
2069         (WebKit::WebOriginDataManager::deleteAllEntries):
2070
2071 2014-07-31  Chris Fleizach  <cfleizach@apple.com>
2072
2073         AX: iOS: Crash accessing m_page in WKAccessibilityPageObject
2074         https://bugs.webkit.org/show_bug.cgi?id=134617
2075
2076         Reviewed by Darin Adler.
2077
2078         Provide a way to detach a WK2 WebPage object so that it can uninitialize other pointers, like the accessibility object.
2079
2080         * WebProcess/WebPage/WebPage.cpp:
2081         (WebKit::WebPage::~WebPage):
2082         * WebProcess/WebPage/WebPage.h:
2083         * WebProcess/WebPage/efl/WebPageEfl.cpp:
2084         (WebKit::WebPage::platformDetach):
2085         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2086         (WebKit::WebPage::platformDetach):
2087         * WebProcess/WebPage/ios/WebPageIOS.mm:
2088         (WebKit::WebPage::platformDetach):
2089         * WebProcess/WebPage/mac/WebPageMac.mm:
2090         (WebKit::WebPage::platformDetach):
2091
2092 2014-07-31  Dan Bernstein  <mitz@apple.com>
2093
2094         WebKit part of: Server trust authentication challenges aren’t sent to the navigation delegate
2095         https://bugs.webkit.org/show_bug.cgi?id=135327
2096
2097         Reviewed by Alexey Proskuryakov.
2098
2099         * UIProcess/Cocoa/NavigationState.mm:
2100         (WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame):
2101         Return true for server trust protection spaces if the delegate implements
2102         -webView:didReceiveAuthenticationChallenge:completionHandler:.
2103         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): Removed
2104         an assertion that is no longer true due to the above.
2105
2106 2014-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2107
2108         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.5.1 release.
2109
2110         * gtk/NEWS: Add release notes for 2.5.1.
2111
2112 2014-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2113
2114         Unreviewed. Fix GTK+ make distcheck.
2115
2116         * Shared/InteractionInformationAtPosition.h: Only include
2117         WebCore/SelectionRect.h for IOS.
2118
2119 2014-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2120
2121         [GTK] Bump binary version for 2.6
2122         https://bugs.webkit.org/show_bug.cgi?id=133724
2123
2124         Reviewed by Philippe Normand.
2125
2126         * PlatformGTK.cmake: Fix JavaScriptCore dependency on
2127         instrospection commands and make them depend on GTK+-3.0.
2128
2129 2014-07-30  Enrica Casucci  <enrica@apple.com>
2130
2131         REGRESSION (WK2 iOS): Inline editing for Chinese and Japanese keyboards does not work in Safari.
2132         https://bugs.webkit.org/show_bug.cgi?id=135449
2133         <rdar://problem/17824833>
2134
2135         Reviewed by Benjamin Poulain.
2136
2137         The WebProcess sends the notification that the gesture modified the phrase boundary,
2138         but the flag was not being converted properly, therefore we failed to notify
2139         the text input system that a change had occurred.
2140
2141         * UIProcess/ios/WKContentViewInteraction.mm:
2142         (toUIWKSelectionFlags):
2143
2144 2014-07-30  Andy Estes  <aestes@apple.com>
2145
2146         USE(CONTENT_FILTERING) should be ENABLE(CONTENT_FILTERING)
2147         https://bugs.webkit.org/show_bug.cgi?id=135439
2148
2149         Reviewed by Tim Horton.
2150
2151         We now support two different platform content filters, and will soon support a mock content filter (as part of
2152         webkit.org/b/128858). This makes content filtering a feature of WebKit, not just an adoption of a third-party
2153         library. ENABLE() is the correct macro to use for such a feature.
2154
2155         * Configurations/FeatureDefines.xcconfig:
2156         * Shared/WebCoreArgumentCoders.h:
2157         * UIProcess/WebFrameProxy.cpp:
2158         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2159         * UIProcess/WebFrameProxy.h:
2160         * UIProcess/WebPageProxy.cpp:
2161         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2162         * UIProcess/WebPageProxy.h:
2163         * UIProcess/WebPageProxy.messages.in:
2164         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2165         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2166
2167 2014-07-30  Andreas Kling  <akling@apple.com>
2168
2169         Static hash tables no longer need to be coupled with a VM.
2170         <https://webkit.org/b/135421>
2171
2172         Reviewed by Geoffrey Garen.
2173
2174         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2175         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2176
2177 2014-07-30  Dan Bernstein  <mitz@apple.com>
2178
2179         Get rid of the WKNSURLProtectionSpace wrapper
2180         https://bugs.webkit.org/show_bug.cgi?id=135425
2181
2182         Reviewed by Sam Weinig.
2183
2184         * Shared/Cocoa/APIObject.mm:
2185         (API::Object::newObject): Don’t allocate WKNSURLProtectionSpace wrappers.
2186
2187         * Shared/Cocoa/WKNSURLProtectionSpace.h: Removed.
2188         * Shared/Cocoa/WKNSURLProtectionSpace.mm: Removed.
2189
2190         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2191         (canAuthenticateAgainstProtectionSpaceInFrame): Get the NSURLProtectionSpace from the
2192         WebCore::ProtectionSpace in the WebProtectionSpace.
2193
2194         * UIProcess/Cocoa/NavigationState.mm:
2195         (WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
2196
2197         * WebKit2.xcodeproj/project.pbxproj: Removed references to removed files.
2198
2199 2014-07-30  Dan Bernstein  <mitz@apple.com>
2200
2201         Updated for changes to the WebCore::Credential API.
2202         Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327
2203
2204         Reviewed by Alexey Proskuryakov.
2205
2206         * Shared/Downloads/mac/DownloadMac.mm:
2207         (WebKit::Download::receivedCredential):Use new Credential::nsCredential getter.
2208
2209         * Shared/WebCoreArgumentCoders.cpp:
2210         (IPC::ArgumentCoder<Credential>::encode):  If encoding the credential requires encoding the
2211         platform data, do that.
2212         (IPC::ArgumentCoder<Credential>::decode): If platform data was encoded, decode it.
2213         * Shared/WebCoreArgumentCoders.h:
2214
2215         * Shared/mac/WebCoreArgumentCodersMac.mm:
2216         (IPC::ArgumentCoder<Credential>::encodePlatformData): Archive the NSURLCredential.
2217         (IPC::ArgumentCoder<Credential>::decodePlatformData): Unarchive it.
2218
2219         * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
2220         (-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]): Use
2221         Credential constructor that takes an NSURLCredential.
2222
2223         * UIProcess/Cocoa/NavigationState.mm:
2224         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): Ditto.
2225
2226
2227 2014-07-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2228
2229         [GTK] REGRESSION(r171742): Test /webkit2/WebKitWebView/disallow-modal-dialogs fails
2230         https://bugs.webkit.org/show_bug.cgi?id=135412
2231
2232         Reviewed by Philippe Normand.
2233
2234         The problem is that WebPageProxy::setUIClient() calls
2235         setCanRunModal() with the value of m_uiClient->canRunModal() which
2236         is always true for us. We override that manually by calling
2237         setCanRunModal() depending on the WebKitSettings. In r171742,
2238         webkitWebViewUpdateSettings(), the method that overrides
2239         setCanRunModal(), was moved before attachUIClientToView(), so the
2240         value set by WebPageProxy::setUIClient() is the last one and takes
2241         precedence. We need to make sure webkitWebViewUpdateSettings() is
2242         always called after attachUIClientToView().
2243
2244         * UIProcess/API/gtk/WebKitWebView.cpp:
2245         (webkitWebViewConstructed): Move webkitWebViewUpdateSettings()
2246         call after attachUIClientToView() and add a comment to not forget
2247         about it again.
2248
2249 2014-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2250
2251         [GTK] Remove WebKitCertificateInfo from WebKit2GTK+ API
2252         https://bugs.webkit.org/show_bug.cgi?id=134830
2253
2254         Reviewed by Gustavo Noronha Silva.
2255
2256         It was added to make the API more convenient but it has ended up
2257         making it more complicated. WebKitWebView::load-failed-with-tls-errors
2258         now receives a GTlsCertificate + GTlsCertificateFlags and
2259         webkit_web_context_allow_tls_certificate_for_host() receives a GTlsCertificate
2260         since the errors are not actually needed. This makes the API more
2261         consistent with the existing method webkit_web_view_get_tls_info().
2262
2263         * PlatformGTK.cmake: Remove files from compilation.
2264         * UIProcess/API/gtk/WebKitCertificateInfo.cpp: Removed.
2265         * UIProcess/API/gtk/WebKitCertificateInfo.h: Removed.
2266         * UIProcess/API/gtk/WebKitCertificateInfoPrivate.h: Removed.
2267         * UIProcess/API/gtk/WebKitWebContext.cpp:
2268         (webkit_web_context_allow_tls_certificate_for_host):
2269         * UIProcess/API/gtk/WebKitWebContext.h:
2270         * UIProcess/API/gtk/WebKitWebView.cpp:
2271         (webkit_web_view_class_init):
2272         (webkitWebViewLoadFailedWithTLSErrors):
2273         * UIProcess/API/gtk/WebKitWebView.h:
2274         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2275         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
2276         * UIProcess/API/gtk/webkit2.h:
2277
2278 2014-07-29  Jinwoo Song  <jinwoo7.song@samsung.com>
2279
2280         [EFL] Do not initialize g_type system explicitly in the ewk_init()
2281         https://bugs.webkit.org/show_bug.cgi?id=135407
2282
2283         Reviewed by Gyuyoung Kim.
2284
2285         EFL build requires glib version 2.38 but g_type_init() has been deprecated
2286         since version 2.36. As the type system is initialized automatically since
2287         version 2.36, we do not need to call g_type_init() in the ewk_init().
2288
2289         https://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g-type-init
2290
2291         * UIProcess/API/efl/ewk_main.cpp:
2292         (ewk_init):
2293
2294 2014-07-29  Enrica Casucci  <enrica@apple.com>
2295
2296         REGRESSION [WebKit2 iOS]: Cannot add shortcut to user dictionary from non editable content.
2297         https://bugs.webkit.org/show_bug.cgi?id=135392
2298         <rdar://problem/17760073>
2299
2300         Reviewed by Benjamin Poulain.
2301
2302         Adding a shortcut to the user dictionary needs to be available in non editable content too.
2303
2304         * UIProcess/ios/WKContentViewInteraction.mm:
2305         (-[WKContentView _addShortcut:]):
2306
2307 2014-07-29  Tim Horton  <timothy_horton@apple.com>
2308
2309         WKPDFView paints rotated pages squished
2310         https://bugs.webkit.org/show_bug.cgi?id=135401
2311         <rdar://problem/17173916>
2312
2313         Reviewed by Simon Fraser.
2314
2315         * UIProcess/ios/WKPDFView.mm:
2316         (-[WKPDFView _computePageAndDocumentFrames]):
2317         [page size] returns the crop box's size, ignoring rotation.
2318         [page cropBoxAccountForRotation] respects rotation, but otherwise returns the same size.
2319         UIPDFPageView will respect rotation when painting, so we
2320         should make sure that it is given an aspect ratio that also
2321         respects rotation, so that the page isn't squished.
2322
2323 2014-07-29  Csaba Osztrogonác  <ossy@webkit.org>
2324
2325         URTBF for !ENABLE(DATABASE_PROCESS) platforms.
2326
2327         * WebProcess/OriginData/WebOriginDataManager.cpp:
2328         (WebKit::WebOriginDataManager::getOrigins):
2329         (WebKit::WebOriginDataManager::deleteEntriesForOrigin):
2330         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates):
2331         (WebKit::WebOriginDataManager::deleteAllEntries):
2332
2333 2014-07-29  Brady Eidson  <beidson@apple.com>
2334
2335         Make WKOriginDataManager actually operate on IndexedDatabases.
2336         https://bugs.webkit.org/show_bug.cgi?id=135346
2337
2338         Reviewed by Sam Weinig (and David Kilzer and Alex Christensen)
2339
2340         * DatabaseProcess/DatabaseProcess.cpp:
2341         (WebKit::DatabaseProcess::DatabaseProcess):
2342         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): 
2343         (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins):
2344         (WebKit::removeAllDatabasesForOriginPath): Utility to delete all database files for the given origin path
2345             that have been modified between the given dates.
2346         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
2347         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin):
2348         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
2349         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates):
2350         (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
2351         (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries):
2352         * DatabaseProcess/DatabaseProcess.h:
2353
2354         * Shared/WebCrossThreadCopier.cpp:
2355         (WebCore::SecurityOriginData>::copy):
2356         * Shared/WebCrossThreadCopier.h:
2357
2358         * UIProcess/WebOriginDataManagerProxy.cpp:
2359         (WebKit::WebOriginDataManagerProxy::getOrigins):
2360         (WebKit::WebOriginDataManagerProxy::didGetOrigins):
2361         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
2362         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates):
2363         (WebKit::WebOriginDataManagerProxy::deleteAllEntries):
2364
2365         * WebProcess/OriginData/WebOriginDataManager.cpp:
2366         (WebKit::WebOriginDataManager::getOrigins): Pipe IDB requests through to the DatabaseProcess.
2367         (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Ditto.
2368         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Ditto.
2369         (WebKit::WebOriginDataManager::deleteAllEntries): Ditto.
2370
2371 2014-07-29  Commit Queue  <commit-queue@webkit.org>
2372
2373         Unreviewed, rolling out r171704.
2374         https://bugs.webkit.org/show_bug.cgi?id=135389
2375
2376         Broke two IndexedDB tests (Requested by ap on #webkit).
2377
2378         Reverted changeset:
2379
2380         "IDB transactions never reset if the Web Process ends before
2381         cleaning up"
2382         https://bugs.webkit.org/show_bug.cgi?id=135218
2383         http://trac.webkit.org/changeset/171704
2384
2385 2014-07-29  Daniel Bates  <dabates@apple.com>
2386
2387         Use WTF::move() instead of std::move() to help ensure move semantics
2388         https://bugs.webkit.org/show_bug.cgi?id=135351
2389
2390         Reviewed by Alexey Proskuryakov.
2391
2392         * UIProcess/API/Cocoa/_WKSessionState.mm:
2393         (-[_WKSessionState _initWithSessionState:]):
2394         * UIProcess/API/gtk/WebKitUserContent.cpp:
2395         (toStringVector): Remove use of std::move(). It's unnecessary to call std::move() on an rvalue.
2396         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2397         (WebKit::ServicesOverlayController::mouseEvent):
2398
2399 2014-07-28  Pratik Solanki  <psolanki@apple.com>
2400
2401         Get SharedBuffer.h out of ResourceBuffer.h (and a few other places)
2402         https://bugs.webkit.org/show_bug.cgi?id=131782
2403
2404         Original patch by Tim Horton.
2405         Reviewed by Darin Adler.
2406
2407         * NetworkProcess/NetworkResourceLoader.cpp:
2408         * WebProcess/Network/NetworkProcessConnection.cpp:
2409         Include SharedBuffer.h in implementation files.
2410
2411         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
2412         Un-indent namespace and remove SharedBuffer forward-declaration.
2413
2414 2014-07-29  Adrian Perez de Castro  <aperez@igalia.com>
2415
2416         [GTK] Remove WebKitWebViewGroup from WebKit2 GTK+ API
2417         https://bugs.webkit.org/show_bug.cgi?id=133729
2418
2419         Reviewed by Carlos Garcia Campos.
2420
2421         Removes WebKitWebViewGroup, effectively reverting the changes
2422         introduced by r149117. The motivation for WebKitWebViewGroup
2423         was using the user style sheet injection API, which has been
2424         moved into WebKitUserContentManager, rendering it unneeded.
2425
2426         * PlatformGTK.cmake: Remove WebKitWebViewGroup source files
2427         from the build.
2428         * UIProcess/API/C/gtk/WKView.cpp:
2429         (WKViewCreate): Accomodate for changes in the signature of
2430         webkitWebViewBaseCreate().
2431         * UIProcess/API/gtk/WebKitSettings.cpp: Update API documentation.
2432         * UIProcess/API/gtk/WebKitWebContext.cpp: Remove the default web
2433         view group from WebKitWebContext.
2434         (webkitWebContextCreatePageForWebView): Allow passing a
2435         WebPreferences object at construction.
2436         (webkitWebContextGetDefaultWebViewGroup): Deleted.
2437         * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
2438         * UIProcess/API/gtk/WebKitWebView.cpp:
2439         (webkitWebViewUpdateSettings): Use WebPageProxy::setPreferences()
2440         directly. Handle the case when webkit_web_view_set_settings()
2441         is called on construction by doing an early-return.
2442         (webkitWebViewConstructed): Call webkitWebViewUpdateSettings()
2443         after creating the internal WebPageProxy object.
2444         (webkitWebViewSetProperty): Removed "group" property, added
2445         "settings" property.
2446         (webkitWebViewGetProperty): Ditto.
2447         (webkitWebViewDispose): Do not disconnect signal handler for
2448         the (now unexistant) WebKitWebViewGroup.
2449         (webkit_web_view_class_init): Removed "group" property, added
2450         "settings" property.
2451         (webkitWebViewHandleAuthenticationChallenge): Access the
2452         WebKitWebSettings directly.
2453         (webkit_web_view_new_with_related_view): Make new views share
2454         settings with their related view.
2455         (webkit_web_view_new_with_settings): Added.
2456         (webkit_web_view_set_settings): Access the settings directly in
2457         the WebKitWebView.
2458         (webkit_web_view_get_settings): Ditto.
2459         (webkit_web_view_set_zoom_level): Ditto.
2460         (webkit_web_view_get_zoom_level): Ditto.
2461         (webkitWebViewSettingsChanged): Deleted.
2462         (webkitWebViewDisconnectSettingsChangedSignalHandler): Deleted.
2463         (webkit_web_view_new_with_group): Deleted.
2464         (webkit_web_view_get_group): Deleted.
2465         * UIProcess/API/gtk/WebKitWebView.h: Removed API methods related
2466         to WebKitWebViewGroup.
2467         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2468         (webkitWebViewBaseCreate): Allow passing a WebPreferences object
2469         for constructing the WebPageProxy.
2470         (webkitWebViewBaseUpdatePreferences): Instead of going through
2471         the page group, use WebPageProxy::preferences() directly.
2472         (webkitWebViewBaseCreateWebPage): Allow passing a WebPreferences
2473         object for constructing the WebPageProxy.
2474         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Update the
2475         prototypes of the internal functions.
2476         * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed.
2477         * UIProcess/API/gtk/WebKitWebViewGroup.h: Removed.
2478         * UIProcess/API/gtk/WebKitWebViewGroupPrivate.h: Removed.
2479         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Change public API
2480         bits in the documentation.
2481         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Ditto.
2482         * UIProcess/API/gtk/docs/webkit2gtk.types: Ditto.
2483         * UIProcess/API/gtk/webkit2.h: Removed WebKitWebViewGroup.h header.
2484         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2485         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2486         Accomodate for changes in the signature of
2487         webkitWebViewBaseCreate().
2488
2489 2014-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2490
2491         Implement webkit_web_view_load_string() in WebKit2
2492         https://bugs.webkit.org/show_bug.cgi?id=134735
2493
2494         Reviewed by Sergio Villar Senin.
2495
2496         Add webkit_web_view_load_bytes() that receives a GBytes to load
2497         random data in the web view using the given MIME-Type, encoding
2498         and base URL.
2499
2500         * UIProcess/API/gtk/WebKitWebView.cpp:
2501         (releaseGBytes):
2502         (webkit_web_view_load_bytes):
2503         * UIProcess/API/gtk/WebKitWebView.h:
2504         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2505         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
2506
2507 2014-07-29  Ryuan Choi  <ryuan.choi@samsung.com>
2508
2509         [EFL] Alpha value of ewk_view_bg_color_set is not working
2510         https://bugs.webkit.org/show_bug.cgi?id=135333
2511
2512         Reviewed by Gyuyoung Kim.
2513
2514         evas_object_image_alpha_set should be called for the transparent evas object.
2515
2516         * UIProcess/API/efl/EwkView.cpp:
2517         (EwkView::handleEvasObjectColorSet):
2518         (EwkView::setBackgroundColor): Checked the alpha value of object and called evas_object_image_alpha_set.
2519         * UIProcess/API/efl/EwkView.h:
2520         * UIProcess/API/efl/ewk_view.cpp:
2521         (ewk_view_bg_color_set): Moved the logic to EwkView.
2522
2523 2014-07-28  Mark Rowe  <mrowe@apple.com>
2524
2525         Web process crash causes UI process to die with an assertion failure in Connection::exceptionSourceEventHandler
2526         https://bugs.webkit.org/show_bug.cgi?id=135366
2527
2528         Reviewed by Dan Bernstein.
2529
2530         * Platform/IPC/mac/ConnectionMac.mm:
2531         (IPC::Connection::exceptionSourceEventHandler): Remove the assertion since it frequently fires during
2532         normal development with debug builds.
2533
2534 2014-07-28  Benjamin Poulain  <bpoulain@apple.com>
2535
2536         [iOS WK2] WKWebView sometime tries to change the size of a null DrawingAreaProxy
2537         https://bugs.webkit.org/show_bug.cgi?id=135368
2538         <rdar://problem/16988887>
2539
2540         Reviewed by Simon Fraser.
2541
2542         We should never assume DrawingAreaProxy exists in the API invoked by the clients
2543         of WKWebView. There are at least two cases where the DrawingAreaProxy is null:
2544         -In some path on initialization.
2545         -After a crash.
2546
2547         * UIProcess/API/Cocoa/WKWebView.mm:
2548         (-[WKWebView _frameOrBoundsChanged]):
2549         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2550         We can safely null check and skip setting the size. If the call was skipped,
2551         the size is set on DrawingAreaProxy initialization by querying the current
2552         size through the page client.
2553
2554 2014-07-28  Roger Fong  <roger_fong@apple.com>
2555
2556         Disable tagged strings for the plugin process.
2557         https://bugs.webkit.org/show_bug.cgi?id=135354
2558         <rdar://problem/17295639>.
2559
2560         Patch by Alexey Proskuryakov and Roger Fong.
2561
2562         Reviewed by Anders Carlsson.
2563
2564         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
2565         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2566         (WebKit::connectToReExecService):
2567
2568 2014-07-25  Jeffrey Pfau  <jpfau@apple.com>
2569
2570         IDB transactions never reset if the Web Process ends before cleaning up
2571         https://bugs.webkit.org/show_bug.cgi?id=135218
2572
2573         Reviewed by Darin Adler.
2574
2575         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
2576         (WebKit::DatabaseToWebProcessConnection::didClose):
2577         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2578         (WebKit::UniqueIDBDatabase::unregisterConnection):
2579         (WebKit::UniqueIDBDatabase::didCompleteTransactionOperation):
2580         (WebKit::UniqueIDBDatabase::openBackingStoreTransaction):
2581         (WebKit::UniqueIDBDatabase::resetBackingStoreTransaction):
2582         (WebKit::UniqueIDBDatabase::didEstablishTransaction):
2583         (WebKit::UniqueIDBDatabase::didResetTransaction):
2584         (WebKit::UniqueIDBDatabase::resetAllTransactions):
2585         (WebKit::UniqueIDBDatabase::finalizeRollback):
2586         (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory):
2587         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
2588         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2589         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::rollbackTransaction):
2590
2591 2014-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
2592
2593         [GTK] Keep non-DATABASE_PROCESS build
2594         https://bugs.webkit.org/show_bug.cgi?id=135321
2595
2596         Reviewed by Gyuyoung Kim.
2597
2598         This is the patch for r171622 in non-DATABASE_PROCESS builds.
2599         Change sendToDatabaseProcessRelaunchingIfNecessary to support non-DATABASE_PROCESS implementation.
2600
2601         * CMakeLists.txt:
2602         * UIProcess/WebContext.h:
2603         (WebKit::WebContext::sendToDatabaseProcessRelaunchingIfNecessary):
2604
2605 2014-07-27  Gavin Barraclough  <baraclough@apple.com>
2606
2607         Don't rely on reading applicationState from within DidEnterBackground/WillEnterForeground
2608         https://bugs.webkit.org/show_bug.cgi?id=135329
2609         rdar://problem/17818308
2610
2611         Reviewed by Sam Weinig.
2612
2613         API may not be stable.
2614
2615         * UIProcess/ios/PageClientImplIOS.mm:
2616         (WebKit::PageClientImpl::isViewVisible):
2617             - changed to use -[WKContentView isBackground]
2618         * UIProcess/ios/ProcessAssertionIOS.mm:
2619         (-[WKProcessAssertionBackgroundTaskManager init]):
2620             - split notification handlers
2621         (-[WKProcessAssertionBackgroundTaskManager _applicationWillEnterForeground:]):
2622         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackground:]):
2623         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]): Deleted.
2624             - Assume application is background is after DidEnterBackground, and not after WillEnterForeground
2625         * UIProcess/ios/WKContentView.h:
2626             - added isBackground.
2627         * UIProcess/ios/WKContentView.mm:
2628         (-[WKContentView initWithFrame:context:configuration:webView:]):
2629             - check applicationState at init.
2630         (-[WKContentView isBackground]):
2631             - accessor
2632         (-[WKContentView _applicationDidEnterBackground:]):
2633         (-[WKContentView _applicationWillEnterForeground:]):
2634             - update isBackground
2635
2636 2014-07-26  Enrica Casucci  <enrica@apple.com>
2637
2638         [WebKit2 iOS]Add support for caret movement for the 3rd party keyboard protocol.
2639         https://bugs.webkit.org/show_bug.cgi?id=135325
2640         <rdar://problem/17682120>
2641
2642         Reviewed by Sam Weinig.
2643
2644         WKContentView now implements moveByOffset to support the
2645         protocol for 3rd party keyboards.
2646
2647         * UIProcess/WebPageProxy.h:
2648         * UIProcess/ios/WKContentViewInteraction.mm:
2649         (-[WKContentView moveByOffset:]):
2650         * UIProcess/ios/WebPageProxyIOS.mm:
2651         (WebKit::WebPageProxy::moveSelectionByOffset):
2652         * WebProcess/WebPage/WebPage.h:
2653         * WebProcess/WebPage/WebPage.messages.in:
2654         * WebProcess/WebPage/ios/WebPageIOS.mm:
2655         (WebKit::WebPage::moveSelectionByOffset):
2656
2657 2014-07-26  Timothy Horton  <timothy_horton@apple.com>
2658
2659         Crash in Web Content Process under ~PDFDocument under clearTouchEventListeners at topDocument()
2660         https://bugs.webkit.org/show_bug.cgi?id=135319
2661         <rdar://problem/17315168>
2662
2663         Reviewed by Darin Adler and Antti Koivisto.
2664
2665         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2666         (WebKit::WebFrameLoaderClient::committedLoad):
2667         Allow data through to WebCore for frames with custom content providers;
2668         the only custom content provider currently implemented is main frame PDF
2669         on iOS, which will end up creating a PDFDocument in WebCore, which drops all
2670         data on the floor immediately, so this won't result in WebCore doing anything
2671         with the data, but makes sure that more of the normal document lifecycle is maintained.
2672
2673         In the future, we might want to consider ensuring that all custom content providers
2674         end up creating a SinkDocument or something similarly generic to ensure that
2675         WebCore doesn't try to do anything with their data, but for now, the only client is covered.
2676
2677 2014-07-25  Jeremy Jones  <jeremyj@apple.com>
2678
2679         Parent fullscreen from window instead of view
2680         https://bugs.webkit.org/show_bug.cgi?id=135310
2681
2682         Reviewed by Jer Noble.
2683
2684         Parenting in the view causes an incorrect animation to fullscreen, and can cause 
2685         fullscreen to only expand to the size of the view instead of the whole window.
2686
2687         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2688         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): pass view's window.
2689         * WebProcess/ios/WebVideoFullscreenManager.mm: screenRect instead of clientRect
2690         (WebKit::screenRectForNode): was clientRectForNode
2691         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): use screenRectForNode
2692         (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): ditto
2693         (WebKit::clientRectForNode): Deleted.
2694
2695 2014-07-25  Oliver Hunt  <oliver@apple.com>
2696
2697         Creating incorrect sandbox extension for hsts plist due to missing /
2698         https://bugs.webkit.org/show_bug.cgi?id=135309
2699
2700         Reviewed by Sam Weinig.
2701
2702         So it turns out that you do actually need /'s in paths...
2703         Now we actually create the correct extension.
2704
2705         * UIProcess/mac/WebContextMac.mm:
2706         (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath):
2707
2708 2014-07-24  Anders Carlsson  <andersca@apple.com>
2709
2710         WKNavigation's properties are either always nil or don't behave as documented
2711         https://bugs.webkit.org/show_bug.cgi?id=135267
2712         <rdar://problem/17730536>
2713
2714         Reviewed by Andreas Kling.
2715
2716         Remove the properties from WKNavigation and introduce -[WKNavigation _request] as SPI for now.
2717
2718         * Shared/API/Cocoa/WebKitPrivate.h:
2719         * UIProcess/API/Cocoa/WKNavigation.h:
2720         * UIProcess/API/Cocoa/WKNavigation.mm:
2721         (-[WKNavigation _request]):
2722         (-[WKNavigation initialRequest]): Deleted.
2723         (-[WKNavigation request]): Deleted.
2724         (-[WKNavigation setRequest:]): Deleted.
2725         (-[WKNavigation response]): Deleted.
2726         (-[WKNavigation error]): Deleted.
2727         * UIProcess/API/Cocoa/WKNavigationInternal.h:
2728         * UIProcess/API/Cocoa/WKNavigationPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h.
2729         * UIProcess/Cocoa/NavigationState.mm:
2730         (WebKit::NavigationState::createLoadRequestNavigation):
2731         * WebKit2.xcodeproj/project.pbxproj:
2732
2733 2014-07-25  Brady Eidson  <beidson@apple.com>
2734
2735         Clean up WKOriginDataManager and get it messaging to the DatabaseProcess
2736         https://bugs.webkit.org/show_bug.cgi?id=135035
2737
2738         Reviewed by Sam Weinig.
2739
2740         * DatabaseProcess/DatabaseProcess.cpp:
2741         (WebKit::DatabaseProcess::DatabaseProcess): Instantiate the WebOriginDataManager, installing its message handler.
2742         (WebKit::DatabaseProcess::didReceiveMessage): Try the message receiver map, which will try the WebOriginDataManager.
2743         * DatabaseProcess/DatabaseProcess.h:
2744         * DatabaseProcess/DatabaseProcess.messages.in:
2745
2746         * UIProcess/API/C/WKOriginDataManager.cpp:
2747         (WKOriginDataManagerDeleteEntriesForOrigin): Updated to also take a callback.
2748         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates): Added.
2749         (WKOriginDataManagerDeleteAllEntries): Updated to also take a callback.
2750         (WKOriginDataManagerStartObservingChanges): Deleted.
2751         (WKOriginDataManagerStopObservingChanges): Deleted.
2752         (WKOriginDataManagerSetChangeClient): Deleted.
2753         * UIProcess/API/C/WKOriginDataManager.h:
2754
2755         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2756         (WebKit::DatabaseProcessProxy::didReceiveMessage): Send messages to the WebOriginDataManagerProxy supplement if appropriate.
2757         * UIProcess/Databases/DatabaseProcessProxy.h:
2758         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
2759
2760         * UIProcess/WebContext.cpp:
2761         (WebKit::WebContext::WebContext): Instantiate the WebOriginDataManagerProxy supplement.
2762         * UIProcess/WebContext.h:
2763         (WebKit::WebContext::sendToDatabaseProcessRelaunchingIfNecessary):
2764
2765         * UIProcess/WebOriginDataManagerProxy.cpp:
2766         (WebKit::WebOriginDataManagerProxy::contextDestroyed):
2767         (WebKit::WebOriginDataManagerProxy::processDidClose):
2768         (WebKit::WebOriginDataManagerProxy::getOrigins):
2769         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): Setup a callback with the message.
2770         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates): Added
2771         (WebKit::WebOriginDataManagerProxy::didDeleteEntries): Call the callback.
2772         (WebKit::WebOriginDataManagerProxy::deleteAllEntries): Setup a callback with the message.
2773         (WebKit::WebOriginDataManagerProxy::didDeleteAllEntries): Call the callback.
2774         (WebKit::WebOriginDataManagerProxy::startObservingChanges): Deleted.
2775         (WebKit::WebOriginDataManagerProxy::stopObservingChanges): Deleted.
2776         (WebKit::WebOriginDataManagerProxy::setChangeClient): Deleted.
2777         (WebKit::WebOriginDataManagerProxy::didChange): Deleted.
2778         * UIProcess/WebOriginDataManagerProxy.h:
2779         * UIProcess/WebOriginDataManagerProxy.messages.in:
2780
2781         * UIProcess/WebOriginDataManagerProxyChangeClient.cpp: Removed.
2782         * UIProcess/WebOriginDataManagerProxyChangeClient.h: Removed.
2783
2784         * WebKit2.xcodeproj/project.pbxproj:
2785
2786         * WebProcess/OriginData/WebOriginDataManager.cpp:
2787         (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Send the callback reply.
2788         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Added.
2789         (WebKit::WebOriginDataManager::deleteAllEntries): Send the callback reply.
2790         (WebKit::WebOriginDataManager::startObservingChanges): Deleted.
2791         (WebKit::WebOriginDataManager::stopObservingChanges): Deleted.
2792         * WebProcess/OriginData/WebOriginDataManager.h:
2793         * WebProcess/OriginData/WebOriginDataManager.messages.in:
2794
2795 2014-07-25  Gavin Barraclough  <baraclough@apple.com>
2796
2797         Yosemite version number is 101000
2798         https://bugs.webkit.org/show_bug.cgi?id=135301
2799
2800         Reviewed by Sam Weinig.
2801
2802         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2803         (WebKit::connectToService):
2804         * WebProcess/com.apple.WebProcess.sb.in:
2805
2806 2014-07-24  Benjamin Poulain  <bpoulain@apple.com>
2807
2808         [iOS][WK2] Do not try to hit test a null mainFrameRenderView on dynamicViewportSizeUpdate()
2809         https://bugs.webkit.org/show_bug.cgi?id=135277
2810         <rdar://problem/17804891>
2811
2812         Reviewed by Tim Horton.
2813
2814         * WebProcess/WebPage/ios/WebPageIOS.mm:
2815         (WebKit::WebPage::dynamicViewportSizeUpdate):
2816         There is no guarantee that the main frame have its root view when performing a dynamicViewportSizeUpdate(),
2817         we should not attempt to use the layer without null checking it first.
2818
2819         The odd part for me is <rdar://problem/17804891> is a little too frequent. In the vast majority of cases,
2820         there is a RenderView, it seems actually pretty hard not to have one on dynamicViewportSizeUpdate().
2821
2822         Skipping hit testing is safe because it is a completely optional part of this algorithm.
2823         When the hit test is not done, the new position is computed based on the relative position prior to
2824         the size change.
2825
2826 2014-07-24  Dan Bernstein  <mitz@apple.com>
2827
2828         WebKit2 part of <rdar://problem/17593701> Assertion failure in WebPage::reload (!m_pendingNavigationID) when reloading after a same-document back navigation
2829         https://bugs.webkit.org/show_bug.cgi?id=135129
2830
2831         Reviewed by Darin Adler.
2832
2833         * Shared/WebBackForwardListItem.cpp:
2834         (WebKit::childItemWithDocumentSequenceNumber): New helper function based on
2835         WebCore::HistoryItem::childItemWithDocumentSequenceNumber.
2836         (WebKit::documentTreesAreEqual): New helper function based on
2837         WebCore::HistoryItem::hasSameDocumentTree.
2838         (WebKit::WebBackForwardListItem::itemIsInSameDocument): Added. Based on
2839         WebCore::HistoryItem::shouldDoSameDocumentNavigationTo.
2840         * Shared/WebBackForwardListItem.h:
2841
2842         * UIProcess/WebPageProxy.cpp:
2843         (WebKit::WebPageProxy::goForward): Don’t assign a new navigation ID if the back-forward
2844         navigation is a same-document navigation.
2845         (WebKit::WebPageProxy::goBack): Ditto.
2846         (WebKit::WebPageProxy::goToBackForwardItem): Ditto.
2847
2848 2014-07-24  Tim Horton  <timothy_horton@apple.com>
2849
2850         Sometimes WKWebView is blank after resuming the app, until you scroll
2851         https://bugs.webkit.org/show_bug.cgi?id=135275
2852         <rdar://problem/17803170>
2853
2854         Reviewed by Benjamin Poulain.
2855
2856         * UIProcess/WebPageProxy.cpp:
2857         (WebKit::WebPageProxy::dispatchViewStateChange):
2858         If the UI process is waiting for a didUpdateViewState, we need to *always*
2859         get a reply from the Web Process, so dispatchViewStateChange should *always*
2860         send SetViewState even if nothing changed (so that we get the reply).
2861
2862 2014-07-24  Simon Fraser  <simon.fraser@apple.com>
2863
2864         [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
2865         https://bugs.webkit.org/show_bug.cgi?id=135221
2866         <rdar://problem/17542454>
2867
2868         Reviewed by Benjamin Poulain.
2869         
2870         The call to didCommitLayerTree() can cause one or two visible rect updates,
2871         via changes to the UIScrollView contentSize and contentOffset. As a result, we
2872         would notify the scrolling tree about a viewport change, but using the old
2873         scrolling tree rather than the new one, so we could move layers around for
2874         nodes which are about to be removed from the tree.
2875         
2876         However, we also have to ensure that programmatic scrolls are applied after
2877         didCommitLayerTree() has updated the view size, so have RemoteScrollingCoordinatorProxy
2878         store data about programmatic scrolls and return them to the caller, which
2879         can apply them after didCommitLayerTree().
2880
2881         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: Store a pointer to a RequestedScrollInfo
2882         for the duration of the tree update, so that we can store requested scroll info in it.
2883         (WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy):
2884         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree):
2885         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll):
2886         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2887         * UIProcess/WebPageProxy.cpp:
2888         (WebKit::WebPageProxy::didCommitLayerTree): Give Mac a stub implementation.
2889         * UIProcess/WebPageProxy.h: Group some editing-related functions together.
2890         (WebKit::WebPageProxy::editorState):
2891         (WebKit::WebPageProxy::canDelete):
2892         (WebKit::WebPageProxy::hasSelectedRange):
2893         (WebKit::WebPageProxy::isContentEditable):
2894         (WebKit::WebPageProxy::maintainsInactiveSelection):
2895         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2896         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): Ordering change: update
2897         the layer tree, then call didCommitLayerTree(), then do the viewport update, followed
2898         by any programmatic scroll.
2899
2900 2014-07-24  Peyton Randolph  <prandolph@apple.com>
2901
2902         Rename feature flag for long-press gesture on Mac.                                                                   
2903         https://bugs.webkit.org/show_bug.cgi?id=135259                                                                  
2904
2905         Reviewed by Beth Dakin.
2906
2907         * Configurations/FeatureDefines.xcconfig:
2908         Rename LINK_LONG_PRESS to MAC_LONG_PRESS.
2909
2910 2014-07-24  Dan Bernstein  <mitz@apple.com>
2911
2912         WebKit2 part of <rdar://problem/17766348> [Cocoa] WebCore::ProtectionSpace doesn’t preserve all NSURLProtectionSpace properties, such as the distinguishedNames array
2913         https://bugs.webkit.org/show_bug.cgi?id=135229
2914
2915         Reviewed by Alexey Proskuryakov.
2916
2917         * Shared/Cocoa/WKNSURLProtectionSpace.mm: Changed to use ProtectionSpace::nsSpace.
2918
2919         * Shared/WebCoreArgumentCoders.cpp:
2920         (IPC::ArgumentCoder<ProtectionSpace>::encode): If encoding the space requires encoding the
2921         platform data, do that.
2922         (IPC::ArgumentCoder<ProtectionSpace>::decode): If platform data was encoded, decode it.
2923         * Shared/WebCoreArgumentCoders.h:
2924
2925         * Shared/mac/WebCoreArgumentCodersMac.mm:
2926         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Archive the NSURLProtectionSpace.
2927         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Unarchive it.
2928
2929         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2930         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Added.
2931         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Added.
2932
2933 2014-07-24  Benjamin Poulain  <benjamin@webkit.org>
2934
2935         [WK2] Fixed/Sticky layers can get mispositioned when the layer tree commit change their position or size
2936         https://bugs.webkit.org/show_bug.cgi?id=135227
2937         <rdar://problem/17279500>
2938
2939         Reviewed by Simon Fraser.
2940
2941         In some cases, a fixed or sticky positioned layer would end up at its position corresponding to the WebProcess
2942         instead of sticking the to real viewport in the UIProcess.
2943
2944         The sequence of event is:
2945         1) A layer becomes fixed in some ScrollingTree transaction.
2946         2) Later, some change in the WebProcess causes a LayerTree update for that exact same layer, but no corresponding
2947            ScrollingTree update is made.
2948         3) In the UIProcess, the position of the fixed layer is changed due to the LayerTree update.
2949            But! There is no ScrollingTree change, updateScrollingTree() never sets fixedOrStickyLayerChanged to true,
2950            and the position is not corrected.
2951         -> The layer is now at the wrong position until the next VisibleContentRectUpdate.
2952
2953         Ideally, we should have fixedOrStickyLayerChanged track if either the position or size of a fixed layer changed
2954         in the layer tree. This is tricky since the layer tree does not keep track of the fixed nodes of the scrolling tree.
2955
2956         Since this complexity seems risky at this point, I went for something simpler but with more overhead:
2957         any time the scrolling tree contains either a fixed or sticky layer, viewportChangedViaDelegatedScrolling()
2958         is called to "fix" the position.
2959
2960         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2961         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree):
2962         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2963         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2964         (WebKit::RemoteScrollingCoordinatorProxy::hasFixedOrSticky):
2965         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2966         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2967         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2968         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2969
2970 2014-07-24  Oliver Hunt  <oliver@apple.com>
2971
2972         Need to explicitly support location services in webcontent profile
2973         https://bugs.webkit.org/show_bug.cgi?id=135251
2974         <rdar://17798346>
2975
2976         Reviewed by Dan Bernstein.
2977
2978         Switching to uikit-app means that we remove the implicit support
2979         for location services. This makes us explicitly opt-in.
2980
2981         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2982
2983 2014-07-24  Tim Horton  <timothy_horton@apple.com>
2984
2985         Crash at [WKContentView _applicationWillEnterForeground:] + 28
2986         <rdar://problem/17797103>
2987
2988         Reviewed by Sam Weinig.
2989
2990         * UIProcess/ios/WKContentView.mm:
2991         (-[WKContentView _applicationWillEnterForeground:]):
2992         Drawing area can be null; null check it!
2993         It's ok if we don't hide the content in this case, because if the drawing area is null,
2994         it doesn't have any layers in the tree anyway.
2995
2996 2014-07-23  Simon Fraser  <simon.fraser@apple.com>
2997
2998         [iOS WK2] Some help.apple.com pages not scrollable
2999         https://bugs.webkit.org/show_bug.cgi?id=135228
3000         <rdar://problem/17790792>
3001
3002         Reviewed by Benjamin Poulain.
3003         
3004         On pages which size their document to the device size, the WKContentView size
3005         never changes after it's created. In this situation, we never set a bounds
3006         on the _rootContentView, so it remains zero-sized which breaks hit testing
3007         on all enclosed UIScrollViews for overflow:scroll.
3008         
3009         Fix by making the _rootContentView and the _inspectorIndicationView use autosizing
3010         so they are always the size of their parent view, and remove the explicit setting
3011         of their bounds.
3012
3013         * UIProcess/ios/WKContentView.mm:
3014         (-[WKContentView initWithFrame:context:configuration:webView:]):
3015         (-[WKContentView setShowingInspectorIndication:]):
3016         (-[WKContentView _didCommitLayerTree:]):
3017
3018 2014-07-23  Benjamin Poulain  <bpoulain@apple.com>
3019
3020         [iOS][WK2] r171124 is incorrect when the virtual keyboard is up
3021         https://bugs.webkit.org/show_bug.cgi?id=135187
3022
3023         Reviewed by Simon Fraser.
3024
3025         Unfortunately, restricting the input into the document rect does not work.
3026         When the keyboard is up, the keyboard bounds can overlap the WKWebView, and
3027         the valid range should account for that.
3028
3029         Instead of playing with the keyboard rect, we can limit the scroll position
3030         inside the valid range of UIScrollView. The keyboard always adjusts the UIScrollView
3031         range as needed to give access to the content. Using that range is a bit more permissive
3032         because the page could scroll to reveal content in the content inset defined by the client
3033         of the API (this could actually be quite useful for hybrid apps).
3034
3035         There was already a function to change the content offset in the valid scrollview
3036         range: changeContentOffsetBoundedInValidRange(), I extracted the range check
3037         to contentOffsetBoundedInValidRange() for the needs of -[WKWebView _scrollToContentOffset:].
3038
3039         So...contentOffsetBoundedInValidRange() is cool, but it is not in the right coordinate
3040         system. The scroll position we get from the WebProcess is in document coordinates, while
3041         contentOffsetBoundedInValidRange() works with the UIScrollView coordinates.
3042         To fix that, we scale the input position to get to the same scale as UIScrollView, then
3043         apply the insets with the weirdly named [WKWebView _adjustedContentOffset:].
3044
3045         * UIProcess/API/Cocoa/WKWebView.mm:
3046         (contentOffsetBoundedInValidRange):
3047         (changeContentOffsetBoundedInValidRange):
3048         (-[WKWebView _scrollToContentOffset:]):
3049
3050 2014-07-23  Commit Queue  <commit-queue@webkit.org>
3051
3052         Unreviewed, rolling out r171498.
3053         https://bugs.webkit.org/show_bug.cgi?id=135223
3054
3055         It will regress some scroll position restoration on navigation
3056         (r167916). (Requested by smfr on #webkit).
3057
3058         Reverted changeset:
3059
3060         "[iOS WK2] Header bar on nytimes articles lands in the wrong
3061         place after rubberbanding"
3062         https://bugs.webkit.org/show_bug.cgi?id=135221
3063         http://trac.webkit.org/changeset/171498
3064
3065 2014-07-23  Simon Fraser  <simon.fraser@apple.com>
3066
3067         [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
3068         https://bugs.webkit.org/show_bug.cgi?id=135221
3069
3070         Reviewed by Tim Horton.
3071         
3072         The call to didCommitLayerTree() can cause one or two visible rect updates,
3073         via changes to the UIScrollView contentSize and contentOffset. As a result, we
3074         would notify the scrolling tree about a viewport change, but using the old
3075         scrolling tree rather than the new one, so we could move layers around for
3076         nodes which are about to be removed from the tree.
3077         
3078         Fix by m_webPageProxy->didCommitLayerTree() after the scrolling tree has been
3079         committed.
3080
3081         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3082         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3083
3084 2014-07-23  Oliver Hunt  <oliver@apple.com>
3085
3086         Add a pseudo target to create sandbox override roots
3087         https://bugs.webkit.org/show_bug.cgi?id=135216
3088         <rdar://17785560>
3089
3090         Reviewed by Alexey Proskuryakov.
3091
3092         Just a duplicate of the standard ios sandbox target, targetting
3093         the profile overrides directory.  This means we can make roots
3094         that "Just Work".
3095
3096         * WebKit2.xcodeproj/project.pbxproj:
3097
3098 2014-07-23  Oliver Hunt  <oliver@apple.com>
3099
3100         Incorrect commit for sandbox profile
3101         https://bugs.webkit.org/show_bug.cgi?id=135214
3102         <rdar://17739108>
3103
3104         Reviewed by Anders Carlsson.
3105
3106         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3107
3108 2014-07-23  Dan Bernstein  <mitz@apple.com>
3109
3110         <rdar://problem/17782623> [iOS] Client-certificate authentication isn’t working with some certificates
3111         https://bugs.webkit.org/show_bug.cgi?id=135206
3112
3113         Reviewed by Anders Carlsson.
3114
3115         * Shared/cf/ArgumentCodersCF.cpp:
3116         (IPC::copyPersistentRef): Added this helper function. It differs from
3117         SecKeyCopyPersistentRef in that if multiple copies of the key exist in the keychain, it
3118         ensures that we get a reference to the copy that is in the keychain access group that the
3119         Networking process can use.
3120         (IPC::encode): Use copyPersistentRef.
3121
3122 2014-07-23  Bem Jones-Bey  <bjonesbe@adobe.com>
3123
3124         Remove CSS_EXCLUSIONS compile flag and leftover code
3125         https://bugs.webkit.org/show_bug.cgi?id=135175
3126
3127         Reviewed by Zoltan Horvath.
3128
3129         At this point, the CSS_EXCLUSIONS flag guards nothing but some useless
3130         stubs. This removes the flag and the useless code.
3131
3132         * Configurations/FeatureDefines.xcconfig:
3133
3134 2014-07-23  Timothy Horton  <timothy_horton@apple.com>
3135
3136         REGRESSION (r171239): Much more time spent taking snapshots during the PLT
3137         https://bugs.webkit.org/show_bug.cgi?id=135177
3138         <rdar://problem/17764847>
3139
3140         Reviewed by Dan Bernstein.
3141
3142         * UIProcess/WebPageProxy.cpp:
3143         (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame):
3144         (WebKit::WebPageProxy::willChangeCurrentHistoryItem): Deleted.
3145         * UIProcess/WebPageProxy.h:
3146         * UIProcess/WebPageProxy.messages.in:
3147         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3148         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
3149         * WebProcess/WebPage/WebPage.cpp:
3150         (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame):
3151         (WebKit::WebPage::willChangeCurrentHistoryItem): Deleted.
3152         * WebProcess/WebPage/WebPage.h:
3153         Rename WillChangeCurrentHistoryItem to WillChangeCurrentHistoryItemForMainFrame.
3154         Only send it when the current history item for the main frame changes.
3155
3156 2014-07-23  Ryuan Choi  <ryuan.choi@samsung.com>
3157
3158         [EFL] EWebKit2.h should contain version information
3159         https://bugs.webkit.org/show_bug.cgi?id=135189
3160
3161         Reviewed by Gyuyoung Kim.
3162
3163         Generate EWebKit2.h to contain the version information.
3164
3165         * PlatformEfl.cmake:
3166         * UIProcess/API/efl/EWebKit2.h.in: Renamed from Source/WebKit2/UIProcess/API/efl/EWebKit2.h.
3167
3168 2014-07-23  Ryuan Choi  <ryuan.choi@samsung.com>
3169
3170         [EFL] Do not generate forwarding header for ewk headers
3171         https://bugs.webkit.org/show_bug.cgi?id=135147
3172
3173         Reviewed by Gyuyoung Kim.
3174
3175         Only EWebKit2.h and ewk_text_checker.h are generated as forwarding header.
3176         This is unnecessary.
3177
3178         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
3179         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
3180         * UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:
3181         * UIProcess/API/efl/tests/test_ewk2_window_features.cpp:
3182         * UIProcess/efl/TextCheckerClientEfl.h:
3183
3184 2014-07-22  Commit Queue  <commit-queue@webkit.org>
3185
3186         Unreviewed, rolling out r171366.
3187         https://bugs.webkit.org/show_bug.cgi?id=135190
3188
3189         Broke three API tests (Requested by ap on #webkit).
3190
3191         Reverted changeset:
3192
3193         "REGRESSION (r171239): Much more time spent taking snapshots
3194         during the PLT"
3195         https://bugs.webkit.org/show_bug.cgi?id=135177
3196         http://trac.webkit.org/changeset/171366
3197
3198 2014-07-22  Oliver Hunt  <oliver@apple.com>
3199
3200         Reduce the size of the root WebContent sandbox profile
3201         https://bugs.webkit.org/show_bug.cgi?id=135182
3202         <rdar://problem/17739108>
3203
3204         Reviewed by Alexey Proskuryakov.
3205
3206         Switch from apple-ui-app to uikit-app as the root of the webcontent
3207         profile.
3208
3209         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3210
3211 2014-07-22  Jinwoo Song  <jinwoo7.song@samsung.com>
3212
3213         Unreviewed build fix on EFL port after r171356.
3214
3215         Implement a dummy platformMediaCacheDirectory() to avoid undefined reference error.
3216
3217         * UIProcess/efl/WebContextEfl.cpp:
3218         (WebKit::WebContext::platformMediaCacheDirectory):
3219
3220 2014-07-22  Enrica Casucci  <enrica@apple.com>
3221
3222         REGRESSION (WebKit2): Selection inside accelerated overflow:scroll doesn't track scrolling.
3223         https://bugs.webkit.org/show_bug.cgi?id=135180
3224         <rdar://problem/16721055>
3225
3226         Reviewed by Simon Fraser.
3227
3228         Adds notifications to the WKContentView to know when scrolling starts and ends
3229         in an overflow scroll. When scrolling starts, we hide the selection and we restore
3230         it when scrolling ends, though not before the selection information in the editor
3231         state has been updated.
3232         It also adds a new method to the EditorClient class to force the
3233         selection update when scrolling is completed.
3234         
3235         * UIProcess/PageClient.h:
3236         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3237         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3238         (WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartScroll):
3239         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndScroll):
3240         * UIProcess/Scrolling/RemoteScrollingTree.h:
3241         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3242         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3243         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
3244         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
3245         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
3246         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart):
3247         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd):
3248         * UIProcess/WebPageProxy.h:
3249         * UIProcess/ios/PageClientImplIOS.h:
3250         * UIProcess/ios/PageClientImplIOS.mm:
3251         (WebKit::PageClientImpl::overflowScrollWillStartScroll):
3252         (WebKit::PageClientImpl::overflowScrollDidEndScroll):
3253         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3254         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll):
3255         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll):
3256         * UIProcess/ios/WKContentViewInteraction.h:
3257         * UIProcess/ios/WKContentViewInteraction.mm:
3258         (-[WKContentView _overflowScrollingWillBegin]):
3259         (-[WKContentView _overflowScrollingDidEnd]):
3260         (-[WKContentView _updateChangedSelection]):
3261         * UIProcess/ios/WebPageProxyIOS.mm:
3262         (WebKit::WebPageProxy::overflowScrollWillStartScroll):
3263         (WebKit::WebPageProxy::overflowScrollDidEndScroll):
3264         * WebProcess/WebCoreSupport/WebEditorClient.h:
3265         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3266         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3267         (WebKit::WebEditorClient::updateSelection):
3268
3269 2014-07-22  Benjamin Poulain  <bpoulain@apple.com>
3270
3271         [iOS][WK2] WebPageProxy should not do anything when responding to an animated resize is the page is not in a valid state
3272         https://bugs.webkit.org/show_bug.cgi?id=135169
3273         <rdar://problem/17740149>
3274
3275         Reviewed by Tim Horton.
3276
3277         * UIProcess/ios/WebPageProxyIOS.mm:
3278         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3279         Neither m_dynamicViewportSizeUpdateWaitingForTarget nor m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit should
3280         be modified if there is not WebProcess to respond to DynamicViewportSizeUpdate.
3281
3282         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
3283         We should not attempt to synchronize anything if the page was closed before the end of the dynamic viewport
3284         update.
3285
3286 2014-07-22  Timothy Horton  <timothy_horton@apple.com>
3287
3288         REGRESSION (r171239): Much more time spent taking snapshots during the PLT
3289         https://bugs.webkit.org/show_bug.cgi?id=135177
3290         <rdar://problem/17764847>
3291
3292         Reviewed by Dan Bernstein.
3293
3294         * UIProcess/WebPageProxy.cpp:
3295         (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame):
3296         (WebKit::WebPageProxy::willChangeCurrentHistoryItem): Deleted.
3297         * UIProcess/WebPageProxy.h:
3298         * UIProcess/WebPageProxy.messages.in:
3299         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3300         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
3301         * WebProcess/WebPage/WebPage.cpp:
3302         (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame):
3303         (WebKit::WebPage::willChangeCurrentHistoryItem): Deleted.
3304         * WebProcess/WebPage/WebPage.h:
3305         Rename WillChangeCurrentHistoryItem to WillChangeCurrentHistoryItemForMainFrame.
3306         Only send it when the current history item for the main frame changes.
3307
3308 2014-07-22  Oliver Hunt  <oliver@apple.com>
3309
3310         Add accountsd access to network sandbox profile
3311         https://bugs.webkit.org/show_bug.cgi?id=135176
3312         <rdar://17656487>
3313
3314         Reviewed by Anders Carlsson.
3315
3316         This is available to the webcontent process already, but is also
3317         needed for the networking process.
3318
3319         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3320
3321 2014-07-22  Oliver Hunt  <oliver@apple.com>
3322
3323         Remove unused com.apple.webkit.* rules from profiles
3324         https://bugs.webkit.org/show_bug.cgi?id=135174
3325         <rdar://17755931>
3326
3327         Reviewed by Anders Carlsson.
3328
3329         We never send these rules so we should just remove use of them
3330         from the profiles.
3331
3332         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3333         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3334
3335 2014-07-22  Oliver Hunt  <oliver@apple.com>
3336
3337         Provide networking process with access to its HSTS db
3338         https://bugs.webkit.org/show_bug.cgi?id=135121
3339         <rdar://17654369>
3340
3341         Reviewed by Alexey Proskuryakov.
3342
3343         Add an extension parameter to pass the hsts database file.
3344         This requires us to create the Caches/com.apple.WebKit.Networking
3345         directory in the UI process, as the network sandbox
3346         does not allow it to create the containing directory.
3347
3348         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3349         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3350         * Shared/Network/NetworkProcessCreationParameters.cpp:
3351         (WebKit::NetworkProcessCreationParameters::encode):
3352         (WebKit::NetworkProcessCreationParameters::decode):
3353         * Shared/Network/NetworkProcessCreationParameters.h:
3354         * UIProcess/WebContext.cpp:
3355         (WebKit::WebContext::ensureNetworkProcess):
3356         (WebKit::WebContext::networkingHSTSDatabasePath):
3357         * UIProcess/WebContext.h:
3358         * UIProcess/mac/WebContextMac.mm:
3359         (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath):
3360
3361 2014-07-22  Benjamin Poulain  <bpoulain@apple.com>
3362
3363         [iOS][WK2] UI helpers that zoom on an element ignore the viewport's allowsUserScaling
3364         https://bugs.webkit.org/show_bug.cgi?id=135140
3365         <rdar://problem/17754921>
3366
3367         Reviewed by Tim Horton.
3368
3369         UIScrollView makes a difference between min/max zoom and allowUserScaling. To express that,
3370         everything is set up on the LayerTransaction.
3371
3372         For zooming related helpers (find on page, double tap to zoom, etc), the min and max zoom
3373         should be the actual min/max for the current page state.
3374
3375         This patch split the two explicitely.
3376         For layer transactions, the values are taken from the viewport configuration directly.
3377         For everything else, we should use minimumPageScaleFactor/maximumPageScaleFactor. Those two methods
3378         have been updated to take into account allowsUserScaling.
3379
3380         * WebProcess/WebPage/WebPage.cpp:
3381         (WebKit::WebPage::willCommitLayerTree):
3382         * WebProcess/WebPage/ios/WebPageIOS.mm:
3383         (WebKit::WebPage::minimumPageScaleFactor):
3384         (WebKit::WebPage::maximumPageScaleFactor):
3385         (WebKit::WebPage::getAssistedNodeInformation):
3386
3387 2014-07-22  Shivakumar JM  <shiva.jm@samsung.com>
3388
3389         Web Inspector: Fix unused parameter build warning
3390         https://bugs.webkit.org/show_bug.cgi?id=135151
3391
3392         Reviewed by Joseph Pecoraro.
3393
3394         Fix unused parameter build warning by removing the parameter name 
3395
3396         * WebProcess/WebPage/WebInspector.cpp:
3397         (WebKit::WebInspector::setJavaScriptProfilingEnabled):
3398
3399 2014-07-22  Shivakumar JM  <shiva.jm@samsung.com>
3400
3401         Fix unused parameter build warning in UIProcess module
3402         https://bugs.webkit.org/show_bug.cgi?id=135154
3403
3404         Reviewed by Alexey Proskuryakov.
3405
3406         Fix unused parameter build warning in UIProcess module by using UNUSED_PARAM macro.
3407
3408         * UIProcess/WebPageProxy.cpp:
3409         (WebKit::WebPageProxy::viewStateDidChange):
3410
3411 2014-07-22  Jeremy Jones  <jeremyj@apple.com>
3412
3413         Don't create new UIWindow for video fullscreen.
3414         https://bugs.webkit.org/show_bug.cgi?id=135038
3415
3416         Reviewed by Darin Adler.
3417
3418         Use root UIView to parent fullscreen interface.
3419
3420         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3421         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): pass parent UIView
3422         * WebProcess/ios/WebVideoFullscreenManager.mm:
3423         (WebKit::screenRectForNode): Use client rect instead of screen rect.
3424
3425 2014-07-21  Ryuan Choi  <ryuan.choi@samsung.com>
3426
3427         [EFL] Add Ewk prefix to enums of ewk_navigation_policy
3428         https://bugs.webkit.org/show_bug.cgi?id=135144
3429
3430         Reviewed by Gyuyoung Kim.
3431
3432         All public enums of ewebkit should start with Ewk prefix.
3433         This patch added Ewk prefix to Ewk_Event_Mouse_Button and Ewk_Event_Modifiers.
3434         In addition, added missing description and default value for Ewk_Event_Modifier.
3435
3436         * UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
3437         (toEwkEventMouseButton):
3438         (toEwkEventModifiers):
3439         (EwkNavigationPolicyDecision::mouseButton):
3440         (EwkNavigationPolicyDecision::modifiers):
3441         (ewk_navigation_policy_mouse_button_get):
3442         (ewk_navigation_policy_modifiers_get):
3443         (toEventMouseButton): Deleted.
3444         (toEventModifierKeys): Deleted.
3445         * UIProcess/API/efl/ewk_navigation_policy_decision.h:
3446         * UIProcess/API/efl/ewk_navigation_policy_decision_private.h:
3447
3448 2014-07-21  Benjamin Poulain  <bpoulain@apple.com>
3449
3450         [iOS][WK2] Improve event throttling for Scroll Events
3451         https://bugs.webkit.org/show_bug.cgi?id=135082
3452         <rdar://problem/17445266>
3453
3454         Reviewed by Simon Fraser.
3455
3456         In the WebKit layer, we want a measure that is representative of the responsiveness.
3457
3458         In this patch, I use the total delay between a VisibleContentRectUpdate being dispatched
3459         by the UIProcess, and the time RemoteLayerTreeDrawingArea flushes the layer tree.
3460
3461         The value used for eventThrottlingDelay() is computed by averaging the new value with
3462         the old values with a 80/20 split, favoring the old data. Favoring historical data
3463         over the last timing avoid excessively throttling for a single slow frame.
3464
3465         The computation of m_estimatedMainThreadLatency can be improved in the future, this is
3466         a first cut keeping things simple.
3467
3468         With m_estimatedMainThreadLatency in our hands, we can compute our eventThrottlingDelay().
3469         If m_estimatedMainThreadLatency is smaller than a single frame timespan, we have a fast page
3470         and nothing is throttled.
3471
3472         If is it more than a frame, we throttle such that we can at least render two frames
3473         per event dispatch based on the historical data.
3474
3475         The exact values will need some tweaking, but this set ensures well written pages get
3476         60 events per seconds, while slow pages do not waste too much time on events.
3477
3478         * WebProcess/WebCoreSupport/WebChromeClient.h:
3479         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3480         (WebKit::WebChromeClient::eventThrottlingDelay):
3481         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
3482         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
3483         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
3484         * WebProcess/WebPage/ViewUpdateDispatcher.h:
3485         * WebProcess/WebPage/WebPage.cpp:
3486         (WebKit::WebPage::WebPage):
3487         (WebKit::WebPage::didFlushLayerTreeAtTime):
3488         (WebKit::WebPage::didCommitLoad):
3489         * WebProcess/WebPage/WebPage.h:
3490         * WebProcess/WebPage/ios/WebPageIOS.mm:
3491         (WebKit::WebPage::eventThrottlingDelay):
3492         (WebKit::WebPage::updateVisibleContentRects):
3493         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3494         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3495
3496 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
3497
3498         REGRESSION (r170361): In landscape with UI hidden, fixed position elements at top of screen are too low
3499         https://bugs.webkit.org/show_bug.cgi?id=135141
3500         <rdar://problem/17627525>
3501
3502         Reviewed by Benjamin Poulain.
3503         
3504         We can't use the WKWebView's UIScrollView contentInsets to determine the unobscured rect
3505         in MobileSafari, because contentInsets can't be changed dynamically while scrolling.
3506         To get around this, MobileSafari sets obscured insets instead (but also sets a fixed
3507         contentInset).
3508         
3509         So if the client calls _setObscuredInsets:, always use _obscuredInsets to compute the 
3510         content insets.
3511
3512         * UIProcess/API/Cocoa/WKWebView.mm:
3513         (-[WKWebView _computedContentInset]):
3514         (-[WKWebView _setObscuredInsets:]):
3515
3516 2014-07-21  Oliver Hunt  <oliver@apple.com>
3517
3518         Remove global cookie workaround from sandbox profiles
3519         https://bugs.webkit.org/show_bug.cgi?id=135138
3520         <rdar://17513375>
3521
3522         Reviewed by Alexey Proskuryakov.
3523
3524         Remove the workaround needed for global cookie access, and silencing
3525         of the associated sandbox violation.
3526
3527         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3528         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3529         * UIProcess/mac/WebContextMac.mm:
3530         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
3531
3532 2014-07-21  Oliver Hunt  <oliver@apple.com>
3533
3534         Correct sandbox profiles to fix some excess privileges
3535         https://bugs.webkit.org/show_bug.cgi?id=135134
3536         <rdar://problem/17741886>
3537         <rdar://problem/17739080>
3538
3539         Reviewed by Alexey Proskuryakov.
3540
3541         This cleans up our sandbox profiles to fix a few issues - the profiles
3542         no longer allow us to issue file extension we have the ability to consume,
3543         and tightens some of the other file access rules.
3544
3545         This means we have to addd some rules to allow us to access things
3546         that we previously had access to due to lax file system restrictions.
3547
3548         Some of the features were fixable simply by using entitlements on the
3549         process rather than custom rules.
3550
3551         * Configurations/WebContent-iOS.entitlements:
3552         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
3553         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3554         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3555
3556 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
3557
3558         [iOS WK2] Turn off position:fixed behavior when the keyboard is up
3559         https://bugs.webkit.org/show_bug.cgi?id=132537
3560
3561         Reviewed by Benjamin Poulain.
3562         
3563         Make interaction with form elements inside position:fixed less terrible by re-laying out
3564         fixed elements relative to the document while we have an assisted node. This ensures
3565         that all parts of a position:fixed are accessible (e.g. inputs on the right side
3566         of a fixed-width top bar).
3567         
3568         * Shared/AssistedNodeInformation.cpp: Add a flag for being inside postion:fixed,
3569         and encode/decode it.
3570         (WebKit::AssistedNodeInformation::encode):
3571         (WebKit::AssistedNodeInformation::decode):
3572         * Shared/AssistedNodeInformation.h:
3573         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
3574         * UIProcess/PageClient.h: Add isAssistingNode().
3575         * UIProcess/ios/PageClientImplIOS.h:
3576         * UIProcess/ios/PageClientImplIOS.mm:
3577         (WebKit::PageClientImpl::isAssistingNode):
3578         * UIProcess/ios/WebPageProxyIOS.mm:
3579         (WebKit::WebPageProxy::computeCustomFixedPositionRect): If we have an assisted
3580         node, just use the document rect as the custom fixed position rect.
3581         * WebProcess/WebPage/ios/WebPageIOS.mm:
3582         (WebKit::WebPage::getAssistedNodeInformation): Get the selection rect first,
3583         since we have to fix it up for position:fixed. If the element is inside fixed
3584         position in the main frame, re-set the fixed position rect to the document rect
3585         (which forces a layout), re-fetch elementRect, then set it back. This ensures
3586         that the UI process gets an elementRect which it can zoom to correctly.
3587
3588 2014-07-21  Timothy Horton  <timothy_horton@apple.com>
3589
3590         Random crashes on the Web Thread due to Timers firing on the wrong thread in the UI process
3591         https://bugs.webkit.org/show_bug.cgi?id=135132
3592         <rdar://problem/17719832>
3593
3594         Reviewed by Simon Fraser.
3595
3596         * UIProcess/ProcessThrottler.cpp:
3597         (WebKit::ProcessThrottler::ProcessThrottler):
3598         (WebKit::ProcessThrottler::suspendTimerFired):
3599         * UIProcess/ProcessThrottler.h:
3600         * UIProcess/ios/ViewGestureControllerIOS.mm:
3601         (WebKit::ViewGestureController::ViewGestureController):
3602         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
3603         * UIProcess/mac/ViewGestureController.h:
3604         * UIProcess/mac/ViewGestureControllerMac.mm:
3605         (WebKit::ViewGestureController::ViewGestureController):
3606         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
3607         We can't use WebCore timers in the UI process because of coexistence concerns
3608         (they fire on the Web Thread if there is one!), so use RunLoop::Timer instead.
3609
3610 2014-07-21  Andy Estes  <aestes@apple.com>
3611
3612         [iOS] Handle QuickLook ResourceLoaders in the web process
3613         https://bugs.webkit.org/show_bug.cgi?id=135113
3614
3615         Reviewed by David Kilzer.
3616
3617         The QuickLook framework registers a NSURLProtocol to handle loading subresources of the HTML documents it
3618         generates. In order for these loads to succeed, we need to start them in the same process in which QuickLook
3619         generated the main resource.
3620
3621         * WebProcess/Network/WebResourceLoadScheduler.cpp:
3622         (WebKit::WebResourceLoadScheduler::scheduleLoad):
3623
3624 2014-07-21  Brady Eidson  <beidson@apple.com>
3625
3626         DatabaseProcess doesn't relaunch after crashing.
3627         <rdar://problem/17717343> and https://bugs.webkit.org/show_bug.cgi?id=135117
3628
3629         Reviewed by Alexey Proskuryakov.
3630
3631         * UIProcess/Databases/DatabaseProcessProxy.cpp:
3632         (WebKit::DatabaseProcessProxy::didClose): Tell the WebContext.
3633
3634         * UIProcess/WebContext.cpp:
3635         (WebKit::WebContext::databaseProcessCrashed): Notify supplements, then clear the DatabaseProcessProxy pointer.
3636         * UIProcess/WebContext.h:
3637
3638         * UIProcess/WebContextSupplement.h:
3639         (WebKit::WebContextSupplement::processDidClose): Added. No users right now, but the patch in bug 135035 will need this.
3640
3641 2014-07-20  KwangHyuk Kim  <hyuki.kim@samsung.com>
3642
3643         Fix warnings caused by unused parameter.
3644         https://bugs.webkit.org/show_bug.cgi?id=134975
3645
3646         Reviewed by Gyuyoung Kim.
3647
3648         Fix warnings on EwkView.cpp and LegacySessionStateCodingNone.cpp that are caused by unused parameter data.
3649
3650         * UIProcess/API/efl/EwkView.cpp:
3651         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
3652         * UIProcess/LegacySessionStateCodingNone.cpp:
3653         (WebKit::decodeLegacySessionState):
3654
3655 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
3656
3657         Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
3658         https://bugs.webkit.org/show_bug.cgi?id=134894
3659
3660         Reviewed by Darin Adler.
3661
3662         Add setCanPlayFastReverse
3663
3664         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
3665         * WebProcess/ios/WebVideoFullscreenManager.h: ditto
3666         * WebProcess/ios/WebVideoFullscreenManager.mm: ditto
3667         (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): ditto
3668
3669 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
3670
3671         Decrease flicker when enter and exit fullscreen.
3672         https://bugs.webkit.org/show_bug.cgi?id=134919
3673
3674         Reviewed by Simon Fraser.
3675
3676         Change the sequence of tear down and use transparency to prevent flicker when entering and exiting fullscreen.
3677
3678         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: wait to remove layerHost until didCleanupFullscreen
3679         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): removed from here
3680         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): added here
3681         * WebProcess/ios/WebVideoFullscreenManager.mm:
3682         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): use transparent background during transition
3683
3684 2014-07-20  Dan Bernstein  <mitz@apple.com>
3685
3686         <rdar://problem/17739526> REGRESSION (r171057): Crash in WebPage::getPositionInformation()
3687         https://bugs.webkit.org/show_bug.cgi?id=135099
3688
3689         Reviewed by David Kilzer.
3690
3691         * WebProcess/WebPage/ios/WebPageIOS.mm:
3692         (WebKit::WebPage::getPositionInformation): Added a null check.
3693
3694 2014-07-19  Zan Dobersek  <zdobersek@igalia.com>
3695
3696         Consistently use uint64_t as the handle parameter type for the SetAcceleratedCompositingWindowId message
3697         https://bugs.webkit.org/show_bug.cgi?id=135047
3698
3699         Reviewed by Darin Adler.
3700
3701         UIProcess' WebPageProxy is handling this parameter as an uint64_t, it should be handled as such
3702         in WebProcess as well.
3703
3704         * WebProcess/WebPage/WebPage.h:
3705         * WebProcess/WebPage/WebPage.messages.in: Also changed the parameter name to match other places.
3706         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3707         (WebKit::WebPage::setAcceleratedCompositingWindowId):
3708
3709 2014-07-18  Oliver Hunt  <oliver@apple.com>
3710
3711         We don't provide an extension to the temp file used for uploads
3712         https://bugs.webkit.org/show_bug.cgi?id=135079
3713
3714         Reviewed by Sam Weinig.
3715
3716         Make sure didChooseFilesForOpenPanelWithDisplayStringAndIcon vends
3717         extensions for the files passed to the content process.
3718
3719         * UIProcess/WebPageProxy.cpp:
3720         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
3721
3722 2014-07-18  Tim Horton  <timothy_horton@apple.com>
3723
3724         ASSERTion failures in ViewGestureController indicating that we're copying WebBackForwardList
3725         https://bugs.webkit.org/show_bug.cgi?id=135080
3726         <rdar://problem/17734714>
3727
3728         Reviewed by Sam Weinig.
3729
3730         * UIProcess/ios/ViewGestureControllerIOS.mm:
3731         (WebKit::ViewGestureController::beginSwipeGesture):
3732         (WebKit::ViewGestureController::canSwipeInDirection):
3733
3734 2014-07-18  Yongjun Zhang  <yongjun_zhang@apple.com>
3735
3736         _WKActivatedElementInfo.title should fallback to innerText if the link doesn't have title attribute.
3737         https://bugs.webkit.org/show_bug.cgi?id=135077
3738
3739         When populate InteractionInformationAtPosition's title value, use a link element's innerText if it
3740         doesn't have title attribute.
3741
3742         Reviewed by Dan Bernstein.
3743
3744         * WebProcess/WebPage/ios/WebPageIOS.mm:
3745         (WebKit::WebPage::getPositionInformation):
3746
3747 2014-07-18  Andy Estes  <aestes@apple.com>
3748
3749         [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
3750         https://bugs.webkit.org/show_bug.cgi?id=135072
3751         <rdar://problem/17528188>
3752
3753         Reviewed by David Kilzer.
3754
3755         * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter.
3756         * Shared/mac/WebCoreArgumentCodersMac.mm:
3757         (IPC::ArgumentCoder<ContentFilter>::encode): Encoded the ContentFilter using a NSKeyedArchiver.
3758         (IPC::ArgumentCoder<ContentFilter>::decode): Decoded the ContentFilter using a NSKeyedUnarchiver.
3759         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3760         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::setContentFilterForBlockedLoad().
3761         * UIProcess/WebFrameProxy.cpp:
3762         (WebKit::WebFrameProxy::didStartProvisionalLoad): Reset m_contentFilterForBlockedLoad to nullptr.
3763         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful().
3764         If the unblock is successful, reload the WebPageProxy.
3765         * UIProcess/WebFrameProxy.h:
3766         (WebKit::WebFrameProxy::setContentFilterForBlockedLoad):
3767         * UIProcess/WebPageProxy.cpp:
3768         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check if this is navigation represents an unblock
3769         request and ignore if so.
3770         * UIProcess/WebPageProxy.h:
3771         * UIProcess/WebPageProxy.messages.in: Defined ContentFilterDidBlockLoadForFrame.
3772         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3773         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): Sent ContentFilterDidBlockLoadForFrame to the WebPageProxy.
3774         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3775
3776 2014-07-18  Simon Fraser  <simon.fraser@apple.com>
3777
3778         [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
3779         https://bugs.webkit.org/show_bug.cgi?id=135078
3780         <rdar://problem/17401823>
3781
3782         Reviewed by Tim Horton.
3783         
3784         Fix the logging of requested scroll position and frame scale factor.
3785
3786         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3787         (WebKit::RemoteScrollingTreeTextStream::dump):
3788
3789 2014-07-18  Joseph Pecoraro  <pecoraro@apple.com>
3790
3791         [Cocoa] Use RetainPtr in _WKRemoteObjectInterface
3792         https://bugs.webkit.org/show_bug.cgi?id=135062
3793
3794         Reviewed by Anders Carlsson.
3795
3796         Switch to RetainPtr instead of manual memory management of ivars.
3797
3798         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
3799         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
3800         (-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
3801         (-[_WKRemoteObjectInterface identifier]):
3802         (-[_WKRemoteObjectInterface description]):
3803         (-[_WKRemoteObjectInterface dealloc]): Deleted.
3804
3805 2014-07-18  Tim Horton  <timothy_horton@apple.com>
3806
3807         Take navigation snapshots whenever the current back-forward item is going to change
3808         https://bugs.webkit.org/show_bug.cgi?id=135058
3809         <rdar://problem/17464515>
3810
3811         Reviewed by Dan Bernstein.
3812
3813         Instead of trying to have the UI process figure out when to take navigation snapshots by itself,
3814         snapshot whenever the Web process says that the current back-forward item is going to change.
3815         This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to
3816         just two places instead of 5.
3817
3818         * UIProcess/WebPageProxy.cpp:
3819         (WebKit::WebPageProxy::goForward):
3820         (WebKit::WebPageProxy::goBack):
3821         (WebKit::WebPageProxy::goToBackForwardItem):
3822         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3823         We no longer need to special-case taking navigation snapshots
3824         when the UI process changes the back forward item or upon
3825         didStartProvisionalLoadForFrame, because we'll always snapshot
3826         in willChangeCurrentHistoryItem in all of these cases.
3827
3828         * UIProcess/WebPageProxy.cpp:
3829         (WebKit::WebPageProxy::willChangeCurrentHistoryItem):
3830         * UIProcess/WebPageProxy.h:
3831         * UIProcess/WebPageProxy.messages.in:
3832         Add willChangeCurrentHistoryItem message, which comes from the Web process.
3833         When it arrives, take a navigation snapshot.
3834
3835         * UIProcess/ios/ViewGestureControllerIOS.mm:
3836         (WebKit::ViewGestureController::beginSwipeGesture):
3837         Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe,
3838         so that it doesn't bail from taking the snapshot because we have a snapshot up.
3839
3840         (WebKit::ViewGestureController::endSwipeGesture):
3841         We no longer need to explicitly disable snapshotting while navigating, because
3842         we will avoid taking the snapshot if there's a snapshot being displayed.
3843
3844         * UIProcess/mac/ViewGestureControllerMac.mm:
3845         (WebKit::ViewGestureController::~ViewGestureController):
3846         Remove the snapshot if it's still up when ViewGestureController is destroyed.
3847         The Mac version of ViewGestureController is destroyed on Web process crashes
3848         because it is a message receiver, so it is not guaranteed to have the same
3849         lifetime as the WebPageProxy and friends.
3850
3851         (WebKit::ViewGestureController::trackSwipeGesture):
3852         Make use of recordNavigationSnapshot.
3853
3854         (WebKit::ViewGestureController::endSwipeGesture):
3855         Ditto from the Mac version.
3856
3857         * UIProcess/mac/ViewSnapshotStore.h:
3858         (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted.
3859         (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted.
3860         * UIProcess/mac/ViewSnapshotStore.mm:
3861         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
3862         (WebKit::ViewSnapshotStore::recordSnapshot):
3863         Remove the snapshot disabling mechanism and bail from snapshotting if we're
3864         showing a snapshot, as mentioned above.
3865
3866         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3867         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
3868         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3869         * WebProcess/WebPage/WebPage.cpp:
3870         (WebKit::WebPage::willChangeCurrentHistoryItem):
3871         * WebProcess/WebPage/WebPage.h:
3872         Proxy willChangeCurrentHistoryItem from HistoryController to the UI process.
3873
3874 2014-07-18  Jon Honeycutt  <jhoneycutt@apple.com>
3875
3876         REGRESSION: Crash when typing into text field that clears itself on iOS
3877
3878         <https://bugs.webkit.org/show_bug.cgi?id=135044>
3879         <rdar://problem/17640443>
3880
3881         Reviewed by Darin Adler.
3882
3883         * WebProcess/WebPage/ios/WebPageIOS.mm:
3884         (WebKit::WebPage::requestAutocorrectionData):
3885         wordRangeFromPosition() returns null in some cases; null check range
3886         before dereferencing it. Moved some variable declarations around to
3887         better match our style.
3888
3889 2014-07-18  Tim Horton  <timothy_horton@apple.com>
3890
3891         [WK2] Provide a mechanism to grab the back-forward list for gesture navigation purposes from another WKWebView
3892         https://bugs.webkit.org/show_bug.cgi?id=134999
3893         <rdar://problem/17238025>
3894
3895         Reviewed by Sam Weinig.
3896
3897         In some cases, clients may need to throw a WKWebView with no back-forward list over
3898         another WKWebView, and want to participate in gesture swipe as if they were actually
3899         the page being overlaid.
3900
3901         * UIProcess/API/Cocoa/WKWebView.mm:
3902         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
3903         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3904         (-[WKWebViewConfiguration copyWithZone:]):
3905         (-[WKWebViewConfiguration _alternateWebViewForNavigationGestures]):
3906         (-[WKWebViewConfiguration _setAlternateWebViewForNavigationGestures:]):
3907         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3908         Keep an "alternate" WKWebView "for navigation gestures", which ViewGestureController
3909         will use as the real source of back-forward items, and the destination of the swipe navigation.
3910         All swipe delegate callbacks will also fire from the alternate view, because it owns the items
3911         and will be doing the navigation.
3912
3913         * UIProcess/ios/ViewGestureControllerIOS.mm:
3914         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView):
3915         (WebKit::ViewGestureController::beginSwipeGesture):
3916         Send navigationGestureDidBegin via the alternate view's WebPageProxy if it exists.
3917         Record a new snapshot on the current page, but copy it to the alternate view if necessary,
3918         so that when swiping forward from the alternate view, it will have the "right" snapshot.
3919         Get the target back forward item from the alternate view.
3920         Send navigationGestureWillEnd via the alternate view's WebPageProxy if it exists.
3921
3922         (WebKit::ViewGestureController::canSwipeInDirection):
3923         Determine if we can swipe in a direction by looking at the alternate view's back-forward list if necessary.
3924
3925         (WebKit::ViewGestureController::endSwipeGesture):
3926         Send navigationGestureDidEnd via the alternate view's WebPageProxy if it exists.
3927         Perform the navigation on the alternate view if necessary.
3928
3929         (WebKit::ViewGestureController::removeSwipeSnapshot):
3930         Send navigationGestureSnapshotWasRemoved via the alternate view's WebPageProxy if it exists.
3931
3932         * UIProcess/mac/ViewGestureController.h:
3933
3934 2014-07-17  David Kilzer  <ddkilzer@apple.com>
3935
3936         SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
3937         <http://webkit.org/b/135006>
3938
3939         Reviewed by Darin Adler.
3940
3941         * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
3942         WebKit.xcconfig.
3943         * Configurations/DebugRelease.xcconfig: Remove empty
3944         SECTORDER_FLAGS definition.
3945         * Configurations/WebKit.xcconfig: Use $(CONFIGURATION) so
3946         SECTORDER_FLAGS is only set on Production builds.
3947
3948 2014-07-17  Alexey Proskuryakov  <ap@apple.com>
3949
3950         REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes
3951         https://bugs.webkit.org/show_bug.cgi?id=135032
3952         <rdar://problem/17716602>
3953
3954         Reviewed by Dan Bernstein.
3955
3956         * UIProcess/WebPageProxy.cpp:
3957         (WebKit::WebPageProxy::processDidCrash): Create a transaction, so that the nested
3958         transaction in resetStateAfterProcessExited() wouldn't be committed.
3959         (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't use auto - it was hiding
3960         the most important fact that this is a stack object that can't be simply moved to
3961         a different function.
3962
3963 2014-07-17  Benjamin Poulain  <bpoulain@apple.com>
3964
3965         [iOS][WK2] Fix the updateVisibleContentRects synchronization for load after r171154
3966         https://bugs.webkit.org/show_bug.cgi?id=135036
3967
3968         Reviewed by Dan Bernstein.
3969
3970         * WebProcess/WebPage/ios/WebPageIOS.mm:
3971         (WebKit::WebPage::updateVisibleContentRects):
3972         I forgot to update one of the condition after changing from lastTransaction to next transaction
3973         in r171154.
3974
3975 2014-07-17  Enrica Casucci  <enrica@apple.com>
3976
3977         [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
3978         https://bugs.webkit.org/show_bug.cgi?id=135023
3979         <rdar://problem/17617282>
3980
3981         Reviewed by Benjamin Poulain and Ryosuke Niwa.
3982
3983         WKContentView needs to implement hasContent to correctly show
3984         the appropriate menu bar content. The patch adds this information
3985         to the EditorState.
3986
3987         * Shared/EditorState.cpp:
3988         (WebKit::EditorState::encode):
3989         (WebKit::EditorState::decode):
3990         * Shared/EditorState.h:
3991         (WebKit::EditorState::EditorState):
3992         * UIProcess/ios/WKContentViewInteraction.mm:
3993         (-[WKContentView hasContent]):
3994         * WebProcess/WebPage/WebPage.cpp:
3995         (WebKit::WebPage::editorState):
3996
3997 2014-07-17  Benjamin Poulain  <benjamin@webkit.org>
3998