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