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