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