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