583242712eaba8d76993d10eb6edbc51c17d4254
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-11-14  Anders Carlsson  <andersca@apple.com>
2
3         Raise an exception if -[WKWebView initWithFrame:configuration:] is passed a nil configuration
4         https://bugs.webkit.org/show_bug.cgi?id=138757
5
6         Reviewed by Simon Fraser.
7
8         * UIProcess/API/Cocoa/WKWebView.mm:
9         (-[WKWebView initWithFrame:configuration:]):
10
11 2014-11-15  Carlos Garcia Campos  <cgarcia@igalia.com>
12
13         Network process crash when running http/tests/appcache/fallback.html
14         https://bugs.webkit.org/show_bug.cgi?id=138740
15
16         Reviewed by Alexey Proskuryakov.
17
18         It happens because ResourceHandle::continueWillSendRequest() is
19         called with a null request. We could handle that case in the
20         ResourceHandle, but the thing is tha the behaviour is
21         not the same for async loads, or when loading in the web
22         process. In WebResourceLoader::willSendRequest(),
23         ResourceRequest::willSendRequest() is called, and cancels the load
24         if the client returns a null request. In this case, the
25         ResourceLoader is detached and WebResourceLoader::willSendRequest()
26         returns early without sending the ContinueWillSendRequest message
27         to the network process. However, for synchronous loads,
28         NetworkResourceLoader::continueWillSendRequest() is always called.
29
30         Fixes http/tests/appcache/fallback.html for GTK port when using
31         the network process.
32
33         * NetworkProcess/NetworkResourceLoader.cpp:
34         (WebKit::NetworkResourceLoader::continueWillSendRequest): Do not
35         call ResourceHandle::continueWillSendRequest() if the client
36         request is null, since the load is going to be cancelled.
37
38 2014-11-15  Tim Horton  <timothy_horton@apple.com>
39
40         Implement data detectors and mailto action menus for WebKit1
41         https://bugs.webkit.org/show_bug.cgi?id=138765
42         <rdar://problem/18877535>
43
44         Reviewed by Beth Dakin.
45
46         * UIProcess/mac/WKActionMenuController.mm:
47         (-[WKActionMenuController _defaultMenuItemsForMailtoLink]):
48
49 2014-11-14  Tim Horton  <timothy_horton@apple.com>
50
51         Remove pre-[DDActionContext contextForView:...] fallback path
52         https://bugs.webkit.org/show_bug.cgi?id=138735
53         <rdar://problem/18982046>
54
55         Reviewed by Simon Fraser.
56
57         * UIProcess/mac/WKActionMenuController.mm:
58         (-[WKActionMenuController willOpenMenu:withEvent:]):
59         (-[WKActionMenuController didCloseMenu:withEvent:]):
60         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
61         (hasDataDetectorsCompletionAPI): Deleted.
62         Remove the now-unnecessary fallback path.
63
64 2014-11-14  Tim Horton  <timothy_horton@apple.com>
65
66         Frequent crashes under actionContextForResultAtPoint
67         https://bugs.webkit.org/show_bug.cgi?id=138761
68         <rdar://problem/18990684>
69
70         Reviewed by Dean Jackson.
71
72         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
73         (PageOverlayClientImpl::actionContextForResultAtPoint):
74         Initialize apiRange.
75
76 2014-11-14  Daniel Bates  <dabates@apple.com>
77
78         [iOS] CoreGraphics SPI not available in public SDK
79         https://bugs.webkit.org/show_bug.cgi?id=138709
80
81         Reviewed by David Kilzer.
82
83         Include header CoreGraphicsSPI.h instead of including headers of
84         CoreGraphics directly.
85
86         * UIProcess/API/Cocoa/WKWebView.mm:
87         * UIProcess/ios/WKScrollView.mm:
88
89 2014-11-14  Tim Horton  <timothy_horton@apple.com>
90
91         Move DataDetectors scanning code to WebCore
92         https://bugs.webkit.org/show_bug.cgi?id=138731
93         <rdar://problem/18877535>
94
95         Reviewed by Anders Carlsson.
96
97         Move DataDetectors scanning code to WebCore, so that both WebKits can use it.
98
99         * Shared/TextIndicator.cpp:
100         (WebKit::TextIndicator::createWithRange):
101         Move createWithRange in from WebPageMac's textIndicatorForRange.
102
103         (WebKit::TextIndicator::createWithSelectionInFrame):
104         * Shared/TextIndicator.h:
105         * WebProcess/WebPage/WebFrame.cpp:
106         (WebKit::WebFrame::createSelectionSnapshot):
107         * WebProcess/WebPage/WebFrame.h:
108         Constify some things.
109
110         * WebProcess/WebPage/mac/WebPageMac.mm:
111         (WebKit::WebPage::performActionMenuHitTestAtLocation):
112         Avoid using the DD result if it didn't come with a non-null Range.
113         Make use of detectItemAroundHitTestResult and TextIndicator::createWithRange.
114
115         (WebKit::scanForDataDetectedItems): Deleted.
116         (WebKit::textIndicatorForRange): Deleted.
117         Moved these two to other places.
118
119 2014-11-14  Dan Bernstein  <mitz@apple.com>
120
121         <rdar://problem/18978497> Wrong (off-by-1) navigation snapshots shown after a mix of gesture and button back/forward navigation
122         https://bugs.webkit.org/show_bug.cgi?id=138753
123
124         Reviewed by Tim Horton.
125
126         Rather than having the UI process record a snapshot jut before the Web Content process’s
127         notion of its current back/forward list item changes, have the UI process record a snapshot
128         right before its own current back/forward list item changes. This ensures that the right
129         snapshot gets attached to the right item in the UI process.
130
131         * UIProcess/WebBackForwardList.cpp:
132         (WebKit::WebBackForwardList::addItem): If there is a current item, record a navigation
133         snapshot of it before making the new item current.
134         (WebKit::WebBackForwardList::goToItem): If there is a current item, record a navigation
135         snapshot of it before making another item current.
136
137         * UIProcess/WebPageProxy.cpp:
138         (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame): Deleted.
139         * UIProcess/WebPageProxy.h:
140
141         * UIProcess/WebPageProxy.messages.in: Removed willChangeCurrentHistoryItemForMainFrame
142         message.
143
144         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
145         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem): Deleted.
146         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Removed declaration of
147         willChangeCurrentHistoryItem override.
148
149         * WebProcess/WebPage/WebPage.cpp:
150         (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame): Deleted.
151         * WebProcess/WebPage/WebPage.h:
152
153 2014-11-14  Dan Bernstein  <mitz@apple.com>
154
155         Add some tracing to help investigating <rdar://problem/18905383> [iOS] Crash due to null m_webPageProxyForBackForwardListForCurrentSwipe in ViewGestureController::endSwipeGesture
156         https://bugs.webkit.org/show_bug.cgi?id=138750
157
158         Reviewed by Tim Horton.
159
160         Emit trace messages at various points, and log them prior to crashing if the error condition
161         occurs. Otherwise, clear the trace messages.
162
163         * UIProcess/ios/ViewGestureControllerIOS.mm:
164         (WebKit::addLogEntry): Helper function that adds a message, including a time stamp and a
165         backtrace, to m_logEntries.
166         (WebKit::dumpLogEntries): Helper function that logs everything in m_logEntries.
167         (WebKit::ViewGestureController::beginSwipeGesture): Add a log entry.
168         (WebKit::ViewGestureController::endSwipeGesture): If
169         m_webPageProxyForBackForwardListForCurrentSwipe is null, dump the log entries just before
170         crashing. Otherwise, clear m_logEntries.
171         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree): Add a log entry.
172         (WebKit::ViewGestureController::removeSwipeSnapshot): Add a log entry.
173         * UIProcess/mac/ViewGestureController.h: Defined ENABLE_VIEW_GESTURE_CONTROLLER_TRACING,
174         and added m_logEntries member variable.
175
176 2014-11-14  Beth Dakin  <bdakin@apple.com>
177
178         URLs for some videos are not valid URLs, should not be exposed to action menu
179         https://bugs.webkit.org/show_bug.cgi?id=138746
180         -and corresponding-
181         rdar://problem/18941927
182
183         Reviewed by Tim Horton.
184
185         If the video cannot be downloaded, that is also an indication that the URL of the 
186         video will not be valid on its own. In these cases, we should share or copy the 
187         main page’s URL.
188         * UIProcess/mac/WKActionMenuController.mm:
189         (-[WKActionMenuController _defaultMenuItemsForVideo]):
190         (-[WKActionMenuController _copyVideoURL:]):
191
192 2014-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
193
194         [SOUP] Encode/Decode allowCookies in ResourceRequest
195         https://bugs.webkit.org/show_bug.cgi?id=138730
196
197         Reviewed by Sergio Villar Senin.
198
199         We are not sending this information to the network process, making
200         cookies always available. Fixes
201         http/tests/xmlhttprequest/cross-origin-no-authorization.html when
202         network process is enabled.
203
204         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
205         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
206         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
207
208 2014-11-14  Zan Dobersek  <zdobersek@igalia.com>
209
210         Unreviewed build fix for the GTK+ port using Clang.
211
212         * UIProcess/gtk/RedirectedXCompositeWindow.h: Include the <functional>
213         header for the use of std::function<>.
214
215 2014-11-13  Dan Bernstein  <mitz@apple.com>
216
217         Two WKWebView internal methods are implemented in a category
218         https://bugs.webkit.org/show_bug.cgi?id=138728
219
220         Reviewed by Tim HOrton.
221
222         Moved the implementations from the category to the class.
223
224         * UIProcess/API/Cocoa/WKWebView.mm:
225         (-[WKWebView _ignoresNonWheelMouseEvents]):
226         (-[WKWebView _setIgnoresNonWheelMouseEvents:]):
227
228 2014-11-13  Myles C. Maxfield  <mmaxfield@apple.com>
229
230         Move FontMac and FontCacheMac off of WKSI
231         https://bugs.webkit.org/show_bug.cgi?id=138633
232
233         Reviewed by Simon Fraser.
234
235         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
236         (InitWebCoreSystemInterface):
237         * mac/WebKit2.order:
238
239 2014-11-13  Eric Carlson  <eric.carlson@apple.com>
240
241         Context menus should not offer the "Download video" option for videos that cannot 
242         be downloaded
243         https://bugs.webkit.org/show_bug.cgi?id=138530
244         -and corresponding-
245         rdar://problem/18919130
246
247         Reviewed by Tim Horton.
248
249         Expose isDownloadableMedia() to the InjectedBundleHitTestResult.
250         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
251         (WKBundleHitTestResultIsDownloadableMedia):
252         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
253         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
254         (WebKit::InjectedBundleHitTestResult::isDownloadableMedia):
255         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
256
257 2014-11-13  Daniel Bates  <dabates@apple.com>
258
259         [iOS] NSGeometry data types are not available in the public SDK
260         https://bugs.webkit.org/show_bug.cgi?id=137536
261
262         Reviewed by David Kilzer.
263
264         Substitute header WAKAppKitStubs.h for NSGeometry.h as the latter is a
265         private header.
266
267         * Shared/ios/NativeWebTouchEventIOS.mm:
268
269 2014-11-13  Simon Fraser  <simon.fraser@apple.com>
270
271         [WK2] Fire a layout milestone on session restore based on render tree size
272         https://bugs.webkit.org/show_bug.cgi?id=138711
273         rdar://problem/16033854
274
275         Reviewed by Anders Carlsson.
276         
277         Add a session-restore layout milestone which fires after restoring a session,
278         when the render tree size reaches 50% of the size saved in the session state.
279
280         * Shared/SessionState.h: Add renderTreeSize.
281         * UIProcess/API/Cocoa/WKWebView.mm:
282         (layoutMilestones): Translate from SPI to WebCore milestones.
283         * UIProcess/API/Cocoa/WKWebViewPrivate.h: New iOS-only milestone, er, event.
284         * UIProcess/Cocoa/NavigationState.mm:
285         (WebKit::renderingProgressEvents): Translate from WebCore milestone to rendering event.
286         * UIProcess/WebPageProxy.cpp:
287         (WebKit::WebPageProxy::WebPageProxy): Init stuff.
288         (WebKit::WebPageProxy::sessionState):
289         (WebKit::WebPageProxy::restoreFromSessionState): Zero out the target render tree size,
290         then get it out of session state and set the flag to say that we haven't reached it yet.
291         (WebKit::WebPageProxy::listenForLayoutMilestones): Set a flag to know that we should fire
292         the milestone. The other milestones get sent directly to WebCore.
293         * UIProcess/WebPageProxy.h:
294         * UIProcess/ios/WebPageProxyIOS.mm:
295         (WebKit::exceedsRenderTreeSizeSizeThreshold): Return true when we've reached 50%.
296         (WebKit::WebPageProxy::didCommitLayerTree): Fire the milestone when appropriate.
297         * UIProcess/mac/LegacySessionStateCoding.cpp: Rev the session state data for iOS
298         (where doing so is less disruptive). Standardize some CFString constants.
299         (WebKit::encodeSessionHistory): Wrap for legibility.
300         (WebKit::encodeLegacySessionState): Make a CFNumber for render tree size, and store
301         it in the root dictionary.
302         (WebKit::decodeBackForwardTreeNode): Move a comment to match another similar block.
303         (WebKit::decodeLegacySessionState): Decode render tree size and store it.
304
305 2014-11-13  Tim Horton  <timothy_horton@apple.com>
306
307         Adjust the WKBundlePageOverlay Data Detectors SPI
308         https://bugs.webkit.org/show_bug.cgi?id=138685
309         <rdar://problem/18947156>
310
311         Reviewed by Anders Carlsson.
312
313         * UIProcess/mac/WKActionMenuController.mm:
314         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
315         Forward DDActionContext callbacks to the Web process.
316
317         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
318         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
319         * WebProcess/WebPage/WebPageOverlay.cpp:
320         * WebProcess/WebPage/WebPageOverlay.h:
321         Add four DataDetectors-related WebKit2-only page overlay callbacks:
322
323         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
324         Called during the action menu hit test; clients can reply with a DDActionContext
325         and a DOM range, and WebKit will treat that result and range as if it had
326         detected it itself, building the action menu and showing the yellow highlight as usual.
327
328         (WebKit::WebPageOverlay::dataDetectorsPresentedUI):
329         (WebKit::WebPageOverlay::dataDetectorsChangedUI):
330         (WebKit::WebPageOverlay::dataDetectorsHidUI):
331         These correspond to the DDActionContext callbacks, and can be used by clients
332         to show/hide corresponding UI while DataDetectors in the UI process is presenting UI.
333
334         (WebKit::WebPageOverlay::prepareForActionMenu): Deleted.
335         Get rid of prepareForActionMenu, as nobody ever used it.
336
337         * WebProcess/WebPage/WebPage.cpp:
338         Add WebPageOverlay.h so that we can build, because the destructor lives here.
339
340         * WebProcess/WebPage/WebPage.h:
341         * WebProcess/WebPage/WebPage.messages.in:
342         
343         * WebProcess/WebPage/mac/WebPageMac.mm:
344         (WebKit::WebPage::performActionMenuHitTestAtLocation):
345         Give all of the WebPageOverlays the first shot at data detection; if none of them
346         reply with a valid DDActionContext/DOM range, we'll go ahead and do our normal detection.
347
348         (WebKit::WebPage::dataDetectorsPresentedUI):
349         (WebKit::WebPage::dataDetectorsChangedUI):
350         (WebKit::WebPage::dataDetectorsHidUI):
351         Forward these along to the active WebPageOverlay.
352
353 2014-11-13  Carlos Garcia Campos  <cgarcia@igalia.com>
354
355         [SOUP] Missing ResourceRequest members encoded/decoded
356         https://bugs.webkit.org/show_bug.cgi?id=138694
357
358         Reviewed by Sergio Villar Senin.
359
360         At least timeoutInterval and priority should also be
361         encoded/decoded. This fixes all http/tests/xmlhttprequest/timeout/
362         tests when using the network process, since the timeout is always
363         0 for all requests that we send to the network process.
364
365         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
366         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
367         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
368
369 2014-11-12  Ryuan Choi  <ryuan.choi@navercorp.com>
370
371         [EFL] Fix the build with EFL 1.12
372         https://bugs.webkit.org/show_bug.cgi?id=138245
373
374         Reviewed by Gyuyoung Kim.
375
376         * UIProcess/API/efl/EwkView.cpp:
377         First, modified to use Evas_GL raw pointer instead of UniquePtrEfl because
378         Evas_GL.h can't be included in UniquePtrEfl.h
379         It should be moved into EvasGLContext because WebKit/EFL use only one Evas_GL.
380         Second, provided the version of GLES in Evas_GL_Config not to break build with
381         EFL 1.12
382         (EwkView::EwkView):
383         (EwkView::~EwkView):
384         (EwkView::displayTimerFired):
385         (EwkView::createGLSurface):
386         * UIProcess/API/efl/EwkView.h:
387
388 2014-11-12  Ada Chan  <adachan@apple.com>
389
390         Fix the iOS build.
391
392         * WebProcess/Plugins/PluginView.cpp:
393         (WebKit::PluginView::pageMutedStateDidChange):
394
395 2014-11-05  Ada Chan  <adachan@apple.com>
396
397         Implement new plug-in API for muting plug-ins
398         https://bugs.webkit.org/show_bug.cgi?id=138105
399
400         Reviewed by Anders Carlsson.
401
402         Handle the setting of NPNVmuteAudioBool on the plug-in.
403
404         * PluginProcess/PluginControllerProxy.cpp:
405         (WebKit::PluginControllerProxy::PluginControllerProxy):
406         Initialize m_isMuted.
407         (WebKit::PluginControllerProxy::mutedStateChanged):
408         Tell the plugin about the new muted state.
409         * PluginProcess/PluginControllerProxy.h:
410         * PluginProcess/PluginControllerProxy.messages.in:
411         Add the MutedStateChanged message.
412         * PluginProcess/PluginCreationParameters.cpp:
413         (WebKit::PluginCreationParameters::PluginCreationParameters):
414         Initialize isMuted.
415         (WebKit::PluginCreationParameters::encode):
416         Handle isMuted.
417         (WebKit::PluginCreationParameters::decode):
418         Ditto.
419         * PluginProcess/PluginCreationParameters.h:
420         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
421         (WebKit::NPN_GetValue):
422         Get the plug-in's muted state.
423         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
424         (WebKit::NetscapePlugin::isMuted):
425         Get the muted state from PluginControllerProxy.
426         (WebKit::NetscapePlugin::mutedStateChanged):
427         Call NPP_SetValue with NPNVmuteAudioBool and the updated muted state.
428         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
429         * WebProcess/Plugins/Plugin.h:
430         (WebKit::Plugin::mutedStateChanged):
431         * WebProcess/Plugins/PluginController.h:
432         * WebProcess/Plugins/PluginProxy.cpp:
433         (WebKit::PluginProxy::initialize):
434         Set m_pendingPluginCreationParameters->isMuted.
435         (WebKit::PluginProxy::mutedStateChanged):
436         Send the MutedStateChanged message to the plugin process.
437         * WebProcess/Plugins/PluginProxy.h:
438         * WebProcess/Plugins/PluginView.cpp:
439         (WebKit::PluginView::pageMutedStateDidChange):
440         Call Plugin::mutedStateChanged() with the page's muted state.
441         (WebKit::PluginView::isMuted):
442         Get the page's current muted state.
443         * WebProcess/Plugins/PluginView.h:
444
445 2014-11-12  Tim Horton  <timothy_horton@apple.com>
446
447         Two action menu item titles are swapped
448         https://bugs.webkit.org/show_bug.cgi?id=138667
449         <rdar://problem/18960409>
450
451         Reviewed by Beth Dakin.
452
453         * UIProcess/mac/WKActionMenuController.mm:
454         (-[WKActionMenuController _createActionMenuItemForTag:]):
455         Swap them back.
456
457 2014-11-12  Commit Queue  <commit-queue@webkit.org>
458
459         Unreviewed, rolling out r175806.
460         https://bugs.webkit.org/show_bug.cgi?id=138666
461
462         Capturing CString is not thread safe (Requested by anttik on
463         #webkit).
464
465         Reverted changeset:
466
467         "[WK2] Use C++ lambdas in IPC::Connection"
468         https://bugs.webkit.org/show_bug.cgi?id=138018
469         http://trac.webkit.org/changeset/175806
470
471 2014-11-12  Tim Horton  <timothy_horton@apple.com>
472
473         Need to show the text indicator when Data Detectors shows a popover
474         https://bugs.webkit.org/show_bug.cgi?id=138664
475         <rdar://problem/18869900>
476
477         Reviewed by Beth Dakin.
478
479         * UIProcess/mac/WKActionMenuController.h:
480         * UIProcess/mac/WKActionMenuController.mm:
481         (hasDataDetectorsCompletionAPI):
482         Determine if we have the new API.
483
484         (-[WKActionMenuController willDestroyView:]):
485         (-[WKActionMenuController willOpenMenu:withEvent:]):
486         Make use of the new API.
487         If we wanted to show a Data Detectors menu but have no items (or they're all
488         disabled), cancel the menu.
489         If we don't have it, manually manipulate the highlight.
490
491         (-[WKActionMenuController didCloseMenu:withEvent:]):
492         Make use of the new API.
493         If we don't have it, manually manipulate the highlight.
494
495         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
496         Set up completion handlers if we have the new API; when DataDetectors
497         presents UI, show the text indicator, when it dismisses, hide it.
498         If we don't have the API, manually manipulate the highlight.
499
500 2014-11-12  Tim Horton  <timothy_horton@apple.com>
501
502         Make action menus much more reliable
503         https://bugs.webkit.org/show_bug.cgi?id=138654
504         <rdar://problem/18909111>
505
506         Reviewed by Anders Carlsson.
507
508         * UIProcess/mac/WKActionMenuController.mm:
509         (-[WKActionMenuController prepareForMenu:withEvent:]):
510         Remove MenuUpdateStage; nothing actually uses this value, we just pass it around.
511
512         (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
513         Update the menu as soon as we have a reply from the Web process.
514
515         (-[WKActionMenuController menuNeedsUpdate:]):
516         If our sync-wait for the Web process' reply times out, we should still update
517         the menu to remove the placeholder separator item.
518
519         (-[WKActionMenuController _updateActionMenuItems]):
520         (-[WKActionMenuController _updateActionMenuItemsForStage:]): Deleted.
521         If we have our final answer for this menu (_state == Ready), and the final answer
522         has no items in the menu, cancel tracking on the menu.
523
524 2014-11-12  Carlos Garcia Campos  <cgarcia@igalia.com>
525
526         [GTK] Move RedirectedXCompositeWindow from platform to WebKit2 layer
527         https://bugs.webkit.org/show_bug.cgi?id=138093
528
529         Reviewed by Martin Robinson.
530
531         It's only used by WebKitWebViewBase. While moving the code the
532         following cleanups have been made:
533
534           - Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL.
535           - Use a helper class XDamageNotifier to handle the XDamage
536             events filtering and notification.
537           - Use std::function instead of pointer to function for the
538             damage callback.
539           - Pass the X display to the RedirectedXCompositeWindow constructor
540             and keep it as a member to use it everywhere, instead of using
541             the default display in some places and the widget display in others.
542           - Pass the damage notify function as a contructor parameter of
543             RedirectedXCompositeWindow instead of setting the callback
544             right after creating the object.
545           - Remove GLContextNeeded and all the dead code related to the
546             CreateGLContext mode that is no longer used.
547           - Rename cairoSurfaceForWidget() as surface().
548           - windowId() has been renamed as windowID() and made const.
549           - Use std::unique_ptr instead of PassOwnPtr.
550           - Fix coding style issues.
551
552         * PlatformGTK.cmake:
553         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
554         (webkitWebViewBaseConstructed):
555         (webkitWebViewRenderAcceleratedCompositingResults):
556         (webkitWebViewBaseCreateWebPage):
557         (redirectedWindowDamagedCallback): Deleted.
558         * UIProcess/gtk/RedirectedXCompositeWindow.cpp: Renamed from Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp.
559         (WebKit::XDamageNotifier::XDamageNotifier):
560         (WebKit::XDamageNotifier::add):
561         (WebKit::XDamageNotifier::remove):
562         (WebKit::XDamageNotifier::filterXDamageEvent):
563         (WebKit::XDamageNotifier::filterXEvent):
564         (WebKit::xDamageNotifier):
565         (WebKit::supportsXDamageAndXComposite):
566         (WebKit::RedirectedXCompositeWindow::create):
567         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
568         (WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
569         (WebKit::RedirectedXCompositeWindow::resize):
570         (WebKit::RedirectedXCompositeWindow::cleanupPixmapAndPixmapSurface):
571         (WebKit::RedirectedXCompositeWindow::surface):
572         * UIProcess/gtk/RedirectedXCompositeWindow.h: Renamed from Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h.
573         (WebKit::RedirectedXCompositeWindow::windowID):
574
575 2014-09-01  Philippe Normand  <pnormand@igalia.com>
576
577         [WK2] UserMediaClient support
578         https://bugs.webkit.org/show_bug.cgi?id=123158
579
580         Reviewed by Benjamin Poulain.
581
582         Support for UserMediaPermissionRequest in WebKit2. It's
583         implemented similarily to the GeolocationPermissionRequest
584         support. When the WebPage requires this permission it sends a
585         message to the UI process which at some point grants or denies the
586         permission and sends the result back to the WebProcess.
587
588         * CMakeLists.txt: Generic CMake support for new files.
589         * Shared/API/c/WKBase.h: New type for UserMediaPermissionRequest.
590         * Shared/APIObject.h: Ditto.
591         * UIProcess/API/C/WKAPICast.h: PermissionRequest API mapping.
592         * UIProcess/API/APIUIClient.h: New decidePolicy handler for UserMediaPermissionRequest.
593         (API::UIClient::decidePolicyForUserMediaPermissionRequest):
594         * UIProcess/API/C/WKPage.cpp: Ditto.
595         (WKPageSetPageUIClient):
596         * UIProcess/API/C/WKPageUIClient.h: WKPageUIClient version bump to
597         5, including the new decidePolicyForUserMediaPermissionRequest member.
598         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp: Added, C API
599         implementation of the UserMediaPermissionRequest.
600         (WKUserMediaPermissionRequestGetTypeID):
601         (WKUserMediaPermissionRequestAllow):
602         (WKUserMediaPermissionRequestDeny):
603         * UIProcess/API/C/WKUserMediaPermissionRequest.h: Added.
604         * UIProcess/API/C/WebKit2_C.h:
605         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Added.
606         * UIProcess/UserMediaPermissionRequestProxy.cpp: Added, proxy
607         object for the UserMediaPermissionRequestType.
608         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
609         (WebKit::UserMediaPermissionRequestProxy::allow):
610         (WebKit::UserMediaPermissionRequestProxy::deny):
611         (WebKit::UserMediaPermissionRequestProxy::invalidate):
612         * UIProcess/UserMediaPermissionRequestProxy.h: Added.
613         (WebKit::UserMediaPermissionRequestProxy::create):
614         (WebKit::UserMediaPermissionRequestProxy::mediaParameters):
615         * UIProcess/WebPageProxy.cpp:
616         (WebKit::WebPageProxy::WebPageProxy):
617         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Defer
618         UserPermissionRequest to the UIClient.
619         * UIProcess/WebPageProxy.h:
620         * UIProcess/WebPageProxy.messages.in: New message to handle UserMediaPermissionRequests.
621         * WebKit2.xcodeproj/project.pbxproj:
622         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: Added,
623         WebProcess side of the UserRequestManager, keeping track of each
624         permission request.
625         (WebKit::generateRequestID):
626         (WebKit::UserMediaPermissionRequestManager::UserMediaPermissionRequestManager):
627         (WebKit::UserMediaPermissionRequestManager::startRequest):
628         (WebKit::UserMediaPermissionRequestManager::cancelRequest):
629         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision):
630         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: Added.
631         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: Added,
632         WebProcess implementation of the WebCore::UserMediaClient.
633         (WebKit::WebUserMediaClient::WebUserMediaClient):
634         (WebKit::WebUserMediaClient::pageDestroyed):
635         (WebKit::WebUserMediaClient::requestPermission):
636         (WebKit::WebUserMediaClient::cancelRequest):
637         * WebProcess/WebCoreSupport/WebUserMediaClient.h: Added.
638         * WebProcess/WebPage/WebPage.cpp:
639         (WebKit::WebPage::WebPage): Create the
640         UserMediaPermissionRequestManager and register the UserMediaClient
641         to the page.
642         (WebKit::WebPage::didReceiveUserMediaPermissionDecision): Dispatch
643         decision to manager.
644         * WebProcess/WebPage/WebPage.h:
645         (WebKit::WebPage::userMediaPermissionRequestManager):
646         * WebProcess/WebPage/WebPage.messages.in: New Message to handle
647         permission decision result from the UI process.
648
649 2014-11-11  Tim Horton  <timothy_horton@apple.com>
650
651         Add support for mailto: link action menus
652         https://bugs.webkit.org/show_bug.cgi?id=138641
653         <rdar://problem/18741567>
654
655         Reviewed by Beth Dakin.
656
657         * Shared/API/c/WKActionMenuTypes.h:
658         Add a new type for mailto links.
659
660         * UIProcess/mac/WKActionMenuController.mm:
661         (-[WKActionMenuController _defaultMenuItemsForMailtoLink]):
662         Build a DDActionContext and grab menu items for our mailto link.
663
664         (-[WKActionMenuController _defaultMenuItems]):
665         Get menu items from _defaultMenuItemsForMailtoLink if needed.
666
667 2014-11-11  Conrad Shultz  <conrad_shultz@apple.com>
668
669         Clients should be notified when a page preview finishes
670         https://bugs.webkit.org/show_bug.cgi?id=138635
671
672         Reviewed by Tim Horton.
673
674         Add SPI to WKView to allow clients to do any cleanup that might be necessary when the preview closes.
675
676         * UIProcess/API/Cocoa/WKViewPrivate.h:
677         Declare new SPI.
678
679         * UIProcess/API/mac/WKView.mm:
680         (-[WKView _finishPreviewingURL:withPreviewView:]):
681         Stub SPI implementation.
682
683         * UIProcess/mac/WKActionMenuController.h:
684         Add an ivar for the preview view controller.
685
686         * UIProcess/mac/WKActionMenuController.mm:
687         (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
688         Update to use the ivar.
689         (-[WKActionMenuController _clearPreviewPopover]):
690         Send -_finishPreviewingURL:withPreviewView: and nil out the view controller ivar.
691
692 2014-11-11  Tim Horton  <timothy_horton@apple.com>
693
694         Update artwork for some action menu items
695         https://bugs.webkit.org/show_bug.cgi?id=138634
696         <rdar://problem/18871984>
697
698         Reviewed by Anders Carlsson.
699
700         * Resources/OpenInNewWindowTemplate.pdf: Removed.
701         * UIProcess/mac/WKActionMenuController.mm:
702         (-[WKActionMenuController _createActionMenuItemForTag:]):
703         (webKitBundleImageNamed): Deleted.
704         * WebKit2.xcodeproj/project.pbxproj:
705         Get rid of our custom art, and use system art for two more items.
706
707 2014-11-11  Alexey Proskuryakov  <ap@apple.com>
708
709         DRT and WKTR touch disk cache
710         https://bugs.webkit.org/show_bug.cgi?id=138622
711
712         Reviewed by Geoffrey Garen.
713
714         Setting a cache model has a very strange behavior in WebKit2, where it ignores
715         sizes that were explicitly passed from UI process, and uses different ones. As
716         setCacheModel() is always called on launch, it always creates a non-empty disk cache.
717
718         The design needs to be improved one day, but for now, just make sure that we never
719         create a disk cache during testing.
720
721         * NetworkProcess/NetworkProcess.cpp:
722         (WebKit::NetworkProcess::NetworkProcess):
723         (WebKit::NetworkProcess::initializeNetworkProcess):
724         * NetworkProcess/NetworkProcess.h:
725         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
726         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
727         (WebKit::NetworkProcess::platformSetCacheModel):
728         * WebProcess/WebProcess.cpp:
729         (WebKit::WebProcess::WebProcess):
730         (WebKit::WebProcess::initializeWebProcess):
731         * WebProcess/WebProcess.h:
732         * WebProcess/cocoa/WebProcessCocoa.mm:
733         (WebKit::WebProcess::platformSetCacheModel):
734         (WebKit::WebProcess::platformInitializeWebProcess):
735
736 2014-11-11  Eric Carlson  <eric.carlson@apple.com>
737
738         [iOS] a page with video in optimized fullscreen is visible
739         https://bugs.webkit.org/show_bug.cgi?id=138632
740
741         Reviewed by Anders Carlsson.
742
743         * UIProcess/API/Cocoa/WKWebView.mm:
744         (-[WKWebView _isPlayingFullscreenOptimizedVideo]): New.
745
746         * UIProcess/API/Cocoa/WKWebViewInternal.h:
747         * UIProcess/ios/PageClientImplIOS.mm:
748         (WebKit::PageClientImpl::isViewVisible): Return true if displaying optimized fullscreen
749             video.
750
751 2014-11-11  Tim Horton  <timothy_horton@apple.com>
752
753         Occasional assertion failure under recommendedScrollbarStyleDidChange()
754         https://bugs.webkit.org/show_bug.cgi?id=138604
755         <rdar://problem/18855914>
756
757         Reviewed by Beth Dakin.
758
759         It is possible for AppKit to install tracking areas into our view
760         behind our back, but we have code that depends on knowing exactly
761         the set of tracking areas installed on WKView.
762
763         Make this more robust by keeping a reference to the tracking area we
764         use for many things and manipulating that instead of making assumptions
765         about the total set of tracking areas on WKView.
766
767         * UIProcess/API/mac/WKView.mm:
768         (-[WKView _primaryTrackingArea]):
769         (-[WKView _replacePrimaryTrackingArea:]):
770         Provide a 'primary' tracking area setter/getter.
771
772         (-[WKView initWithFrame:context:configuration:webView:]):
773         Keep a reference to the original tracking area installed at initialization time.
774
775         * UIProcess/API/mac/WKViewInternal.h:
776         * UIProcess/mac/PageClientImpl.mm:
777         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
778         Instead of walking the set of tracking areas, make use of the fact that
779         we know exactly which tracking area we installed, and uninstall just that
780         one, and replace it with our newly-built one.
781
782 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
783
784         Finish moving CTFontGetVerticalGlyphsForCharacters and CTLineCreateWithUniCharProvider out from WKSI
785         https://bugs.webkit.org/show_bug.cgi?id=138623
786
787         Reviewed by Geoff Garen.
788
789         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
790         (InitWebCoreSystemInterface):
791         * mac/WebKit2.order:
792
793 2014-11-11  Timothy Horton  <timothy_horton@apple.com>
794
795         Add a respondsToSelector check to dismissActionMenuPopovers
796         ​https://bugs.webkit.org/show_bug.cgi?id=138600
797         <rdar://problem/18932770>
798
799         Reviewed by Beth Dakin.
800
801         * UIProcess/mac/WKActionMenuController.mm:
802         (-[WKActionMenuController dismissActionMenuPopovers]):
803         Avoid calling this wherever it doesn't exist.
804
805 2014-11-11  Tim Horton  <timothy_horton@apple.com>
806
807         DataDetectors' menu items aren't presented in the telephone number menu
808         https://bugs.webkit.org/show_bug.cgi?id=138602
809         <rdar://problem/18866308>
810
811         Reviewed by Beth Dakin.
812
813         We currently round-trip the DataDetectors telephone number NSMenuItems
814         through the very-lossy WebContextMenuItemData, for no real reason.
815         We should avoid this so that DataDetectors' actual NSMenuItems are
816         presented in the final menu, so that they can adjust their items after
817         providing them to us.
818
819         * Platform/mac/MenuUtilities.h:
820         * Platform/mac/MenuUtilities.mm:
821         (WebKit::menuItemTitleForTelephoneNumber): Deleted.
822         Stop adjusting the menu item titles, as they come correct now.
823
824         (WebKit::menuItemsForTelephoneNumber): Deleted.
825         (WebKit::menuForTelephoneNumber):
826         Return a fully-formed menu for the single telephone number case.
827
828         * UIProcess/mac/WebPageProxyMac.mm:
829         (WebKit::WebPageProxy::showTelephoneNumberMenu):
830         Present the fully-formed menu, without round-tripping through
831         WebContextMenuItemData, because we do not need to hand the items to
832         the context menu client (and indeed, were not), and because this
833         allows us to use the exact items returned by DataDetectors, so they
834         can keep ahold of the items that we actually present.
835
836         * UIProcess/PageClient.h:
837         * UIProcess/mac/PageClientImpl.h:
838         * UIProcess/mac/PageClientImpl.mm:
839         (WebKit::PageClientImpl::showPlatformContextMenu):
840         Add a Mac-only PageClient function for presenting a NSMenu at a
841         WKView-relative point.
842
843 2014-11-11  Tim Horton  <timothy_horton@apple.com>
844
845         Adopt DDActionContext menu type SPI
846         https://bugs.webkit.org/show_bug.cgi?id=138603
847         <rdar://problem/18867627>
848
849         Reviewed by Anders Carlsson.
850
851         * UIProcess/mac/WKActionMenuController.mm:
852         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
853         Use the new SPI instead of WKSI.
854
855 2014-11-11  Tim Horton  <timothy_horton@apple.com>
856
857         Data Detectors popovers should be dismissed upon scrolling
858         https://bugs.webkit.org/show_bug.cgi?id=138600
859         <rdar://problem/18932770>
860
861         Reviewed by Beth Dakin.
862
863         * UIProcess/mac/WKActionMenuController.mm:
864         (-[WKActionMenuController prepareForMenu:withEvent:]):
865         Dismiss popovers when we start preparing another menu.
866
867         (-[WKActionMenuController dismissActionMenuPopovers]):
868         Use the new DataDetectors SPI.
869
870 2014-11-11  Tim Horton  <timothy_horton@apple.com>
871
872         Localize strings for action menus
873         https://bugs.webkit.org/show_bug.cgi?id=138591
874         <rdar://problem/18815343>
875
876         Reviewed by Dan Bates.
877
878         * UIProcess/mac/WKActionMenuController.mm:
879         (-[WKActionMenuController _showTextIndicator]):
880         (-[WKActionMenuController _hideTextIndicator]):
881         (-[WKActionMenuController _createActionMenuItemForTag:]):
882         Make use of the new strings.
883
884 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
885
886         Cleanup from r175379
887         https://bugs.webkit.org/show_bug.cgi?id=138616
888
889         Reviewed by Simon Fraser.
890
891         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
892         (InitWebCoreSystemInterface):
893         * mac/WebKit2.order:
894
895 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
896
897         Move CTFontTransformGlyphs out from WKSI
898         https://bugs.webkit.org/show_bug.cgi?id=138599
899
900         Reviewed by Simon Fraser.
901
902         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
903         (InitWebCoreSystemInterface):
904         * mac/WebKit2.order:
905
906 2014-11-10  Simon Fraser  <simon.fraser@apple.com>
907
908         Fix possible crash when closing the web inspector
909         https://bugs.webkit.org/show_bug.cgi?id=138597
910         rdar://problem/18872688
911
912         Reviewed by Andreas Kling.
913         
914         I reported a crash when reloading a page after inspecting it, possibly caused by
915         r172864. Speculatively fix by null-checking the main frame.
916
917         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
918         (WebKit::WebInspectorClient::~WebInspectorClient):
919
920 2014-11-10  Beth Dakin  <bdakin@apple.com>
921
922         Whitespace action menus aren't working properly
923         https://bugs.webkit.org/show_bug.cgi?id=138585
924         -and corresponding-
925         rdar://problem/18933586
926
927         Reviewed by Tim Horton.
928
929         Treat the whitespace menu as a text menu.
930         * UIProcess/mac/WKActionMenuController.mm:
931         (-[WKActionMenuController isMenuForTextContent]):
932
933 2014-11-10  Simon Fraser  <simon.fraser@apple.com>
934
935         [iOS WK2] Scroll deceleration rate is wrong
936         https://bugs.webkit.org/show_bug.cgi?id=138574
937         rdar://problem/18715303
938
939         Reviewed by Benjamin Poulain.
940         
941         The CSS Snap Points code incorrectly set the WKScrollView's deceleration rate,
942         overriding the custom value that UIWebScrollView sets.
943         
944         Fix by having WKScrollView store the custom rate at init time, and
945         using that value in -scrollViewWillBeginDragging:.
946
947         * UIProcess/API/Cocoa/WKWebView.mm:
948         (-[WKWebView scrollViewWillBeginDragging:]):
949         * UIProcess/ios/WKScrollView.h:
950         * UIProcess/ios/WKScrollView.mm:
951         (-[WKScrollView initWithFrame:]):
952
953 2014-11-09  Ada Chan  <adachan@apple.com>
954
955         Reset WebPageProxy's isPlayingAudio state after web process crash or page invalidation.
956         https://bugs.webkit.org/show_bug.cgi?id=138559
957
958         Reviewed by Andreas Kling.
959
960         * UIProcess/WebPageProxy.cpp:
961         (WebKit::WebPageProxy::resetState):
962
963 2014-11-10  Beth Dakin  <bdakin@apple.com>
964
965         WK1: Support default actions for read-only text
966         https://bugs.webkit.org/show_bug.cgi?id=138552
967         -and corresponding-
968         rdar://problem/18877483
969
970         Reviewed by Tim Horton.
971
972         WK1 now needs to do a lot of dictionary lookup operations that it did not 
973         previously have to handle. So this patch takes a lot of that functionality, which 
974         was implemented as static functions in WebPageMac for WK2 and moves it into 
975         WebCore.
976
977         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
978         (InitWebCoreSystemInterface):
979         * WebProcess/WebPage/mac/WebPageMac.mm:
980         (WebKit::WebPage::performDictionaryLookupForRange):
981         (WebKit::isPositionInRange): Deleted.
982         (WebKit::shouldUseSelection): Deleted.
983         (WebKit::rangeExpandedAroundPositionByCharacters): Deleted.
984         (WebKit::rangeForDictionaryLookupForSelection): Deleted.
985         (WebKit::rangeForDictionaryLookupAtHitTestResult): Deleted.
986
987 2014-11-10  Dan Bernstein  <mitz@apple.com>
988
989         iOS build fix.
990
991         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
992         (WebKit::RemoteLayerTreeHost::createLayer):
993
994 2014-11-10  Zan Dobersek  <zdobersek@igalia.com>
995
996         [WK2] Use C++ lambdas in IPC::Connection
997         https://bugs.webkit.org/show_bug.cgi?id=138018
998
999         Reviewed by Anders Carlsson.
1000
1001         Replace uses of WTF::bind() in the IPC::Connection class with C++11 lambdas.
1002
1003         * Platform/IPC/Connection.cpp:
1004         (IPC::Connection::SyncMessageState::processIncomingMessage):
1005         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
1006         (IPC::Connection::invalidate):
1007         (IPC::Connection::sendMessage):
1008         (IPC::Connection::processIncomingMessage):
1009         (IPC::Connection::enqueueIncomingMessage):
1010         * Platform/IPC/mac/ConnectionMac.mm:
1011         (IPC::Connection::initializeDeadNameSource):
1012         (IPC::Connection::receiveSourceEventHandler):
1013         * Platform/IPC/unix/ConnectionUnix.cpp:
1014         (IPC::Connection::open):
1015
1016 2014-11-09  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1017
1018         Remove create() factory function in FooAnimationValue classes
1019         https://bugs.webkit.org/show_bug.cgi?id=138206
1020
1021         Reviewed by Darin Adler.
1022
1023         As a step to use std::unique_ptr and std::make_unique, this patch removes create()
1024         factory function in FooAnimationValue classes. As this changes, FooAnimationValue::create()
1025         are changed to std::make_unique<>.
1026
1027         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
1028         (IPC::ArgumentCoder<GraphicsLayerAnimation>::decode):
1029         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1030         (WebKit::WebInspectorClient::showPaintRect):
1031
1032 2014-11-09  Chris Dumez  <cdumez@apple.com>
1033
1034         Unreviewed, fix typo in r175796.
1035
1036         Rename areEssentialEqualAsFloat to areEssentiallyEqualAsFloat.
1037
1038         * WebProcess/WebPage/ios/WebPageIOS.mm:
1039         (WebKit::areEssentiallyEqualAsFloat):
1040         (WebKit::WebPage::dynamicViewportSizeUpdate):
1041         (WebKit::areEssentialEqualAsFloat): Deleted.
1042
1043 2014-11-09  Chris Dumez  <cdumez@apple.com>
1044
1045         Add a more correct way to compare floating point numbers and use it
1046         https://bugs.webkit.org/show_bug.cgi?id=138527
1047
1048         Reviewed by Darin Adler.
1049
1050         Use the new WTF::areEssentuallyEqual() utility function from MathExtras.h
1051         to compare floating-point numbers.
1052
1053         * UIProcess/API/Cocoa/WKWebView.mm:
1054         (withinEpsilon):
1055         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1056         (WebKit::PageViewportController::updateMinimumScaleToFit):
1057         (WebKit::fuzzyCompare): Deleted.
1058         * UIProcess/CoordinatedGraphics/PageViewportController.h:
1059         * WebProcess/WebPage/ios/WebPageIOS.mm:
1060         (WebKit::withinEpsilon):
1061
1062         * UIProcess/API/Cocoa/WKWebView.mm:
1063         (areEssentiallyEqualAsFloat):
1064         (-[WKWebView _didCommitLayerTree:]):
1065         (withinEpsilon): Deleted.
1066         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1067         (WebKit::PageViewportController::updateMinimumScaleToFit):
1068         (WebKit::fuzzyCompare): Deleted.
1069         * UIProcess/CoordinatedGraphics/PageViewportController.h:
1070         * WebProcess/WebPage/ios/WebPageIOS.mm:
1071         (WebKit::areEssentialEqualAsFloat):
1072         (WebKit::WebPage::dynamicViewportSizeUpdate):
1073         (WebKit::withinEpsilon): Deleted.
1074
1075 2014-11-08  Simon Fraser  <simon.fraser@apple.com>
1076
1077         Implement round-rect clipping on video elements
1078         https://bugs.webkit.org/show_bug.cgi?id=138537
1079         rdar://problem/9534399
1080
1081         Reviewed by Darin Adler.
1082
1083         Support border-radius on video and other layers with composited contents,
1084         by pushing a FloatRoundedRect onto the GraphicsLayer as the contentsClippingRect,
1085         and, on Mac, using layer corner-radius or a CAShapeLayer mask.
1086
1087         * Shared/WebCoreArgumentCoders.cpp:
1088         (IPC::ArgumentCoder<FloatRoundedRect>::encode):
1089         (IPC::ArgumentCoder<FloatRoundedRect>::decode):
1090         * Shared/WebCoreArgumentCoders.h:
1091         * Shared/mac/RemoteLayerBackingStore.mm: New shape layer type.
1092         (WebKit::RemoteLayerBackingStore::drawInContext):
1093         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1094         (WebKit::applyPropertiesToLayer): Apply corner-radius and shape path.
1095         * Shared/mac/RemoteLayerTreeTransaction.h: Prettify the flags. Yes, I prefer this style.
1096         * Shared/mac/RemoteLayerTreeTransaction.mm:
1097         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1098         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1099         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1100         (WebKit::RemoteLayerTreeTextStream::operator<<):
1101         (WebKit::dumpChangedLayers):
1102         (WebKit::RemoteLayerTreeTransaction::description):
1103         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1104         (+[WKShapeView layerClass]): Make UIViews with a CAShapeLayer layer class.
1105         (WebKit::RemoteLayerTreeHost::createLayer):
1106         * UIProcess/mac/RemoteLayerTreeHost.mm:
1107         (WebKit::RemoteLayerTreeHost::createLayer):
1108         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1109         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
1110         (WebKit::isEquivalentLayer):
1111         (WebKit::PlatformCALayerRemote::setMask):
1112         (WebKit::PlatformCALayerRemote::setClonedLayer):
1113         (WebKit::PlatformCALayerRemote::cornerRadius):
1114         (WebKit::PlatformCALayerRemote::setCornerRadius):
1115         (WebKit::PlatformCALayerRemote::shapeRoundedRect):
1116         (WebKit::PlatformCALayerRemote::setShapeRoundedRect):
1117         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1118
1119 2014-11-09  Conrad Shultz  <conrad_shultz@apple.com>
1120
1121         Move _ignoresNonWheelMouseEvents implementation to WKView(Private)
1122         https://bugs.webkit.org/show_bug.cgi?id=138487
1123
1124         Reviewed by Dan Bernstein.
1125
1126         Relocate some methods that should have been in a category implementation.
1127
1128         * UIProcess/API/mac/WKView.mm:
1129         (-[WKView _setIgnoresNonWheelMouseEvents:]):
1130         (-[WKView _ignoresNonWheelMouseEvents]):
1131
1132 2014-11-08  Beth Dakin  <bdakin@apple.com>
1133
1134         WKActionMenuController methods should be more careful to use the best 
1135         WebHitTestResult
1136         https://bugs.webkit.org/show_bug.cgi?id=138536
1137         -and corresponding-
1138         rdar://problem/18919195
1139
1140         Reviewed by Tim Horton.
1141
1142         This patch re-names _hitTestResultForStage to _webHitTestResult. The method no 
1143         longer takes a stage since that value is really not necessary to determine the 
1144         correct WebHitTestResult. This patch also makes all spots in this file that access 
1145         a WebHitTestResult go through _webHitTestResult to ensure that they get the most 
1146         up-to-date option.
1147         * UIProcess/mac/WKActionMenuController.mm:
1148         (-[WKActionMenuController willOpenMenu:withEvent:]):
1149         (-[WKActionMenuController _openURLFromActionMenu:]):
1150         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
1151         (-[WKActionMenuController _previewURLFromActionMenu:]):
1152         (-[WKActionMenuController _defaultMenuItemsForVideo]):
1153         (-[WKActionMenuController _copyVideoURL:]):
1154         (-[WKActionMenuController _saveVideoToDownloads:]):
1155         (-[WKActionMenuController _saveImageToDownloads:]):
1156         (-[WKActionMenuController _defaultMenuItems]):
1157         (-[WKActionMenuController _updateActionMenuItemsForStage:]):
1158         (imageForResource:name::switch): Deleted.
1159         (-[WKActionMenuController _defaultMenuItems:]): Deleted.
1160
1161 2014-11-08  Beth Dakin  <bdakin@apple.com>
1162
1163         Implement action menu support for videos
1164         https://bugs.webkit.org/show_bug.cgi?id=138534
1165         -and corresponding-
1166         rdar://problem/18742164
1167
1168         Reviewed by Tim Horton.
1169
1170         New menu type and items types.
1171         * Shared/API/c/WKActionMenuItemTypes.h:
1172         * Shared/API/c/WKActionMenuTypes.h:
1173
1174         Plumb isMediaThatCanBeDownloaded() up to WebHitTestResult.
1175         * Shared/WebHitTestResult.cpp:
1176         (WebKit::WebHitTestResult::Data::Data):
1177         (WebKit::WebHitTestResult::Data::encode):
1178         (WebKit::WebHitTestResult::Data::decode):
1179         * Shared/WebHitTestResult.h:
1180         (WebKit::WebHitTestResult::isMediaThatCanBeDownloaded):
1181
1182         Re-name _canAddImageToPhotos to _canAddMediaToPhotos, which is more accurate. We 
1183         might use this method for videos some day, so now it has an accurate name.
1184         * UIProcess/mac/WKActionMenuController.mm:
1185
1186         Default items and their actions.
1187         (-[WKActionMenuController _defaultMenuItemsForVideo]):
1188         (-[WKActionMenuController _copyVideoURL:]):
1189         (-[WKActionMenuController _saveVideoToDownloads:]):
1190         (-[WKActionMenuController _defaultMenuItemsForImage]):
1191         (-[WKActionMenuController _canAddMediaToPhotos]):
1192         (-[WKActionMenuController _addImageToPhotos:]):
1193         (-[WKActionMenuController _createActionMenuItemForTag:]):
1194         (-[WKActionMenuController _defaultMenuItems:]):
1195         (-[WKActionMenuController _canAddImageToPhotos]): Deleted.
1196
1197         We hit test including shadow content to get the desired result for editable text 
1198         regions. But for media, we want to re-set to the shadow root.
1199         * WebProcess/WebPage/mac/WebPageMac.mm:
1200         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1201
1202 2014-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1203
1204         [GTK] Allow to create a view with a related page in WTR
1205         https://bugs.webkit.org/show_bug.cgi?id=138501
1206
1207         Reviewed by Martin Robinson.
1208
1209         This is needed when running tests in multi web process mode.
1210
1211         * UIProcess/API/C/gtk/WKView.cpp:
1212         (WKViewCreate):
1213         * UIProcess/API/C/gtk/WKView.h:
1214
1215 2014-11-07  Conrad Shultz  <conrad_shultz@apple.com>
1216
1217         "Lookup" action menu should read "Look up"
1218         https://bugs.webkit.org/show_bug.cgi?id=138509
1219
1220         Reviewed by Tim Horton.
1221
1222         * UIProcess/mac/WKActionMenuController.mm:
1223         (-[WKActionMenuController _createActionMenuItemForTag:]):
1224
1225 2014-11-07  Beth Dakin  <bdakin@apple.com>
1226
1227         Null deref performing Lookup on Apple Trailers full screen button
1228         https://bugs.webkit.org/show_bug.cgi?id=138513
1229         -and corresponding-
1230         rdar://problem/18909699
1231
1232         Reviewed by Tim Horton.
1233
1234         * WebProcess/WebPage/mac/WebPageMac.mm:
1235         (WebKit::WebPage::performDictionaryLookupForSelection):
1236
1237 2014-11-07  Anshu Chimala  <anshu@apple.com>
1238
1239         Make it possible to associate snapshots with back/forward list items other than the current item.
1240         https://bugs.webkit.org/show_bug.cgi?id=138490
1241
1242         Reviewed by Tim Horton.
1243
1244         * UIProcess/API/Cocoa/WKViewPrivate.h:
1245         Declare -saveBackForwardSnapshotForItem:, an alternative to -saveBackForwardSnapshotForCurrentItem that accepts a
1246         back/forward list item as an argument.
1247         * UIProcess/API/mac/WKView.mm:
1248         (-[WKView saveBackForwardSnapshotForItem:]):
1249         Pass the provided back/forward list item along to WebPageProxy::recordNavigationSnapshot().
1250
1251         * UIProcess/WebPageProxy.cpp:
1252         (WebKit::WebPageProxy::recordNavigationSnapshot):
1253         Overloaded to optionally take a back/forward list item as an argument. If one isn't provided, default to the current item
1254         as before; otherwise, associate the snapshot with whichever item was provided.
1255         * UIProcess/WebPageProxy.h:
1256         Declare the new recordNavigationSnapshot() overload.
1257
1258         * UIProcess/mac/ViewSnapshotStore.h:
1259         Make recordSnapshot() take a back/forward list item as an argument.
1260         * UIProcess/mac/ViewSnapshotStore.mm:
1261         (WebKit::ViewSnapshotStore::recordSnapshot):
1262         Store the snapshot in the provided back/forward list item instead of in the current item.
1263
1264 2014-11-07  Tim Horton  <timothy_horton@apple.com>
1265
1266         Popovers do not dismiss when navigating back and forth using gestures
1267         https://bugs.webkit.org/show_bug.cgi?id=138512
1268         <rdar://problem/18900200>
1269
1270         Reviewed by Beth Dakin.
1271
1272         * UIProcess/mac/PageClientImpl.mm:
1273         (WebKit::PageClientImpl::navigationGestureDidBegin):
1274         Dismiss action menu related popovers when navigation gestures begin.
1275
1276 2014-11-07  Beth Dakin  <bdakin@apple.com>
1277
1278         Action menu preview popover should dismiss on scroll
1279         https://bugs.webkit.org/show_bug.cgi?id=138511
1280         -and corresponding-
1281         rdar://problem/18901445
1282
1283         Reviewed by Tim Horton.
1284
1285         This patch re-names dismissActionMenuDataDetectorPopovers() to 
1286         dismissActionMenuPopovers() and also calls _clearPreviewPopover from that method 
1287         as well.
1288         * UIProcess/API/mac/WKView.mm:
1289         (-[WKView viewDidMoveToWindow]):
1290         (-[WKView _dismissActionMenuPopovers]):
1291         (-[WKView _dismissActionMenuDataDetectorPopovers]): Deleted.
1292         * UIProcess/API/mac/WKViewInternal.h:
1293         * UIProcess/PageClient.h:
1294         * UIProcess/WebPageProxy.cpp:
1295         (WebKit::WebPageProxy::didCommitLoadForFrame):
1296         (WebKit::WebPageProxy::pageDidScroll):
1297         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1298         * UIProcess/mac/PageClientImpl.h:
1299         * UIProcess/mac/PageClientImpl.mm:
1300         (WebKit::PageClientImpl::dismissActionMenuPopovers):
1301         (WebKit::PageClientImpl::dismissActionMenuDataDetectorPopovers): Deleted.
1302         * UIProcess/mac/WKActionMenuController.h:
1303         * UIProcess/mac/WKActionMenuController.mm:
1304         (-[WKActionMenuController dismissActionMenuPopovers]):
1305         (-[WKActionMenuController dismissActionMenuDataDetectorPopovers]): Deleted.
1306
1307 2014-11-07  Beth Dakin  <bdakin@apple.com>
1308
1309         Support action menus for whitespace in editable areas
1310         https://bugs.webkit.org/show_bug.cgi?id=138488
1311         -and corresponding-
1312         rdar://problem/18877717
1313
1314         Reviewed by Tim Horton.
1315
1316         Very simple menu for whitespace in editable areas.
1317         * Shared/API/c/WKActionMenuTypes.h:
1318         * UIProcess/mac/WKActionMenuController.mm:
1319         (-[WKActionMenuController _defaultMenuItemsForWhitespaceInEditableArea]):
1320         (-[WKActionMenuController _defaultMenuItems:]):
1321
1322 2014-11-07  Beth Dakin  <bdakin@apple.com>
1323
1324         Invoking an action menu should dismiss existing selection
1325         https://bugs.webkit.org/show_bug.cgi?id=138496
1326         -and corresponding-
1327         rdar://problem/18892787
1328
1329         Reviewed by Tim Horton.
1330
1331         * UIProcess/mac/WKActionMenuController.mm:
1332         (-[WKActionMenuController willOpenMenu:withEvent:]):
1333
1334 2014-11-07  Eric Carlson  <eric.carlson@apple.com>
1335
1336         [iOS] Update optimized fullscreen media controls
1337         https://bugs.webkit.org/show_bug.cgi?id=138493
1338
1339         Reviewed by Brent Fulgham.
1340
1341         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1342         (InitWebCoreSystemInterface): Initialize GetMediaUIImageData.
1343
1344 2014-11-07  Antti Koivisto  <antti@apple.com>
1345
1346         Add cache coders
1347         https://bugs.webkit.org/show_bug.cgi?id=138413
1348
1349         Reviewed by Anders Carlsson.
1350
1351         Add encoding and decoding support for cache types.
1352
1353         This is largely a copy of the IPC coder classes with some unnecessary features removed.
1354         The coders compute a type-sensitive checksum that can be used to verify the data integrity.
1355
1356         The code is behind ENABLE(NETWORK_CACHE) and not yet used.
1357
1358         * NetworkProcess/cache: Added.
1359         * NetworkProcess/cache/NetworkCacheCoder.h: Added.
1360         * NetworkProcess/cache/NetworkCacheCoders.cpp: Added.
1361         * NetworkProcess/cache/NetworkCacheCoders.h: Added.
1362         * NetworkProcess/cache/NetworkCacheDecoder.cpp: Added.
1363         * NetworkProcess/cache/NetworkCacheDecoder.h: Added.
1364         * NetworkProcess/cache/NetworkCacheEncoder.cpp: Added.
1365         * NetworkProcess/cache/NetworkCacheEncoder.h: Added.
1366         * WebKit2.xcodeproj/project.pbxproj:
1367
1368 2014-11-06  Conrad Shultz  <conrad_shultz@apple.com>
1369
1370         Clients should be able to customize the view used for page previews
1371         https://bugs.webkit.org/show_bug.cgi?id=138447
1372
1373         Reviewed by Tim Horton.
1374
1375         Add SPI to WKView that clients can use to customize the view used in the page preview popover.
1376
1377         * UIProcess/API/Cocoa/WKViewPrivate.h:
1378         Declare -_viewForPreviewingURL:initialFrameSize:.
1379
1380         * UIProcess/API/mac/WKView.mm:
1381         (-[WKView _viewForPreviewingURL:initialFrameSize:]):
1382         Return nil in the default implementation.
1383
1384         * UIProcess/mac/WKActionMenuController.mm:
1385         (-[WKPagePreviewViewController loadView]):
1386         Only spin up a WKWebView if the delegate (and, therefore, the presenting WKView) doesn't supply a custom view.
1387         (-[WKActionMenuController pagePreviewViewController:viewForPreviewingURL:initialFrameSize:]):
1388         WKPagePreviewViewControllerDelegate method; wrap the WKView SPI.
1389
1390 2014-11-05  Jer Noble  <jer.noble@apple.com>
1391
1392         De-templatize Timer
1393         https://bugs.webkit.org/show_bug.cgi?id=138450
1394
1395         Reviewed by Anders Carlsson.
1396
1397         Remove template specifiers from Timer.
1398
1399         * NetworkProcess/NetworkResourceLoader.cpp:
1400         (WebKit::NetworkResourceLoader::bufferingTimerFired):
1401         * NetworkProcess/NetworkResourceLoader.h:
1402         * Shared/WebMemorySampler.cpp:
1403         (WebKit::WebMemorySampler::sampleTimerFired):
1404         (WebKit::WebMemorySampler::stopTimerFired):
1405         * Shared/WebMemorySampler.h:
1406         * Shared/mac/RemoteLayerBackingStoreCollection.h:
1407         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1408         (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
1409         * UIProcess/API/efl/EwkView.cpp:
1410         (EwkView::displayTimerFired):
1411         * UIProcess/API/efl/EwkView.h:
1412         * UIProcess/efl/TextCheckerClientEfl.cpp:
1413         (TextCheckerClientEfl::languagesUpdateTimerFired):
1414         (TextCheckerClientEfl::spellCheckingSettingChangeTimerFired):
1415         * UIProcess/efl/TextCheckerClientEfl.h:
1416         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1417         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
1418         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1419         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1420         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1421         (WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired):
1422         * WebProcess/WebProcess.cpp:
1423         (WebKit::WebProcess::processSuspensionCleanupTimerFired):
1424         (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired):
1425         * WebProcess/WebProcess.h:
1426
1427 2014-11-06  Dean Jackson  <dino@apple.com>
1428
1429         [filters2] Support for backdrop-filter
1430         https://bugs.webkit.org/show_bug.cgi?id=138384
1431         <rdar://problem/18874494>
1432
1433         Reviewed by Simon Fraser.
1434
1435         Take 2!! Previous patch was rolled out.
1436
1437         * Shared/mac/RemoteLayerBackingStore.mm:
1438         (WebKit::RemoteLayerBackingStore::drawInContext): Handle LayerTypeBackdropLayer in the switch.
1439         * Shared/mac/RemoteLayerTreeTransaction.mm:
1440         (WebKit::RemoteLayerTreeTransaction::description): Describe a backdrop layer.
1441         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1442         (+[WKBackdropView layerClass]): Define CABackdropLayer and use it as the class.
1443         (WebKit::RemoteLayerTreeHost::createLayer):
1444         * UIProcess/mac/RemoteLayerTreeHost.mm: Ditto.
1445         (WebKit::RemoteLayerTreeHost::createLayer):
1446
1447 2014-11-06  Tim Horton  <timothy_horton@apple.com>
1448
1449         Data detectors popover points at the first line of the detected item
1450         https://bugs.webkit.org/show_bug.cgi?id=138471
1451         <rdar://problem/18893079>
1452
1453         Reviewed by Sam Weinig.
1454
1455         * WebProcess/WebPage/mac/WebPageMac.mm:
1456         (WebKit::scanForDataDetectedItems):
1457         Determine the bounding box of all quads of the detected item's text.
1458         This way, the popover will point at the border of the item, instead of
1459         right at the very first line.
1460
1461 2014-11-06  Beth Dakin  <bdakin@apple.com>
1462
1463         Preview views often misplaced inside popover
1464         https://bugs.webkit.org/show_bug.cgi?id=138472
1465
1466         Reviewed by Tim Horton.
1467
1468         This patch makes the popover maintain aspect ratio, and it uses the final scale of 
1469         that popover to scale the preview view as well.
1470
1471         * UIProcess/mac/WKActionMenuController.mm:
1472         (-[WKPagePreviewViewController initWithPageURL:mainViewSize:popoverToViewScale:]):
1473         (-[WKPagePreviewViewController loadView]):
1474         (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
1475         (-[WKActionMenuController _targetSize:fitsInAvailableSpace:]):
1476         (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
1477         (-[WKPagePreviewViewController initWithPageURL:]): Deleted.
1478
1479 2014-11-06  Tim Horton  <timothy_horton@apple.com>
1480
1481         TextIndicatorWindow's bounce animation is lopsided when indicating two short lines of text
1482         https://bugs.webkit.org/show_bug.cgi?id=138458
1483
1484         Reviewed by Simon Fraser.
1485
1486         Previously, the TextIndicator's frame() covered the entire selection highlight bounds.
1487         This was undesirable in cases where the highlight included areas far outside the
1488         bounds of the selected text, as the TextIndicatorWindow's 'bounce' animation
1489         would be misaligned (centered on the highlight instead of on the text).
1490
1491         * Shared/TextIndicator.cpp:
1492         Get rid of the many-argument TextIndicator::create, because it was only used
1493         internally, and have createWithSelectionInFrame make a ::Data instead.
1494
1495         (WebKit::TextIndicator::createWithSelectionInFrame):
1496         Compute and store the bounding rect of all of the selected text rects, and store
1497         all of the text rects relative to that bounding rect instead of relative to the
1498         selection highlight bounds. We do this because the selection highlight bounds
1499         often includes area which is far outside of the text bounds (in the case of a
1500         selection that spans multiple lines), and causes the text indicator bounce
1501         animation to bounce in a lopsided manner.
1502
1503         (WebKit::TextIndicator::TextIndicator):
1504         Adjust to the rename of textRectsInSelectionRectCoordinates -> textRectsInBoundingRectCoordinates.
1505
1506         (WebKit::TextIndicator::frameRect):
1507         Instead of the TextIndicator's frame being the selection highlight bounds,
1508         it is now the bounds of all of the text rects.
1509
1510         (WebKit::TextIndicator::draw):
1511         Translate into the image by the difference between the selection highlight bounds
1512         and the text bounding rect. This is necessary because the content image is still generated
1513         covering the entire selection highlight bounds, but the text rects are in text-rect-bounds coordinates.
1514
1515         (WebKit::TextIndicator::Data::encode):
1516         (WebKit::TextIndicator::Data::decode):
1517         Adjust to the rename of textRectsInSelectionRectCoordinates -> textRectsInBoundingRectCoordinates.
1518         Encode/decode textBoundingRectInWindowCoordinates.
1519
1520         * Shared/TextIndicator.h:
1521         (WebKit::TextIndicator::contentImage): Deleted.
1522         Get rid of an unnecessary getter and constructor.
1523
1524 2014-11-06  Tim Horton  <timothy_horton@apple.com>
1525
1526         Only provide a single result to the action menu DDActionContext
1527         https://bugs.webkit.org/show_bug.cgi?id=138469
1528         <rdar://problem/18869036>
1529
1530         Reviewed by Anders Carlsson.
1531
1532         * WebProcess/WebPage/mac/WebPageMac.mm:
1533         (WebKit::scanForDataDetectedItems):
1534         Only provide one result; secondary results can be extremely unrelated to
1535         the primary one and confuse Data Detectors further down the line.
1536
1537 2014-11-06  Tim Horton  <timothy_horton@apple.com>
1538
1539         Null deref in rangeForDictionaryLookupAtHitTestResult on occasion
1540         https://bugs.webkit.org/show_bug.cgi?id=138459
1541         <rdar://problem/18872825>
1542
1543         Reviewed by Andreas Kling.
1544
1545         * WebProcess/WebPage/mac/WebPageMac.mm:
1546         (WebKit::rangeForDictionaryLookupAtHitTestResult):
1547         rangeExpandedAroundPositionByCharacters can return null.
1548
1549 2014-11-06  Tim Horton  <timothy_horton@apple.com>
1550
1551         Prefer link action menus over images
1552         https://bugs.webkit.org/show_bug.cgi?id=138461
1553         <rdar://problem/18768377>
1554
1555         Reviewed by Anders Carlsson.
1556
1557         * UIProcess/mac/WKActionMenuController.mm:
1558         (-[WKActionMenuController _defaultMenuItems:]):
1559         Swap the priority of links and images.
1560
1561 2014-11-05  Sam Weinig  <sam@webkit.org>
1562
1563         Use std::unique_ptr for TileController
1564         https://bugs.webkit.org/show_bug.cgi?id=138429
1565
1566         Reviewed by Anders Carlsson.
1567
1568         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
1569         (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
1570         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
1571
1572 2014-11-06  Dan Bernstein  <mitz@apple.com>
1573
1574         iOS build fix.
1575
1576         * WebProcess/Plugins/PluginController.h:
1577
1578 2014-11-06  Daniel Bates  <dabates@apple.com>
1579
1580         [iOS] WebProcess needs to take a background task assertion to prevent being killed
1581         for "suspended with locked system files"
1582         https://bugs.webkit.org/show_bug.cgi?id=138155
1583         <rdar://problem/17939303>
1584
1585         Reviewed by Anders Carlsson.
1586
1587         Mitigates an issue where the WebProcess may be killed when suspended holding locked files
1588         by allowing the WebProcess to notify the UIProcess when it is holding such files so that
1589         both can continue to run for a period of time after the UIProcess transitions to the
1590         background. In particular, the WebProcess notifies the UIProcess that it is holding- or
1591         relinquished- a locked file when it begins and ends a sequence of SQLite transactions,
1592         respectively.
1593
1594         * UIProcess/WebProcessProxy.cpp:
1595         (WebKit::WebProcessProxy::disconnect): Relinquish an existing background task assertion
1596         when the WebProcess disconnects. Among other situations, the WebProcess may disconnect as
1597         a result of being suspended holding locked files even when the UIProcess requested a
1598         background task assertion (i.e. it may have exceeded its background time limit).
1599         (WebKit::WebProcessProxy::setIsHoldingLockedFiles): Added. Either acquires a new background
1600         task assertion or relinquishes an existing one.
1601         * UIProcess/WebProcessProxy.h:
1602         * UIProcess/WebProcessProxy.messages.in: Added message SetIsHoldingLockedFiles(bool). The WebProcess
1603         dispatches this message to inform the UIProcess that it is holding- or relinquished- a locked file.
1604         * WebKit2.xcodeproj/project.pbxproj: Added files WebSQLiteDatabaseTracker.{cpp, h}.
1605         * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp: Added.
1606         (WebKit::WebSQLiteDatabaseTracker::supplementName): Added.
1607         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker): Added.
1608         (WebKit::WebSQLiteDatabaseTracker::initialize): Register to receive SQLiteDatabaseTrackerClient callbacks.
1609         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction): Inform the HysteresisActivity object on
1610         the main thread that we began a transaction so that it calls WebSQLiteDatabaseTracker::started().
1611         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction): Inform the HysteresisActivity object on
1612         the main thread that we finished a transaction so that it may eventually call WebSQLiteDatabaseTracker::stopped().
1613         (WebKit::WebSQLiteDatabaseTracker::started): Notify the UIProcess that the WebProcess is holding
1614         a locked file.
1615         (WebKit::WebSQLiteDatabaseTracker::stopped): Notify the UIProcess that the WebProcess has
1616         relinquished the locked file.
1617         * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h: Added. We use a HysteresisActivity object
1618         to coalesce SetIsHoldingLockedFiles(false) messages as an optimization to minimize the number of
1619         messages exchanged between the UIProcess and WebProcess when a web page performs SQLite transactions
1620         in batches.
1621         * WebProcess/WebProcess.cpp:
1622         (WebKit::WebProcess::WebProcess): Instantiate the supplement WebSQLiteDatabaseTracker when building
1623         for iOS.
1624
1625 2014-11-06  Alberto Garcia  <berto@igalia.com>
1626
1627         [GTK] [Stable] webkitgtk 2.6.1 fails to load flashplugin
1628         https://bugs.webkit.org/show_bug.cgi?id=137849
1629
1630         Reviewed by Carlos Garcia Campos.
1631
1632         NPPVpluginNeedsXEmbed is a boolean value, so it should normally
1633         use an NPBool (1 byte). However some plugins (the Flash player in
1634         particular) are using an int instead, so we have to do it as well
1635         else we'll end up corrupting the stack.
1636
1637         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1638         (WebKit::NetscapePlugin::platformPostInitialize):
1639
1640 2014-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1641
1642         [GTK] Add context menu API to Web Process Extensions
1643         https://bugs.webkit.org/show_bug.cgi?id=138311
1644
1645         Reviewed by Gustavo Noronha Silva.
1646
1647         Add WebKitWebPage::context-menu signal, similar to the
1648         WebKitWebView one, but that receives a WebKitWebHitTestResult, a
1649         class that extends WebKitTestResult to provide the WebKitDOMNode
1650         from the Web Process Extensions API. This makes WebKitContextMenu,
1651         WebKitContextMenuItem and WebKitTestResult classes shared between
1652         UI and Web Extensions APIs. In addition to be able to customize
1653         the context menu, it also provides API to set user data, as a
1654         GVariant, in the Web Process that is sent to the UI Process.
1655
1656         * PlatformGTK.cmake: Add new files.
1657         * UIProcess/API/gtk/WebKitContextMenu.cpp:
1658         (webkit_context_menu_set_user_data): Add user data to the context
1659         menu as a GVariant.
1660         (webkit_context_menu_get_user_data): Get the user data previously
1661         set with webkit_context_menu_set_user_data() either from the Web
1662         or UI processes.
1663         * UIProcess/API/gtk/WebKitContextMenu.h:
1664         * UIProcess/API/gtk/WebKitContextMenuActions.h:
1665         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
1666         (getContextMenuFromProposedMenu): Convert the received user data
1667         into a GVariant and pass it to webkitWebViewPopulateContextMenu().
1668         * UIProcess/API/gtk/WebKitContextMenuItem.h:
1669         * UIProcess/API/gtk/WebKitForwardDeclarations.h:
1670         * UIProcess/API/gtk/WebKitHitTestResult.h:
1671         * UIProcess/API/gtk/WebKitWebView.cpp:
1672         (webkitWebViewPopulateContextMenu): Set the user data received
1673         from the Web Process to the WebKitContextMenu before emitting
1674         WebKitWebView::context-menu.
1675         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1676         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitWebHitTestResult.
1677         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
1678         * UIProcess/API/gtk/docs/webkit2gtk.types: Add webkit_web_hit_test_result_get_type.
1679         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp: Added.
1680         (webkitWebHitTestResultGetProperty): Add getter for node property.
1681         (webkitWebHitTestResultSetProperty): Add setter for node property.
1682         (webkit_web_hit_test_result_class_init): Add node property.
1683         (webkitWebHitTestResultCreate): Create a new
1684         WebKitWebHitTestResult for the given InjectedBundleHitTestResult.
1685         (webkit_web_hit_test_result_get_node): Return the WebKitDOMNode.
1686         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.h: Added.
1687         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h: Added.
1688         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1689         (getContextMenuFromDefaultMenu): Build a WebKitContextMenu and
1690         WebKitWebHitTestResult and emit WebKitWebPage::context-menu signal.
1691         (webkit_web_page_class_init): Add WebKitWebPage::context-menu signal.
1692         (webkitWebPageCreate): Add implementation for getContextMenuFromDefaultMenu.
1693         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
1694
1695 2014-11-06  Ryuan Choi  <ryuan.choi@gmail.com>
1696
1697         [EFL] Remove m_scrollPosition from CoordinatedGraphicsScene
1698         https://bugs.webkit.org/show_bug.cgi?id=138419
1699
1700         Reviewed by Gyuyoung Kim.
1701
1702         m_scrollPosition of CoordinatedGraphicsScene is only to adjust the position
1703         of fixed element. But this adjustment is only called by paintToCurrentGLContext()
1704         and WebView can pass same information to the parameter of that method.
1705
1706         * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1707         (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
1708         (WebCore::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
1709         (WebCore::CoordinatedGraphicsScene::setScrollPosition): Deleted.
1710         * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1711         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
1712         (WebKit::CoordinatedLayerTreeHostProxy::setVisibleContentsRect):
1713         * UIProcess/CoordinatedGraphics/WebView.cpp:
1714         (WebKit::WebView::paintToCurrentGLContext):
1715
1716 2014-11-05  Commit Queue  <commit-queue@webkit.org>
1717
1718         Unreviewed, rolling out r175672.
1719         https://bugs.webkit.org/show_bug.cgi?id=138455
1720
1721         Tries to make backdrop layers on every layer, asserts on
1722         Mavericks (Requested by smfr on #webkit).
1723
1724         Reverted changeset:
1725
1726         "[filters2] Support for backdrop-filter"
1727         https://bugs.webkit.org/show_bug.cgi?id=138384
1728         http://trac.webkit.org/changeset/175672
1729
1730 2014-11-04  Ada Chan  <adachan@apple.com>
1731
1732         Figure out whether a plug-in is playing audio.
1733         https://bugs.webkit.org/show_bug.cgi?id=137219
1734
1735         Reviewed by Anders Carlsson.
1736
1737         Handle the setting of the NPPVpluginIsPlayingAudio variable.
1738
1739         * PluginProcess/PluginControllerProxy.cpp:
1740         (WebKit::PluginControllerProxy::setPluginIsPlayingAudio):
1741         Send a SetPluginIsPlayingAudio message to the WebProcess.
1742         * PluginProcess/PluginControllerProxy.h:
1743         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1744         (WebKit::NPN_SetValue):
1745         Handle NPPVpluginIsPlayingAudio. Call NetscapePlugin::setIsPlayingAudio().
1746         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1747         (WebKit::NetscapePlugin::setIsPlayingAudio):
1748         Call PluginControllerProxy::setPluginIsPlayingAudio().
1749         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1750         * WebProcess/Plugins/PluginController.h:
1751         * WebProcess/Plugins/PluginProxy.cpp:
1752         (WebKit::PluginProxy::setPluginIsPlayingAudio):
1753         Call PluginView::setPluginIsPlayingAudio().
1754         * WebProcess/Plugins/PluginProxy.h:
1755         * WebProcess/Plugins/PluginProxy.messages.in:
1756         Add the SetPluginIsPlayingAudio message.
1757         * WebProcess/Plugins/PluginView.cpp:
1758         (WebKit::PluginView::PluginView):
1759         Initialize m_pluginIsPlayingAudio.
1760         (WebKit::PluginView::~PluginView):
1761         Remove itself from the Document's list of AudioProducers.
1762         (WebKit::PluginView::initializePlugin):
1763         Add itself to the Document's list of AudioProducers.
1764         (WebKit::PluginView::pageMutedStateDidChange):
1765         Add a FIXME.
1766         (WebKit::PluginView::setPluginIsPlayingAudio):
1767         If m_pluginIsPlayingAudio has changed, tell the Document to update its audio playing state.
1768         * WebProcess/Plugins/PluginView.h:
1769         Now inherits AudioProducer.
1770
1771 2014-11-05  Dan Bernstein  <mitz@apple.com>
1772
1773         Tried to fix the GTK build.
1774
1775         * PlatformGTK.cmake: Removed references to deletion UI resources that have been removed.
1776
1777 2014-11-04  Dean Jackson  <dino@apple.com>
1778
1779         [filters2] Support for backdrop-filter
1780         https://bugs.webkit.org/show_bug.cgi?id=138384
1781         <rdar://problem/18874494>
1782
1783         Reviewed by Simon Fraser.
1784
1785         * Shared/mac/RemoteLayerBackingStore.mm:
1786         (WebKit::RemoteLayerBackingStore::drawInContext): Handle LayerTypeBackdropLayer in the switch.
1787         * Shared/mac/RemoteLayerTreeTransaction.mm:
1788         (WebKit::RemoteLayerTreeTransaction::description): Describe a backdrop layer.
1789         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1790         (+[WKBackdropView layerClass]): Define CABackdropLayer and use it as the class.
1791         (WebKit::RemoteLayerTreeHost::createLayer):
1792         * UIProcess/mac/RemoteLayerTreeHost.mm: Ditto.
1793         (WebKit::RemoteLayerTreeHost::createLayer):
1794
1795 2014-11-05  Ryuan Choi  <ryuan.choi@gmail.com>
1796
1797         [EFL] Improve previous temporary fix against drawing (0,0) position before rendering content of next web page
1798         https://bugs.webkit.org/show_bug.cgi?id=138305
1799
1800         Reviewed by Gyuyoung Kim.
1801
1802         WebKit2 has freezed layer tree until frame load completion since r101838.
1803         In EFL port, we unfreeze it when PageViewportController::pageTransitionViewportReady() is called though,
1804         UIProcess on EFL port updates cairo surface during the freezing time of layer tree.
1805         Thus UIProcess should not update the layer trees until the layerTreeState is unfrozen.
1806
1807         * UIProcess/API/efl/EwkView.h: Removed previous workarounds.
1808         (EwkView::setWaitingForNewPage): Deleted.
1809         (EwkView::waitingForNewPage): Deleted.
1810         (EwkView::didCommitNewPage): Deleted.
1811         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1812         (WebKit::PageViewportController::PageViewportController):
1813         (WebKit::PageViewportController::didCommitLoad):
1814         (WebKit::PageViewportController::didRenderFrame):
1815         (WebKit::PageViewportController::syncVisibleContents):
1816         * UIProcess/CoordinatedGraphics/PageViewportController.h:
1817         * UIProcess/efl/PageLoadClientEfl.cpp:
1818         (WebKit::PageLoadClientEfl::didCommitLoadForFrame):
1819         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
1820         (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
1821         * UIProcess/efl/ViewClientEfl.cpp:
1822         (WebKit::ViewClientEfl::didRenderFrame):
1823
1824 2014-11-05  Timothy Horton  <timothy_horton@apple.com>
1825
1826         Fix the build.
1827
1828         * UIProcess/mac/WKActionMenuController.mm:
1829
1830 2014-11-05  Dan Bernstein  <mitz@apple.com>
1831
1832         Remove the unused deletion UI feature
1833         https://bugs.webkit.org/show_bug.cgi?id=138442
1834
1835         Rubber-stamped by Alexey Proskuryakov.
1836
1837         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1838         (WebKit::WebEditorClient::shouldShowDeleteInterface): Deleted.
1839         * WebProcess/WebCoreSupport/WebEditorClient.h:
1840
1841 2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
1842
1843         It should be possible to open a page preview by clicking on it
1844         https://bugs.webkit.org/show_bug.cgi?id=138445
1845
1846         Reviewed by Tim Horton.
1847
1848         Add a click recognizer to WKPagePreviewViewController and plumb it through to WKActionMenuController.
1849
1850         * UIProcess/mac/WKActionMenuController.mm:
1851         Declare <WKPagePreviewViewControllerDelegate>, currently home to just a single method.
1852         (-[WKPagePreviewViewController loadView]):
1853         Configure and add a click gesture recognizer to the WKWebView.
1854         (-[WKPagePreviewViewController _clickRecognized:]):
1855         Gesture recognizer action; send -pagePreviewViewControllerWasClicked: to the delegate.
1856         (-[WKActionMenuController willDestroyView:]):
1857         Extract code to -_clearPreviewPopover.
1858         (-[WKActionMenuController didCloseMenu:withEvent:]):
1859         Ditto.
1860         (-[WKActionMenuController _createPreviewPopoverForURL:]):
1861         Set ourself as the delegate of the page preview controller.
1862         (-[WKActionMenuController _clearPreviewPopover]):
1863         Extracted from various other methods; if appropriate, nil out the preview view controller's delegate.
1864         (-[WKActionMenuController popoverWillClose:]):
1865         Extract code to -_clearPreviewPopover.
1866         (-[WKActionMenuController pagePreviewViewControllerWasClicked:]):
1867         WKPagePreviewViewControllerDelegate method; open the URL of the clicked page.
1868
1869 2014-11-05  Beth Dakin  <bdakin@apple.com>
1870
1871         Page preview popover should show scaled-down web content
1872         https://bugs.webkit.org/show_bug.cgi?id=138444
1873
1874         Reviewed by Anders Carlsson.
1875
1876         Instead of keeping the preferred size in the controller, keep the main view’s 
1877         size, and then scale the bounds of the popover’s view using that and the scale 
1878         factor as a constant. Set the size of the popover explicitly so that it doesn’t 
1879         get the view’s size. This will cause it to scale the WKWebView.
1880         * UIProcess/mac/WKActionMenuController.mm:
1881         (-[WKPagePreviewViewController initWithPageURL:]):
1882         (-[WKPagePreviewViewController loadView]):
1883         (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
1884         (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
1885
1886 2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
1887
1888         Page preview popovers sometimes cover their originating element
1889         https://bugs.webkit.org/show_bug.cgi?id=138437
1890
1891         Reviewed by Beth Dakin.
1892
1893         If a popover is sufficiently large, and the originating element is in a particular location, it's
1894         possible that the popover can't be positioned in a manner that doesn't occlude the originating element.
1895         Address this by scaling down the popover content if it can't fit entirely between the originating
1896         element and the screen edge.
1897
1898         * UIProcess/mac/WKActionMenuController.mm:
1899         (-[WKActionMenuController _previewURLFromActionMenu:]):
1900         Update to use -_createPreviewPopoverForURL:originRect:.
1901         (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
1902         Renamed from -_createPreviewPopoverForURL:; extract code to -_preferredSizeForPopoverPresentedFromOriginRect:.
1903         (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
1904         Compute a size that is as large as possible while keeping the popover between the origin rect and screen edge
1905         (with an arbitrary padding applied to keep from directly abutting the screen edge).
1906         (-[WKActionMenuController _createPreviewPopoverForURL:]): Deleted.
1907
1908 2014-11-05  Alexey Proskuryakov  <ap@apple.com>
1909
1910         fast/dom/remove-body-during-body-replacement2.html fails on WK2
1911         https://bugs.webkit.org/show_bug.cgi?id=138334
1912
1913         Reviewed by Anders Carlsson.
1914
1915         Added an SPI to focus a frame.
1916
1917         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1918         (WKBundleFrameFocus):
1919         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1920         * WebProcess/WebPage/WebPage.cpp:
1921         (WebKit::WebPage::setViewState):
1922
1923 2014-11-05  Tim Horton  <timothy_horton@apple.com>
1924
1925         Select Data Detectors results instead of just highlighting them
1926         https://bugs.webkit.org/show_bug.cgi?id=138435
1927         <rdar://problem/18877675>
1928
1929         Reviewed by Beth Dakin.
1930
1931         * UIProcess/WebPageProxy.cpp:
1932         (WebKit::WebPageProxy::selectLastActionMenuRange):
1933         (WebKit::WebPageProxy::selectLookupTextAtLocation): Deleted.
1934         Rename selectLookupTextAtLocation to selectLastActionMenuRange.
1935
1936         * UIProcess/WebPageProxy.h:
1937         * UIProcess/mac/WKActionMenuController.mm:
1938         (-[WKActionMenuController willOpenMenu:withEvent:]):
1939         Do a real selection for single-item Data Detector menus; show the yellow highlight otherwise.
1940         Adopt selectLastActionMenuRange for non-detected text.
1941
1942         * WebProcess/WebPage/WebPage.h:
1943         * WebProcess/WebPage/WebPage.messages.in:
1944         * WebProcess/WebPage/mac/WebPageMac.mm:
1945         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1946         (WebKit::WebPage::selectLastActionMenuRange):
1947         (WebKit::WebPage::selectLookupTextAtLocation): Deleted.
1948         Store the last (detected data or Lookup-derived) action menu range.
1949         Select it upon selectLastActionMenuRange.
1950
1951 2014-11-04  Jon Honeycutt  <jhoneycutt@apple.com>
1952
1953         WebContent crash in WebPage::selectWithGesture()
1954
1955         <https://bugs.webkit.org/show_bug.cgi?id=138399>
1956         <rdar://problem/18550631>
1957
1958         This crash occurs when the web process receives a "TapAndAHalf" gesture
1959         with the "Changed" state without having received a "TapAndAHalf"
1960         gesture with the "Began" state.
1961
1962         No test possible.
1963
1964         Reviewed by Simon Fraser.
1965
1966         * WebProcess/WebPage/ios/WebPageIOS.mm:
1967         (WebKit::WebPage::selectWithGesture):
1968         Null check m_currentWordRange before dereferencing it.
1969
1970 2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
1971
1972         Disable action menus on page previews
1973         https://bugs.webkit.org/show_bug.cgi?id=138431
1974
1975         Reviewed by Anders Carlsson.
1976
1977         * UIProcess/API/mac/WKView.mm:
1978         (-[WKView _shouldIgnoreMouseEvents]):
1979         Renamed from -shouldIgnoreMouseEvents since this isn't actually public.
1980         (-[WKView swipeWithEvent:]):
1981         (-[WKView mouseMoved:]):
1982         (-[WKView mouseDown:]):
1983         (-[WKView mouseUp:]):
1984         (-[WKView mouseDragged:]):
1985         Updated to reflect method rename.
1986         (-[WKView shouldIgnoreMouseEvents]): Deleted.
1987
1988         * UIProcess/API/mac/WKViewInternal.h:
1989         Expose -_shouldIgnoreMouseEvents.
1990
1991         * UIProcess/mac/WKActionMenuController.mm:
1992         (-[WKActionMenuController prepareForMenu:withEvent:]):
1993         Cancel the menu if the presenting WKView should ignore mouse events.
1994
1995 2014-11-05  Beth Dakin  <bdakin@apple.com>
1996
1997         Action menu URL preview should "peek," i.e. appear when the menu item is 
1998         highlighted
1999         https://bugs.webkit.org/show_bug.cgi?id=138432
2000         -and corresponding-
2001         rdar://problem/18774264
2002
2003         Reviewed by Anders Carlsson.
2004
2005         New ivars. Keep a reference to the popover, and a BOOL that indicates whether we 
2006         should close the popover when the menu goes away.
2007         * UIProcess/mac/WKActionMenuController.h:
2008         * UIProcess/mac/WKActionMenuController.mm:
2009
2010         Re-set the preview bool to NO whenever we are about to pop up a new menu.
2011         (-[WKActionMenuController prepareForMenu:withEvent:]):
2012
2013         Close the popover when the menu closes unless _shouldKeepPreviewPopoverOpen has 
2014         been set.
2015         (-[WKActionMenuController didCloseMenu:withEvent:]):
2016
2017         Set _shouldKeepPreviewPopoverOpen.
2018         (-[WKActionMenuController _keepPreviewOpen:]):
2019
2020         Re-factored to use ivar.
2021         (-[WKActionMenuController _previewURLFromActionMenu:]):
2022         (-[WKActionMenuController _createPreviewPopoverForURL:]):
2023
2024         Now call _previewURLFromActionMenu on menu item highlight.
2025         (-[WKActionMenuController menu:willHighlightItem:]):
2026
2027         NSPopover delegate method so that we can keep our BOOL and ivar accurate in the 
2028         case where the popover is closed by some other mechanism than the action menu 
2029         going away.
2030         (-[WKActionMenuController popoverWillClose:]):
2031
2032         New selector for the preview. Now when this item is actually selected, we just 
2033         want to set the BOOL _shouldKeepPreviewPopoverOpen to YES so that we keep the 
2034         preview open.
2035         (-[WKActionMenuController _createActionMenuItemForTag:]):
2036
2037 2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
2038
2039         Disable interaction with action menu page previews
2040         https://bugs.webkit.org/show_bug.cgi?id=138400
2041
2042         Reviewed by Tim Horton.
2043
2044         Expand on the existing -[WKView shouldIgnoreMouseEvents] by adding facilities to suppress handling
2045         of all non-wheel events, effectively creating a scroll-only web view. Deploy this in
2046         WKPagePreviewViewController.
2047
2048         * UIProcess/API/Cocoa/WKViewPrivate.h:
2049         Declare the OS X-only ignoresNonWheelMouseEvents SPI.
2050
2051         * UIProcess/API/Cocoa/WKWebView.mm:
2052         (-[WKWebView _ignoresNonWheelMouseEvents]):
2053         (-[WKWebView _setIgnoresNonWheelMouseEvents:]):
2054         Wrap the underlying WKView methods.
2055
2056         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2057         Declare the OS X-only ignoresNonWheelMouseEvents property.
2058
2059         * UIProcess/API/mac/WKView.mm:
2060         Add _ignoresNonWheelMouseEvents to WKViewData.
2061         (-[WKView shouldIgnoreMouseEvents]):
2062         Include a check for _ignoresNonWheelMouseEvents.
2063         (-[WKView _setIgnoresNonWheelMouseEvents:]):
2064         Set the ivar in WKViewData.
2065         (-[WKView _ignoresNonWheelMouseEvents]):
2066         Fetch the ivar in WKViewData.
2067         (-[WKView _shouldIgnoreWheelEvents]):
2068         Implement the old -shouldIgnoreMouseEvents behavior.
2069         (-[WKView scrollWheel:]):
2070         -shouldIgnoreMouseEvents -> -_shouldIgnoreWheelEvents.
2071
2072         * UIProcess/mac/WKActionMenuController.mm:
2073         (-[WKPagePreviewViewController loadView]):
2074         Configure the WKWebView to ignore non-wheel mouse events; use RetainPtr for the WKWebView.
2075
2076 2014-11-03  Dean Jackson  <dino@apple.com>
2077
2078         Add ENABLE_FILTERS_LEVEL_2 feature guard.
2079         https://bugs.webkit.org/show_bug.cgi?id=138362
2080
2081         Reviewed by Tim Horton.
2082
2083         Add a new feature define for Level 2 of CSS Filters.
2084         http://dev.w3.org/fxtf/filters-2/
2085
2086         * Configurations/FeatureDefines.xcconfig:
2087
2088 2014-11-05  Alberto Garcia  <berto@igalia.com>
2089
2090         NetscapePlugin: NPP_GetValue should receive a pointer to NPBool, not bool
2091         https://bugs.webkit.org/show_bug.cgi?id=138418
2092
2093         Reviewed by Carlos Garcia Campos.
2094
2095         Replace bool with NPBool, which is actually an unsigned char.
2096
2097         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2098         (WebKit::NetscapePlugin::platformPostInitialize):
2099
2100 2014-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2101
2102         [GTK] Add WebKitWebResource::failed-with-tls-errors signal
2103         https://bugs.webkit.org/show_bug.cgi?id=137862
2104
2105         Reviewed by Gustavo Noronha Silva.
2106
2107         When a resource load fails due to TLS errors emit WebKitWebResource::failed-with-tls-errors
2108         signal instead of WebKitWebResource::failed so that TLS errors information and certificate
2109         are provided.
2110
2111         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
2112         (didReceiveWebViewMessageFromInjectedBundle): Check if the error
2113         is a TLS failure to emit failed-with-tls-errors instead of failed.
2114         * UIProcess/API/gtk/WebKitWebResource.cpp:
2115         (webkit_web_resource_class_init): Add WebKitWebResource::failed-with-tls-errors signal.
2116         (webkitWebResourceFailedWithTLSErrors): Emit failed-with-tls-errors and finish signals.
2117         * UIProcess/API/gtk/WebKitWebResourcePrivate.h:
2118
2119 2014-11-05  Shivakumar JM  <shiva.jm@samsung.com>
2120
2121         Fix build warning in WebKit2/WebProcess module.
2122         https://bugs.webkit.org/show_bug.cgi?id=138410
2123
2124         Reviewed by Alexey Proskuryakov.
2125
2126         Fix build warning by removing parameter name
2127
2128         * WebProcess/WebPage/WebPageOverlay.h:
2129         (WebKit::WebPageOverlay::Client::prepareForActionMenu):
2130
2131 2014-11-05  Antti Koivisto  <antti@apple.com>
2132
2133         Move HTTPHeaderMap encoding to the class
2134         https://bugs.webkit.org/show_bug.cgi?id=138412
2135
2136         Reviewed by Andreas Kling.
2137
2138         * PluginProcess/PluginControllerProxy.cpp:
2139         * Shared/WebCoreArgumentCoders.cpp:
2140         (IPC::ArgumentCoder<HTTPHeaderMap>::encode): Deleted.
2141         (IPC::ArgumentCoder<HTTPHeaderMap>::decode): Deleted.
2142
2143             Make these HTTPHeaderMap members instead so they can access internals and can be used elsewhere.
2144
2145         * Shared/WebCoreArgumentCoders.h:
2146
2147 2014-11-04  Beth Dakin  <bdakin@apple.com>
2148
2149         Speculative build fix.
2150
2151         * UIProcess/API/mac/WKView.mm:
2152         (-[WKView _dismissActionMenuDataDetectorPopovers]):
2153         * UIProcess/API/mac/WKViewInternal.h:
2154
2155 2014-11-04  Beth Dakin  <bdakin@apple.com>
2156
2157         Un-anchor data detector popovers on scroll
2158         https://bugs.webkit.org/show_bug.cgi?id=138385
2159         -and corresponding-
2160         rdar://problem/18869345
2161
2162         Reviewed by Tim Horton.
2163
2164         Whenever we dismiss the dictionary popover, and on scroll, we should try to 
2165         dismiss the data detector popovers. Right now we don’t have the ability to know if 
2166         a dismiss succeeded, so we will settle for un-anchoring the popover.
2167
2168         * UIProcess/API/mac/WKView.mm:
2169         (-[WKView viewDidMoveToWindow]):
2170         (-[WKView _dismissActionMenuDataDetetcorPopovers]):
2171         * UIProcess/API/mac/WKViewInternal.h:
2172         * UIProcess/PageClient.h:
2173         * UIProcess/WebPageProxy.cpp:
2174         (WebKit::WebPageProxy::didCommitLoadForFrame):
2175         (WebKit::WebPageProxy::pageDidScroll):
2176         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2177         * UIProcess/mac/PageClientImpl.h:
2178         * UIProcess/mac/PageClientImpl.mm:
2179         (WebKit::PageClientImpl::dismissActionMenuDataDetetcorPopovers):
2180         * UIProcess/mac/WKActionMenuController.h:
2181         * UIProcess/mac/WKActionMenuController.mm:
2182         (-[WKActionMenuController dismissActionMenuDataDetetcorPopovers]):
2183
2184 2014-11-04  Andy Estes  <aestes@apple.com>
2185
2186         [iOS] WKPDFView should scroll to a fragment when loading a PDF
2187         https://bugs.webkit.org/show_bug.cgi?id=138404
2188
2189         Reviewed by Tim Horton.
2190
2191         WKPDFView already knew how to scroll to a page number fragment during a same-document navigation, but it didn't
2192         know to do so when loading a PDF whose URL already contained a page number fragment. This could happen if the
2193         user long-presses a page number link and taps 'Open in New Tab'.
2194
2195         * UIProcess/ios/WKPDFView.mm:
2196         (-[WKPDFView web_setContentProviderData:suggestedFilename:]): Called _scrollToFragment:.
2197         (-[WKPDFView _scrollToFragment:]): Moved fragment scrolling code to here from web_didSameDocumentNavigation:.
2198         (-[WKPDFView web_didSameDocumentNavigation:]): Called _scrollToFragment.
2199
2200 2014-11-04  Andy Estes  <aestes@apple.com>
2201
2202         [iOS] Stop using +[NSURL _web_URLWithWTFString:relativeToURL:] in WKPDFView
2203         https://bugs.webkit.org/show_bug.cgi?id=138357
2204
2205         Rubber-stamped by Dan Bernstein.
2206
2207         During patch review for r175595 I changed from using +URLWithString:relativeToURL: to using
2208         +_web_URLWithWTFString:relativeToURL: to append a page number fragment to the document URL.
2209         If the base URL already contains a fragment, +_web_URLWithWTFString:relativeToURL: appends to the existing
2210         fragment whereas +URLWithString:relativeToURL: replaces the existing fragment. I want the latter behavior.
2211
2212         * UIProcess/ios/WKPDFView.mm:
2213         (-[WKPDFView _URLForLinkAnnotation:]):
2214
2215 2014-11-04  Tim Horton  <timothy_horton@apple.com>
2216
2217         Add bundle SPI allowing PageOverlay to customize the action menu
2218         https://bugs.webkit.org/show_bug.cgi?id=138388
2219         <rdar://problem/18875579>
2220
2221         Reviewed by Anders Carlsson.
2222
2223         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2224         Bump the BundlePageOverlay client version.
2225
2226         (WKBundlePageOverlayCreate):
2227         (WKBundlePageOverlaySetAccessibilityClient):
2228         Don't return if we have a version; the version check happens later anyway,
2229         and now it is valid to have a version >0.
2230
2231         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
2232         Bump the BundlePageOverlay client version.
2233         Add prepareForActionMenu callback.
2234
2235         * WebProcess/WebPage/WebPageOverlay.h:
2236         (WebKit::WebPageOverlay::Client::prepareForActionMenu):
2237         * WebProcess/WebPage/WebPageOverlay.cpp:
2238         (WebKit::overlayMap):
2239         (WebKit::WebPageOverlay::WebPageOverlay):
2240         (WebKit::WebPageOverlay::~WebPageOverlay):
2241         (WebKit::WebPageOverlay::fromCoreOverlay):
2242         (WebKit::WebPageOverlay::pageOverlayDestroyed):
2243         Keep track of a map of PageOverlay to WebPageOverlay.
2244
2245         (WebKit::WebPageOverlay::prepareForActionMenu):
2246         Forward prepareForActionMenu to the client.
2247         
2248         * WebProcess/WebPage/mac/WebPageMac.mm:
2249         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2250         Iterate through the overlays and let them prepareForActionMenu;
2251         the first overlay that returns true wins. If no overlays want to
2252         do anything, hand preparation along to the context menu client.
2253
2254 2014-11-03  Jeremy Jones  <jeremyj@apple.com>
2255
2256         Add button and enable optimized fullscreen.
2257         https://bugs.webkit.org/show_bug.cgi?id=138351
2258
2259         Reviewed by Eric Carlson.
2260
2261         Add IsOptimizedFullscreenSupported to enable the feature only where appropriate.
2262
2263         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2264         (InitWebCoreSystemInterface): add IsOptimizedFullscreenSupported
2265
2266 2014-11-04  Andy Estes  <aestes@apple.com>
2267
2268         [iOS] Add long press support for links in WKPDFView
2269         https://bugs.webkit.org/show_bug.cgi?id=138357
2270
2271         Reviewed by Dan Bernstein.
2272
2273         Use WKActionSheetAssistant to show a link action sheet in response to long-pressing on a link. Have WKPDFView
2274         conform to WKActionSheetAssistantDelegate in order to respond to the open and copy actions as well as to
2275         provide the link's URL and position information to WKActionSheetAssistant. The long-pressed link is highlighted
2276         for .75 seconds before the sheet is displayed in order to match UIWebPDFView.
2277
2278         * UIProcess/ios/WKActionSheetAssistant.h: Made protocol methods that WKPDFView doesn't implement optional.
2279         * UIProcess/ios/WKActionSheetAssistant.mm:
2280         (-[WKActionSheetAssistant updatePositionInformation]): Checked if delegate responds to
2281         updatePositionInformationForActionSheetAssistant: before calling.
2282         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Checked if delegate responds to
2283         actionSheetAssistant:willStartInteractionWithElement: before calling.
2284         (-[WKActionSheetAssistant cleanupSheet]): Checked if delegate responds to actionSheetAssistantDidStopInteraction:
2285         before calling.
2286         * UIProcess/ios/WKPDFView.h: Conformed to WKActionSheetAssistantDelegate.
2287         * UIProcess/ios/WKPDFView.mm:
2288         (-[WKPDFView web_initWithFrame:webView:]): Instantiated a WKActionSheetAssistant and set self as its delegate.
2289         (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]): Moved highlight drawing to here from
2290         annotation:wasTouchedAtPoint:controller: in order to be reused for long-press.
2291         (-[WKPDFView _URLForLinkAnnotation:]): Moved URL creation to here from annotation:wasTouchedAtPoint:controller:
2292         in order to be reused for long-press. Generated an absolute URL since this URL might go into the pasteboard.
2293         (-[WKPDFView annotation:wasTouchedAtPoint:controller:]): Changed to call
2294         _highlightLinkAnnotation:forDuration:completionHandler: and _URLForLinkAnnotation:.
2295         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]): Set values on _positionInformation and called
2296         -[WKActionSheetAssistant showLinkSheet] after showing a highlight for .75 seconds.
2297         (-[WKPDFView positionInformation]): Returned _positionInformation.
2298         (-[WKPDFView performAction:]): Added a UTF-8 text and URL representation of the pressed URL to the pasteboard.
2299         (-[WKPDFView openElementAtLocation:]): Called WebPage::navigateToURLWithSimulatedClick().
2300         (-[WKPDFView actionsForElement:defaultActions:]): Returned actions from UIClient::actionsForElement().
2301         (-[WKPDFView _createHighlightViewWithFrame:]): Deleted.
2302
2303 2014-11-04  Anders Carlsson  <andersca@apple.com>
2304
2305         Try to fix the 32-bit build.
2306
2307         * UIProcess/mac/WKActionMenuController.mm:
2308         (-[WKActionMenuController _defaultMenuItemsForLink]):
2309         (-[WKActionMenuController _createActionMenuItemForTag:]):
2310
2311 2014-11-04  Conrad Shultz  <conrad_shultz@apple.com>
2312
2313         Use a web view for Quick Look in action menus
2314         https://bugs.webkit.org/show_bug.cgi?id=138370
2315
2316         Reviewed by Anders Carlsson.
2317
2318         Instead of using the QLPreviewBubble SPI, show a popover containing a web view. This currently
2319         does not inherit any configuration from the presenting WKView and does not expose any
2320         customization options.
2321
2322         * UIProcess/mac/WKActionMenuController.mm:
2323         Declare new internal NSViewController subclass, WKPagePreviewViewController.
2324         (-[WKPagePreviewViewController initWithPageURL:]):
2325         Store the passed-in URL and set a somewhat arbitrary (iPhone 5 screen size) default preferred size.
2326         (-[WKPagePreviewViewController loadView]):
2327         Create a WKWebView and load the URL passed into the initializer.
2328         (-[WKActionMenuController _previewURLFromActionMenu:]):
2329         Renamed from -_quickLookURLFromActionMenu:; present the popover returned by -_createPreviewPopoverForURL:.
2330         (-[WKActionMenuController _createPreviewPopoverForURL:]):
2331         New helper method; return a popover that owns a _WKPagePreviewViewController configured to show a scaled-down web page.
2332         (-[WKActionMenuController _createActionMenuItemForTag:]):
2333         Update to reflect method rename.
2334         (-[WKActionMenuController _quickLookURLFromActionMenu:]): Deleted.
2335
2336 2014-11-04  Chris Dumez  <cdumez@apple.com>
2337
2338         Add ptr() method to Ref class
2339         https://bugs.webkit.org/show_bug.cgi?id=138361
2340
2341         Reviewed by Darin Adler.
2342
2343         Use the new Ref::ptr() method.
2344
2345         * UIProcess/WebContext.cpp:
2346         (WebKit::WebContext::createWebPage):
2347         * UIProcess/WebPageProxy.cpp:
2348         (WebKit::WebPageProxy::setPreferences):
2349         * UIProcess/WebProcessProxy.cpp:
2350         (WebKit::WebProcessProxy::didNavigateWithNavigationData):
2351         (WebKit::WebProcessProxy::didPerformClientRedirect):
2352         (WebKit::WebProcessProxy::didPerformServerRedirect):
2353         (WebKit::WebProcessProxy::didUpdateHistoryTitle):
2354
2355 2014-11-04  Andy Estes  <aestes@apple.com>
2356
2357         [iOS] Include a WKActionSheetAssistant parameter in WKActionSheetAssistantDelegate methods
2358         https://bugs.webkit.org/show_bug.cgi?id=137792
2359
2360         Reviewed by Dan Bernstein.
2361
2362         * UIProcess/API/Cocoa/_WKElementAction.mm:
2363         (+[_WKElementAction elementActionWithTitle:actionHandler:]):
2364         (+[_WKElementAction elementActionWithType:customTitle:]):
2365         (-[_WKElementAction _runActionWithElementInfo:forActionSheetAssistant:]):
2366         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
2367         * UIProcess/ios/WKActionSheetAssistant.h:
2368         * UIProcess/ios/WKActionSheetAssistant.mm:
2369         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
2370         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
2371         (-[WKActionSheetAssistant updatePositionInformation]):
2372         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
2373         (-[WKActionSheetAssistant showImageSheet]):
2374         (-[WKActionSheetAssistant showLinkSheet]):
2375         (-[WKActionSheetAssistant showDataDetectorsSheet]):
2376         (-[WKActionSheetAssistant cleanupSheet]):
2377         * UIProcess/ios/WKContentViewInteraction.mm:
2378         (-[WKContentView positionInformationForActionSheetAssistant:]):
2379         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
2380         (-[WKContentView actionSheetAssistant:performAction:]):
2381         (-[WKContentView actionSheetAssistant:openElementAtLocation:]):
2382         (-[WKContentView actionSheetAssistant:decideActionsForElement:defaultActions:]):
2383         (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
2384         (-[WKContentView actionSheetAssistantDidStopInteraction:]):
2385
2386 2014-11-04  Csaba Osztrogonác  <ossy@webkit.org>
2387
2388          URTBF after r175564 for !PLATFORM(COCOA).
2389
2390         * Shared/TextIndicator.cpp:
2391
2392 2014-11-04  Tim Horton  <timothy_horton@apple.com>
2393
2394         Implement yellow highlight over data detected items
2395         https://bugs.webkit.org/show_bug.cgi?id=138340
2396         <rdar://problem/18840102>
2397
2398         Reviewed by Anders Carlsson.
2399
2400         * Shared/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/TextIndicator.cpp.
2401         * Shared/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/TextIndicator.h.
2402         Move TextIndicator to Shared.
2403         Move all of the members to a Data struct.
2404         Implement encode/decode for TextIndicator::Data, so it can be passed as
2405         the argument to SetTextIndicator, and also as a field on ActionMenuHitTestResult.
2406         Add 'createWithSelectionInFrame', which builds a TextIndicator
2407         from the selection in the given frame.
2408
2409         * Shared/mac/ActionMenuHitTestResult.h:
2410         * Shared/mac/ActionMenuHitTestResult.mm:
2411         (WebKit::ActionMenuHitTestResult::encode):
2412         (WebKit::ActionMenuHitTestResult::decode):
2413         Rename actionBoundingBox to detectedDataBoundingBox.
2414         Store/encode/decode detectedDataTextIndicator.
2415
2416         * UIProcess/WebPageProxy.cpp:
2417         (WebKit::WebPageProxy::setTextIndicator):
2418         * UIProcess/WebPageProxy.h:
2419         * UIProcess/WebPageProxy.messages.in:
2420         Create a TextIndicator from the TextIndicator::Data.
2421         Add an explicit ClearTextIndicator message instead of sending empty Data.
2422         
2423         * UIProcess/mac/WKActionMenuController.h:
2424         * UIProcess/mac/WKActionMenuController.mm:
2425         (-[WKActionMenuController prepareForMenu:withEvent:]):
2426         If the text indicator is up when preparing for a new menu invocation, hide it.
2427
2428         (-[WKActionMenuController willOpenMenu:withEvent:]):
2429         Show the text indicator when the menu opens, for data detected items.
2430
2431         (-[WKActionMenuController didCloseMenu:withEvent:]):
2432         Hide the text indicator when the menu closes, unless we only had one item.
2433         Then, we'll hide it in the DDActionContext completionHandler block.
2434         
2435         (-[WKActionMenuController _showTextIndicator]):
2436         (-[WKActionMenuController _hideTextIndicator]):
2437         Added. Show and hide the text indicator based on the TextIndicator
2438         data included in the action menu hit test result.
2439
2440         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
2441         Hide the text indicator when the data detector popover completes.
2442
2443         * WebKit2.xcodeproj/project.pbxproj:
2444         * WebProcess/WebPage/FindController.cpp:
2445         (WebKit::FindController::getImageForFindMatch):
2446         Make use of the newly-moved createSelectionSnapshot.
2447
2448         (WebKit::FindController::updateFindIndicator):
2449         Make use of TextIndicator::createWithSelectionInFrame, which allows
2450         us to share this code for building a TextIndicator with other callers.
2451
2452         (WebKit::FindController::hideFindIndicator):
2453
2454         (WebKit::getFindIndicatorBitmap): Deleted.
2455         Move getFindIndicatorBitmap to WebFrame::createSelectionSnapshot.
2456
2457         * WebProcess/WebPage/WebFrame.cpp:
2458         (WebKit::WebFrame::createSelectionSnapshot):
2459         Moved from FindController's getFindIndicatorBitmap.
2460         Now returns a ShareableBitmap instead of going ahead and making a Handle.
2461
2462         * WebProcess/WebPage/WebFrame.h:
2463         * WebProcess/WebPage/mac/WebPageMac.mm:
2464         (WebKit::scanForDataDetectedItems):
2465         (WebKit::textIndicatorForRange):
2466         Temporarily change the selection to the given range, then use
2467         TextIndicator::indicatorWithSelectionInFrame to acquire a TextIndicator,
2468         then reset the selection.
2469
2470         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2471         Create a TextIndicator from the data detected range.
2472
2473 2014-11-04  Andy Estes  <aestes@apple.com>
2474
2475         Fix the iOS build after r175549.
2476
2477         * WebProcess/WebPage/ios/WebPageIOS.mm:
2478         (WebKit::WebPage::performActionOnElement):
2479
2480 2014-11-04  Darin Adler  <darin@apple.com>
2481
2482         Eliminate ResourceBuffer and use SharedBuffer directly instead
2483         https://bugs.webkit.org/show_bug.cgi?id=138174
2484
2485         Reviewed by Antti Koivisto.
2486
2487         * CMakeLists.txt: Removed WebResourceBuffer.cpp.
2488
2489         * NetworkProcess/NetworkResourceLoader.cpp:
2490         (WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer.
2491         * NetworkProcess/NetworkResourceLoader.h: Ditto.
2492         * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto.
2493         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
2494         (WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto.
2495         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
2496         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto.
2497
2498         * Shared/WebResourceBuffer.cpp: Removed.
2499         * Shared/WebResourceBuffer.h: Removed.
2500
2501         * WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h.
2502
2503         * WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes.
2504         (WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead
2505         of a pointer.
2506
2507         * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include.
2508         * WebProcess/Network/WebResourceLoader.cpp: Ditto.
2509         * WebProcess/Network/WebResourceLoader.h: Ditto.
2510         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto.
2511         (WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly.
2512         * WebProcess/WebPage/WebFrame.cpp:
2513         (WebKit::WebFrame::source): Ditto.
2514
2515         * WebProcess/WebPage/WebPage.cpp:
2516         (WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship
2517         between the buffer and the DataReference clearer and to avoid having a long-lived
2518         DataReference pointing to an underlying buffer with unclear lifetime.
2519         (WebKit::WebPage::getContentsAsString): Ditto.
2520         (WebKit::WebPage::getSelectionAsWebArchiveData): Ditto.
2521         (WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly.
2522         (WebKit::WebPage::getResourceDataFromFrame): Ditto.
2523         (WebKit::WebPage::getWebArchiveOfFrame): Ditto.
2524
2525         * WebProcess/WebPage/ios/WebPageIOS.mm:
2526         (WebKit::containingLinkElement): Use elementLineage.
2527         (WebKit::WebPage::performActionOnElement): Use references and SharedBuffer.
2528         ALso did a bit of other cleanup in here.
2529         (WebKit::isAssistableElement): Take Element& instead of Node*, since that's what
2530         the caller has.
2531         (WebKit::nextAssistableElement): Changed name to match what the function does.
2532         Added an obviously-missing check on the startNode argument. Updated for change
2533         to isAssistableElement above. Take a Page& instead of a Page*.
2534         (WebKit::hasAssistableElement): Changed name to match what the function does.
2535         Updated for change to nextAssistableElement above. Took out incorrect comparison
2536         of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*.
2537         (WebKit::WebPage::focusNextAssistedNode): Updated for above changes.
2538         (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes.
2539
2540 2014-11-04  Tim Horton  <timothy_horton@apple.com>
2541
2542         Dictionary lookup panel pops up at random when clicking on selected text
2543         https://bugs.webkit.org/show_bug.cgi?id=138353
2544         <rdar://problem/18861406>
2545
2546         * WebProcess/WebPage/WebPage.h:
2547         Fix the build; this needs to be public.
2548
2549         * WebProcess/WebPage/mac/WebPageMac.mm:
2550         (WebKit::rangeForDictionaryLookupAtHitTestResult):
2551         Use the right selection (the one we just tested) in the change from r175517.
2552
2553 2014-11-04  Tim Horton  <timothy_horton@apple.com>
2554
2555         Dictionary lookup panel pops up at random when clicking on selected text
2556         https://bugs.webkit.org/show_bug.cgi?id=138353
2557         <rdar://problem/18861406>
2558
2559         Reviewed by Andreas Kling.
2560
2561         * WebProcess/WebPage/WebPage.h:
2562         * WebProcess/WebPage/mac/WebPageMac.mm:
2563         (WebKit::rangeForDictionaryLookupForSelection):
2564         (WebKit::rangeForDictionaryLookupAtHitTestResult):
2565         Factor rangeForDictionaryLookupForSelection out of performDictionaryLookupForSelection.
2566
2567         Make use of rangeForDictionaryLookupForSelection in rangeForDictionaryLookupAtHitTestResult,
2568         returning the selection-based range if the hit test intersects the selected text.
2569         Previously, we were just going forward with performDictionaryLookupForSelection,
2570         which would actually *do* the lookup, even if we just wanted to retrieve the range.
2571
2572         Make rangeForDictionaryLookup* static.
2573
2574         (WebKit::WebPage::performDictionaryLookupForSelection):
2575         Make use of rangeForDictionaryLookupForSelection.
2576
2577 2014-11-03  Chris Dumez  <cdumez@apple.com>
2578
2579         Allow implicit conversion from Ref<T> to T&
2580         https://bugs.webkit.org/show_bug.cgi?id=138331
2581
2582         Reviewed by Andreas Kling.
2583
2584         Remove unnecessary calls to Ref<T>::get() now that a Ref<T> can be
2585         converted implicitly to a T&.
2586
2587 2014-11-03  Simon Fraser  <simon.fraser@apple.com>
2588
2589         Expose visibleDebugOverlayRegions pref via the WK2 C SPI
2590         https://bugs.webkit.org/show_bug.cgi?id=138342
2591
2592         Reviewed by Dan Bernstein.
2593         
2594         Expose WKDebugOverlayRegions via the C SPI.
2595         
2596         * UIProcess/API/C/WKPreferences.cpp:
2597         (WKPreferencesSetVisibleDebugOverlayRegions):
2598         (WKPreferencesGetVisibleDebugOverlayRegions):
2599         * UIProcess/API/C/WKPreferencesRef.h:
2600
2601 2014-11-03  Beth Dakin  <bdakin@apple.com>
2602
2603         Implement action menus for editable text with spelling suggestions
2604         https://bugs.webkit.org/show_bug.cgi?id=138333
2605         -and corresponding-
2606         rdar://problem/18742371
2607
2608         Reviewed by Tim Horton.
2609
2610         New types.
2611         * Shared/API/c/WKActionMenuItemTypes.h:
2612         * Shared/API/c/WKActionMenuTypes.h:
2613
2614         ActionMenuHitTestResult now stores the String result of the lookup.
2615         * Shared/mac/ActionMenuHitTestResult.h:
2616         * Shared/mac/ActionMenuHitTestResult.mm:
2617         (WebKit::ActionMenuHitTestResult::encode):
2618         (WebKit::ActionMenuHitTestResult::decode):
2619
2620         Make getGuessesForWord() public so we can call it from WKActionMenuController.
2621         * UIProcess/WebPageProxy.h:
2622         * UIProcess/mac/WKActionMenuController.mm:
2623
2624         Select the text for all types of text menus.
2625         (-[WKActionMenuController isMenuForTextContent]):
2626         (-[WKActionMenuController willOpenMenu:withEvent:]):
2627
2628         Spelling suggestions are presented in a sub-menu and will replace the selection 
2629         when chosen.
2630         (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions:]):
2631         (-[WKActionMenuController _changeSelectionToSuggestion:]):
2632         (-[WKActionMenuController _createActionMenuItemForTag:]):
2633         (-[WKActionMenuController _defaultMenuItems:]):
2634
2635         New function to store the lookupText as a String on the ActionMenuHitTestResult.
2636         * WebProcess/WebPage/WebPage.h:
2637         * WebProcess/WebPage/mac/WebPageMac.mm:
2638         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2639         (WebKit::WebPage::lookupTextAtLocation):
2640
2641 2014-11-03  Simon Fraser  <simon.fraser@apple.com>
2642
2643         Add page overlays that show regions with mouseWheel event handlers, and the non-fast-scrollable region, and code to toggle them in MiniBrowser WK2
2644         https://bugs.webkit.org/show_bug.cgi?id=138257
2645
2646         Reviewed by Tim Horton.
2647         
2648         Add private prefs to control visibility of debug-related page region overlays.
2649
2650         * Shared/WebPreferencesDefinitions.h:
2651         * UIProcess/API/Cocoa/WKPreferences.mm:
2652         (-[WKPreferences _visibleDebugOverlayRegions]):
2653         (-[WKPreferences _setVisibleDebugOverlayRegions:]):
2654         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2655         * UIProcess/mac/WebPreferencesMac.mm:
2656         (WebKit::setDebugUInt32ValueIfInUserDefaults):
2657         * WebProcess/WebPage/WebPage.cpp:
2658         (WebKit::WebPage::updatePreferences):
2659         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2660         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences): Update the overlays.
2661         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2662         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences): Update the overlays.
2663
2664 2014-11-03  Commit Queue  <commit-queue@webkit.org>
2665
2666         Unreviewed, rolling out r175406, r175413, and r175423.
2667         https://bugs.webkit.org/show_bug.cgi?id=138327
2668
2669         Multipart tests are still broken (Requested by ap on #webkit).
2670
2671         Reverted changesets:
2672
2673         "Eliminate ResourceBuffer and use SharedBuffer directly
2674         instead"
2675         https://bugs.webkit.org/show_bug.cgi?id=138174
2676         http://trac.webkit.org/changeset/175406
2677
2678         "Unreviewed, iOS build fix since 175406."
2679         http://trac.webkit.org/changeset/175413
2680
2681         "Fix assertion in CachedResource::addDataBuffer"
2682         http://trac.webkit.org/changeset/175423
2683
2684 2014-11-03  Tim Horton  <timothy_horton@apple.com>
2685
2686         _actionMenuItemsForHitTestResult is given kWKActionMenuLink but an empty array of defaultMenuItems
2687         https://bugs.webkit.org/show_bug.cgi?id=138321
2688         <rdar://problem/18855134>
2689
2690         Reviewed by Beth Dakin.
2691
2692         * UIProcess/mac/WKActionMenuController.mm:
2693         (-[WKActionMenuController _defaultMenuItemsForLink]):
2694         (-[WKActionMenuController _defaultMenuItems:]):
2695         Move the HTTP-family-URLs-only condition to the place where we decide what kind of menu to
2696         show. We depend on _defaultMenuItemsForLink returning the link menu, and should never
2697         set the link menu type if we aren't going to build a link menu.
2698
2699 2014-11-03  Tim Horton  <timothy_horton@apple.com>
2700
2701         Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap
2702         https://bugs.webkit.org/show_bug.cgi?id=138300
2703         <rdar://problem/18855863>
2704
2705         Reviewed by Simon Fraser.
2706
2707         Share more code by using WebCore's FrameSnapshotting::snapshotSelection
2708         in FindController instead of copying it into FindController wholesale.
2709
2710         * WebProcess/WebPage/FindController.cpp:
2711         (WebKit::getFindIndicatorBitmap):
2712         Make getFindIndicatorBitmap static, rename it from getFindIndicatorBitmapAndRect,
2713         and drop the rect argument because only one caller wanted it, and we no longer need
2714         to compute it (this happens in WebCore now).
2715
2716         Use snapshotSelection; all of the removed paint behaviors get added by
2717         code in or underneath snapshotSelection now.
2718
2719         Draw the snapshot into our ShareableBitmap; we could avoid this in a future patch
2720         by refactoring the FrameSnapshotting functions to take GraphicsContexts.
2721
2722         (WebKit::FindController::getImageForFindMatch):
2723         (WebKit::FindController::updateFindIndicator):
2724         Adopt the new getFindIndicatorBitmap.
2725
2726         * WebProcess/WebPage/FindController.h:
2727         Remove getFindIndicatorBitmap(AndRect), which is now static.
2728
2729 2014-11-03  Csaba Osztrogonác  <ossy@webkit.org>
2730
2731         URTBF after r175476 to make GTK and EFL build happy.
2732
2733         * UIProcess/API/gtk/PageClientImpl.cpp:
2734         (WebKit::PageClientImpl::setTextIndicator):
2735         (WebKit::PageClientImpl::setFindIndicator): Deleted.
2736         * UIProcess/API/gtk/PageClientImpl.h:
2737         * UIProcess/CoordinatedGraphics/WebView.cpp:
2738         (WebKit::WebView::setTextIndicator):
2739         (WebKit::WebView::setFindIndicator): Deleted.
2740         * UIProcess/CoordinatedGraphics/WebView.h:
2741
2742 2014-11-03  Tim Horton  <timothy_horton@apple.com>
2743
2744         Rename FindIndicator{Window} to TextIndicator{Window}
2745         https://bugs.webkit.org/show_bug.cgi?id=138302
2746         <rdar://problem/18855190>
2747
2748         Reviewed by Anders Carlsson.
2749
2750         Rename FindIndicator{Window} to TextIndicator{Window} (and related),
2751         because it will soon be used to indicate ranges of text that are not
2752         necessarily find-in-page results.
2753
2754         FindController still has things named 'findIndicator' internally,
2755         and I left the API alone (because all the API bits are actually find-specific),
2756         but the actual FindIndicator/Window and the message to set it up, etc. are all
2757         now called Text*.
2758
2759         * CMakeLists.txt:
2760         * UIProcess/API/mac/WKView.mm:
2761         * UIProcess/API/mac/WKViewInternal.h:
2762         * UIProcess/PageClient.h:
2763         * UIProcess/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/FindIndicator.cpp.
2764         * UIProcess/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/FindIndicator.h.
2765         * UIProcess/WebPageProxy.cpp:
2766         * UIProcess/WebPageProxy.h:
2767         * UIProcess/WebPageProxy.messages.in:
2768         * UIProcess/ios/PageClientImplIOS.h:
2769         * UIProcess/ios/PageClientImplIOS.mm:
2770         * UIProcess/ios/WKContentView.h:
2771         * UIProcess/mac/PageClientImpl.h:
2772         * UIProcess/mac/PageClientImpl.mm:
2773         * UIProcess/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h.
2774         * UIProcess/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm.
2775         * WebKit2.xcodeproj/project.pbxproj:
2776         * WebProcess/WebPage/FindController.cpp:
2777
2778 2014-11-03  Beth Dakin  <bdakin@apple.com>
2779
2780         Implement action menus for editable text
2781         https://bugs.webkit.org/show_bug.cgi?id=138284
2782         -and corresponding-
2783         rdar://problem/18742323
2784
2785         Reviewed by Tim Horton.
2786
2787         New item type for paste.
2788         * Shared/API/c/WKActionMenuItemTypes.h:
2789
2790         New menu type for editable text.
2791         * Shared/API/c/WKActionMenuTypes.h:
2792         * UIProcess/mac/WKActionMenuController.mm:
2793
2794         willOpenMenu should select text for both regular text menus and editable text 
2795         menus. 
2796         (-[WKActionMenuController willOpenMenu:withEvent:]):
2797
2798         Default items for editable text.
2799         (-[WKActionMenuController _defaultMenuItemsForEditableText]):
2800         (-[WKActionMenuController _paste:]):
2801         (-[WKActionMenuController _createActionMenuItemForTag:]):
2802
2803         New method _hitTestResultForStage:(MenuUpdateStage)stage will figure out whether 
2804         we can use the WebHitTestResult from the ActionMenuHitTestResult or if we have to 
2805         use the potentially out-of-date WebHitTestResult that is cached on WebPageProxy. 
2806         An important difference between these results is that the ActionMenuHitTest 
2807         result, in addition to being more recent and accurate, also now includes shadow 
2808         content, which affects some editable regions on important sites such as 
2809         bugs.webkit.org and nytimes.com.
2810         (-[WKActionMenuController _defaultMenuItems:]):
2811         (-[WKActionMenuController _updateActionMenuItemsForStage:]):
2812         (imageForResource:name::if): Deleted.
2813
2814         Allow shadow content in action menu hit testing.
2815         * WebProcess/WebPage/mac/WebPageMac.mm:
2816         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2817         (WebKit::WebPage::selectLookupTextAtLocation):
2818
2819 2014-11-03  Ada Chan  <adachan@apple.com>
2820
2821         Persist the page's muted state across web process crashes.
2822         https://bugs.webkit.org/show_bug.cgi?id=138195
2823
2824         Reviewed by Anders Carlsson.
2825
2826         Store the Page's muted state in WebPageCreationParameters so that state can be properly
2827         restored after recovering from a crash in the web process.
2828
2829         * Shared/WebPageCreationParameters.cpp:
2830         (WebKit::WebPageCreationParameters::encode):
2831         (WebKit::WebPageCreationParameters::decode):
2832         * Shared/WebPageCreationParameters.h:
2833         * UIProcess/WebPageProxy.cpp:
2834         (WebKit::WebPageProxy::WebPageProxy):
2835         Initialize m_muted.
2836         (WebKit::WebPageProxy::setMuted):
2837         Update m_muted.
2838         (WebKit::WebPageProxy::creationParameters):
2839         Set the muted data member in WebPageCreationParameters.
2840         * UIProcess/WebPageProxy.h:
2841         * WebProcess/WebPage/WebPage.cpp:
2842         (WebKit::WebPage::WebPage):
2843         Initialize the page's muted state with the muted value from WebPageCreationParameters.
2844
2845 2014-11-03  Ryuan Choi  <ryuan.choi@gmail.com>
2846
2847         [EFL] Remove dependency of PageViewportController from PageViewportControllerClient
2848         https://bugs.webkit.org/show_bug.cgi?id=138301
2849
2850         Reviewed by Gyuyoung Kim.
2851
2852         PaeViewportControllerClient does not need to keep the instance of PageViewPortController.
2853         This patch removes it to simplify relation between them.
2854         In addition, uses a reference for the client of PageViewportController.
2855
2856         * UIProcess/API/efl/EwkView.cpp:
2857         (EwkView::EwkView):
2858         (EwkView::setViewportPosition):
2859         * UIProcess/API/efl/EwkView.h:
2860         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
2861         (WebKit::PageViewportController::PageViewportController):
2862         (WebKit::PageViewportController::didChangeContentsSize):
2863         (WebKit::PageViewportController::didRenderFrame):
2864         (WebKit::PageViewportController::pageDidRequestScroll):
2865         (WebKit::PageViewportController::syncVisibleContents):
2866         (WebKit::PageViewportController::didChangeViewportAttributes):
2867         * UIProcess/CoordinatedGraphics/PageViewportController.h:
2868         * UIProcess/PageViewportControllerClient.h:
2869         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
2870         (WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl):
2871         (WebKit::PageViewportControllerClientEfl::setViewportPosition):
2872         (WebKit::PageViewportControllerClientEfl::setController): Deleted.
2873         * UIProcess/efl/PageViewportControllerClientEfl.h:
2874
2875 2014-11-03  Sungmann Cho  <sungmann.cho@navercorp.com>
2876
2877         AX: Fix some minor typos related to the word "accessibility".
2878         https://bugs.webkit.org/show_bug.cgi?id=138299
2879
2880         Reviewed by Chris Fleizach.
2881
2882         No new tests, no behavior change.
2883
2884         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
2885
2886 2014-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2887
2888         REGRESSION(r163656): Remote inspector doesn't work unless preferences change after page initialization
2889         https://bugs.webkit.org/show_bug.cgi?id=138246
2890
2891         Reviewed by Joseph Pecoraro.
2892
2893         The problem is that initializeWebPage() is still using
2894         pageGroup().preferences() instead of m_preferences to check if
2895         developer extras are enabled to enable remote inspection of the page.
2896
2897         * UIProcess/WebPageProxy.cpp:
2898         (WebKit::WebPageProxy::initializeWebPage): Use m_preferences
2899         instead of pageGroup().preferences().
2900
2901 2014-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2902
2903         REGRESSION(CMake): Make it possible to build without introspection
2904         https://bugs.webkit.org/show_bug.cgi?id=138006
2905
2906         Reviewed by Philippe Normand.
2907
2908         Do not install introspection files when introspection is disabled.
2909
2910         * PlatformGTK.cmake:
2911
2912 2014-10-31  Dan Bernstein  <mitz@apple.com>
2913
2914         Removed a reference to a file that’s been deleted.
2915
2916         * WebKit2.xcodeproj/project.pbxproj: Removed reference to XPCPtr.h.
2917
2918 2014-10-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2919
2920         Use std::unique_ptr instead of OwnPtr in CoordinatorDrawingProxy
2921         https://bugs.webkit.org/show_bug.cgi?id=138238
2922
2923         Reviewed by Ryosuke Niwa.
2924
2925         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
2926         (WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy): Use std::make_unique.
2927         (WebKit::CoordinatedDrawingAreaProxy::enterAcceleratedCompositingMode):
2928         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h: Use std::unique_ptr instead of OwnPtr.
2929
2930 2014-10-31  Sam Weinig  <sam@webkit.org>
2931
2932         Add bundle SPI to customize the action menu
2933         <rdar://problem/18830771>
2934         https://bugs.webkit.org/show_bug.cgi?id=138271
2935
2936         Reviewed by Anders Carlsson.
2937
2938         - Adds a new function to the WKBundlePageContextMenuClient that allows the client to pass construct
2939           user data in the bundle that can be available when customizing the menu in -[WKView _actionMenuItemsForHitTestResult...].
2940         - Changes the signature of  -[WKView _actionMenuItemsForHitTestResult...] to add userData.
2941         - Makes the actual hit test result available in the second invocation of -[WKView _actionMenuItemsForHitTestResult...]
2942           by serializing it in the ActionMenuHitTestResult.
2943
2944         * Shared/mac/ActionMenuHitTestResult.h:
2945         * Shared/mac/ActionMenuHitTestResult.mm:
2946         (WebKit::ActionMenuHitTestResult::encode):
2947         (WebKit::ActionMenuHitTestResult::decode):
2948         Adds the WebHitTestResult and the original hit test request location.
2949         
2950         * UIProcess/API/Cocoa/WKViewPrivate.h:
2951         Adds a new version of _actionMenuItemsForHitTestResult that passes userData along.
2952
2953         * UIProcess/API/mac/WKView.mm:
2954         (-[WKView _didPerformActionMenuHitTest:userData:]):
2955         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]):
2956         * UIProcess/API/mac/WKViewInternal.h:
2957         * UIProcess/PageClient.h:
2958         * UIProcess/WebPageProxy.cpp:
2959         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
2960         * UIProcess/WebPageProxy.h:
2961         * UIProcess/WebPageProxy.messages.in:
2962         * UIProcess/mac/PageClientImpl.h:
2963         * UIProcess/mac/PageClientImpl.mm:
2964         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
2965         Pipe the user data through to the WKView.
2966
2967         * UIProcess/mac/WKActionMenuController.h:
2968         * UIProcess/mac/WKActionMenuController.mm:
2969         (-[WKActionMenuController prepareForMenu:withEvent:]):
2970         (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
2971         (-[WKActionMenuController menuNeedsUpdate:]):
2972         (-[WKActionMenuController _updateActionMenuItemsForStage:]):
2973         Differentiate between the two times _updateActionMenuItems was called via a new stage parameter,
2974         (it is called once in prepareForMenu, and once in menuNeedsUpdate). Use the last mouse move hit
2975         test result in the prepareForMenu case (as we don't have a real result yet), and the hit result
2976         passed in via didPerformActionMenuHitTest in the menuNeedsUpdate case (assuming we didn't time out)
2977         waiting on the web process.
2978
2979         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
2980         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
2981         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu):
2982         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
2983         * WebProcess/WebPage/mac/WebPageMac.mm:
2984         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2985         Adds new bundle SPI to collect user data to pass to the -[WKView _actionMenuItemsForHitTestResult...] method.
2986
2987 2014-10-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2988
2989         Use std::unique_ptr for TypeCountSet
2990         https://bugs.webkit.org/show_bug.cgi?id=138242
2991
2992         Reviewed by Andreas Kling.
2993
2994         * WebProcess/WebProcess.cpp:
2995         (WebKit::WebProcess::getWebCoreStatistics): Use std::unique_ptr<> instead of OwnPtr.
2996
2997 2014-10-30  Jer Noble  <jer.noble@apple.com>
2998
2999         [WK2] Send origin & deletion requests to WebProcessess in additon to the DatabaseProcess.
3000         https://bugs.webkit.org/show_bug.cgi?id=138212
3001
3002         Reviewed by Brady Eidson.
3003
3004         Now that the WebProcess has its own WebOriginDataManager, WebOriginDataManagerProxy needs to
3005         send its origin and deletion messages to all the WebProcesses. This necessetates synchronizing
3006         all the various process's callbacks so that the final callback is only triggered once all the
3007         messaged processes reply.
3008
3009         Add a simple class, CallbackSynchronizer, which will keep track of outstanding process callbacks
3010         and which will trigger the final callback once all of them finish.
3011
3012         * UIProcess/WebOriginDataManagerProxy.cpp:
3013         (WebKit::CallbackSynchronizer::create):
3014         (WebKit::CallbackSynchronizer::~CallbackSynchronizer):
3015         (WebKit::CallbackSynchronizer::taskStarted):
3016         (WebKit::CallbackSynchronizer::taskCompleted):
3017         (WebKit::CallbackSynchronizer::CallbackSynchronizer):
3018         (WebKit::createSynchronizedCallback):
3019         (WebKit::sendMessageToAllProcessesInContext):
3020         (WebKit::WebOriginDataManagerProxy::getOrigins):
3021         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
3022         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates):
3023         (WebKit::WebOriginDataManagerProxy::deleteAllEntries):
3024
3025         Drive-by fix: check the correct enum value for WebMedia origin requests.
3026
3027         * WebProcess/WebProcess.cpp:
3028         (WebKit::WebProcess::getOrigins):
3029         (WebKit::WebProcess::deleteEntriesForOrigin):
3030         (WebKit::WebProcess::deleteEntriesModifiedBetweenDates):
3031         (WebKit::WebProcess::deleteAllEntries):
3032
3033 2014-10-31  Tim Horton  <timothy_horton@apple.com>
3034
3035         REGRESSION (r175376): Occasional null deref when doing a dictionary lookup
3036         https://bugs.webkit.org/show_bug.cgi?id=138261
3037         <rdar://problem/18841709>
3038
3039         Reviewed by Anders Carlsson.
3040
3041         * WebProcess/WebPage/mac/WebPageMac.mm:
3042         (WebKit::WebPage::performDictionaryLookupAtLocation):
3043         rangeForDictionaryLookupAtHitTestResult can easily return null.
3044
3045 2014-10-31  Beth Dakin  <bdakin@apple.com>
3046
3047         Use system art for action menus when possible
3048         https://bugs.webkit.org/show_bug.cgi?id=138260
3049
3050         Reviewed by Tim Horton.
3051
3052         * Resources/AddImageToPhotosTemplate.pdf: Removed.
3053         * Resources/CopyImageTemplate.pdf: Removed.
3054         * Resources/SaveImageToDownloadsTemplate.pdf: Removed.
3055         * Resources/ShareImageTemplate.pdf: Removed.
3056         * UIProcess/mac/WKActionMenuController.mm:
3057         (-[WKActionMenuController _createActionMenuItemForTag:]):
3058         * WebKit2.xcodeproj/project.pbxproj:
3059
3060 2014-10-31  Timothy Horton  <timothy_horton@apple.com>
3061
3062         Fix the build for Yosemite systems after r175417
3063
3064         * UIProcess/mac/WKActionMenuController.mm:
3065
3066 2014-10-31  Timothy Horton  <timothy_horton@apple.com>
3067
3068         Fix the build for pre-Yosemite systems after r175417
3069
3070         * UIProcess/API/mac/WKView.mm:
3071         (-[WKView dealloc]):
3072         (-[WKView initWithFrame:context:configuration:webView:]):
3073         * UIProcess/API/mac/WKViewInternal.h:
3074         * UIProcess/mac/PageClientImpl.mm:
3075         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
3076         * UIProcess/mac/WKActionMenuController.h:
3077         * UIProcess/mac/WKActionMenuController.mm:
3078
3079 2014-10-31  Timothy Horton  <timothy_horton@apple.com>
3080
3081         Remove "Add to iPhoto" from the action menu's sharing menu
3082         https://bugs.webkit.org/show_bug.cgi?id=138251
3083         <rdar://problem/18837197>
3084
3085         Reviewed by Anders Carlsson.
3086
3087         * UIProcess/mac/WKActionMenuController.mm:
3088         (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
3089         Retain/autorelease the new array.
3090
3091 2014-10-31  Tim Horton  <timothy_horton@apple.com>
3092
3093         Remove "Add to iPhoto" from the action menu's sharing menu
3094         https://bugs.webkit.org/show_bug.cgi?id=138251
3095         <rdar://problem/18837197>
3096
3097         Reviewed by Anders Carlsson.
3098
3099         * UIProcess/mac/WKActionMenuController.mm:
3100         (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
3101         Filter out "Add to iPhoto".
3102
3103 2014-10-31  Adrian Perez de Castro  <aperez@igalia.com>
3104
3105         [GTK] Support script message handlers WebKitUserContentManager
3106         https://bugs.webkit.org/show_bug.cgi?id=133730
3107
3108         Reviewed by Carlos Garcia Campos.
3109
3110         Support user script message handlers in WebKitUserContentManager.
3111         This needs building with ENABLE_USER_MESSAGE_HANDLERS, for which
3112         an option is added to the CMake build files. The option is disabled
3113         globally by default, and the WebKitGTK port enables it. On the API
3114         level, two new methods to register and unregister names are provided
3115         in the "window.webkit" namespace, and on message reception the
3116         "WebKitUserContentManager::script-message-received" signal is
3117         emitted, using the registered names as signal detail.
3118
3119         * UIProcess/API/gtk/WebKitJavascriptResult.cpp: Add a new private
3120         function to construct a WebKitJavascriptResult directly from a
3121         WebCore::SerializedScriptValue.
3122         (_WebKitJavascriptResult::_WebKitJavascriptResult): Ditto.
3123         (webkitJavascriptResultCreate): Ditto.
3124         * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h: Ditto.
3125         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
3126         (webkit_user_content_manager_class_init): Install the
3127         "script-message-received" signal.
3128         (webkit_user_content_manager_register_script_message_handler):
3129         Added.
3130         (webkit_user_content_manager_unregister_script_message_handler):
3131         Added.
3132         * UIProcess/API/gtk/WebKitUserContentManager.h: Added the new
3133         public API methods.
3134         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Ditto.
3135         * UIProcess/API/gtk/docs/webkit2gtk.types: Add
3136         webkit_user_content_manager_get_type() to the list in order to make
3137         gtk-doc to generate documentation for signals.
3138
3139 2014-10-31  Martin Hock  <mhock@apple.com>
3140
3141         Unreviewed, iOS build fix since 175406.
3142
3143         * WebProcess/WebPage/ios/WebPageIOS.mm:
3144         (WebKit::WebPage::performActionOnElement):
3145
3146 2014-10-30  Darin Adler  <darin@apple.com>
3147
3148         Eliminate ResourceBuffer and use SharedBuffer directly instead
3149         https://bugs.webkit.org/show_bug.cgi?id=138174
3150
3151         Reviewed by Antti Koivisto.
3152
3153         * CMakeLists.txt: Removed WebResourceBuffer.cpp.
3154
3155         * NetworkProcess/NetworkResourceLoader.cpp:
3156         (WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer.
3157         * NetworkProcess/NetworkResourceLoader.h: Ditto.
3158         * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto.
3159         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
3160         (WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto.
3161         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
3162         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto.
3163
3164         * Shared/WebResourceBuffer.cpp: Removed.
3165         * Shared/WebResourceBuffer.h: Removed.
3166
3167         * WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h.
3168
3169         * WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes.
3170         (WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead
3171         of a pointer.
3172
3173         * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include.
3174         * WebProcess/Network/WebResourceLoader.cpp: Ditto.
3175         * WebProcess/Network/WebResourceLoader.h: Ditto.
3176         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto.
3177         (WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly.
3178         * WebProcess/WebPage/WebFrame.cpp:
3179         (WebKit::WebFrame::source): Ditto.
3180
3181         * WebProcess/WebPage/WebPage.cpp:
3182         (WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship
3183         between the buffer and the DataReference clearer and to avoid having a long-lived
3184         DataReference pointing to an underlying buffer with unclear lifetime.
3185         (WebKit::WebPage::getContentsAsString): Ditto.
3186         (WebKit::WebPage::getSelectionAsWebArchiveData): Ditto.
3187         (WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly.
3188         (WebKit::WebPage::getResourceDataFromFrame): Ditto.
3189         (WebKit::WebPage::getWebArchiveOfFrame): Ditto.
3190
3191         * WebProcess/WebPage/ios/WebPageIOS.mm:
3192         (WebKit::containingLinkElement): Use elementLineage.
3193         (WebKit::WebPage::performActionOnElement): Use references and SharedBuffer.
3194         ALso did a bit of other cleanup in here.
3195         (WebKit::isAssistableElement): Take Element& instead of Node*, since that's what
3196         the caller has.
3197         (WebKit::nextAssistableElement): Changed name to match what the function does.
3198         Added an obviously-missing check on the startNode argument. Updated for change
3199         to isAssistableElement above. Take a Page& instead of a Page*.
3200         (WebKit::hasAssistableElement): Changed name to match what the function does.
3201         Updated for change to nextAssistableElement above. Took out incorrect comparison
3202         of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*.
3203         (WebKit::WebPage::focusNextAssistedNode): Updated for above changes.
3204         (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes.
3205
3206 2014-10-30  Jer Noble  <jer.noble@apple.com>
3207
3208         [EME] Add Setting for accessing storage location for MediaKeys data
3209         https://bugs.webkit.org/show_bug.cgi?id=138147
3210
3211         Reviewed by Brady Eidson.
3212
3213         * WebProcess/WebPage/WebPage.cpp:
3214         (WebKit::WebPage::WebPage): Pass from WebMediaKeyStorageManager into Settings.
3215
3216 2014-10-30  Dana Burkart  <dburkart@apple.com>
3217
3218         Workaround for <rdar://problem/18830639>
3219
3220         Unreviewed.
3221
3222         * Shared/API/Cocoa/WKFoundation.h:
3223
3224 2014-10-30  Dana Burkart  <dburkart@apple.com>
3225
3226         <rdar://problem/18821260> Prepare for the mysterious future
3227
3228         Reviewed by Lucas Forschler.
3229
3230         * Configurations/Base.xcconfig:
3231         * Configurations/DebugRelease.xcconfig:
3232         * Configurations/FeatureDefines.xcconfig:
3233         * Configurations/Version.xcconfig:
3234         * Configurations/WebContentService.Development.xcconfig:
3235         * Configurations/WebContentService.xcconfig:
3236         * Configurations/WebKit.xcconfig:
3237
3238 2014-10-30  Anders Carlsson  <andersca@apple.com>
3239
3240         Try to fix the iOS build.
3241
3242         * WebProcess/WebPage/WebPage.messages.in:
3243
3244 2014-10-30  Tim Horton  <timothy_horton@apple.com>
3245
3246         Long spins under rangeExpandedAroundPosition on Yahoo Mail
3247         https://bugs.webkit.org/show_bug.cgi?id=138223
3248         <rdar://problem/18819547>
3249
3250         Reviewed by Enrica Casucci.
3251
3252         * WebProcess/WebPage/mac/WebPageMac.mm:
3253         (WebKit::rangeExpandedAroundPositionByCharacters):
3254         Reimplement rangeExpandedAroundPosition to operate on characters instead of lines,
3255         and to use Position. Moving VisiblePositions by line can be very expensive in some cases,
3256         and for generating lookup/Data Detectors context, we don't care about that kind of precision.
3257         This makes this function ~1000x faster when it hits on a row in the Yahoo Mail message list.
3258
3259         (WebKit::WebPage::performDictionaryLookupAtLocation):
3260         (WebKit::scanForDataDetectedItems):
3261         Adopt the new rangeExpandedAroundPositionByCharacters, expanding 250 characters
3262         before and after, which roughly matches what we were usually getting going by line,
3263         and is a reasonable amount of context for these operations.
3264
3265 2014-10-30  Brady Eidson  <beidson@apple.com>
3266
3267         IndexedDB is deleting data when a PK is shared amongst two objectStores
3268         rdar://problem/18479306 and https://bugs.webkit.org/show_bug.cgi?id=137154
3269
3270         Reviewed by Jer Noble.
3271
3272         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3273         (WebKit::v1RecordsTableSchema): Store away the v1 schema for introspection into the database.
3274         (WebKit::v2RecordsTableSchema): Add utility methods to get the v2 schema with different Table names.
3275         (WebKit::createOrMigrateRecordsTableIfNecessary): Check to see if the Records table exists with
3276           the correct schema. If it is the v1 schema, then migrate the data to a new v2 table, drop the v1
3277           table, then slide the new table into place.
3278         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::ensureValidRecordsTable): Make sure the Records table
3279           exists and is v2, and then make sure the uniqueness index exists.
3280         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Don’t bother creating
3281           the Records table here as it will have already been established earlier.
3282         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata):
3283         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
3284
3285 2014-10-30  Beth Dakin  <bdakin@apple.com>
3286
3287         Implement action menus for text
3288         https://bugs.webkit.org/show_bug.cgi?id=138220
3289         -and corresponding-
3290         rdar://problem/18742297
3291
3292         Reviewed by Tim Horton.
3293
3294         Two new types of actions for the two text actions.
3295         * Shared/API/c/WKActionMenuItemTypes.h:
3296
3297         One new type of menu.
3298         * Shared/API/c/WKActionMenuTypes.h:
3299
3300         Pass willOpenMenu on to the WKActionMenuController.
3301         * UIProcess/API/mac/WKView.mm:
3302         (-[WKView willOpenMenu:withEvent:]):
3303
3304         Two new WebPageProxy functions that will pass messages along to the web process.
3305         * UIProcess/WebPageProxy.cpp:
3306         (WebKit::WebPageProxy::selectLookupTextAtLocation):
3307         * UIProcess/WebPageProxy.h:
3308
3309         At willOpenMenu time, text menus should select text so that it is clear what the 
3310         menu actions will apply to.
3311         * UIProcess/mac/WKActionMenuController.h:
3312         * UIProcess/mac/WKActionMenuController.mm:
3313
3314         Menu items for text menus.
3315         (-[WKActionMenuController willOpenMenu:withEvent:]):
3316         (-[WKActionMenuController _defaultMenuItemsForText]):
3317         (-[WKActionMenuController _copyText:]):
3318         (-[WKActionMenuController _lookupText:]):
3319         (-[WKActionMenuController _createActionMenuItemForTag:]):
3320         (imageForResource:name::if):
3321
3322         New messages to the web process.
3323         * UIProcess/mac/WebPageProxyMac.mm:
3324         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
3325         * WebProcess/WebPage/WebPage.h:
3326         * WebProcess/WebPage/WebPage.messages.in:
3327
3328         Re-factor performDictionaryLookupAtLocation() to re-use the code that finds the 
3329         Range for the dictionary lookup. That code now lives in 
3330         rangeForDictionaryLookupAtHitTestResult() and can be used by 
3331         performDictionaryLookupAtLocation() and our new function 
3332         selectLookupTextAtLocation().
3333         * WebProcess/WebPage/mac/WebPageMac.mm:
3334         (WebKit::WebPage::rangeForDictionaryLookupAtHitTestResult):
3335         (WebKit::WebPage::performDictionaryLookupAtLocation):
3336
3337         Since the action menu text is always selected, when the lookup action is chosen, 
3338         we can just lookup the current selection.
3339         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
3340
3341         Uses the new function rangeForDictionaryLookupAtHitTestResult() to get a lookup 
3342         range and then select it.
3343         (WebKit::WebPage::selectLookupTextAtLocation):
3344
3345 2014-10-30  Dan Bernstein  <mitz@apple.com>
3346
3347         When a client certificate is rejected, Safari says the website didn’t accept the certificate “unknown” instead of naming the certificate
3348         https://bugs.webkit.org/show_bug.cgi?id=138216
3349
3350         Reviewed by Alexey Proskuryakov.
3351
3352         * Shared/cf/ArgumentCodersCF.cpp:
3353         (IPC::typeFromCFTypeRef): Remove no-longer-necessary platform guards around SecIdentityRef.
3354         (IPC::encode): Ditto.
3355         (IPC::decode): Ditto.
3356         * Shared/mac/WebCoreArgumentCodersMac.mm:
3357         (IPC::ArgumentCoder<ResourceError>::encodePlatformData): If NSErrorClientCertificateChainKey
3358         is present in the error’s userInfo dictionary, assert that it’s an array of identities and
3359         certificates, and include it in the filtered dictionary.
3360
3361 2014-10-29  Hunseop Jeong  <hs85.jeong@samsung.com>
3362
3363         [CoordinatedGraphics] Use modern for-loops
3364         https://bugs.webkit.org/show_bug.cgi?id=138168
3365
3366         Reviewed by Andreas Kling.
3367
3368         No new tests as there is no change in functionality.
3369
3370         * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: Use a modern for loop.
3371         (WebCore::CoordinatedBackingStore::texture):
3372         (WebCore::CoordinatedBackingStore::paintTilesToTextureMapper):
3373         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp: Use a modern for loop.
3374         (WebKit::CoordinatedDrawingAreaProxy::incorporateUpdate):
3375         * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: Use a modern for loop.
3376         (WebCore::CoordinatedGraphicsScene::setLayerChildrenIfNeeded):
3377         (WebCore::CoordinatedGraphicsScene::createLayers): changed the name of argument to be equal with deleteLayer(). 
3378         (WebCore::CoordinatedGraphicsScene::deleteLayers):
3379         (WebCore::CoordinatedGraphicsScene::createTilesIfNeeded):
3380         (WebCore::CoordinatedGraphicsScene::removeTilesIfNeeded):
3381         (WebCore::CoordinatedGraphicsScene::updateTilesIfNeeded):
3382         (WebCore::CoordinatedGraphicsScene::syncUpdateAtlases):
3383         (WebCore::CoordinatedGraphicsScene::syncImageBackings):
3384         (WebCore::CoordinatedGraphicsScene::commitSceneState):
3385         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: Use a modern for loop.
3386         (WebKit::shouldPaintBoundsRect):
3387         (WebKit::CoordinatedDrawingArea::display):
3388
3389 2014-10-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3390
3391         Unreviewed, EFL build fix since r175349.
3392
3393         * UIProcess/WebBackForwardList.cpp:
3394         (WebKit::WebBackForwardList::didRemoveItem): Use PLATFORM(COCOA) for setSnapshot().
3395
3396 2014-10-29  Tim Horton  <timothy_horton@apple.com>
3397
3398         Null deref under performActionMenuHitTestAtLocation
3399         https://bugs.webkit.org/show_bug.cgi?id=138197
3400         <rdar://problem/18817803>
3401
3402         Reviewed by Beth Dakin.
3403
3404         * WebProcess/WebPage/mac/WebPageMac.mm:
3405         (WebKit::scanForDataDetectedItems):
3406         Null-check the expanded range.
3407
3408 2014-10-28  Ada Chan  <adachan@apple.com>
3409
3410         Implement WKPageSetMuted(bool).
3411         https://bugs.webkit.org/show_bug.cgi?id=138158
3412
3413         Reviewed by Anders Carlsson.
3414
3415         * UIProcess/API/C/WKPage.cpp:
3416         (WKPageSetMuted):
3417         * UIProcess/API/C/WKPagePrivate.h:
3418         * UIProcess/WebPageProxy.cpp:
3419         (WebKit::WebPageProxy::setMuted):
3420         * UIProcess/WebPageProxy.h:
3421         * WebProcess/WebPage/WebPage.cpp:
3422         (WebKit::WebPage::setMuted):
3423         * WebProcess/WebPage/WebPage.h:
3424         * WebProcess/WebPage/WebPage.messages.in:
3425
3426 2014-10-29  Anders Carlsson  <andersca@apple.com>
3427
3428         Clear ViewSnapshots when back/forward list items are removed from their list
3429         https://bugs.webkit.org/show_bug.cgi?id=138188
3430         <rdar://problem/18817001>
3431
3432         Reviewed by Tim Horton.
3433
3434         Ideally we should remove the WebBackForwardListItem objects as well, but this is a somewhat safer fix.
3435
3436         Change all the "remove item" codepaths to call WebBackForwardList::didRemoveItem and have it clear out the snapshot.
3437
3438         * UIProcess/WebBackForwardList.cpp:
3439         (WebKit::WebBackForwardList::pageClosed):
3440         (WebKit::WebBackForwardList::addItem):
3441         (WebKit::WebBackForwardList::removeAllItems):
3442         (WebKit::WebBackForwardList::clear):
3443         (WebKit::WebBackForwardList::didRemoveItem):
3444         * UIProcess/WebBackForwardList.h:
3445
3446 2014-10-29  Tim Horton  <timothy_horton@apple.com>
3447
3448         Hide the 'Add to Photos' item if it isn't available
3449         https://bugs.webkit.org/show_bug.cgi?id=138182
3450         <rdar://problem/18814999>
3451
3452         Reviewed by Beth Dakin.
3453
3454         * UIProcess/mac/WKActionMenuController.mm:
3455         (-[WKActionMenuController _defaultMenuItemsForImage]):
3456         (-[WKActionMenuController _canAddImageToPhotos]):
3457         (-[WKActionMenuController _addImageToPhotos:]):
3458         Factor _canAddImageToPhotos out of _addImageToPhotos:, and use it in
3459         _defaultMenuItemsForImage to avoid including the menu item in the first place.
3460
3461 2014-10-29  Tim Horton  <timothy_horton@apple.com>
3462
3463         Rename WebPageProxy::activeActionMenuHitTestResult to lastMouseMoveHitTestResult
3464         https://bugs.webkit.org/show_bug.cgi?id=138137
3465         <rdar://problem/18798257>
3466
3467         Reviewed by Anders Carlsson.
3468
3469         * UIProcess/WebPageProxy.cpp:
3470         (WebKit::WebPageProxy::mouseDidMoveOverElement):
3471         * UIProcess/WebPageProxy.h:
3472         (WebKit::WebPageProxy::lastMouseMoveHitTestResult):
3473         (WebKit::WebPageProxy::activeActionMenuHitTestResult): Deleted.
3474         * UIProcess/mac/WKActionMenuController.mm:
3475         (-[WKActionMenuController _defaultMenuItemsForLink]):
3476         (-[WKActionMenuController _openURLFromActionMenu:]):
3477         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
3478         (-[WKActionMenuController _quickLookURLFromActionMenu:]):
3479         (-[WKActionMenuController _saveImageToDownloads:]):
3480         (imageForResource:name::if):
3481         (-[WKActionMenuController _updateActionMenuItems]):
3482         Rename to the more accurate and general name.
3483
3484 2014-10-29  Tim Horton  <timothy_horton@apple.com>
3485
3486         Implement action menus for data detected items
3487         https://bugs.webkit.org/show_bug.cgi?id=138178
3488         <rdar://problem/18709436>
3489
3490         Reviewed by Anders Carlsson.
3491
3492         * Shared/API/c/WKActionMenuTypes.h:
3493         Add a new type.
3494
3495         * Shared/WebHitTestResult.cpp:
3496         (WebKit::WebHitTestResult::Data::Data):
3497         (WebKit::WebHitTestResult::Data::encode):
3498         (WebKit::WebHitTestResult::Data::decode):
3499         * Shared/WebHitTestResult.h:
3500         (WebKit::WebHitTestResult::isTextNode):
3501         Determine, store, encode, and decode whether or not the hit node is a text node.
3502
3503         * Shared/mac/ActionMenuHitTestResult.h:
3504         * Shared/mac/ActionMenuHitTestResult.mm: Renamed from Source/WebKit2/Shared/mac/ActionMenuHitTestResult.cpp.
3505         (WebKit::ActionMenuHitTestResult::encode):
3506         (WebKit::ActionMenuHitTestResult::decode):
3507         Make ActionMenuHitTestResult an Obj-C++ file.
3508         Store, encode, and decode (securely!) a DDActionContext and FloatRect
3509         representing the bounding box of the data detected item, if any.
3510
3511         * UIProcess/API/mac/WKView.mm:
3512         (-[WKView initWithFrame:context:configuration:webView:]):
3513         (-[WKView willOpenMenu:withEvent:]): Deleted.
3514         Stop using willOpenMenu; we'll use NSMenuDelegate's menuNeedsUpdate: instead.
3515         Hook up WKActionMenuController as our action menu's delegate.
3516
3517         * UIProcess/mac/WKActionMenuController.mm:
3518         (-[WKActionMenuController prepareForMenu:withEvent:]):
3519         Call _updateActionMenuItems *after* we've adjusted _state, so that it
3520         can depend on the value being correct.
3521
3522         (-[WKActionMenuController willOpenMenu:withEvent:]):
3523         (-[WKActionMenuController didPerformActionMenuHitTest:]):
3524         Move menu updating to menuNeedsUpdate for more accurate timing.
3525
3526         (_updateActionMenuItems):
3527         When building the menu, if we have a text node that is not a link,
3528         and hit a data detected item, retrieve the menu from the DDActionContext.
3529         If we have nothing, make sure to reset _type, and if the final hit-test
3530         is still pending, build a menu with a dummy item.
3531
3532         * WebKit2.xcodeproj/project.pbxproj:
3533         * WebProcess/WebPage/WebPage.cpp:
3534         (WebKit::WebPage::performActionMenuHitTestAtLocation): Moved to WebPageMac.
3535         * WebProcess/WebPage/mac/WebPageMac.mm:
3536         (WebKit::rangeExpandedAroundPosition):
3537         Factor this out of performDictionaryLookupAtLocation.
3538
3539         (WebKit::WebPage::performDictionaryLookupAtLocation):
3540         Make use of rangeExpandedAroundPosition.
3541
3542         (WebKit::scanForDataDetectedItems):
3543         Expand to four lines of context around the hit point.
3544         Convert that range to plain text, and feed it to DataDetectors.
3545         Find the result that intersects the hit point, and make a DDActionContext
3546         for it. Also, store the bounding box of the first quad of the detected
3547         text, to provide to Data Detectors as a hint for UI placement.
3548
3549         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3550         If the hit node is a text node, call scanForDataDetectedItems and
3551         store the resultant DDActionContext and bounding rect on our
3552         ActionMenuHitTestResult for transfer to the UI process.
3553
3554 2014-10-29  Joseph Pecoraro  <pecoraro@apple.com>
3555
3556         [iOS] iPad: Occasional <select> crashes attempting to scroll to non-existing row 0 in viewWillAppear
3557         https://bugs.webkit.org/show_bug.cgi?id=138165
3558
3559         Reviewed by David Kilzer.
3560
3561         This is a speculative fix for a crash attempting to scroll to a row in a
3562         select picker on iPad. In these cases we are trying to scroll to the first
3563         row of the first section, but no such row appears to exist. I was unable
3564         to reproduce the issue, but if it is happening we should be able to protect
3565         safely protect against crashing.
3566
3567         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3568         (-[WKSelectTableViewController viewWillAppear:]):
3569         Protect against trying to scroll to a section/row that does not exist
3570         by pre-checking that the section/row is valid.
3571
3572 2014-10-28  Ting-Wei Lan  <lantw44@gmail.com>
3573
3574         Cast std::chrono::duration.count() to int64_t in ArgumentCoder
3575         https://bugs.webkit.org/show_bug.cgi?id=136981
3576
3577         Reviewed by Alexey Proskuryakov.
3578
3579         Explicitly cast the return value of std::chrono::duration.count() to
3580         a fixed-size interger type, which prevents compilation error when
3581         the return value type matches neither int32_t nor int64_t.
3582
3583         * Platform/IPC/ArgumentCoders.h:
3584
3585 2014-10-28  Jer Noble  <jer.noble@apple.com>
3586
3587         [EME] Pass location for media key storage through from WebKit/WebKit2.
3588         https://bugs.webkit.org/show_bug.cgi?id=137120
3589
3590         Reviewed by Anders Carlsson.
3591
3592         Allow the location for media key storage to be passed into the WebProcess from the UIProcess
3593         through the WebContextConfiguraiton struct.
3594
3595         * Shared/WebProcessCreationParameters.cpp:
3596         (WebKit::WebProcessCreationParameters::encode): Add mediaKeysStorageDirectory.
3597         (WebKit::WebProcessCreationParameters::decode): Ditto.
3598         * Shared/WebProcessCreationParameters.h:
3599         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3600         (WKContextConfigurationCopyMediaKeysStorageDirectory): Added getter.
3601         (WKContextConfigurationSetMediaKeysStorageDirectory): Added setter.
3602         * UIProcess/API/C/WKContextConfigurationRef.h:
3603         * UIProcess/API/C/WKOriginDataManager.h:
3604         * UIProcess/API/Cocoa/WKProcessPool.mm:
3605         (-[WKProcessPool _initWithConfiguration:]): Provide a default location.
3606         * UIProcess/APIContextConfiguration.cpp:
3607         (API::ContextConfiguration::webContextConfiguration): Set mediaKeysStorageDirectory.
3608         * UIProcess/APIContextConfiguration.h:
3609         (API::ContextConfiguration::mediaKeysStorageDirectory): Added getter.
3610         (API::ContextConfiguration::setMediaKeysStorageDirectory): Added setter.
3611         * UIProcess/WebContext.cpp:
3612         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): Apply mediaKeysStorageDirectory.
3613         (WebKit::WebContext::WebContext): Initialize m_mediaKeysStorageDirectory.
3614         (WebKit::WebContext::createNewWebProcess): Create a sandbox extension handle for mediaKeysStorageDirectory.
3615         * UIProcess/WebContext.h:
3616         * UIProcess/efl/WebContextEfl.cpp:
3617         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Return a default location.
3618         * UIProcess/gtk/WebContextGtk.cpp:
3619         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Ditto.
3620         * UIProcess/mac/WebContextMac.mm:
3621         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Return an overridable default location.
3622         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: Added.
3623         (WebKit::WebMediaKeyStorageManager::initialize): Pull the mediaKeysStorageDirectory out of configuration.
3624         (WebKit::WebMediaKeyStorageManager::supplementName): Return a configuration name.
3625         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin): Return the
3626             correct storage directory based on the SecureOrigin.
3627         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins): Return the origins within the
3628             storage directory.
3629         (WebKit::removeAllMediaKeyStorageForOriginPath): Static, remove contents and directory at path.
3630         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin): Use
3631             removeAllMediaKeyStorageForOriginPath to remove origin data.
3632         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates): Ditto.
3633         (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries): Ditto.
3634         * WebProcess/MediaCache/WebMediaKeyStorageManager.h: Added.
3635         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager): Default constructor.
3636         (WebKit::WebMediaKeyStorageManager::~WebMediaKeyStorageManager): Default virtual destructor.
3637         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectory): Simple accessor.
3638         * WebProcess/WebProcess.cpp:
3639         (WebKit::WebProcess::WebProcess): Add WebMediaKeyStorageManager as a supplement.
3640         * WebProcess/cocoa/WebProcessCocoa.mm:
3641         (WebKit::WebProcess::platformInitializeWebProcess): Create a sandbox extension from the sandbox extension handle.
3642
3643         Add new source files to project(s).
3644
3645         * PlatformEfl.cmake:
3646         * PlatformGTK.cmake:
3647         * WebKit2.xcodeproj/project.pbxproj:
3648         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3649         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
3650         (WebKit::removeAllMediaKeyStorageForOriginPath):
3651
3652         Drive-by fix: references to VoidCallback are ambiguous, since the same name is re-used in multiple namespaces.
3653         Make references to WebCore::VoidCallback explicit where the entire WebCore (and other) namespaces are pulled in.
3654
3655         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
3656         (WebKit::NotificationPermissionRequestManager::startRequest):
3657         (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
3658         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
3659         (WebKit::WebNotificationClient::requestPermission):
3660
3661 2014-10-28  Jeremy Jones  <jeremyj@apple.com>
3662
3663         Add optimized fullscreen mode.
3664         https://bugs.webkit.org/show_bug.cgi?id=138044
3665
3666         Reviewed by Anders Carlsson.
3667
3668         Enable different types of fullscreen video behavior.
3669         Add an enum parameter to enterVideoFullscreenForVideoElement for alternate types of fullscreen.
3670
3671         * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Add fullscreenType parameter
3672         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
3673         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3674         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): ditto
3675         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3676         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): ditto
3677         * WebProcess/WebCoreSupport/WebChromeClient.h: ditto
3678         * WebProcess/ios/WebVideoFullscreenManager.h: ditto
3679         * WebProcess/ios/WebVideoFullscreenManager.mm:
3680         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): ditto
3681         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): ditto
3682
3683 2014-10-28  Dan Bernstein  <mitz@apple.com>
3684
3685         Added a Radar reference to a comment.
3686
3687         * Shared/mac/WebCoreArgumentCodersMac.mm:
3688         (IPC::ArgumentCoder<Credential>::encodePlatformData):
3689
3690 2014-10-28  Dan Bernstein  <mitz@apple.com>
3691
3692         [Cocoa] REGERESSION (r171801): Client certificate authentication is failing
3693         https://bugs.webkit.org/show_bug.cgi?id=138144
3694
3695         Reviewed by Alexey Proskuryakov.
3696
3697         NSURLCredential’s implementation of NSSecureCoding fails to encode identity-based
3698         credentials properly. Work around that by encoding the identity, certificate, and
3699         persistence individually.
3700
3701         * Shared/mac/WebCoreArgumentCodersMac.mm:
3702         (IPC::ArgumentCoder<Credential>::encodePlatformData):
3703         (IPC::ArgumentCoder<Credential>::decodePlatformData):
3704
3705 2014-10-28  Joseph Pecoraro  <pecoraro@apple.com>
3706
3707         [iOS] iPhone should not allow selecting <optgroup> in <select multiple>
3708         https://bugs.webkit.org/show_bug.cgi?id=137991
3709
3710         Reviewed by Darin Adler.
3711
3712         We seem to be getting the delegate when we are not supposed to.
3713         Workaround the issue as best we can by reseting the styles
3714         for the group's content view and not changing selections.
3715
3716         * UIProcess/ios/forms/WKFormSelectPicker.mm:
3717         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
3718
3719 2014-10-28  Tim Horton  <timothy_horton@apple.com>
3720
3721         Remove an inaccurate comment in WKActionMenuController
3722         https://bugs.webkit.org/show_bug.cgi?id=138135
3723
3724         Reviewed by Anders Carlsson.
3725
3726         * UIProcess/mac/WKActionMenuController.mm:
3727         (-[WKActionMenuController _defaultMenuItemsForLink]):
3728         The comment is wrong; the separator is there for spacing, not just as a workaround.
3729
3730 2014-10-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3731
3732         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.1 release.
3733
3734         * gtk/NEWS: Add release notes for 2.7.1.
3735
3736 2014-10-28  Dan Bernstein  <mitz@apple.com>
3737
3738         [Mac] OS X Mavericks build broken with public SDK
3739         https://bugs.webkit.org/show_bug.cgi?id=138108
3740
3741         Reviewed by Mark Rowe.
3742
3743         * Shared/API/Cocoa/WKFoundation.h: Only define the NSEventModifierFlags type when using a
3744         version of the OS X SDK that doesn’t define it.
3745
3746 2014-10-27  Conrad Shultz  <conrad_shultz@apple.com>
3747
3748         NSSharingService protocol conformance should be internal to WKActionMenuController
3749         https://bugs.webkit.org/show_bug.cgi?id=138112
3750
3751         Reviewed by Tim Horton.
3752
3753         * UIProcess/mac/WKActionMenuController.h:
3754         * UIProcess/mac/WKActionMenuController.mm:
3755         Move protocol conformance from the interface to a class extension.
3756
3757 2014-10-27  Enrica Casucci  <enrica@apple.com>
3758
3759         WebContent crash in WebKit::WebPage::expandedRangeFromHandle.
3760         https://bugs.webkit.org/show_bug.cgi?id=138023
3761         rdar://problem/18787412
3762
3763         Reviewed by Ryosuke Niwa.
3764
3765         We must change that we have a valid currentRange before trying
3766         to expand or contract.
3767
3768         * WebProcess/WebPage/ios/WebPageIOS.mm:
3769         (WebKit::WebPage::changeBlockSelection):
3770
3771 2014-10-27  Alexey Proskuryakov  <ap@apple.com>
3772
3773         http/tests/cookies/third-party-cookie-relaxing.html is flaky on bots
3774         https://bugs.webkit.org/show_bug.cgi?id=138098
3775
3776         Reviewed by Anders Carlsson.
3777
3778         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3779         * WebProcess/com.apple.WebProcess.sb.in:
3780         Update for the new name of testing session. Memory regions are now of the form
3781         "WebKit Test-<pid>-0".
3782
3783 2014-10-27  Chris Dumez  <cdumez@apple.com>
3784
3785         Use separate HashMaps for common and uncommon headers in HTTPHeaderMap
3786         https://bugs.webkit.org/show_bug.cgi?id=138079
3787
3788         Reviewed by Anders Carlsson.
3789
3790         Update the WK2 IPC HTTPHeaderMap serialization / deserialization code
3791         to leverage the fact that HTTPHeaderMap now stores common HTTP headers
3792         and uncommon one in separate HashMaps. This speeds up deserialization
3793         as we no longer need to call findHTTPHeaderName() for every decoded
3794         header. We already know if the header is a common one or not, and if
3795         it is then we already have a HTTPHeaderName type instead of a String.
3796
3797         I see that we spend ~40% less time in HTTPHeaderMap decoding when
3798         loading http://flickr.com/explore, while the encoding takes about
3799         the same amount of time as before.
3800
3801         * Shared/WebCoreArgumentCoders.cpp:
3802         (IPC::ArgumentCoder<HTTPHeaderMap>::encode):
3803         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
3804
3805 2014-10-24  Benjamin Poulain  <bpoulain@apple.com>
3806
3807         Fix the iOS build
3808
3809         * Configurations/WebKit.xcconfig:
3810
3811 2014-10-24  Beth Dakin  <bdakin@apple.com>
3812
3813         _actionMenuItemsForHitTestResult should also take a type indicating what the menu 
3814         was built for
3815         https://bugs.webkit.org/show_bug.cgi?id=138063
3816
3817         Reviewed by Dan Bernstein.
3818
3819         New type enum that can be used by clients.
3820         * Shared/API/c/WKActionMenuTypes.h: Added.
3821
3822         Remove the old SPI and add the new.
3823         * UIProcess/API/Cocoa/WKViewPrivate.h:
3824         * UIProcess/API/mac/WKView.mm:
3825         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]):
3826         (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]): Deleted.
3827
3828         Now keep an ivar for the type.
3829         * UIProcess/mac/WKActionMenuController.h:
3830
3831         Create a category for the old SPI so that we can still call it if clients have 
3832         implemented it.
3833         * UIProcess/mac/WKActionMenuController.mm:
3834         (-[WKActionMenuController initWithPage:view:]):
3835         (-[WKActionMenuController didCloseMenu:withEvent:]):
3836         (imageForResource:name::if):
3837         (-[WKActionMenuController _updateActionMenuItems]):
3838         * WebKit2.xcodeproj/project.pbxproj:
3839
3840 2014-10-24  Tim Horton  <timothy_horton@apple.com>
3841
3842         Share sheet doesn't attach to the window
3843         https://bugs.webkit.org/show_bug.cgi?id=138062
3844         <rdar://problem/18767397>
3845
3846         Reviewed by Beth Dakin.
3847
3848         * UIProcess/mac/WKActionMenuController.h:
3849         WKActionMenuController is now a NSSharingService{Picker}Delegate.
3850
3851         * UIProcess/mac/WKActionMenuController.mm:
3852         (-[WKActionMenuController _defaultMenuItemsForImage]):
3853         Set us up as the NSSharingServicePicker delegate.
3854
3855         (-[WKActionMenuController sharingServicePicker:delegateForSharingService:]):
3856         Set us up as the NSSharingService delegate.
3857
3858         (-[WKActionMenuController sharingService:sourceWindowForShareItems:sharingContentScope:]):
3859         Return the appropriate window to attach to.
3860
3861 2014-10-24  Jer Noble  <jer.noble@apple.com>
3862
3863         Abstractify WebOriginDataManager to support arbitrary ChildProcess supplements.
3864         https://bugs.webkit.org/show_bug.cgi?id=137993
3865
3866         Reviewed by Brady Eidson.
3867
3868         To allow different ChildProcess subclasses to handle listing and deletion of origin
3869         data, make WebOriginDataManager more generic by having a supplement implement the
3870         details, leaving WebOriginDataManager to deal with cross-process messaging.
3871
3872         De-virtualize AsyncTask, allowing a task to be created by passing in a
3873         function<void()>, rather than an object, method, and arguments.
3874
3875         * Shared/AsyncTask.h:
3876         (WebKit::AsyncTask::AsyncTask):
3877         (WebKit::AsyncTask::performTask):
3878         (WebKit::AsyncTask::~AsyncTask): Deleted.
3879
3880         Add a new virtual base class, to be implemented by various ChildProcesses, which
3881         WebOriginDataManager will use to implement listing and deletion requests.
3882
3883         * WebProcess/OriginData/WebOriginDataManager.h:
3884         * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Added.
3885         (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement):
3886         (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement):
3887         (WebKit::WebOriginDataManagerSupplement::getOrigins):
3888         (WebKit::WebOriginDataManagerSupplement::deleteEntriesForOrigin):
3889         (WebKit::WebOriginDataManagerSupplement::deleteEntriesModifiedBetweenDates):
3890         (WebKit::WebOriginDataManagerSupplement::deleteAllEntries):
3891         * WebKit2.xcodeproj/project.pbxproj:
3892
3893         WebOriginDataManager doesn't need to be a ChildSupplement. Remove the DatabaseProcess-
3894         specific implementations for its message handlers and replace with clean, generic calls
3895         to its supplement. Because these supplements may want to respond to the request
3896         asynchronously, pass a completion function in to be called by the supplement once its
3897         work is complete.
3898
3899         * WebProcess/OriginData/WebOriginDataManager.cpp:
3900         (WebKit::WebOriginDataManager::WebOriginDataManager):
3901         (WebKit::WebOriginDataManager::getOrigins):
3902         (WebKit::WebOriginDataManager::deleteEntriesForOrigin):
3903         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates):
3904         (WebKit::WebOriginDataManager::deleteAllEntries):
3905         (WebKit::WebOriginDataManager::supplementName): Deleted.
3906
3907         DatabaseProcess already uses WebOriginDataManager, so it will be the first process
3908         to fall under the heel of the new regime. DatabaseProcess will subclass
3909         WebOriginDataManagerSupplement, and pass itself in twice to the WebOriginDataManager
3910         constructor. Create a lambda-based AsyncTask for each request, and call the completion
3911         function when each request is complete.
3912
3913         * DatabaseProcess/DatabaseProcess.cpp:
3914         (WebKit::DatabaseProcess::DatabaseProcess):
3915         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
3916         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
3917         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
3918         (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
3919         (WebKit::DatabaseProcess::getOrigins):
3920         (WebKit::DatabaseProcess::deleteEntriesForOrigin):
3921         (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates):
3922         (WebKit::DatabaseProcess::deleteAllEntries):
3923         (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): Deleted.
3924         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): Deleted.
3925         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted.
3926         (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): Deleted.
3927         * DatabaseProcess/DatabaseProcess.h:
3928
3929 2014-10-24  Beth Dakin  <bdakin@apple.com>
3930
3931         Very large images crash in action menu code
3932         https://bugs.webkit.org/show_bug.cgi?id=138059
3933         -and corresponding-
3934         rdar://problem/18767859
3935
3936         Reviewed by Tim Horton.
3937
3938         If the HitTestResult failed to create and image, then don’t go for the image 
3939         action menu.
3940         * UIProcess/mac/WKActionMenuController.mm:
3941         (-[WKActionMenuController _defaultMenuItems]):
3942
3943         ShareableBitmap::createShareable() can fail. The result needs to be null-checked.
3944         * WebProcess/WebPage/WebPage.cpp:
3945         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3946
3947 2014-10-24  Beth Dakin  <bdakin@apple.com>
3948
3949         Build fix.
3950
3951         * UIProcess/mac/WKActionMenuController.h:
3952         * UIProcess/mac/WKActionMenuController.mm:
3953
3954 2014-10-24  Tim Horton  <timothy_horton@apple.com>
3955
3956         Blindly try to fix all the builds.
3957
3958         * UIProcess/mac/WKActionMenuController.h:
3959         * UIProcess/mac/WKActionMenuController.mm:
3960
3961 2014-10-24  Timothy Horton  <timothy_horton@apple.com>
3962
3963         Blindly try to fix all the builds.
3964
3965         * UIProcess/mac/WKActionMenuController.h:
3966
3967 2014-10-24  Timothy Horton  <timothy_horton@apple.com>
3968
3969         Blindly try to fix the 32-bit build.
3970
3971         * UIProcess/mac/WKActionMenuController.h:
3972         * UIProcess/mac/WKActionMenuController.mm:
3973
3974 2014-10-24  Tim Horton  <timothy_horton@apple.com>
3975
3976         [Mac][WebKit2] Move action menu code into its own file
3977         https://bugs.webkit.org/show_bug.cgi?id=138034
3978         <rdar://problem/18758758>
3979
3980         * UIProcess/mac/WKActionMenuController.mm:
3981         (-[WKActionMenuController prepareForMenu:withEvent:]):
3982         (-[WKActionMenuController _addImageToPhotos:]):
3983         Review comments that were not previously addressed.
3984
3985 2014-10-24  Tim Horton  <timothy_horton@apple.com>
3986
3987         [Mac][WebKit2] Move action menu code into its own file
3988         https://bugs.webkit.org/show_bug.cgi?id=138034
3989         <rdar://problem/18758758>
3990
3991         Reviewed by Dan Bernstein.
3992
3993         * UIProcess/API/mac/WKView.mm:
3994         (-[WKView initWithFrame:context:configuration:webView:]):
3995         Make a WKActionMenuController if needed.
3996
3997         (-[WKView prepareForMenu:withEvent:]):
3998         (-[WKView willOpenMenu:withEvent:]):
3999         (-[WKView didCloseMenu:withEvent:]):
4000         (-[WKView _didPerformActionMenuHitTest:]):
4001         Forward these to WKActionMenuController.
4002
4003         (-[WKView _openURLFromActionMenu:]): Deleted.
4004         (-[WKView _addToReadingListFromActionMenu:]): Deleted.
4005         (-[WKView _quickLookURLFromActionMenu:]): Deleted.
4006         (-[WKView _createActionMenuItemForTag:]): Deleted.
4007         (webKitBundleImageNamed): Deleted.
4008         (-[WKView _copyImage:]): Deleted.
4009         (-[WKView _saveImageToDownloads:]): Deleted.
4010         (temporaryPhotosDirectoryPath): Deleted.
4011         (pathToPhotoOnDisk): Deleted.
4012         (-[WKView _addImageToPhotos:]): Deleted.
4013         (-[WKView _defaultMenuItemsForImage]): Deleted.
4014         (-[WKView _defaultMenuItems]): Deleted.
4015         (-[WKView _updateActionMenu]): Deleted.
4016         Moved to WKActionMenuController.
4017
4018         * UIProcess/mac/WKActionMenuController.h: Added.
4019         * UIProcess/mac/WKActionMenuController.mm: Added.
4020         (-[WKActionMenuController initWithPage:view:]):
4021         (-[WKActionMenuController prepareForMenu:withEvent:]):
4022         (-[WKActionMenuController willOpenMenu:withEvent:]):
4023         (-[WKActionMenuController didCloseMenu:withEvent:]):
4024         (-[WKActionMenuController didPerformActionMenuHitTest:]):
4025         (-[WKActionMenuController _defaultMenuItemsForLink]):
4026         (-[WKActionMenuController _openURLFromActionMenu:]):
4027         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
4028         (-[WKActionMenuController _quickLookURLFromActionMenu:]):
4029         (-[WKActionMenuController _defaultMenuItemsForImage]):
4030         (-[WKActionMenuController _copyImage:]):
4031         (-[WKActionMenuController _saveImageToDownloads:]):
4032         (temporaryPhotosDirectoryPath):
4033         (pathToPhotoOnDisk):
4034         (-[WKActionMenuController _addImageToPhotos:]):
4035         (-[WKActionMenuController _createActionMenuItemForTag:]):
4036         (webKitBundleImageNamed):
4037         (imageForResource:name::if):
4038         (-[WKActionMenuController _updateActionMenuItems]):
4039         Moved from WKView.
4040
4041         * WebKit2.xcodeproj/project.pbxproj:
4042
4043 2014-10-24  Marcos Chavarría Teijeiro  <chavarria1991@gmail.com>