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