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