Remove the unused deletion UI feature
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-11-05  Dan Bernstein  <mitz@apple.com>
2
3         Remove the unused deletion UI feature
4         https://bugs.webkit.org/show_bug.cgi?id=138442
5
6         Rubber-stamped by Alexey Proskuryakov.
7
8         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
9         (WebKit::WebEditorClient::shouldShowDeleteInterface): Deleted.
10         * WebProcess/WebCoreSupport/WebEditorClient.h:
11
12 2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
13
14         It should be possible to open a page preview by clicking on it
15         https://bugs.webkit.org/show_bug.cgi?id=138445
16
17         Reviewed by Tim Horton.
18
19         Add a click recognizer to WKPagePreviewViewController and plumb it through to WKActionMenuController.
20
21         * UIProcess/mac/WKActionMenuController.mm:
22         Declare <WKPagePreviewViewControllerDelegate>, currently home to just a single method.
23         (-[WKPagePreviewViewController loadView]):
24         Configure and add a click gesture recognizer to the WKWebView.
25         (-[WKPagePreviewViewController _clickRecognized:]):
26         Gesture recognizer action; send -pagePreviewViewControllerWasClicked: to the delegate.
27         (-[WKActionMenuController willDestroyView:]):
28         Extract code to -_clearPreviewPopover.
29         (-[WKActionMenuController didCloseMenu:withEvent:]):
30         Ditto.
31         (-[WKActionMenuController _createPreviewPopoverForURL:]):
32         Set ourself as the delegate of the page preview controller.
33         (-[WKActionMenuController _clearPreviewPopover]):
34         Extracted from various other methods; if appropriate, nil out the preview view controller's delegate.
35         (-[WKActionMenuController popoverWillClose:]):
36         Extract code to -_clearPreviewPopover.
37         (-[WKActionMenuController pagePreviewViewControllerWasClicked:]):
38         WKPagePreviewViewControllerDelegate method; open the URL of the clicked page.
39
40 2014-11-05  Beth Dakin  <bdakin@apple.com>
41
42         Page preview popover should show scaled-down web content
43         https://bugs.webkit.org/show_bug.cgi?id=138444
44
45         Reviewed by Anders Carlsson.
46
47         Instead of keeping the preferred size in the controller, keep the main view’s 
48         size, and then scale the bounds of the popover’s view using that and the scale 
49         factor as a constant. Set the size of the popover explicitly so that it doesn’t 
50         get the view’s size. This will cause it to scale the WKWebView.
51         * UIProcess/mac/WKActionMenuController.mm:
52         (-[WKPagePreviewViewController initWithPageURL:]):
53         (-[WKPagePreviewViewController loadView]):
54         (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
55         (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
56
57 2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
58
59         Page preview popovers sometimes cover their originating element
60         https://bugs.webkit.org/show_bug.cgi?id=138437
61
62         Reviewed by Beth Dakin.
63
64         If a popover is sufficiently large, and the originating element is in a particular location, it's
65         possible that the popover can't be positioned in a manner that doesn't occlude the originating element.
66         Address this by scaling down the popover content if it can't fit entirely between the originating
67         element and the screen edge.
68
69         * UIProcess/mac/WKActionMenuController.mm:
70         (-[WKActionMenuController _previewURLFromActionMenu:]):
71         Update to use -_createPreviewPopoverForURL:originRect:.
72         (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
73         Renamed from -_createPreviewPopoverForURL:; extract code to -_preferredSizeForPopoverPresentedFromOriginRect:.
74         (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
75         Compute a size that is as large as possible while keeping the popover between the origin rect and screen edge
76         (with an arbitrary padding applied to keep from directly abutting the screen edge).
77         (-[WKActionMenuController _createPreviewPopoverForURL:]): Deleted.
78
79 2014-11-05  Alexey Proskuryakov  <ap@apple.com>
80
81         fast/dom/remove-body-during-body-replacement2.html fails on WK2
82         https://bugs.webkit.org/show_bug.cgi?id=138334
83
84         Reviewed by Anders Carlsson.
85
86         Added an SPI to focus a frame.
87
88         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
89         (WKBundleFrameFocus):
90         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
91         * WebProcess/WebPage/WebPage.cpp:
92         (WebKit::WebPage::setViewState):
93
94 2014-11-05  Tim Horton  <timothy_horton@apple.com>
95
96         Select Data Detectors results instead of just highlighting them
97         https://bugs.webkit.org/show_bug.cgi?id=138435
98         <rdar://problem/18877675>
99
100         Reviewed by Beth Dakin.
101
102         * UIProcess/WebPageProxy.cpp:
103         (WebKit::WebPageProxy::selectLastActionMenuRange):
104         (WebKit::WebPageProxy::selectLookupTextAtLocation): Deleted.
105         Rename selectLookupTextAtLocation to selectLastActionMenuRange.
106
107         * UIProcess/WebPageProxy.h:
108         * UIProcess/mac/WKActionMenuController.mm:
109         (-[WKActionMenuController willOpenMenu:withEvent:]):
110         Do a real selection for single-item Data Detector menus; show the yellow highlight otherwise.
111         Adopt selectLastActionMenuRange for non-detected text.
112
113         * WebProcess/WebPage/WebPage.h:
114         * WebProcess/WebPage/WebPage.messages.in:
115         * WebProcess/WebPage/mac/WebPageMac.mm:
116         (WebKit::WebPage::performActionMenuHitTestAtLocation):
117         (WebKit::WebPage::selectLastActionMenuRange):
118         (WebKit::WebPage::selectLookupTextAtLocation): Deleted.
119         Store the last (detected data or Lookup-derived) action menu range.
120         Select it upon selectLastActionMenuRange.
121
122 2014-11-04  Jon Honeycutt  <jhoneycutt@apple.com>
123
124         WebContent crash in WebPage::selectWithGesture()
125
126         <https://bugs.webkit.org/show_bug.cgi?id=138399>
127         <rdar://problem/18550631>
128
129         This crash occurs when the web process receives a "TapAndAHalf" gesture
130         with the "Changed" state without having received a "TapAndAHalf"
131         gesture with the "Began" state.
132
133         No test possible.
134
135         Reviewed by Simon Fraser.
136
137         * WebProcess/WebPage/ios/WebPageIOS.mm:
138         (WebKit::WebPage::selectWithGesture):
139         Null check m_currentWordRange before dereferencing it.
140
141 2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
142
143         Disable action menus on page previews
144         https://bugs.webkit.org/show_bug.cgi?id=138431
145
146         Reviewed by Anders Carlsson.
147
148         * UIProcess/API/mac/WKView.mm:
149         (-[WKView _shouldIgnoreMouseEvents]):
150         Renamed from -shouldIgnoreMouseEvents since this isn't actually public.
151         (-[WKView swipeWithEvent:]):
152         (-[WKView mouseMoved:]):
153         (-[WKView mouseDown:]):
154         (-[WKView mouseUp:]):
155         (-[WKView mouseDragged:]):
156         Updated to reflect method rename.
157         (-[WKView shouldIgnoreMouseEvents]): Deleted.
158
159         * UIProcess/API/mac/WKViewInternal.h:
160         Expose -_shouldIgnoreMouseEvents.
161
162         * UIProcess/mac/WKActionMenuController.mm:
163         (-[WKActionMenuController prepareForMenu:withEvent:]):
164         Cancel the menu if the presenting WKView should ignore mouse events.
165
166 2014-11-05  Beth Dakin  <bdakin@apple.com>
167
168         Action menu URL preview should "peek," i.e. appear when the menu item is 
169         highlighted
170         https://bugs.webkit.org/show_bug.cgi?id=138432
171         -and corresponding-
172         rdar://problem/18774264
173
174         Reviewed by Anders Carlsson.
175
176         New ivars. Keep a reference to the popover, and a BOOL that indicates whether we 
177         should close the popover when the menu goes away.
178         * UIProcess/mac/WKActionMenuController.h:
179         * UIProcess/mac/WKActionMenuController.mm:
180
181         Re-set the preview bool to NO whenever we are about to pop up a new menu.
182         (-[WKActionMenuController prepareForMenu:withEvent:]):
183
184         Close the popover when the menu closes unless _shouldKeepPreviewPopoverOpen has 
185         been set.
186         (-[WKActionMenuController didCloseMenu:withEvent:]):
187
188         Set _shouldKeepPreviewPopoverOpen.
189         (-[WKActionMenuController _keepPreviewOpen:]):
190
191         Re-factored to use ivar.
192         (-[WKActionMenuController _previewURLFromActionMenu:]):
193         (-[WKActionMenuController _createPreviewPopoverForURL:]):
194
195         Now call _previewURLFromActionMenu on menu item highlight.
196         (-[WKActionMenuController menu:willHighlightItem:]):
197
198         NSPopover delegate method so that we can keep our BOOL and ivar accurate in the 
199         case where the popover is closed by some other mechanism than the action menu 
200         going away.
201         (-[WKActionMenuController popoverWillClose:]):
202
203         New selector for the preview. Now when this item is actually selected, we just 
204         want to set the BOOL _shouldKeepPreviewPopoverOpen to YES so that we keep the 
205         preview open.
206         (-[WKActionMenuController _createActionMenuItemForTag:]):
207
208 2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
209
210         Disable interaction with action menu page previews
211         https://bugs.webkit.org/show_bug.cgi?id=138400
212
213         Reviewed by Tim Horton.
214
215         Expand on the existing -[WKView shouldIgnoreMouseEvents] by adding facilities to suppress handling
216         of all non-wheel events, effectively creating a scroll-only web view. Deploy this in
217         WKPagePreviewViewController.
218
219         * UIProcess/API/Cocoa/WKViewPrivate.h:
220         Declare the OS X-only ignoresNonWheelMouseEvents SPI.
221
222         * UIProcess/API/Cocoa/WKWebView.mm:
223         (-[WKWebView _ignoresNonWheelMouseEvents]):
224         (-[WKWebView _setIgnoresNonWheelMouseEvents:]):
225         Wrap the underlying WKView methods.
226
227         * UIProcess/API/Cocoa/WKWebViewInternal.h:
228         Declare the OS X-only ignoresNonWheelMouseEvents property.
229
230         * UIProcess/API/mac/WKView.mm:
231         Add _ignoresNonWheelMouseEvents to WKViewData.
232         (-[WKView shouldIgnoreMouseEvents]):
233         Include a check for _ignoresNonWheelMouseEvents.
234         (-[WKView _setIgnoresNonWheelMouseEvents:]):
235         Set the ivar in WKViewData.
236         (-[WKView _ignoresNonWheelMouseEvents]):
237         Fetch the ivar in WKViewData.
238         (-[WKView _shouldIgnoreWheelEvents]):
239         Implement the old -shouldIgnoreMouseEvents behavior.
240         (-[WKView scrollWheel:]):
241         -shouldIgnoreMouseEvents -> -_shouldIgnoreWheelEvents.
242
243         * UIProcess/mac/WKActionMenuController.mm:
244         (-[WKPagePreviewViewController loadView]):
245         Configure the WKWebView to ignore non-wheel mouse events; use RetainPtr for the WKWebView.
246
247 2014-11-03  Dean Jackson  <dino@apple.com>
248
249         Add ENABLE_FILTERS_LEVEL_2 feature guard.
250         https://bugs.webkit.org/show_bug.cgi?id=138362
251
252         Reviewed by Tim Horton.
253
254         Add a new feature define for Level 2 of CSS Filters.
255         http://dev.w3.org/fxtf/filters-2/
256
257         * Configurations/FeatureDefines.xcconfig:
258
259 2014-11-05  Alberto Garcia  <berto@igalia.com>
260
261         NetscapePlugin: NPP_GetValue should receive a pointer to NPBool, not bool
262         https://bugs.webkit.org/show_bug.cgi?id=138418
263
264         Reviewed by Carlos Garcia Campos.
265
266         Replace bool with NPBool, which is actually an unsigned char.
267
268         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
269         (WebKit::NetscapePlugin::platformPostInitialize):
270
271 2014-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
272
273         [GTK] Add WebKitWebResource::failed-with-tls-errors signal
274         https://bugs.webkit.org/show_bug.cgi?id=137862
275
276         Reviewed by Gustavo Noronha Silva.
277
278         When a resource load fails due to TLS errors emit WebKitWebResource::failed-with-tls-errors
279         signal instead of WebKitWebResource::failed so that TLS errors information and certificate
280         are provided.
281
282         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
283         (didReceiveWebViewMessageFromInjectedBundle): Check if the error
284         is a TLS failure to emit failed-with-tls-errors instead of failed.
285         * UIProcess/API/gtk/WebKitWebResource.cpp:
286         (webkit_web_resource_class_init): Add WebKitWebResource::failed-with-tls-errors signal.
287         (webkitWebResourceFailedWithTLSErrors): Emit failed-with-tls-errors and finish signals.
288         * UIProcess/API/gtk/WebKitWebResourcePrivate.h:
289
290 2014-11-05  Shivakumar JM  <shiva.jm@samsung.com>
291
292         Fix build warning in WebKit2/WebProcess module.
293         https://bugs.webkit.org/show_bug.cgi?id=138410
294
295         Reviewed by Alexey Proskuryakov.
296
297         Fix build warning by removing parameter name
298
299         * WebProcess/WebPage/WebPageOverlay.h:
300         (WebKit::WebPageOverlay::Client::prepareForActionMenu):
301
302 2014-11-05  Antti Koivisto  <antti@apple.com>
303
304         Move HTTPHeaderMap encoding to the class
305         https://bugs.webkit.org/show_bug.cgi?id=138412
306
307         Reviewed by Andreas Kling.
308
309         * PluginProcess/PluginControllerProxy.cpp:
310         * Shared/WebCoreArgumentCoders.cpp:
311         (IPC::ArgumentCoder<HTTPHeaderMap>::encode): Deleted.
312         (IPC::ArgumentCoder<HTTPHeaderMap>::decode): Deleted.
313
314             Make these HTTPHeaderMap members instead so they can access internals and can be used elsewhere.
315
316         * Shared/WebCoreArgumentCoders.h:
317
318 2014-11-04  Beth Dakin  <bdakin@apple.com>
319
320         Speculative build fix.
321
322         * UIProcess/API/mac/WKView.mm:
323         (-[WKView _dismissActionMenuDataDetectorPopovers]):
324         * UIProcess/API/mac/WKViewInternal.h:
325
326 2014-11-04  Beth Dakin  <bdakin@apple.com>
327
328         Un-anchor data detector popovers on scroll
329         https://bugs.webkit.org/show_bug.cgi?id=138385
330         -and corresponding-
331         rdar://problem/18869345
332
333         Reviewed by Tim Horton.
334
335         Whenever we dismiss the dictionary popover, and on scroll, we should try to 
336         dismiss the data detector popovers. Right now we don’t have the ability to know if 
337         a dismiss succeeded, so we will settle for un-anchoring the popover.
338
339         * UIProcess/API/mac/WKView.mm:
340         (-[WKView viewDidMoveToWindow]):
341         (-[WKView _dismissActionMenuDataDetetcorPopovers]):
342         * UIProcess/API/mac/WKViewInternal.h:
343         * UIProcess/PageClient.h:
344         * UIProcess/WebPageProxy.cpp:
345         (WebKit::WebPageProxy::didCommitLoadForFrame):
346         (WebKit::WebPageProxy::pageDidScroll):
347         (WebKit::WebPageProxy::resetStateAfterProcessExited):
348         * UIProcess/mac/PageClientImpl.h:
349         * UIProcess/mac/PageClientImpl.mm:
350         (WebKit::PageClientImpl::dismissActionMenuDataDetetcorPopovers):
351         * UIProcess/mac/WKActionMenuController.h:
352         * UIProcess/mac/WKActionMenuController.mm:
353         (-[WKActionMenuController dismissActionMenuDataDetetcorPopovers]):
354
355 2014-11-04  Andy Estes  <aestes@apple.com>
356
357         [iOS] WKPDFView should scroll to a fragment when loading a PDF
358         https://bugs.webkit.org/show_bug.cgi?id=138404
359
360         Reviewed by Tim Horton.
361
362         WKPDFView already knew how to scroll to a page number fragment during a same-document navigation, but it didn't
363         know to do so when loading a PDF whose URL already contained a page number fragment. This could happen if the
364         user long-presses a page number link and taps 'Open in New Tab'.
365
366         * UIProcess/ios/WKPDFView.mm:
367         (-[WKPDFView web_setContentProviderData:suggestedFilename:]): Called _scrollToFragment:.
368         (-[WKPDFView _scrollToFragment:]): Moved fragment scrolling code to here from web_didSameDocumentNavigation:.
369         (-[WKPDFView web_didSameDocumentNavigation:]): Called _scrollToFragment.
370
371 2014-11-04  Andy Estes  <aestes@apple.com>
372
373         [iOS] Stop using +[NSURL _web_URLWithWTFString:relativeToURL:] in WKPDFView
374         https://bugs.webkit.org/show_bug.cgi?id=138357
375
376         Rubber-stamped by Dan Bernstein.
377
378         During patch review for r175595 I changed from using +URLWithString:relativeToURL: to using
379         +_web_URLWithWTFString:relativeToURL: to append a page number fragment to the document URL.
380         If the base URL already contains a fragment, +_web_URLWithWTFString:relativeToURL: appends to the existing
381         fragment whereas +URLWithString:relativeToURL: replaces the existing fragment. I want the latter behavior.
382
383         * UIProcess/ios/WKPDFView.mm:
384         (-[WKPDFView _URLForLinkAnnotation:]):
385
386 2014-11-04  Tim Horton  <timothy_horton@apple.com>
387
388         Add bundle SPI allowing PageOverlay to customize the action menu
389         https://bugs.webkit.org/show_bug.cgi?id=138388
390         <rdar://problem/18875579>
391
392         Reviewed by Anders Carlsson.
393
394         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
395         Bump the BundlePageOverlay client version.
396
397         (WKBundlePageOverlayCreate):
398         (WKBundlePageOverlaySetAccessibilityClient):
399         Don't return if we have a version; the version check happens later anyway,
400         and now it is valid to have a version >0.
401
402         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
403         Bump the BundlePageOverlay client version.
404         Add prepareForActionMenu callback.
405
406         * WebProcess/WebPage/WebPageOverlay.h:
407         (WebKit::WebPageOverlay::Client::prepareForActionMenu):
408         * WebProcess/WebPage/WebPageOverlay.cpp:
409         (WebKit::overlayMap):
410         (WebKit::WebPageOverlay::WebPageOverlay):
411         (WebKit::WebPageOverlay::~WebPageOverlay):
412         (WebKit::WebPageOverlay::fromCoreOverlay):
413         (WebKit::WebPageOverlay::pageOverlayDestroyed):
414         Keep track of a map of PageOverlay to WebPageOverlay.
415
416         (WebKit::WebPageOverlay::prepareForActionMenu):
417         Forward prepareForActionMenu to the client.
418         
419         * WebProcess/WebPage/mac/WebPageMac.mm:
420         (WebKit::WebPage::performActionMenuHitTestAtLocation):
421         Iterate through the overlays and let them prepareForActionMenu;
422         the first overlay that returns true wins. If no overlays want to
423         do anything, hand preparation along to the context menu client.
424
425 2014-11-03  Jeremy Jones  <jeremyj@apple.com>
426
427         Add button and enable optimized fullscreen.
428         https://bugs.webkit.org/show_bug.cgi?id=138351
429
430         Reviewed by Eric Carlson.
431
432         Add IsOptimizedFullscreenSupported to enable the feature only where appropriate.
433
434         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
435         (InitWebCoreSystemInterface): add IsOptimizedFullscreenSupported
436
437 2014-11-04  Andy Estes  <aestes@apple.com>
438
439         [iOS] Add long press support for links in WKPDFView
440         https://bugs.webkit.org/show_bug.cgi?id=138357
441
442         Reviewed by Dan Bernstein.
443
444         Use WKActionSheetAssistant to show a link action sheet in response to long-pressing on a link. Have WKPDFView
445         conform to WKActionSheetAssistantDelegate in order to respond to the open and copy actions as well as to
446         provide the link's URL and position information to WKActionSheetAssistant. The long-pressed link is highlighted
447         for .75 seconds before the sheet is displayed in order to match UIWebPDFView.
448
449         * UIProcess/ios/WKActionSheetAssistant.h: Made protocol methods that WKPDFView doesn't implement optional.
450         * UIProcess/ios/WKActionSheetAssistant.mm:
451         (-[WKActionSheetAssistant updatePositionInformation]): Checked if delegate responds to
452         updatePositionInformationForActionSheetAssistant: before calling.
453         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Checked if delegate responds to
454         actionSheetAssistant:willStartInteractionWithElement: before calling.
455         (-[WKActionSheetAssistant cleanupSheet]): Checked if delegate responds to actionSheetAssistantDidStopInteraction:
456         before calling.
457         * UIProcess/ios/WKPDFView.h: Conformed to WKActionSheetAssistantDelegate.
458         * UIProcess/ios/WKPDFView.mm:
459         (-[WKPDFView web_initWithFrame:webView:]): Instantiated a WKActionSheetAssistant and set self as its delegate.
460         (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]): Moved highlight drawing to here from
461         annotation:wasTouchedAtPoint:controller: in order to be reused for long-press.
462         (-[WKPDFView _URLForLinkAnnotation:]): Moved URL creation to here from annotation:wasTouchedAtPoint:controller:
463         in order to be reused for long-press. Generated an absolute URL since this URL might go into the pasteboard.
464         (-[WKPDFView annotation:wasTouchedAtPoint:controller:]): Changed to call
465         _highlightLinkAnnotation:forDuration:completionHandler: and _URLForLinkAnnotation:.
466         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]): Set values on _positionInformation and called
467         -[WKActionSheetAssistant showLinkSheet] after showing a highlight for .75 seconds.
468         (-[WKPDFView positionInformation]): Returned _positionInformation.
469         (-[WKPDFView performAction:]): Added a UTF-8 text and URL representation of the pressed URL to the pasteboard.
470         (-[WKPDFView openElementAtLocation:]): Called WebPage::navigateToURLWithSimulatedClick().
471         (-[WKPDFView actionsForElement:defaultActions:]): Returned actions from UIClient::actionsForElement().
472         (-[WKPDFView _createHighlightViewWithFrame:]): Deleted.
473
474 2014-11-04  Anders Carlsson  <andersca@apple.com>
475
476         Try to fix the 32-bit build.
477
478         * UIProcess/mac/WKActionMenuController.mm:
479         (-[WKActionMenuController _defaultMenuItemsForLink]):
480         (-[WKActionMenuController _createActionMenuItemForTag:]):
481
482 2014-11-04  Conrad Shultz  <conrad_shultz@apple.com>
483
484         Use a web view for Quick Look in action menus
485         https://bugs.webkit.org/show_bug.cgi?id=138370
486
487         Reviewed by Anders Carlsson.
488
489         Instead of using the QLPreviewBubble SPI, show a popover containing a web view. This currently
490         does not inherit any configuration from the presenting WKView and does not expose any
491         customization options.
492
493         * UIProcess/mac/WKActionMenuController.mm:
494         Declare new internal NSViewController subclass, WKPagePreviewViewController.
495         (-[WKPagePreviewViewController initWithPageURL:]):
496         Store the passed-in URL and set a somewhat arbitrary (iPhone 5 screen size) default preferred size.
497         (-[WKPagePreviewViewController loadView]):
498         Create a WKWebView and load the URL passed into the initializer.
499         (-[WKActionMenuController _previewURLFromActionMenu:]):
500         Renamed from -_quickLookURLFromActionMenu:; present the popover returned by -_createPreviewPopoverForURL:.
501         (-[WKActionMenuController _createPreviewPopoverForURL:]):
502         New helper method; return a popover that owns a _WKPagePreviewViewController configured to show a scaled-down web page.
503         (-[WKActionMenuController _createActionMenuItemForTag:]):
504         Update to reflect method rename.
505         (-[WKActionMenuController _quickLookURLFromActionMenu:]): Deleted.
506
507 2014-11-04  Chris Dumez  <cdumez@apple.com>
508
509         Add ptr() method to Ref class
510         https://bugs.webkit.org/show_bug.cgi?id=138361
511
512         Reviewed by Darin Adler.
513
514         Use the new Ref::ptr() method.
515
516         * UIProcess/WebContext.cpp:
517         (WebKit::WebContext::createWebPage):
518         * UIProcess/WebPageProxy.cpp:
519         (WebKit::WebPageProxy::setPreferences):
520         * UIProcess/WebProcessProxy.cpp:
521         (WebKit::WebProcessProxy::didNavigateWithNavigationData):
522         (WebKit::WebProcessProxy::didPerformClientRedirect):
523         (WebKit::WebProcessProxy::didPerformServerRedirect):
524         (WebKit::WebProcessProxy::didUpdateHistoryTitle):
525
526 2014-11-04  Andy Estes  <aestes@apple.com>
527
528         [iOS] Include a WKActionSheetAssistant parameter in WKActionSheetAssistantDelegate methods
529         https://bugs.webkit.org/show_bug.cgi?id=137792
530
531         Reviewed by Dan Bernstein.
532
533         * UIProcess/API/Cocoa/_WKElementAction.mm:
534         (+[_WKElementAction elementActionWithTitle:actionHandler:]):
535         (+[_WKElementAction elementActionWithType:customTitle:]):
536         (-[_WKElementAction _runActionWithElementInfo:forActionSheetAssistant:]):
537         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
538         * UIProcess/ios/WKActionSheetAssistant.h:
539         * UIProcess/ios/WKActionSheetAssistant.mm:
540         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
541         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
542         (-[WKActionSheetAssistant updatePositionInformation]):
543         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
544         (-[WKActionSheetAssistant showImageSheet]):
545         (-[WKActionSheetAssistant showLinkSheet]):
546         (-[WKActionSheetAssistant showDataDetectorsSheet]):
547         (-[WKActionSheetAssistant cleanupSheet]):
548         * UIProcess/ios/WKContentViewInteraction.mm:
549         (-[WKContentView positionInformationForActionSheetAssistant:]):
550         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
551         (-[WKContentView actionSheetAssistant:performAction:]):
552         (-[WKContentView actionSheetAssistant:openElementAtLocation:]):
553         (-[WKContentView actionSheetAssistant:decideActionsForElement:defaultActions:]):
554         (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
555         (-[WKContentView actionSheetAssistantDidStopInteraction:]):
556
557 2014-11-04  Csaba Osztrogonác  <ossy@webkit.org>
558
559          URTBF after r175564 for !PLATFORM(COCOA).
560
561         * Shared/TextIndicator.cpp:
562
563 2014-11-04  Tim Horton  <timothy_horton@apple.com>
564
565         Implement yellow highlight over data detected items
566         https://bugs.webkit.org/show_bug.cgi?id=138340
567         <rdar://problem/18840102>
568
569         Reviewed by Anders Carlsson.
570
571         * Shared/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/TextIndicator.cpp.
572         * Shared/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/TextIndicator.h.
573         Move TextIndicator to Shared.
574         Move all of the members to a Data struct.
575         Implement encode/decode for TextIndicator::Data, so it can be passed as
576         the argument to SetTextIndicator, and also as a field on ActionMenuHitTestResult.
577         Add 'createWithSelectionInFrame', which builds a TextIndicator
578         from the selection in the given frame.
579
580         * Shared/mac/ActionMenuHitTestResult.h:
581         * Shared/mac/ActionMenuHitTestResult.mm:
582         (WebKit::ActionMenuHitTestResult::encode):
583         (WebKit::ActionMenuHitTestResult::decode):
584         Rename actionBoundingBox to detectedDataBoundingBox.
585         Store/encode/decode detectedDataTextIndicator.
586
587         * UIProcess/WebPageProxy.cpp:
588         (WebKit::WebPageProxy::setTextIndicator):
589         * UIProcess/WebPageProxy.h:
590         * UIProcess/WebPageProxy.messages.in:
591         Create a TextIndicator from the TextIndicator::Data.
592         Add an explicit ClearTextIndicator message instead of sending empty Data.
593         
594         * UIProcess/mac/WKActionMenuController.h:
595         * UIProcess/mac/WKActionMenuController.mm:
596         (-[WKActionMenuController prepareForMenu:withEvent:]):
597         If the text indicator is up when preparing for a new menu invocation, hide it.
598
599         (-[WKActionMenuController willOpenMenu:withEvent:]):
600         Show the text indicator when the menu opens, for data detected items.
601
602         (-[WKActionMenuController didCloseMenu:withEvent:]):
603         Hide the text indicator when the menu closes, unless we only had one item.
604         Then, we'll hide it in the DDActionContext completionHandler block.
605         
606         (-[WKActionMenuController _showTextIndicator]):
607         (-[WKActionMenuController _hideTextIndicator]):
608         Added. Show and hide the text indicator based on the TextIndicator
609         data included in the action menu hit test result.
610
611         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
612         Hide the text indicator when the data detector popover completes.
613
614         * WebKit2.xcodeproj/project.pbxproj:
615         * WebProcess/WebPage/FindController.cpp:
616         (WebKit::FindController::getImageForFindMatch):
617         Make use of the newly-moved createSelectionSnapshot.
618
619         (WebKit::FindController::updateFindIndicator):
620         Make use of TextIndicator::createWithSelectionInFrame, which allows
621         us to share this code for building a TextIndicator with other callers.
622
623         (WebKit::FindController::hideFindIndicator):
624
625         (WebKit::getFindIndicatorBitmap): Deleted.
626         Move getFindIndicatorBitmap to WebFrame::createSelectionSnapshot.
627
628         * WebProcess/WebPage/WebFrame.cpp:
629         (WebKit::WebFrame::createSelectionSnapshot):
630         Moved from FindController's getFindIndicatorBitmap.
631         Now returns a ShareableBitmap instead of going ahead and making a Handle.
632
633         * WebProcess/WebPage/WebFrame.h:
634         * WebProcess/WebPage/mac/WebPageMac.mm:
635         (WebKit::scanForDataDetectedItems):
636         (WebKit::textIndicatorForRange):
637         Temporarily change the selection to the given range, then use
638         TextIndicator::indicatorWithSelectionInFrame to acquire a TextIndicator,
639         then reset the selection.
640
641         (WebKit::WebPage::performActionMenuHitTestAtLocation):
642         Create a TextIndicator from the data detected range.
643
644 2014-11-04  Andy Estes  <aestes@apple.com>
645
646         Fix the iOS build after r175549.
647
648         * WebProcess/WebPage/ios/WebPageIOS.mm:
649         (WebKit::WebPage::performActionOnElement):
650
651 2014-11-04  Darin Adler  <darin@apple.com>
652
653         Eliminate ResourceBuffer and use SharedBuffer directly instead
654         https://bugs.webkit.org/show_bug.cgi?id=138174
655
656         Reviewed by Antti Koivisto.
657
658         * CMakeLists.txt: Removed WebResourceBuffer.cpp.
659
660         * NetworkProcess/NetworkResourceLoader.cpp:
661         (WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer.
662         * NetworkProcess/NetworkResourceLoader.h: Ditto.
663         * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto.
664         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
665         (WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto.
666         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
667         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto.
668
669         * Shared/WebResourceBuffer.cpp: Removed.
670         * Shared/WebResourceBuffer.h: Removed.
671
672         * WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h.
673
674         * WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes.
675         (WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead
676         of a pointer.
677
678         * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include.
679         * WebProcess/Network/WebResourceLoader.cpp: Ditto.
680         * WebProcess/Network/WebResourceLoader.h: Ditto.
681         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto.
682         (WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly.
683         * WebProcess/WebPage/WebFrame.cpp:
684         (WebKit::WebFrame::source): Ditto.
685
686         * WebProcess/WebPage/WebPage.cpp:
687         (WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship
688         between the buffer and the DataReference clearer and to avoid having a long-lived
689         DataReference pointing to an underlying buffer with unclear lifetime.
690         (WebKit::WebPage::getContentsAsString): Ditto.
691         (WebKit::WebPage::getSelectionAsWebArchiveData): Ditto.
692         (WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly.
693         (WebKit::WebPage::getResourceDataFromFrame): Ditto.
694         (WebKit::WebPage::getWebArchiveOfFrame): Ditto.
695
696         * WebProcess/WebPage/ios/WebPageIOS.mm:
697         (WebKit::containingLinkElement): Use elementLineage.
698         (WebKit::WebPage::performActionOnElement): Use references and SharedBuffer.
699         ALso did a bit of other cleanup in here.
700         (WebKit::isAssistableElement): Take Element& instead of Node*, since that's what
701         the caller has.
702         (WebKit::nextAssistableElement): Changed name to match what the function does.
703         Added an obviously-missing check on the startNode argument. Updated for change
704         to isAssistableElement above. Take a Page& instead of a Page*.
705         (WebKit::hasAssistableElement): Changed name to match what the function does.
706         Updated for change to nextAssistableElement above. Took out incorrect comparison
707         of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*.
708         (WebKit::WebPage::focusNextAssistedNode): Updated for above changes.
709         (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes.
710
711 2014-11-04  Tim Horton  <timothy_horton@apple.com>
712
713         Dictionary lookup panel pops up at random when clicking on selected text
714         https://bugs.webkit.org/show_bug.cgi?id=138353
715         <rdar://problem/18861406>
716
717         * WebProcess/WebPage/WebPage.h:
718         Fix the build; this needs to be public.
719
720         * WebProcess/WebPage/mac/WebPageMac.mm:
721         (WebKit::rangeForDictionaryLookupAtHitTestResult):
722         Use the right selection (the one we just tested) in the change from r175517.
723
724 2014-11-04  Tim Horton  <timothy_horton@apple.com>
725
726         Dictionary lookup panel pops up at random when clicking on selected text
727         https://bugs.webkit.org/show_bug.cgi?id=138353
728         <rdar://problem/18861406>
729
730         Reviewed by Andreas Kling.
731
732         * WebProcess/WebPage/WebPage.h:
733         * WebProcess/WebPage/mac/WebPageMac.mm:
734         (WebKit::rangeForDictionaryLookupForSelection):
735         (WebKit::rangeForDictionaryLookupAtHitTestResult):
736         Factor rangeForDictionaryLookupForSelection out of performDictionaryLookupForSelection.
737
738         Make use of rangeForDictionaryLookupForSelection in rangeForDictionaryLookupAtHitTestResult,
739         returning the selection-based range if the hit test intersects the selected text.
740         Previously, we were just going forward with performDictionaryLookupForSelection,
741         which would actually *do* the lookup, even if we just wanted to retrieve the range.
742
743         Make rangeForDictionaryLookup* static.
744
745         (WebKit::WebPage::performDictionaryLookupForSelection):
746         Make use of rangeForDictionaryLookupForSelection.
747
748 2014-11-03  Chris Dumez  <cdumez@apple.com>
749
750         Allow implicit conversion from Ref<T> to T&
751         https://bugs.webkit.org/show_bug.cgi?id=138331
752
753         Reviewed by Andreas Kling.
754
755         Remove unnecessary calls to Ref<T>::get() now that a Ref<T> can be
756         converted implicitly to a T&.
757
758 2014-11-03  Simon Fraser  <simon.fraser@apple.com>
759
760         Expose visibleDebugOverlayRegions pref via the WK2 C SPI
761         https://bugs.webkit.org/show_bug.cgi?id=138342
762
763         Reviewed by Dan Bernstein.
764         
765         Expose WKDebugOverlayRegions via the C SPI.
766         
767         * UIProcess/API/C/WKPreferences.cpp:
768         (WKPreferencesSetVisibleDebugOverlayRegions):
769         (WKPreferencesGetVisibleDebugOverlayRegions):
770         * UIProcess/API/C/WKPreferencesRef.h:
771
772 2014-11-03  Beth Dakin  <bdakin@apple.com>
773
774         Implement action menus for editable text with spelling suggestions
775         https://bugs.webkit.org/show_bug.cgi?id=138333
776         -and corresponding-
777         rdar://problem/18742371
778
779         Reviewed by Tim Horton.
780
781         New types.
782         * Shared/API/c/WKActionMenuItemTypes.h:
783         * Shared/API/c/WKActionMenuTypes.h:
784
785         ActionMenuHitTestResult now stores the String result of the lookup.
786         * Shared/mac/ActionMenuHitTestResult.h:
787         * Shared/mac/ActionMenuHitTestResult.mm:
788         (WebKit::ActionMenuHitTestResult::encode):
789         (WebKit::ActionMenuHitTestResult::decode):
790
791         Make getGuessesForWord() public so we can call it from WKActionMenuController.
792         * UIProcess/WebPageProxy.h:
793         * UIProcess/mac/WKActionMenuController.mm:
794
795         Select the text for all types of text menus.
796         (-[WKActionMenuController isMenuForTextContent]):
797         (-[WKActionMenuController willOpenMenu:withEvent:]):
798
799         Spelling suggestions are presented in a sub-menu and will replace the selection 
800         when chosen.
801         (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions:]):
802         (-[WKActionMenuController _changeSelectionToSuggestion:]):
803         (-[WKActionMenuController _createActionMenuItemForTag:]):
804         (-[WKActionMenuController _defaultMenuItems:]):
805
806         New function to store the lookupText as a String on the ActionMenuHitTestResult.
807         * WebProcess/WebPage/WebPage.h:
808         * WebProcess/WebPage/mac/WebPageMac.mm:
809         (WebKit::WebPage::performActionMenuHitTestAtLocation):
810         (WebKit::WebPage::lookupTextAtLocation):
811
812 2014-11-03  Simon Fraser  <simon.fraser@apple.com>
813
814         Add page overlays that show regions with mouseWheel event handlers, and the non-fast-scrollable region, and code to toggle them in MiniBrowser WK2
815         https://bugs.webkit.org/show_bug.cgi?id=138257
816
817         Reviewed by Tim Horton.
818         
819         Add private prefs to control visibility of debug-related page region overlays.
820
821         * Shared/WebPreferencesDefinitions.h:
822         * UIProcess/API/Cocoa/WKPreferences.mm:
823         (-[WKPreferences _visibleDebugOverlayRegions]):
824         (-[WKPreferences _setVisibleDebugOverlayRegions:]):
825         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
826         * UIProcess/mac/WebPreferencesMac.mm:
827         (WebKit::setDebugUInt32ValueIfInUserDefaults):
828         * WebProcess/WebPage/WebPage.cpp:
829         (WebKit::WebPage::updatePreferences):
830         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
831         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences): Update the overlays.
832         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
833         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences): Update the overlays.
834
835 2014-11-03  Commit Queue  <commit-queue@webkit.org>
836
837         Unreviewed, rolling out r175406, r175413, and r175423.
838         https://bugs.webkit.org/show_bug.cgi?id=138327
839
840         Multipart tests are still broken (Requested by ap on #webkit).
841
842         Reverted changesets:
843
844         "Eliminate ResourceBuffer and use SharedBuffer directly
845         instead"
846         https://bugs.webkit.org/show_bug.cgi?id=138174
847         http://trac.webkit.org/changeset/175406
848
849         "Unreviewed, iOS build fix since 175406."
850         http://trac.webkit.org/changeset/175413
851
852         "Fix assertion in CachedResource::addDataBuffer"
853         http://trac.webkit.org/changeset/175423
854
855 2014-11-03  Tim Horton  <timothy_horton@apple.com>
856
857         _actionMenuItemsForHitTestResult is given kWKActionMenuLink but an empty array of defaultMenuItems
858         https://bugs.webkit.org/show_bug.cgi?id=138321
859         <rdar://problem/18855134>
860
861         Reviewed by Beth Dakin.
862
863         * UIProcess/mac/WKActionMenuController.mm:
864         (-[WKActionMenuController _defaultMenuItemsForLink]):
865         (-[WKActionMenuController _defaultMenuItems:]):
866         Move the HTTP-family-URLs-only condition to the place where we decide what kind of menu to
867         show. We depend on _defaultMenuItemsForLink returning the link menu, and should never
868         set the link menu type if we aren't going to build a link menu.
869
870 2014-11-03  Tim Horton  <timothy_horton@apple.com>
871
872         Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap
873         https://bugs.webkit.org/show_bug.cgi?id=138300
874         <rdar://problem/18855863>
875
876         Reviewed by Simon Fraser.
877
878         Share more code by using WebCore's FrameSnapshotting::snapshotSelection
879         in FindController instead of copying it into FindController wholesale.
880
881         * WebProcess/WebPage/FindController.cpp:
882         (WebKit::getFindIndicatorBitmap):
883         Make getFindIndicatorBitmap static, rename it from getFindIndicatorBitmapAndRect,
884         and drop the rect argument because only one caller wanted it, and we no longer need
885         to compute it (this happens in WebCore now).
886
887         Use snapshotSelection; all of the removed paint behaviors get added by
888         code in or underneath snapshotSelection now.
889
890         Draw the snapshot into our ShareableBitmap; we could avoid this in a future patch
891         by refactoring the FrameSnapshotting functions to take GraphicsContexts.
892
893         (WebKit::FindController::getImageForFindMatch):
894         (WebKit::FindController::updateFindIndicator):
895         Adopt the new getFindIndicatorBitmap.
896
897         * WebProcess/WebPage/FindController.h:
898         Remove getFindIndicatorBitmap(AndRect), which is now static.
899
900 2014-11-03  Csaba Osztrogonác  <ossy@webkit.org>
901
902         URTBF after r175476 to make GTK and EFL build happy.
903
904         * UIProcess/API/gtk/PageClientImpl.cpp:
905         (WebKit::PageClientImpl::setTextIndicator):
906         (WebKit::PageClientImpl::setFindIndicator): Deleted.
907         * UIProcess/API/gtk/PageClientImpl.h:
908         * UIProcess/CoordinatedGraphics/WebView.cpp:
909         (WebKit::WebView::setTextIndicator):
910         (WebKit::WebView::setFindIndicator): Deleted.
911         * UIProcess/CoordinatedGraphics/WebView.h:
912
913 2014-11-03  Tim Horton  <timothy_horton@apple.com>
914
915         Rename FindIndicator{Window} to TextIndicator{Window}
916         https://bugs.webkit.org/show_bug.cgi?id=138302
917         <rdar://problem/18855190>
918
919         Reviewed by Anders Carlsson.
920
921         Rename FindIndicator{Window} to TextIndicator{Window} (and related),
922         because it will soon be used to indicate ranges of text that are not
923         necessarily find-in-page results.
924
925         FindController still has things named 'findIndicator' internally,
926         and I left the API alone (because all the API bits are actually find-specific),
927         but the actual FindIndicator/Window and the message to set it up, etc. are all
928         now called Text*.
929
930         * CMakeLists.txt:
931         * UIProcess/API/mac/WKView.mm:
932         * UIProcess/API/mac/WKViewInternal.h:
933         * UIProcess/PageClient.h:
934         * UIProcess/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/FindIndicator.cpp.
935         * UIProcess/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/FindIndicator.h.
936         * UIProcess/WebPageProxy.cpp:
937         * UIProcess/WebPageProxy.h:
938         * UIProcess/WebPageProxy.messages.in:
939         * UIProcess/ios/PageClientImplIOS.h:
940         * UIProcess/ios/PageClientImplIOS.mm:
941         * UIProcess/ios/WKContentView.h:
942         * UIProcess/mac/PageClientImpl.h:
943         * UIProcess/mac/PageClientImpl.mm:
944         * UIProcess/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h.
945         * UIProcess/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm.
946         * WebKit2.xcodeproj/project.pbxproj:
947         * WebProcess/WebPage/FindController.cpp:
948
949 2014-11-03  Beth Dakin  <bdakin@apple.com>
950
951         Implement action menus for editable text
952         https://bugs.webkit.org/show_bug.cgi?id=138284
953         -and corresponding-
954         rdar://problem/18742323
955
956         Reviewed by Tim Horton.
957
958         New item type for paste.
959         * Shared/API/c/WKActionMenuItemTypes.h:
960
961         New menu type for editable text.
962         * Shared/API/c/WKActionMenuTypes.h:
963         * UIProcess/mac/WKActionMenuController.mm:
964
965         willOpenMenu should select text for both regular text menus and editable text 
966         menus. 
967         (-[WKActionMenuController willOpenMenu:withEvent:]):
968
969         Default items for editable text.
970         (-[WKActionMenuController _defaultMenuItemsForEditableText]):
971         (-[WKActionMenuController _paste:]):
972         (-[WKActionMenuController _createActionMenuItemForTag:]):
973
974         New method _hitTestResultForStage:(MenuUpdateStage)stage will figure out whether 
975         we can use the WebHitTestResult from the ActionMenuHitTestResult or if we have to 
976         use the potentially out-of-date WebHitTestResult that is cached on WebPageProxy. 
977         An important difference between these results is that the ActionMenuHitTest 
978         result, in addition to being more recent and accurate, also now includes shadow 
979         content, which affects some editable regions on important sites such as 
980         bugs.webkit.org and nytimes.com.
981         (-[WKActionMenuController _defaultMenuItems:]):
982         (-[WKActionMenuController _updateActionMenuItemsForStage:]):
983         (imageForResource:name::if): Deleted.
984
985         Allow shadow content in action menu hit testing.
986         * WebProcess/WebPage/mac/WebPageMac.mm:
987         (WebKit::WebPage::performActionMenuHitTestAtLocation):
988         (WebKit::WebPage::selectLookupTextAtLocation):
989
990 2014-11-03  Ada Chan  <adachan@apple.com>
991
992         Persist the page's muted state across web process crashes.
993         https://bugs.webkit.org/show_bug.cgi?id=138195
994
995         Reviewed by Anders Carlsson.
996
997         Store the Page's muted state in WebPageCreationParameters so that state can be properly
998         restored after recovering from a crash in the web process.
999
1000         * Shared/WebPageCreationParameters.cpp:
1001         (WebKit::WebPageCreationParameters::encode):
1002         (WebKit::WebPageCreationParameters::decode):
1003         * Shared/WebPageCreationParameters.h:
1004         * UIProcess/WebPageProxy.cpp:
1005         (WebKit::WebPageProxy::WebPageProxy):
1006         Initialize m_muted.
1007         (WebKit::WebPageProxy::setMuted):
1008         Update m_muted.
1009         (WebKit::WebPageProxy::creationParameters):
1010         Set the muted data member in WebPageCreationParameters.
1011         * UIProcess/WebPageProxy.h:
1012         * WebProcess/WebPage/WebPage.cpp:
1013         (WebKit::WebPage::WebPage):
1014         Initialize the page's muted state with the muted value from WebPageCreationParameters.
1015
1016 2014-11-03  Ryuan Choi  <ryuan.choi@gmail.com>
1017
1018         [EFL] Remove dependency of PageViewportController from PageViewportControllerClient
1019         https://bugs.webkit.org/show_bug.cgi?id=138301
1020
1021         Reviewed by Gyuyoung Kim.
1022
1023         PaeViewportControllerClient does not need to keep the instance of PageViewPortController.
1024         This patch removes it to simplify relation between them.
1025         In addition, uses a reference for the client of PageViewportController.
1026
1027         * UIProcess/API/efl/EwkView.cpp:
1028         (EwkView::EwkView):
1029         (EwkView::setViewportPosition):
1030         * UIProcess/API/efl/EwkView.h:
1031         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1032         (WebKit::PageViewportController::PageViewportController):
1033         (WebKit::PageViewportController::didChangeContentsSize):
1034         (WebKit::PageViewportController::didRenderFrame):
1035         (WebKit::PageViewportController::pageDidRequestScroll):
1036         (WebKit::PageViewportController::syncVisibleContents):
1037         (WebKit::PageViewportController::didChangeViewportAttributes):
1038         * UIProcess/CoordinatedGraphics/PageViewportController.h:
1039         * UIProcess/PageViewportControllerClient.h:
1040         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
1041         (WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl):
1042         (WebKit::PageViewportControllerClientEfl::setViewportPosition):
1043         (WebKit::PageViewportControllerClientEfl::setController): Deleted.
1044         * UIProcess/efl/PageViewportControllerClientEfl.h:
1045
1046 2014-11-03  Sungmann Cho  <sungmann.cho@navercorp.com>
1047
1048         AX: Fix some minor typos related to the word "accessibility".
1049         https://bugs.webkit.org/show_bug.cgi?id=138299
1050
1051         Reviewed by Chris Fleizach.
1052
1053         No new tests, no behavior change.
1054
1055         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
1056
1057 2014-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1058
1059         REGRESSION(r163656): Remote inspector doesn't work unless preferences change after page initialization
1060         https://bugs.webkit.org/show_bug.cgi?id=138246
1061
1062         Reviewed by Joseph Pecoraro.
1063
1064         The problem is that initializeWebPage() is still using
1065         pageGroup().preferences() instead of m_preferences to check if
1066         developer extras are enabled to enable remote inspection of the page.
1067
1068         * UIProcess/WebPageProxy.cpp:
1069         (WebKit::WebPageProxy::initializeWebPage): Use m_preferences
1070         instead of pageGroup().preferences().
1071
1072 2014-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1073
1074         REGRESSION(CMake): Make it possible to build without introspection
1075         https://bugs.webkit.org/show_bug.cgi?id=138006
1076
1077         Reviewed by Philippe Normand.
1078
1079         Do not install introspection files when introspection is disabled.
1080
1081         * PlatformGTK.cmake:
1082
1083 2014-10-31  Dan Bernstein  <mitz@apple.com>
1084
1085         Removed a reference to a file that’s been deleted.
1086
1087         * WebKit2.xcodeproj/project.pbxproj: Removed reference to XPCPtr.h.
1088
1089 2014-10-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1090
1091         Use std::unique_ptr instead of OwnPtr in CoordinatorDrawingProxy
1092         https://bugs.webkit.org/show_bug.cgi?id=138238
1093
1094         Reviewed by Ryosuke Niwa.
1095
1096         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
1097         (WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy): Use std::make_unique.
1098         (WebKit::CoordinatedDrawingAreaProxy::enterAcceleratedCompositingMode):
1099         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h: Use std::unique_ptr instead of OwnPtr.
1100
1101 2014-10-31  Sam Weinig  <sam@webkit.org>
1102
1103         Add bundle SPI to customize the action menu
1104         <rdar://problem/18830771>
1105         https://bugs.webkit.org/show_bug.cgi?id=138271
1106
1107         Reviewed by Anders Carlsson.
1108
1109         - Adds a new function to the WKBundlePageContextMenuClient that allows the client to pass construct
1110           user data in the bundle that can be available when customizing the menu in -[WKView _actionMenuItemsForHitTestResult...].
1111         - Changes the signature of  -[WKView _actionMenuItemsForHitTestResult...] to add userData.
1112         - Makes the actual hit test result available in the second invocation of -[WKView _actionMenuItemsForHitTestResult...]
1113           by serializing it in the ActionMenuHitTestResult.
1114
1115         * Shared/mac/ActionMenuHitTestResult.h:
1116         * Shared/mac/ActionMenuHitTestResult.mm:
1117         (WebKit::ActionMenuHitTestResult::encode):
1118         (WebKit::ActionMenuHitTestResult::decode):
1119         Adds the WebHitTestResult and the original hit test request location.
1120         
1121         * UIProcess/API/Cocoa/WKViewPrivate.h:
1122         Adds a new version of _actionMenuItemsForHitTestResult that passes userData along.
1123
1124         * UIProcess/API/mac/WKView.mm:
1125         (-[WKView _didPerformActionMenuHitTest:userData:]):
1126         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]):
1127         * UIProcess/API/mac/WKViewInternal.h:
1128         * UIProcess/PageClient.h:
1129         * UIProcess/WebPageProxy.cpp:
1130         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
1131         * UIProcess/WebPageProxy.h:
1132         * UIProcess/WebPageProxy.messages.in:
1133         * UIProcess/mac/PageClientImpl.h:
1134         * UIProcess/mac/PageClientImpl.mm:
1135         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
1136         Pipe the user data through to the WKView.
1137
1138         * UIProcess/mac/WKActionMenuController.h:
1139         * UIProcess/mac/WKActionMenuController.mm:
1140         (-[WKActionMenuController prepareForMenu:withEvent:]):
1141         (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
1142         (-[WKActionMenuController menuNeedsUpdate:]):
1143         (-[WKActionMenuController _updateActionMenuItemsForStage:]):
1144         Differentiate between the two times _updateActionMenuItems was called via a new stage parameter,
1145         (it is called once in prepareForMenu, and once in menuNeedsUpdate). Use the last mouse move hit
1146         test result in the prepareForMenu case (as we don't have a real result yet), and the hit result
1147         passed in via didPerformActionMenuHitTest in the menuNeedsUpdate case (assuming we didn't time out)
1148         waiting on the web process.
1149
1150         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
1151         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
1152         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu):
1153         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
1154         * WebProcess/WebPage/mac/WebPageMac.mm:
1155         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1156         Adds new bundle SPI to collect user data to pass to the -[WKView _actionMenuItemsForHitTestResult...] method.
1157
1158 2014-10-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1159
1160         Use std::unique_ptr for TypeCountSet
1161         https://bugs.webkit.org/show_bug.cgi?id=138242
1162
1163         Reviewed by Andreas Kling.
1164
1165         * WebProcess/WebProcess.cpp:
1166         (WebKit::WebProcess::getWebCoreStatistics): Use std::unique_ptr<> instead of OwnPtr.
1167
1168 2014-10-30  Jer Noble  <jer.noble@apple.com>
1169
1170         [WK2] Send origin & deletion requests to WebProcessess in additon to the DatabaseProcess.
1171         https://bugs.webkit.org/show_bug.cgi?id=138212
1172
1173         Reviewed by Brady Eidson.
1174
1175         Now that the WebProcess has its own WebOriginDataManager, WebOriginDataManagerProxy needs to
1176         send its origin and deletion messages to all the WebProcesses. This necessetates synchronizing
1177         all the various process's callbacks so that the final callback is only triggered once all the
1178         messaged processes reply.
1179
1180         Add a simple class, CallbackSynchronizer, which will keep track of outstanding process callbacks
1181         and which will trigger the final callback once all of them finish.
1182
1183         * UIProcess/WebOriginDataManagerProxy.cpp:
1184         (WebKit::CallbackSynchronizer::create):
1185         (WebKit::CallbackSynchronizer::~CallbackSynchronizer):
1186         (WebKit::CallbackSynchronizer::taskStarted):
1187         (WebKit::CallbackSynchronizer::taskCompleted):
1188         (WebKit::CallbackSynchronizer::CallbackSynchronizer):
1189         (WebKit::createSynchronizedCallback):
1190         (WebKit::sendMessageToAllProcessesInContext):
1191         (WebKit::WebOriginDataManagerProxy::getOrigins):
1192         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
1193         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates):
1194         (WebKit::WebOriginDataManagerProxy::deleteAllEntries):
1195
1196         Drive-by fix: check the correct enum value for WebMedia origin requests.
1197
1198         * WebProcess/WebProcess.cpp:
1199         (WebKit::WebProcess::getOrigins):
1200         (WebKit::WebProcess::deleteEntriesForOrigin):
1201         (WebKit::WebProcess::deleteEntriesModifiedBetweenDates):
1202         (WebKit::WebProcess::deleteAllEntries):
1203
1204 2014-10-31  Tim Horton  <timothy_horton@apple.com>
1205
1206         REGRESSION (r175376): Occasional null deref when doing a dictionary lookup
1207         https://bugs.webkit.org/show_bug.cgi?id=138261
1208         <rdar://problem/18841709>
1209
1210         Reviewed by Anders Carlsson.
1211
1212         * WebProcess/WebPage/mac/WebPageMac.mm:
1213         (WebKit::WebPage::performDictionaryLookupAtLocation):
1214         rangeForDictionaryLookupAtHitTestResult can easily return null.
1215
1216 2014-10-31  Beth Dakin  <bdakin@apple.com>
1217
1218         Use system art for action menus when possible
1219         https://bugs.webkit.org/show_bug.cgi?id=138260
1220
1221         Reviewed by Tim Horton.
1222
1223         * Resources/AddImageToPhotosTemplate.pdf: Removed.
1224         * Resources/CopyImageTemplate.pdf: Removed.
1225         * Resources/SaveImageToDownloadsTemplate.pdf: Removed.
1226         * Resources/ShareImageTemplate.pdf: Removed.
1227         * UIProcess/mac/WKActionMenuController.mm:
1228         (-[WKActionMenuController _createActionMenuItemForTag:]):
1229         * WebKit2.xcodeproj/project.pbxproj:
1230
1231 2014-10-31  Timothy Horton  <timothy_horton@apple.com>
1232
1233         Fix the build for Yosemite systems after r175417
1234
1235         * UIProcess/mac/WKActionMenuController.mm:
1236
1237 2014-10-31  Timothy Horton  <timothy_horton@apple.com>
1238
1239         Fix the build for pre-Yosemite systems after r175417
1240
1241         * UIProcess/API/mac/WKView.mm:
1242         (-[WKView dealloc]):
1243         (-[WKView initWithFrame:context:configuration:webView:]):
1244         * UIProcess/API/mac/WKViewInternal.h:
1245         * UIProcess/mac/PageClientImpl.mm:
1246         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
1247         * UIProcess/mac/WKActionMenuController.h:
1248         * UIProcess/mac/WKActionMenuController.mm:
1249
1250 2014-10-31  Timothy Horton  <timothy_horton@apple.com>
1251
1252         Remove "Add to iPhoto" from the action menu's sharing menu
1253         https://bugs.webkit.org/show_bug.cgi?id=138251
1254         <rdar://problem/18837197>
1255
1256         Reviewed by Anders Carlsson.
1257
1258         * UIProcess/mac/WKActionMenuController.mm:
1259         (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
1260         Retain/autorelease the new array.
1261
1262 2014-10-31  Tim Horton  <timothy_horton@apple.com>
1263
1264         Remove "Add to iPhoto" from the action menu's sharing menu
1265         https://bugs.webkit.org/show_bug.cgi?id=138251
1266         <rdar://problem/18837197>
1267
1268         Reviewed by Anders Carlsson.
1269
1270         * UIProcess/mac/WKActionMenuController.mm:
1271         (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
1272         Filter out "Add to iPhoto".
1273
1274 2014-10-31  Adrian Perez de Castro  <aperez@igalia.com>
1275
1276         [GTK] Support script message handlers WebKitUserContentManager
1277         https://bugs.webkit.org/show_bug.cgi?id=133730
1278
1279         Reviewed by Carlos Garcia Campos.
1280
1281         Support user script message handlers in WebKitUserContentManager.
1282         This needs building with ENABLE_USER_MESSAGE_HANDLERS, for which
1283         an option is added to the CMake build files. The option is disabled
1284         globally by default, and the WebKitGTK port enables it. On the API
1285         level, two new methods to register and unregister names are provided
1286         in the "window.webkit" namespace, and on message reception the
1287         "WebKitUserContentManager::script-message-received" signal is
1288         emitted, using the registered names as signal detail.
1289
1290         * UIProcess/API/gtk/WebKitJavascriptResult.cpp: Add a new private
1291         function to construct a WebKitJavascriptResult directly from a
1292         WebCore::SerializedScriptValue.
1293         (_WebKitJavascriptResult::_WebKitJavascriptResult): Ditto.
1294         (webkitJavascriptResultCreate): Ditto.
1295         * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h: Ditto.
1296         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
1297         (webkit_user_content_manager_class_init): Install the
1298         "script-message-received" signal.
1299         (webkit_user_content_manager_register_script_message_handler):
1300         Added.
1301         (webkit_user_content_manager_unregister_script_message_handler):
1302         Added.
1303         * UIProcess/API/gtk/WebKitUserContentManager.h: Added the new
1304         public API methods.
1305         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Ditto.
1306         * UIProcess/API/gtk/docs/webkit2gtk.types: Add
1307         webkit_user_content_manager_get_type() to the list in order to make
1308         gtk-doc to generate documentation for signals.
1309
1310 2014-10-31  Martin Hock  <mhock@apple.com>
1311
1312         Unreviewed, iOS build fix since 175406.
1313
1314         * WebProcess/WebPage/ios/WebPageIOS.mm:
1315         (WebKit::WebPage::performActionOnElement):
1316
1317 2014-10-30  Darin Adler  <darin@apple.com>
1318
1319         Eliminate ResourceBuffer and use SharedBuffer directly instead
1320         https://bugs.webkit.org/show_bug.cgi?id=138174
1321
1322         Reviewed by Antti Koivisto.
1323
1324         * CMakeLists.txt: Removed WebResourceBuffer.cpp.
1325
1326         * NetworkProcess/NetworkResourceLoader.cpp:
1327         (WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer.
1328         * NetworkProcess/NetworkResourceLoader.h: Ditto.
1329         * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto.
1330         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
1331         (WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto.
1332         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1333         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto.
1334
1335         * Shared/WebResourceBuffer.cpp: Removed.
1336         * Shared/WebResourceBuffer.h: Removed.
1337
1338         * WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h.
1339
1340         * WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes.
1341         (WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead
1342         of a pointer.
1343
1344         * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include.
1345         * WebProcess/Network/WebResourceLoader.cpp: Ditto.
1346         * WebProcess/Network/WebResourceLoader.h: Ditto.
1347         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto.
1348         (WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly.
1349         * WebProcess/WebPage/WebFrame.cpp:
1350         (WebKit::WebFrame::source): Ditto.
1351
1352         * WebProcess/WebPage/WebPage.cpp:
1353         (WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship
1354         between the buffer and the DataReference clearer and to avoid having a long-lived
1355         DataReference pointing to an underlying buffer with unclear lifetime.
1356         (WebKit::WebPage::getContentsAsString): Ditto.
1357         (WebKit::WebPage::getSelectionAsWebArchiveData): Ditto.
1358         (WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly.
1359         (WebKit::WebPage::getResourceDataFromFrame): Ditto.
1360         (WebKit::WebPage::getWebArchiveOfFrame): Ditto.
1361
1362         * WebProcess/WebPage/ios/WebPageIOS.mm:
1363         (WebKit::containingLinkElement): Use elementLineage.
1364         (WebKit::WebPage::performActionOnElement): Use references and SharedBuffer.
1365         ALso did a bit of other cleanup in here.
1366         (WebKit::isAssistableElement): Take Element& instead of Node*, since that's what
1367         the caller has.
1368         (WebKit::nextAssistableElement): Changed name to match what the function does.
1369         Added an obviously-missing check on the startNode argument. Updated for change
1370         to isAssistableElement above. Take a Page& instead of a Page*.
1371         (WebKit::hasAssistableElement): Changed name to match what the function does.
1372         Updated for change to nextAssistableElement above. Took out incorrect comparison
1373         of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*.
1374         (WebKit::WebPage::focusNextAssistedNode): Updated for above changes.
1375         (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes.
1376
1377 2014-10-30  Jer Noble  <jer.noble@apple.com>
1378
1379         [EME] Add Setting for accessing storage location for MediaKeys data
1380         https://bugs.webkit.org/show_bug.cgi?id=138147
1381
1382         Reviewed by Brady Eidson.
1383
1384         * WebProcess/WebPage/WebPage.cpp:
1385         (WebKit::WebPage::WebPage): Pass from WebMediaKeyStorageManager into Settings.
1386
1387 2014-10-30  Dana Burkart  <dburkart@apple.com>
1388
1389         Workaround for <rdar://problem/18830639>
1390
1391         Unreviewed.
1392
1393         * Shared/API/Cocoa/WKFoundation.h:
1394
1395 2014-10-30  Dana Burkart  <dburkart@apple.com>
1396
1397         <rdar://problem/18821260> Prepare for the mysterious future
1398
1399         Reviewed by Lucas Forschler.
1400
1401         * Configurations/Base.xcconfig:
1402         * Configurations/DebugRelease.xcconfig:
1403         * Configurations/FeatureDefines.xcconfig:
1404         * Configurations/Version.xcconfig:
1405         * Configurations/WebContentService.Development.xcconfig:
1406         * Configurations/WebContentService.xcconfig:
1407         * Configurations/WebKit.xcconfig:
1408
1409 2014-10-30  Anders Carlsson  <andersca@apple.com>
1410
1411         Try to fix the iOS build.
1412
1413         * WebProcess/WebPage/WebPage.messages.in:
1414
1415 2014-10-30  Tim Horton  <timothy_horton@apple.com>
1416
1417         Long spins under rangeExpandedAroundPosition on Yahoo Mail
1418         https://bugs.webkit.org/show_bug.cgi?id=138223
1419         <rdar://problem/18819547>
1420
1421         Reviewed by Enrica Casucci.
1422
1423         * WebProcess/WebPage/mac/WebPageMac.mm:
1424         (WebKit::rangeExpandedAroundPositionByCharacters):
1425         Reimplement rangeExpandedAroundPosition to operate on characters instead of lines,
1426         and to use Position. Moving VisiblePositions by line can be very expensive in some cases,
1427         and for generating lookup/Data Detectors context, we don't care about that kind of precision.
1428         This makes this function ~1000x faster when it hits on a row in the Yahoo Mail message list.
1429
1430         (WebKit::WebPage::performDictionaryLookupAtLocation):
1431         (WebKit::scanForDataDetectedItems):
1432         Adopt the new rangeExpandedAroundPositionByCharacters, expanding 250 characters
1433         before and after, which roughly matches what we were usually getting going by line,
1434         and is a reasonable amount of context for these operations.
1435
1436 2014-10-30  Brady Eidson  <beidson@apple.com>
1437
1438         IndexedDB is deleting data when a PK is shared amongst two objectStores
1439         rdar://problem/18479306 and https://bugs.webkit.org/show_bug.cgi?id=137154
1440
1441         Reviewed by Jer Noble.
1442
1443         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1444         (WebKit::v1RecordsTableSchema): Store away the v1 schema for introspection into the database.
1445         (WebKit::v2RecordsTableSchema): Add utility methods to get the v2 schema with different Table names.
1446         (WebKit::createOrMigrateRecordsTableIfNecessary): Check to see if the Records table exists with
1447           the correct schema. If it is the v1 schema, then migrate the data to a new v2 table, drop the v1
1448           table, then slide the new table into place.
1449         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::ensureValidRecordsTable): Make sure the Records table
1450           exists and is v2, and then make sure the uniqueness index exists.
1451         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Don’t bother creating
1452           the Records table here as it will have already been established earlier.
1453         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata):
1454         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
1455
1456 2014-10-30  Beth Dakin  <bdakin@apple.com>
1457
1458         Implement action menus for text
1459         https://bugs.webkit.org/show_bug.cgi?id=138220
1460         -and corresponding-
1461         rdar://problem/18742297
1462
1463         Reviewed by Tim Horton.
1464
1465         Two new types of actions for the two text actions.
1466         * Shared/API/c/WKActionMenuItemTypes.h:
1467
1468         One new type of menu.
1469         * Shared/API/c/WKActionMenuTypes.h:
1470
1471         Pass willOpenMenu on to the WKActionMenuController.
1472         * UIProcess/API/mac/WKView.mm:
1473         (-[WKView willOpenMenu:withEvent:]):
1474
1475         Two new WebPageProxy functions that will pass messages along to the web process.
1476         * UIProcess/WebPageProxy.cpp:
1477         (WebKit::WebPageProxy::selectLookupTextAtLocation):
1478         * UIProcess/WebPageProxy.h:
1479
1480         At willOpenMenu time, text menus should select text so that it is clear what the 
1481         menu actions will apply to.
1482         * UIProcess/mac/WKActionMenuController.h:
1483         * UIProcess/mac/WKActionMenuController.mm:
1484
1485         Menu items for text menus.
1486         (-[WKActionMenuController willOpenMenu:withEvent:]):
1487         (-[WKActionMenuController _defaultMenuItemsForText]):
1488         (-[WKActionMenuController _copyText:]):
1489         (-[WKActionMenuController _lookupText:]):
1490         (-[WKActionMenuController _createActionMenuItemForTag:]):
1491         (imageForResource:name::if):
1492
1493         New messages to the web process.
1494         * UIProcess/mac/WebPageProxyMac.mm:
1495         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
1496         * WebProcess/WebPage/WebPage.h:
1497         * WebProcess/WebPage/WebPage.messages.in:
1498
1499         Re-factor performDictionaryLookupAtLocation() to re-use the code that finds the 
1500         Range for the dictionary lookup. That code now lives in 
1501         rangeForDictionaryLookupAtHitTestResult() and can be used by 
1502         performDictionaryLookupAtLocation() and our new function 
1503         selectLookupTextAtLocation().
1504         * WebProcess/WebPage/mac/WebPageMac.mm:
1505         (WebKit::WebPage::rangeForDictionaryLookupAtHitTestResult):
1506         (WebKit::WebPage::performDictionaryLookupAtLocation):
1507
1508         Since the action menu text is always selected, when the lookup action is chosen, 
1509         we can just lookup the current selection.
1510         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
1511
1512         Uses the new function rangeForDictionaryLookupAtHitTestResult() to get a lookup 
1513         range and then select it.
1514         (WebKit::WebPage::selectLookupTextAtLocation):
1515
1516 2014-10-30  Dan Bernstein  <mitz@apple.com>
1517
1518         When a client certificate is rejected, Safari says the website didn’t accept the certificate “unknown” instead of naming the certificate
1519         https://bugs.webkit.org/show_bug.cgi?id=138216
1520
1521         Reviewed by Alexey Proskuryakov.
1522
1523         * Shared/cf/ArgumentCodersCF.cpp:
1524         (IPC::typeFromCFTypeRef): Remove no-longer-necessary platform guards around SecIdentityRef.
1525         (IPC::encode): Ditto.
1526         (IPC::decode): Ditto.
1527         * Shared/mac/WebCoreArgumentCodersMac.mm:
1528         (IPC::ArgumentCoder<ResourceError>::encodePlatformData): If NSErrorClientCertificateChainKey
1529         is present in the error’s userInfo dictionary, assert that it’s an array of identities and
1530         certificates, and include it in the filtered dictionary.
1531
1532 2014-10-29  Hunseop Jeong  <hs85.jeong@samsung.com>
1533
1534         [CoordinatedGraphics] Use modern for-loops
1535         https://bugs.webkit.org/show_bug.cgi?id=138168
1536
1537         Reviewed by Andreas Kling.
1538
1539         No new tests as there is no change in functionality.
1540
1541         * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: Use a modern for loop.
1542         (WebCore::CoordinatedBackingStore::texture):
1543         (WebCore::CoordinatedBackingStore::paintTilesToTextureMapper):
1544         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp: Use a modern for loop.
1545         (WebKit::CoordinatedDrawingAreaProxy::incorporateUpdate):
1546         * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: Use a modern for loop.
1547         (WebCore::CoordinatedGraphicsScene::setLayerChildrenIfNeeded):
1548         (WebCore::CoordinatedGraphicsScene::createLayers): changed the name of argument to be equal with deleteLayer(). 
1549         (WebCore::CoordinatedGraphicsScene::deleteLayers):
1550         (WebCore::CoordinatedGraphicsScene::createTilesIfNeeded):
1551         (WebCore::CoordinatedGraphicsScene::removeTilesIfNeeded):
1552         (WebCore::CoordinatedGraphicsScene::updateTilesIfNeeded):
1553         (WebCore::CoordinatedGraphicsScene::syncUpdateAtlases):
1554         (WebCore::CoordinatedGraphicsScene::syncImageBackings):
1555         (WebCore::CoordinatedGraphicsScene::commitSceneState):
1556         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: Use a modern for loop.
1557         (WebKit::shouldPaintBoundsRect):
1558         (WebKit::CoordinatedDrawingArea::display):
1559
1560 2014-10-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1561
1562         Unreviewed, EFL build fix since r175349.
1563
1564         * UIProcess/WebBackForwardList.cpp:
1565         (WebKit::WebBackForwardList::didRemoveItem): Use PLATFORM(COCOA) for setSnapshot().
1566
1567 2014-10-29  Tim Horton  <timothy_horton@apple.com>
1568
1569         Null deref under performActionMenuHitTestAtLocation
1570         https://bugs.webkit.org/show_bug.cgi?id=138197
1571         <rdar://problem/18817803>
1572
1573         Reviewed by Beth Dakin.
1574
1575         * WebProcess/WebPage/mac/WebPageMac.mm:
1576         (WebKit::scanForDataDetectedItems):
1577         Null-check the expanded range.
1578
1579 2014-10-28  Ada Chan  <adachan@apple.com>
1580
1581         Implement WKPageSetMuted(bool).
1582         https://bugs.webkit.org/show_bug.cgi?id=138158
1583
1584         Reviewed by Anders Carlsson.
1585
1586         * UIProcess/API/C/WKPage.cpp:
1587         (WKPageSetMuted):
1588         * UIProcess/API/C/WKPagePrivate.h:
1589         * UIProcess/WebPageProxy.cpp:
1590         (WebKit::WebPageProxy::setMuted):
1591         * UIProcess/WebPageProxy.h:
1592         * WebProcess/WebPage/WebPage.cpp:
1593         (WebKit::WebPage::setMuted):
1594         * WebProcess/WebPage/WebPage.h:
1595         * WebProcess/WebPage/WebPage.messages.in:
1596
1597 2014-10-29  Anders Carlsson  <andersca@apple.com>
1598
1599         Clear ViewSnapshots when back/forward list items are removed from their list
1600         https://bugs.webkit.org/show_bug.cgi?id=138188
1601         <rdar://problem/18817001>
1602
1603         Reviewed by Tim Horton.
1604
1605         Ideally we should remove the WebBackForwardListItem objects as well, but this is a somewhat safer fix.
1606
1607         Change all the "remove item" codepaths to call WebBackForwardList::didRemoveItem and have it clear out the snapshot.
1608
1609         * UIProcess/WebBackForwardList.cpp:
1610         (WebKit::WebBackForwardList::pageClosed):
1611         (WebKit::WebBackForwardList::addItem):
1612         (WebKit::WebBackForwardList::removeAllItems):
1613         (WebKit::WebBackForwardList::clear):
1614         (WebKit::WebBackForwardList::didRemoveItem):
1615         * UIProcess/WebBackForwardList.h:
1616
1617 2014-10-29  Tim Horton  <timothy_horton@apple.com>
1618
1619         Hide the 'Add to Photos' item if it isn't available
1620         https://bugs.webkit.org/show_bug.cgi?id=138182
1621         <rdar://problem/18814999>
1622
1623         Reviewed by Beth Dakin.
1624
1625         * UIProcess/mac/WKActionMenuController.mm:
1626         (-[WKActionMenuController _defaultMenuItemsForImage]):
1627         (-[WKActionMenuController _canAddImageToPhotos]):
1628         (-[WKActionMenuController _addImageToPhotos:]):
1629         Factor _canAddImageToPhotos out of _addImageToPhotos:, and use it in
1630         _defaultMenuItemsForImage to avoid including the menu item in the first place.
1631
1632 2014-10-29  Tim Horton  <timothy_horton@apple.com>
1633
1634         Rename WebPageProxy::activeActionMenuHitTestResult to lastMouseMoveHitTestResult
1635         https://bugs.webkit.org/show_bug.cgi?id=138137
1636         <rdar://problem/18798257>
1637
1638         Reviewed by Anders Carlsson.
1639
1640         * UIProcess/WebPageProxy.cpp:
1641         (WebKit::WebPageProxy::mouseDidMoveOverElement):
1642         * UIProcess/WebPageProxy.h:
1643         (WebKit::WebPageProxy::lastMouseMoveHitTestResult):
1644         (WebKit::WebPageProxy::activeActionMenuHitTestResult): Deleted.
1645         * UIProcess/mac/WKActionMenuController.mm:
1646         (-[WKActionMenuController _defaultMenuItemsForLink]):
1647         (-[WKActionMenuController _openURLFromActionMenu:]):
1648         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
1649         (-[WKActionMenuController _quickLookURLFromActionMenu:]):
1650         (-[WKActionMenuController _saveImageToDownloads:]):
1651         (imageForResource:name::if):
1652         (-[WKActionMenuController _updateActionMenuItems]):
1653         Rename to the more accurate and general name.
1654
1655 2014-10-29  Tim Horton  <timothy_horton@apple.com>
1656
1657         Implement action menus for data detected items
1658         https://bugs.webkit.org/show_bug.cgi?id=138178
1659         <rdar://problem/18709436>
1660
1661         Reviewed by Anders Carlsson.
1662
1663         * Shared/API/c/WKActionMenuTypes.h:
1664         Add a new type.
1665
1666         * Shared/WebHitTestResult.cpp:
1667         (WebKit::WebHitTestResult::Data::Data):
1668         (WebKit::WebHitTestResult::Data::encode):
1669         (WebKit::WebHitTestResult::Data::decode):
1670         * Shared/WebHitTestResult.h:
1671         (WebKit::WebHitTestResult::isTextNode):
1672         Determine, store, encode, and decode whether or not the hit node is a text node.
1673
1674         * Shared/mac/ActionMenuHitTestResult.h:
1675         * Shared/mac/ActionMenuHitTestResult.mm: Renamed from Source/WebKit2/Shared/mac/ActionMenuHitTestResult.cpp.
1676         (WebKit::ActionMenuHitTestResult::encode):
1677         (WebKit::ActionMenuHitTestResult::decode):
1678         Make ActionMenuHitTestResult an Obj-C++ file.
1679         Store, encode, and decode (securely!) a DDActionContext and FloatRect
1680         representing the bounding box of the data detected item, if any.
1681
1682         * UIProcess/API/mac/WKView.mm:
1683         (-[WKView initWithFrame:context:configuration:webView:]):
1684         (-[WKView willOpenMenu:withEvent:]): Deleted.
1685         Stop using willOpenMenu; we'll use NSMenuDelegate's menuNeedsUpdate: instead.
1686         Hook up WKActionMenuController as our action menu's delegate.
1687
1688         * UIProcess/mac/WKActionMenuController.mm:
1689         (-[WKActionMenuController prepareForMenu:withEvent:]):
1690         Call _updateActionMenuItems *after* we've adjusted _state, so that it
1691         can depend on the value being correct.
1692
1693         (-[WKActionMenuController willOpenMenu:withEvent:]):
1694         (-[WKActionMenuController didPerformActionMenuHitTest:]):
1695         Move menu updating to menuNeedsUpdate for more accurate timing.
1696
1697         (_updateActionMenuItems):
1698         When building the menu, if we have a text node that is not a link,
1699         and hit a data detected item, retrieve the menu from the DDActionContext.
1700         If we have nothing, make sure to reset _type, and if the final hit-test
1701         is still pending, build a menu with a dummy item.
1702
1703         * WebKit2.xcodeproj/project.pbxproj:
1704         * WebProcess/WebPage/WebPage.cpp:
1705         (WebKit::WebPage::performActionMenuHitTestAtLocation): Moved to WebPageMac.
1706         * WebProcess/WebPage/mac/WebPageMac.mm:
1707         (WebKit::rangeExpandedAroundPosition):
1708         Factor this out of performDictionaryLookupAtLocation.
1709
1710         (WebKit::WebPage::performDictionaryLookupAtLocation):
1711         Make use of rangeExpandedAroundPosition.
1712
1713         (WebKit::scanForDataDetectedItems):
1714         Expand to four lines of context around the hit point.
1715         Convert that range to plain text, and feed it to DataDetectors.
1716         Find the result that intersects the hit point, and make a DDActionContext
1717         for it. Also, store the bounding box of the first quad of the detected
1718         text, to provide to Data Detectors as a hint for UI placement.
1719
1720         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1721         If the hit node is a text node, call scanForDataDetectedItems and
1722         store the resultant DDActionContext and bounding rect on our
1723         ActionMenuHitTestResult for transfer to the UI process.
1724
1725 2014-10-29  Joseph Pecoraro  <pecoraro@apple.com>
1726
1727         [iOS] iPad: Occasional <select> crashes attempting to scroll to non-existing row 0 in viewWillAppear
1728         https://bugs.webkit.org/show_bug.cgi?id=138165
1729
1730         Reviewed by David Kilzer.
1731
1732         This is a speculative fix for a crash attempting to scroll to a row in a
1733         select picker on iPad. In these cases we are trying to scroll to the first
1734         row of the first section, but no such row appears to exist. I was unable
1735         to reproduce the issue, but if it is happening we should be able to protect
1736         safely protect against crashing.
1737
1738         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1739         (-[WKSelectTableViewController viewWillAppear:]):
1740         Protect against trying to scroll to a section/row that does not exist
1741         by pre-checking that the section/row is valid.
1742
1743 2014-10-28  Ting-Wei Lan  <lantw44@gmail.com>
1744
1745         Cast std::chrono::duration.count() to int64_t in ArgumentCoder
1746         https://bugs.webkit.org/show_bug.cgi?id=136981
1747
1748         Reviewed by Alexey Proskuryakov.
1749
1750         Explicitly cast the return value of std::chrono::duration.count() to
1751         a fixed-size interger type, which prevents compilation error when
1752         the return value type matches neither int32_t nor int64_t.
1753
1754         * Platform/IPC/ArgumentCoders.h:
1755
1756 2014-10-28  Jer Noble  <jer.noble@apple.com>
1757
1758         [EME] Pass location for media key storage through from WebKit/WebKit2.
1759         https://bugs.webkit.org/show_bug.cgi?id=137120
1760
1761         Reviewed by Anders Carlsson.
1762
1763         Allow the location for media key storage to be passed into the WebProcess from the UIProcess
1764         through the WebContextConfiguraiton struct.
1765
1766         * Shared/WebProcessCreationParameters.cpp:
1767         (WebKit::WebProcessCreationParameters::encode): Add mediaKeysStorageDirectory.
1768         (WebKit::WebProcessCreationParameters::decode): Ditto.
1769         * Shared/WebProcessCreationParameters.h:
1770         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1771         (WKContextConfigurationCopyMediaKeysStorageDirectory): Added getter.
1772         (WKContextConfigurationSetMediaKeysStorageDirectory): Added setter.
1773         * UIProcess/API/C/WKContextConfigurationRef.h:
1774         * UIProcess/API/C/WKOriginDataManager.h:
1775         * UIProcess/API/Cocoa/WKProcessPool.mm:
1776         (-[WKProcessPool _initWithConfiguration:]): Provide a default location.
1777         * UIProcess/APIContextConfiguration.cpp:
1778         (API::ContextConfiguration::webContextConfiguration): Set mediaKeysStorageDirectory.
1779         * UIProcess/APIContextConfiguration.h:
1780         (API::ContextConfiguration::mediaKeysStorageDirectory): Added getter.
1781         (API::ContextConfiguration::setMediaKeysStorageDirectory): Added setter.
1782         * UIProcess/WebContext.cpp:
1783         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): Apply mediaKeysStorageDirectory.
1784         (WebKit::WebContext::WebContext): Initialize m_mediaKeysStorageDirectory.
1785         (WebKit::WebContext::createNewWebProcess): Create a sandbox extension handle for mediaKeysStorageDirectory.
1786         * UIProcess/WebContext.h:
1787         * UIProcess/efl/WebContextEfl.cpp:
1788         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Return a default location.
1789         * UIProcess/gtk/WebContextGtk.cpp:
1790         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Ditto.
1791         * UIProcess/mac/WebContextMac.mm:
1792         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Return an overridable default location.
1793         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: Added.
1794         (WebKit::WebMediaKeyStorageManager::initialize): Pull the mediaKeysStorageDirectory out of configuration.
1795         (WebKit::WebMediaKeyStorageManager::supplementName): Return a configuration name.
1796         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin): Return the
1797             correct storage directory based on the SecureOrigin.
1798         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins): Return the origins within the
1799             storage directory.
1800         (WebKit::removeAllMediaKeyStorageForOriginPath): Static, remove contents and directory at path.
1801         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin): Use
1802             removeAllMediaKeyStorageForOriginPath to remove origin data.
1803         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates): Ditto.
1804         (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries): Ditto.
1805         * WebProcess/MediaCache/WebMediaKeyStorageManager.h: Added.
1806         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager): Default constructor.
1807         (WebKit::WebMediaKeyStorageManager::~WebMediaKeyStorageManager): Default virtual destructor.
1808         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectory): Simple accessor.
1809         * WebProcess/WebProcess.cpp:
1810         (WebKit::WebProcess::WebProcess): Add WebMediaKeyStorageManager as a supplement.
1811         * WebProcess/cocoa/WebProcessCocoa.mm:
1812         (WebKit::WebProcess::platformInitializeWebProcess): Create a sandbox extension from the sandbox extension handle.
1813
1814         Add new source files to project(s).
1815
1816         * PlatformEfl.cmake:
1817         * PlatformGTK.cmake:
1818         * WebKit2.xcodeproj/project.pbxproj:
1819         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1820         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
1821         (WebKit::removeAllMediaKeyStorageForOriginPath):
1822
1823         Drive-by fix: references to VoidCallback are ambiguous, since the same name is re-used in multiple namespaces.
1824         Make references to WebCore::VoidCallback explicit where the entire WebCore (and other) namespaces are pulled in.
1825
1826         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
1827         (WebKit::NotificationPermissionRequestManager::startRequest):
1828         (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
1829         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
1830         (WebKit::WebNotificationClient::requestPermission):
1831
1832 2014-10-28  Jeremy Jones  <jeremyj@apple.com>
1833
1834         Add optimized fullscreen mode.
1835         https://bugs.webkit.org/show_bug.cgi?id=138044
1836
1837         Reviewed by Anders Carlsson.
1838
1839         Enable different types of fullscreen video behavior.
1840         Add an enum parameter to enterVideoFullscreenForVideoElement for alternate types of fullscreen.
1841
1842         * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Add fullscreenType parameter
1843         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
1844         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1845         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): ditto
1846         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1847         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): ditto
1848         * WebProcess/WebCoreSupport/WebChromeClient.h: ditto
1849         * WebProcess/ios/WebVideoFullscreenManager.h: ditto
1850         * WebProcess/ios/WebVideoFullscreenManager.mm:
1851         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): ditto
1852         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): ditto
1853
1854 2014-10-28  Dan Bernstein  <mitz@apple.com>
1855
1856         Added a Radar reference to a comment.
1857
1858         * Shared/mac/WebCoreArgumentCodersMac.mm:
1859         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1860
1861 2014-10-28  Dan Bernstein  <mitz@apple.com>
1862
1863         [Cocoa] REGERESSION (r171801): Client certificate authentication is failing
1864         https://bugs.webkit.org/show_bug.cgi?id=138144
1865
1866         Reviewed by Alexey Proskuryakov.
1867
1868         NSURLCredential’s implementation of NSSecureCoding fails to encode identity-based
1869         credentials properly. Work around that by encoding the identity, certificate, and
1870         persistence individually.
1871
1872         * Shared/mac/WebCoreArgumentCodersMac.mm:
1873         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1874         (IPC::ArgumentCoder<Credential>::decodePlatformData):
1875
1876 2014-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1877
1878         [iOS] iPhone should not allow selecting <optgroup> in <select multiple>
1879         https://bugs.webkit.org/show_bug.cgi?id=137991
1880
1881         Reviewed by Darin Adler.
1882
1883         We seem to be getting the delegate when we are not supposed to.
1884         Workaround the issue as best we can by reseting the styles
1885         for the group's content view and not changing selections.
1886
1887         * UIProcess/ios/forms/WKFormSelectPicker.mm:
1888         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
1889
1890 2014-10-28  Tim Horton  <timothy_horton@apple.com>
1891
1892         Remove an inaccurate comment in WKActionMenuController
1893         https://bugs.webkit.org/show_bug.cgi?id=138135
1894
1895         Reviewed by Anders Carlsson.
1896
1897         * UIProcess/mac/WKActionMenuController.mm:
1898         (-[WKActionMenuController _defaultMenuItemsForLink]):
1899         The comment is wrong; the separator is there for spacing, not just as a workaround.
1900
1901 2014-10-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1902
1903         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.1 release.
1904
1905         * gtk/NEWS: Add release notes for 2.7.1.
1906
1907 2014-10-28  Dan Bernstein  <mitz@apple.com>
1908
1909         [Mac] OS X Mavericks build broken with public SDK
1910         https://bugs.webkit.org/show_bug.cgi?id=138108
1911
1912         Reviewed by Mark Rowe.
1913
1914         * Shared/API/Cocoa/WKFoundation.h: Only define the NSEventModifierFlags type when using a
1915         version of the OS X SDK that doesn’t define it.
1916
1917 2014-10-27  Conrad Shultz  <conrad_shultz@apple.com>
1918
1919         NSSharingService protocol conformance should be internal to WKActionMenuController
1920         https://bugs.webkit.org/show_bug.cgi?id=138112
1921
1922         Reviewed by Tim Horton.
1923
1924         * UIProcess/mac/WKActionMenuController.h:
1925         * UIProcess/mac/WKActionMenuController.mm:
1926         Move protocol conformance from the interface to a class extension.
1927
1928 2014-10-27  Enrica Casucci  <enrica@apple.com>
1929
1930         WebContent crash in WebKit::WebPage::expandedRangeFromHandle.
1931         https://bugs.webkit.org/show_bug.cgi?id=138023
1932         rdar://problem/18787412
1933
1934         Reviewed by Ryosuke Niwa.
1935
1936         We must change that we have a valid currentRange before trying
1937         to expand or contract.
1938
1939         * WebProcess/WebPage/ios/WebPageIOS.mm:
1940         (WebKit::WebPage::changeBlockSelection):
1941
1942 2014-10-27  Alexey Proskuryakov  <ap@apple.com>
1943
1944         http/tests/cookies/third-party-cookie-relaxing.html is flaky on bots
1945         https://bugs.webkit.org/show_bug.cgi?id=138098
1946
1947         Reviewed by Anders Carlsson.
1948
1949         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1950         * WebProcess/com.apple.WebProcess.sb.in:
1951         Update for the new name of testing session. Memory regions are now of the form
1952         "WebKit Test-<pid>-0".
1953
1954 2014-10-27  Chris Dumez  <cdumez@apple.com>
1955
1956         Use separate HashMaps for common and uncommon headers in HTTPHeaderMap
1957         https://bugs.webkit.org/show_bug.cgi?id=138079
1958
1959         Reviewed by Anders Carlsson.
1960
1961         Update the WK2 IPC HTTPHeaderMap serialization / deserialization code
1962         to leverage the fact that HTTPHeaderMap now stores common HTTP headers
1963         and uncommon one in separate HashMaps. This speeds up deserialization
1964         as we no longer need to call findHTTPHeaderName() for every decoded
1965         header. We already know if the header is a common one or not, and if
1966         it is then we already have a HTTPHeaderName type instead of a String.
1967
1968         I see that we spend ~40% less time in HTTPHeaderMap decoding when
1969         loading http://flickr.com/explore, while the encoding takes about
1970         the same amount of time as before.
1971
1972         * Shared/WebCoreArgumentCoders.cpp:
1973         (IPC::ArgumentCoder<HTTPHeaderMap>::encode):
1974         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
1975
1976 2014-10-24  Benjamin Poulain  <bpoulain@apple.com>
1977
1978         Fix the iOS build
1979
1980         * Configurations/WebKit.xcconfig:
1981
1982 2014-10-24  Beth Dakin  <bdakin@apple.com>
1983
1984         _actionMenuItemsForHitTestResult should also take a type indicating what the menu 
1985         was built for
1986         https://bugs.webkit.org/show_bug.cgi?id=138063
1987
1988         Reviewed by Dan Bernstein.
1989
1990         New type enum that can be used by clients.
1991         * Shared/API/c/WKActionMenuTypes.h: Added.
1992
1993         Remove the old SPI and add the new.
1994         * UIProcess/API/Cocoa/WKViewPrivate.h:
1995         * UIProcess/API/mac/WKView.mm:
1996         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]):
1997         (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]): Deleted.
1998
1999         Now keep an ivar for the type.
2000         * UIProcess/mac/WKActionMenuController.h:
2001
2002         Create a category for the old SPI so that we can still call it if clients have 
2003         implemented it.
2004         * UIProcess/mac/WKActionMenuController.mm:
2005         (-[WKActionMenuController initWithPage:view:]):
2006         (-[WKActionMenuController didCloseMenu:withEvent:]):
2007         (imageForResource:name::if):
2008         (-[WKActionMenuController _updateActionMenuItems]):
2009         * WebKit2.xcodeproj/project.pbxproj:
2010
2011 2014-10-24  Tim Horton  <timothy_horton@apple.com>
2012
2013         Share sheet doesn't attach to the window
2014         https://bugs.webkit.org/show_bug.cgi?id=138062
2015         <rdar://problem/18767397>
2016
2017         Reviewed by Beth Dakin.
2018
2019         * UIProcess/mac/WKActionMenuController.h:
2020         WKActionMenuController is now a NSSharingService{Picker}Delegate.
2021
2022         * UIProcess/mac/WKActionMenuController.mm:
2023         (-[WKActionMenuController _defaultMenuItemsForImage]):
2024         Set us up as the NSSharingServicePicker delegate.
2025
2026         (-[WKActionMenuController sharingServicePicker:delegateForSharingService:]):
2027         Set us up as the NSSharingService delegate.
2028
2029         (-[WKActionMenuController sharingService:sourceWindowForShareItems:sharingContentScope:]):
2030         Return the appropriate window to attach to.
2031
2032 2014-10-24  Jer Noble  <jer.noble@apple.com>
2033
2034         Abstractify WebOriginDataManager to support arbitrary ChildProcess supplements.
2035         https://bugs.webkit.org/show_bug.cgi?id=137993
2036
2037         Reviewed by Brady Eidson.
2038
2039         To allow different ChildProcess subclasses to handle listing and deletion of origin
2040         data, make WebOriginDataManager more generic by having a supplement implement the
2041         details, leaving WebOriginDataManager to deal with cross-process messaging.
2042
2043         De-virtualize AsyncTask, allowing a task to be created by passing in a
2044         function<void()>, rather than an object, method, and arguments.
2045
2046         * Shared/AsyncTask.h:
2047         (WebKit::AsyncTask::AsyncTask):
2048         (WebKit::AsyncTask::performTask):
2049         (WebKit::AsyncTask::~AsyncTask): Deleted.
2050
2051         Add a new virtual base class, to be implemented by various ChildProcesses, which
2052         WebOriginDataManager will use to implement listing and deletion requests.
2053
2054         * WebProcess/OriginData/WebOriginDataManager.h:
2055         * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Added.
2056         (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement):
2057         (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement):
2058         (WebKit::WebOriginDataManagerSupplement::getOrigins):
2059         (WebKit::WebOriginDataManagerSupplement::deleteEntriesForOrigin):
2060         (WebKit::WebOriginDataManagerSupplement::deleteEntriesModifiedBetweenDates):
2061         (WebKit::WebOriginDataManagerSupplement::deleteAllEntries):
2062         * WebKit2.xcodeproj/project.pbxproj:
2063
2064         WebOriginDataManager doesn't need to be a ChildSupplement. Remove the DatabaseProcess-
2065         specific implementations for its message handlers and replace with clean, generic calls
2066         to its supplement. Because these supplements may want to respond to the request
2067         asynchronously, pass a completion function in to be called by the supplement once its
2068         work is complete.
2069
2070         * WebProcess/OriginData/WebOriginDataManager.cpp:
2071         (WebKit::WebOriginDataManager::WebOriginDataManager):
2072         (WebKit::WebOriginDataManager::getOrigins):
2073         (WebKit::WebOriginDataManager::deleteEntriesForOrigin):
2074         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates):
2075         (WebKit::WebOriginDataManager::deleteAllEntries):
2076         (WebKit::WebOriginDataManager::supplementName): Deleted.
2077
2078         DatabaseProcess already uses WebOriginDataManager, so it will be the first process
2079         to fall under the heel of the new regime. DatabaseProcess will subclass
2080         WebOriginDataManagerSupplement, and pass itself in twice to the WebOriginDataManager
2081         constructor. Create a lambda-based AsyncTask for each request, and call the completion
2082         function when each request is complete.
2083
2084         * DatabaseProcess/DatabaseProcess.cpp:
2085         (WebKit::DatabaseProcess::DatabaseProcess):
2086         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
2087         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
2088         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
2089         (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
2090         (WebKit::DatabaseProcess::getOrigins):
2091         (WebKit::DatabaseProcess::deleteEntriesForOrigin):
2092         (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates):
2093         (WebKit::DatabaseProcess::deleteAllEntries):
2094         (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): Deleted.
2095         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): Deleted.
2096         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted.
2097         (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): Deleted.
2098         * DatabaseProcess/DatabaseProcess.h:
2099
2100 2014-10-24  Beth Dakin  <bdakin@apple.com>
2101
2102         Very large images crash in action menu code
2103         https://bugs.webkit.org/show_bug.cgi?id=138059
2104         -and corresponding-
2105         rdar://problem/18767859
2106
2107         Reviewed by Tim Horton.
2108
2109         If the HitTestResult failed to create and image, then don’t go for the image 
2110         action menu.
2111         * UIProcess/mac/WKActionMenuController.mm:
2112         (-[WKActionMenuController _defaultMenuItems]):
2113
2114         ShareableBitmap::createShareable() can fail. The result needs to be null-checked.
2115         * WebProcess/WebPage/WebPage.cpp:
2116         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2117
2118 2014-10-24  Beth Dakin  <bdakin@apple.com>
2119
2120         Build fix.
2121
2122         * UIProcess/mac/WKActionMenuController.h:
2123         * UIProcess/mac/WKActionMenuController.mm:
2124
2125 2014-10-24  Tim Horton  <timothy_horton@apple.com>
2126
2127         Blindly try to fix all the builds.
2128
2129         * UIProcess/mac/WKActionMenuController.h:
2130         * UIProcess/mac/WKActionMenuController.mm:
2131
2132 2014-10-24  Timothy Horton  <timothy_horton@apple.com>
2133
2134         Blindly try to fix all the builds.
2135
2136         * UIProcess/mac/WKActionMenuController.h:
2137
2138 2014-10-24  Timothy Horton  <timothy_horton@apple.com>
2139
2140         Blindly try to fix the 32-bit build.
2141
2142         * UIProcess/mac/WKActionMenuController.h:
2143         * UIProcess/mac/WKActionMenuController.mm:
2144
2145 2014-10-24  Tim Horton  <timothy_horton@apple.com>
2146
2147         [Mac][WebKit2] Move action menu code into its own file
2148         https://bugs.webkit.org/show_bug.cgi?id=138034
2149         <rdar://problem/18758758>
2150
2151         * UIProcess/mac/WKActionMenuController.mm:
2152         (-[WKActionMenuController prepareForMenu:withEvent:]):
2153         (-[WKActionMenuController _addImageToPhotos:]):
2154         Review comments that were not previously addressed.
2155
2156 2014-10-24  Tim Horton  <timothy_horton@apple.com>
2157
2158         [Mac][WebKit2] Move action menu code into its own file
2159         https://bugs.webkit.org/show_bug.cgi?id=138034
2160         <rdar://problem/18758758>
2161
2162         Reviewed by Dan Bernstein.
2163
2164         * UIProcess/API/mac/WKView.mm:
2165         (-[WKView initWithFrame:context:configuration:webView:]):
2166         Make a WKActionMenuController if needed.
2167
2168         (-[WKView prepareForMenu:withEvent:]):
2169         (-[WKView willOpenMenu:withEvent:]):
2170         (-[WKView didCloseMenu:withEvent:]):
2171         (-[WKView _didPerformActionMenuHitTest:]):
2172         Forward these to WKActionMenuController.
2173
2174         (-[WKView _openURLFromActionMenu:]): Deleted.
2175         (-[WKView _addToReadingListFromActionMenu:]): Deleted.
2176         (-[WKView _quickLookURLFromActionMenu:]): Deleted.
2177         (-[WKView _createActionMenuItemForTag:]): Deleted.
2178         (webKitBundleImageNamed): Deleted.
2179         (-[WKView _copyImage:]): Deleted.
2180         (-[WKView _saveImageToDownloads:]): Deleted.
2181         (temporaryPhotosDirectoryPath): Deleted.
2182         (pathToPhotoOnDisk): Deleted.
2183         (-[WKView _addImageToPhotos:]): Deleted.
2184         (-[WKView _defaultMenuItemsForImage]): Deleted.
2185         (-[WKView _defaultMenuItems]): Deleted.
2186         (-[WKView _updateActionMenu]): Deleted.
2187         Moved to WKActionMenuController.
2188
2189         * UIProcess/mac/WKActionMenuController.h: Added.
2190         * UIProcess/mac/WKActionMenuController.mm: Added.
2191         (-[WKActionMenuController initWithPage:view:]):
2192         (-[WKActionMenuController prepareForMenu:withEvent:]):
2193         (-[WKActionMenuController willOpenMenu:withEvent:]):
2194         (-[WKActionMenuController didCloseMenu:withEvent:]):
2195         (-[WKActionMenuController didPerformActionMenuHitTest:]):
2196         (-[WKActionMenuController _defaultMenuItemsForLink]):
2197         (-[WKActionMenuController _openURLFromActionMenu:]):
2198         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
2199         (-[WKActionMenuController _quickLookURLFromActionMenu:]):
2200         (-[WKActionMenuController _defaultMenuItemsForImage]):
2201         (-[WKActionMenuController _copyImage:]):
2202         (-[WKActionMenuController _saveImageToDownloads:]):
2203         (temporaryPhotosDirectoryPath):
2204         (pathToPhotoOnDisk):
2205         (-[WKActionMenuController _addImageToPhotos:]):
2206         (-[WKActionMenuController _createActionMenuItemForTag:]):
2207         (webKitBundleImageNamed):
2208         (imageForResource:name::if):
2209         (-[WKActionMenuController _updateActionMenuItems]):
2210         Moved from WKView.
2211
2212         * WebKit2.xcodeproj/project.pbxproj:
2213
2214 2014-10-24  Marcos Chavarría Teijeiro  <chavarria1991@gmail.com>
2215
2216         [GTK] Implement is_selected method on WebKitHitTestResult
2217         https://bugs.webkit.org/show_bug.cgi?id=137110
2218
2219         Reviewed by Tim Horton.
2220
2221         Expose CONTEXT_SELECTION for WebKitHitTestResult.
2222
2223         * Shared/WebHitTestResult.cpp: Add is_selected field and getter for this field.
2224         (WebKit::WebHitTestResult::Data::Data):
2225         (WebKit::WebHitTestResult::Data::encode):
2226         (WebKit::WebHitTestResult::Data::decode):
2227         * Shared/WebHitTestResult.h:
2228         (WebKit::WebHitTestResult::isSelected):
2229         * UIProcess/API/gtk/WebKitHitTestResult.cpp: Add WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION context and method to check it.
2230         (webkitHitTestResultCreate):
2231         (webkitHitTestResultCompare):
2232         (webkit_hit_test_result_context_is_selection):
2233         * UIProcess/API/gtk/WebKitHitTestResult.h:
2234         * UIProcess/API/gtk/WebKitWebView.cpp: Modify context-menu callback to set the new context option.
2235         (webkitWebViewPopulateContextMenu):
2236         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add documentation about new function.
2237
2238 2014-10-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2239
2240         [GTK][Cairo] Remove GTK dependency of WidgetBackingStoreGtkX11
2241         https://bugs.webkit.org/show_bug.cgi?id=138004
2242
2243         Reviewed by Gustavo Noronha Silva.
2244
2245         * UIProcess/BackingStore.h: Rename m_backingStore as m_backend,
2246         since it's a bit confusing that a BackingStore class has a
2247         m_backingStore member and WidgetBackingStore has been renamed as
2248         BackingStoreBackendCairo.
2249         * UIProcess/cairo/BackingStoreCairo.cpp:
2250         (WebKit::BackingStore::createBackend): Helper function to create
2251         the BackingStore backend depending on the platform.
2252         (WebKit::BackingStore::paint): Use m_backend instead of m_backingStore.
2253         (WebKit::BackingStore::incorporateUpdate): Ditto.
2254         (WebKit::BackingStore::scroll): Ditto.
2255         (WebKit::createBackingStoreForGTK): Deleted.
2256
2257 2014-10-23  Benjamin Poulain  <bpoulain@apple.com>
2258
2259         Fix a bad find-and-replace in r175153
2260
2261         Looks like I messed up the commit on landing.
2262
2263         * UIProcess/WebPageProxy.cpp:
2264         (WebKit::WebPageProxy::WebPageProxy):
2265         (WebKit::WebPageProxy::didCommitLoadForFrame):
2266
2267 2014-10-23  Benjamin Poulain  <bpoulain@apple.com>
2268
2269         [iOS WK2] If a page has the exact same VisibleContentRect as the page before, its VisibleContentRectUpdate can be ignored
2270         https://bugs.webkit.org/show_bug.cgi?id=138031
2271         rdar://problem/18739335
2272
2273         Reviewed by Simon Fraser.
2274
2275         Since any VisibleContentRectUpdate is costly for the WebProcess, we avoid sending updates
2276         if none of the important parameters have changed (scale and geometry).
2277
2278         One unintended side effect is that the update of a page can be blocked if the parameters
2279         of the previous page were identical.
2280
2281         What happen is this:
2282         1) Page [A] sends its content rect update as needed. WebPageProxy saves the last update
2283            in m_lastVisibleContentRectUpdate and use that value to avoid useless updates.
2284         2) Page [B] load after page [A] and have the exact VisibleContentRect. When receiving the first
2285            layer tree commit after didCommitLoadForFrame, WKWebView sends its VisibleContentRect
2286            to WebPageProxy to synchronize the state of the WebProcess with what is on screen.
2287         3) Since the two VisibleContentRect update has the same value as the ones of page [A], WebPageProxy
2288            discards the update. The WebProcess has its initialization viewport and is not udpated until
2289            a major parameter changes (scale or position).
2290
2291         In rdar://problem/18739335, the problem is the similar but with a different failure point:
2292         1) Everything above happened already.
2293         2) The layer tree transaction has a scrolling request. This is processed by WKWebView.
2294         3) Since the scrolling position is invalid, the request is ignored and we send the last
2295            VisibleContentRect to the WebProcess with WebPageProxy::resendLastVisibleContentRects().
2296         4) Since the VisibleContentRect was never updated after didCommitLoadForFrame, the one we send
2297            is for the previous page, which the web process correctly ignores.
2298
2299         This patch solves the problem by nuking the cached m_lastVisibleContentRectUpdate before
2300         any valid VisibleContentRectUpdate for a new page.
2301
2302         * UIProcess/WebPageProxy.cpp:
2303         (WebKit::WebPageProxy::WebPageProxy):
2304         (WebKit::WebPageProxy::didCommitLoadForFrame):
2305         * UIProcess/WebPageProxy.h:
2306         * UIProcess/ios/WebPageProxyIOS.mm:
2307         (WebKit::WebPageProxy::didCommitLayerTree):
2308
2309 2014-10-23  Joseph Pecoraro  <pecoraro@apple.com>
2310
2311         Web Inspector: Provide a way to have alternate inspector agents
2312         https://bugs.webkit.org/show_bug.cgi?id=137901
2313
2314         Reviewed by Brian Burg.
2315
2316         * Configurations/FeatureDefines.xcconfig:
2317
2318 2014-10-23  Tim Horton  <timothy_horton@apple.com>
2319
2320         Add some SPI headers for NSExtension and NSSharingService{Picker}
2321         https://bugs.webkit.org/show_bug.cgi?id=138027
2322
2323         Reviewed by Anders Carlsson.
2324
2325         * UIProcess/API/mac/WKView.mm:
2326         * UIProcess/mac/ServicesController.mm:
2327         * UIProcess/mac/WebContextMenuProxyMac.mm:
2328         Replace redefinitions with SPI header #imports.
2329
2330 2014-10-23  Benjamin Poulain  <bpoulain@apple.com>
2331
2332         [iOS WK2] Make sure any dynamic viewport update schedules a layer tree commit
2333         https://bugs.webkit.org/show_bug.cgi?id=138021
2334
2335         Reviewed by Simon Fraser.
2336
2337         * WebProcess/WebPage/ios/WebPageIOS.mm:
2338         (WebKit::WebPage::dynamicViewportSizeUpdate):
2339         Sometimes, the clients can do a dynamic viewport update but only change the minimum
2340         layout size (see rdar://problem/18755250).
2341
2342         When that happens, it is possible to do the full state update without ever scheduling
2343         a layer tree commit. For example, if the new minimum layout height is only a few pixels
2344         smaller than the old value and the layout of the page is equal or larger than the old value,
2345         the layout is done without any side effect to the content (assuming a viewport configuration
2346         based on width).
2347
2348         The contract with the client is that the next layer tree commit after a dynamic viewport update
2349         carries all the valid parameters for the new viewport size. Since the new layout never scheduled
2350         a layer tree commit, the UIProcess is just waiting for one, discarding all input.
2351
2352         This patch solves the issue by explicitely scheduling a layer flush after updating all the layout
2353         and view parameters to their final values. In most cases, this makes no difference since a layer
2354         tree commit was already scheduled. In the rare cases where nothing was scheduled, scheduling
2355         the layer tree commit ensure we unlock the UIProcess.
2356
2357 2014-10-23  Ryosuke Niwa  <rniwa@webkit.org>
2358
2359         WebContent crash in WebKit::WebPage::expandedRangeFromHandle
2360         https://bugs.webkit.org/show_bug.cgi?id=138023
2361
2362         Reviewed by Enrica Casucci.
2363
2364         The crashes are caused by rangeForBlockAtPoint returning a null Range.
2365         Exit early or continue if a range is null in various places.
2366
2367         * WebProcess/WebPage/ios/WebPageIOS.mm:
2368         (WebKit::WebPage::expandedRangeFromHandle): Continue looking for another point if the range returned by
2369         rangeForBlockAtPoint is null.
2370         (WebKit::WebPage::contractedRangeFromHandle): Ditto.
2371         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Removed the FIXME now that Enrica has
2372         verified that this early exit added in r173788 is correct.
2373
2374 2014-10-23  Joseph Pecoraro  <pecoraro@apple.com>
2375
2376         [iOS] iPhone unselecting items in <select multiple> shows incorrect values selected
2377         https://bugs.webkit.org/show_bug.cgi?id=137989
2378
2379         Reviewed by Alexey Proskuryakov.
2380
2381         * UIProcess/ios/forms/WKFormSelectPicker.mm:
2382         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
2383         The second argument is "allowsMultipleSelection" and should only be set
2384         when we are making a selection in a <select multiple>.
2385
2386 2014-10-23  Tim Horton  <timothy_horton@apple.com>
2387
2388         Assertion failures in ImageKit soft linking
2389         https://bugs.webkit.org/show_bug.cgi?id=138009
2390
2391         Reviewed by Anders Carlsson.
2392
2393         * UIProcess/API/mac/WKView.mm:
2394         Soft-link ImageKit correctly.
2395         ImageKit is inside the Quartz umbrella framework.
2396
2397 2014-10-23  Daniel Bates  <dabates@apple.com>
2398
2399         [iOS] Fix the build after <http://trac.webkit.org/changeset/175079>
2400         (https://bugs.webkit.org/show_bug.cgi?id=137995)
2401
2402         Rubber-stamped by Anders Carlsson.
2403
2404         Remove PageClientImpl::didPerformActionMenuHitTest() for iOS.
2405
2406         * UIProcess/ios/PageClientImplIOS.h:
2407         * UIProcess/ios/PageClientImplIOS.mm:
2408         (WebKit::PageClientImpl::didPerformActionMenuHitTest): Deleted.
2409
2410 2014-10-23  Krzysztof Czech  <k.czech@samsung.com>
2411
2412         [EFL] Fix build problem after r175098
2413         https://bugs.webkit.org/show_bug.cgi?id=138002
2414
2415         Reviewed by Gyuyoung Kim.
2416
2417         Add ECORE_X dependency to avoid linking problems while building unit tests.
2418
2419         * PlatformEfl.cmake:
2420
2421 2014-10-23  Krzysztof Czech  <k.czech@samsung.com>
2422
2423         [EFL] Set proper default value for WebPageAccessibilityObject
2424         https://bugs.webkit.org/show_bug.cgi?id=137951
2425
2426         Reviewed by Csaba Osztrogonác.
2427
2428         Initial value for WebPageAccessibilityObject should be nullptr.
2429
2430         * WebProcess/WebPage/WebPage.cpp:
2431         (WebKit::WebPage::WebPage):
2432
2433 2014-10-23  Krzysztof Czech  <k.czech@samsung.com>
2434
2435         [EFL] Introduce EFL Accessibility in WebKit
2436         https://bugs.webkit.org/show_bug.cgi?id=137819
2437
2438         Reviewed by Gyuyoung Kim.
2439
2440         EFL Accessibility provides an API that is used to notify clients that certain
2441         Accessibility events occur. Utilizing it makes WebKit-EFL coherent with EFL native
2442         accessibility approach.
2443
2444         * PlatformEfl.cmake:
2445         * UIProcess/API/efl/EwkView.cpp:
2446         (EwkView::EwkView):
2447         * UIProcess/API/efl/EwkView.h:
2448         (EwkView::webAccessibility):
2449         * UIProcess/API/efl/WebAccessibility.cpp: Added.
2450         (WebKit::WebAccessibility::WebAccessibility):
2451         (WebKit::WebAccessibility::~WebAccessibility):
2452         (WebKit::WebAccessibility::eventHandler):
2453         (WebKit::WebAccessibility::executeGestureAction):
2454         (WebKit::WebAccessibility::activate):
2455         (WebKit::WebAccessibility::read):
2456         (WebKit::WebAccessibility::readNext):
2457         (WebKit::WebAccessibility::readPrev):
2458         (WebKit::WebAccessibility::up):
2459         (WebKit::WebAccessibility::down):
2460         (WebKit::WebAccessibility::scroll):
2461         (WebKit::WebAccessibility::mouse):
2462         (WebKit::WebAccessibility::enable):
2463         (WebKit::WebAccessibility::disable):
2464         * UIProcess/API/efl/WebAccessibility.h: Added.
2465         (WebKit::WebAccessibility::activateAction):
2466         (WebKit::WebAccessibility::nextAction):
2467         (WebKit::WebAccessibility::prevAction):
2468         (WebKit::WebAccessibility::readAction):
2469         * UIProcess/API/efl/ewk_view.cpp:
2470         (ewk_view_accessibility_action_activate_get):
2471         (ewk_view_accessibility_action_next_get):
2472         (ewk_view_accessibility_action_prev_get):
2473         (ewk_view_accessibility_action_read_by_point_get):
2474         * UIProcess/API/efl/ewk_view.h:
2475         * UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Added.
2476         (EWK2Accessibility::xwindow):
2477         (TEST_F):
2478         * UIProcess/WebPageProxy.h:
2479         * UIProcess/efl/WebPageProxyEfl.cpp:
2480         (WebKit::WebPageProxy::accessibilityObjectReadByPoint):
2481         (WebKit::WebPageProxy::accessibilityObjectReadPrevious):
2482         (WebKit::WebPageProxy::accessibilityObjectReadNext):
2483
2484 2014-10-22  Benjamin Poulain  <bpoulain@apple.com>
2485
2486         [iOS WK2] Protect WKWebView dynamic viewport change against empty sizes
2487         https://bugs.webkit.org/show_bug.cgi?id=137988
2488         rdar://problem/17785162
2489
2490         Reviewed by Simon Fraser.
2491
2492         * UIProcess/API/Cocoa/WKWebView.mm:
2493         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2494         The algorithm behind dynamic size update finds the best content area to put in the viewport
2495         after a viewport change. If an initial size or a target size is empty, it is impossible to
2496         compute a reasonable area to keep in the view. We end up handling NaN scales
2497         and/or sizes and CoreAnimation raises an exception when applying that value.
2498
2499         This patch add early exits when that occurs and fallback to the common code.
2500
2501         On Input, things are easy. If any of the initial values is empty, we just execute the updateBlock
2502         without attempting any of the dynamic behaviors.
2503
2504         For the target values, things are trickier. We do not know what the values are going to be before we execute
2505         the block. But once we executed the block, we have already skipped all the setters that call the web process.
2506
2507         To handle that, every value is set manually on WebPageProxy. This is a bit unfortunate because the setters
2508         get yet another entry point.
2509
2510 2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2511
2512         EFL and GTK ports have broken since r175075
2513         https://bugs.webkit.org/show_bug.cgi?id=137995
2514
2515         Unreviewed, EFL and GTK ports build fix.
2516
2517         Need to use PLATFORM(MAC) guard for ActionMenuHitTest functions.
2518
2519         * UIProcess/PageClient.h:
2520         * UIProcess/WebPageProxy.cpp:
2521         (WebKit::WebPageProxy::removeNavigationGestureSnapshot):
2522         * UIProcess/WebPageProxy.h:
2523         * UIProcess/WebPageProxy.messages.in:
2524         * WebProcess/WebPage/WebPage.cpp:
2525         * WebProcess/WebPage/WebPage.h:
2526         * WebProcess/WebPage/WebPage.messages.in:
2527
2528 2014-10-22  Tim Horton  <timothy_horton@apple.com>
2529
2530         Add action menu support for images
2531         https://bugs.webkit.org/show_bug.cgi?id=137987
2532         <rdar://problem/18717767>
2533
2534         Reviewed by Anders Carlsson, Sam Weinig, and Beth Dakin.
2535
2536         * Resources/AddImageToPhotos.pdf: Added.
2537         * Resources/CopyImage.pdf: Added.
2538         * Resources/SaveImageToDownloads.pdf: Added.
2539         * Resources/ShareImage.pdf: Added.
2540         Add some temporary artwork.
2541
2542         * Scripts/webkit/messages.py:
2543         (struct_or_class):
2544         ActionMenuHitTestResult is a struct.
2545
2546         * Shared/API/c/WKActionMenuItemTypes.h:
2547         Add new items for image menus.
2548
2549         * Shared/mac/ActionMenuHitTestResult.cpp:
2550         (WebKit::ActionMenuHitTestResult::encode):
2551         (WebKit::ActionMenuHitTestResult::decode):
2552         For now, pass the hit image data across to the UI process as a ShareableBitmap.
2553
2554         * Shared/mac/ActionMenuHitTestResult.h:
2555
2556         * UIProcess/API/mac/WKView.mm:
2557         (-[WKView _createActionMenuItemForTag:]):
2558         Refactor action menu item creation into a single function, so that
2559         callers can share code and be much simpler.
2560
2561         (webKitBundleImageNamed):
2562         Add a helper to acquire an image from the WebKit2 bundle.
2563
2564         (-[WKView _copyImage:]):
2565         (-[WKView _saveImageToDownloads:]):
2566         (temporaryPhotosDirectoryPath):
2567         (pathToPhotoOnDisk):
2568         (-[WKView _addImageToPhotos:]):
2569         Add rudimentary implementations of image actions.
2570
2571         (-[WKView _defaultMenuItemsForImage]):
2572         Support the image menu, plus a submenu acquired from NSSharingServicePicker
2573         for the Share menu.
2574
2575         (-[WKView _defaultMenuItems]):
2576         Call _defaultMenuItemsForImage if needed.
2577
2578         (-[WKView _updateActionMenu]):
2579         Refactor _updateActionMenu out of prepareForMenu:withEvent:.
2580
2581         (-[WKView prepareForMenu:withEvent:]):
2582         Ask the Web process to re-hit-test under the location that the menu
2583         will appear. Mark the menu as pending.
2584
2585         (-[WKView _didPerformActionMenuHitTest:]):
2586         When we get the hit test reply, record the result for future use.
2587
2588         (-[WKView willOpenMenu:withEvent:]):
2589         If we got a hit test reply, rebuild the menu immediately. If not, wait
2590         up to 500ms for the reply to come in. This eventually needs to be
2591         cancellable if the menu is rejected in the interim.
2592
2593         (-[WKView didCloseMenu:withEvent:]):
2594         Clear all state when the menu closes.
2595
2596         * UIProcess/API/mac/WKViewInternal.h:
2597         * UIProcess/PageClient.h:
2598         * UIProcess/WebPageProxy.cpp:
2599         (WebKit::WebPageProxy::performActionMenuHitTestAtLocation):
2600         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
2601         * UIProcess/WebPageProxy.h:
2602         * UIProcess/WebPageProxy.messages.in:
2603         * UIProcess/mac/PageClientImpl.h:
2604         * UIProcess/mac/PageClientImpl.mm:
2605         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
2606         * UIProcess/ios/PageClientImplIOS.h:
2607         * UIProcess/ios/PageClientImplIOS.mm:
2608         * WebProcess/WebPage/WebPage.h:
2609         * WebProcess/WebPage/WebPage.messages.in:
2610         Plumb didPerformActionMenuHitTest back from WebPageProxy to WKView.
2611
2612         * WebProcess/WebPage/WebPage.cpp:
2613         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2614         Hit test at the given location, recording the image data if there is any,
2615         and return the result to the UI process.
2616
2617         * WebKit2.xcodeproj/project.pbxproj:
2618         Add the PDFs.
2619
2620 2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2621
2622         Remove WidgetBackingStoreCairo::create() factory function
2623         https://bugs.webkit.org/show_bug.cgi?id=137943
2624
2625         Reviewed by Darin Adler.
2626
2627         WidgetBackingStoreCairo::create() can be replaced by std::make_unique<>.
2628         Thus this patch removes it, then use std::make_unique<>|std::unique_ptr<>.
2629
2630         * UIProcess/BackingStore.h:
2631         * UIProcess/cairo/BackingStoreCairo.cpp:
2632         (WebKit::createBackingStoreForGTK):
2633         (WebKit::BackingStore::incorporateUpdate):
2634
2635 2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2636
2637         Remove TextCheckerEnchant::create() factory function
2638         https://bugs.webkit.org/show_bug.cgi?id=137944
2639
2640         Reviewed by Darin Adler.
2641
2642         TextCheckerEnchant::create() can be replaced by std::make_unique<> and std::unique_ptr<>.
2643
2644         * UIProcess/API/gtk/WebKitTextChecker.cpp:
2645         (WebKitTextChecker::WebKitTextChecker):
2646         * UIProcess/API/gtk/WebKitTextChecker.h:
2647         * UIProcess/efl/TextCheckerClientEfl.cpp:
2648         (TextCheckerClientEfl::TextCheckerClientEfl):
2649         * UIProcess/efl/TextCheckerClientEfl.h:
2650
2651 2014-10-22  Antti Koivisto  <antti@apple.com>
2652
2653         Revert fix for REGRESSION (r173356): Safari can't install a profile, gets 'Download Failed error
2654         (https://bugs.webkit.org/show_bug.cgi?id=137493)
2655
2656         Turns out the root cause was a bug in MIME type sniffing, https://bugs.webkit.org/show_bug.cgi?id=137855
2657
2658         Remove the workaround.
2659
2660         * Shared/Downloads/ios/DownloadIOS.mm:
2661         (WebKit::Download::startWithHandle):
2662         * Shared/Downloads/mac/DownloadMac.mm:
2663         (WebKit::Download::startWithHandle):
2664
2665 2014-10-22  Beth Dakin  <bdakin@apple.com>
2666
2667         Remove action menu web preference
2668         https://bugs.webkit.org/show_bug.cgi?id=137975
2669
2670         Reviewed by Tim Horton.
2671
2672         * Shared/WebPreferencesDefinitions.h:
2673         * UIProcess/API/C/WKPreferences.cpp:
2674         (WKPreferencesSetActionMenuSupportEnabled): Deleted.
2675         (WKPreferencesGetActionMenuSupportEnabled): Deleted.
2676         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2677         * UIProcess/API/mac/WKView.mm:
2678         (-[WKView initWithFrame:context:configuration:webView:]):
2679
2680 2014-10-22  Chris Dumez  <cdumez@apple.com>
2681
2682         [Mac][WK2] Fix applicationIsSafari() detection
2683         https://bugs.webkit.org/show_bug.cgi?id=137893
2684
2685         Reviewed by Alexey Proskuryakov.
2686
2687         Provide an implementation for FrameLoaderClient's new
2688         needsQuickLookResourceCachingQuirks(), which accesses the flag stored
2689         on the WebProcess, which is initialized upon WebProcess creation.
2690
2691         QuickLookMac::computeNeedsQuickLookResourceCachingQuirks() is called
2692         on UIProcess side so that it works reliably and the flag is passed as
2693         parameter when constructing the WebProcess.
2694
2695         * Shared/WebProcessCreationParameters.cpp:
2696         (WebKit::WebProcessCreationParameters::encode):
2697         (WebKit::WebProcessCreationParameters::decode):
2698         * Shared/WebProcessCreationParameters.h:
2699         * UIProcess/mac/WebContextMac.mm:
2700         (WebKit::WebContext::platformInitializeWebProcess):
2701         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2702         (WebKit::WebFrameLoaderClient::needsQuickLookResourceCachingQuirks):
2703         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2704         * WebProcess/WebProcess.cpp:
2705         (WebKit::WebProcess::WebProcess):
2706         * WebProcess/WebProcess.h:
2707         (WebKit::WebProcess::needsQuickLookResourceCachingQuirks):
2708         * WebProcess/cocoa/WebProcessCocoa.mm:
2709         (WebKit::WebProcess::platformInitializeWebProcess):
2710
2711 2014-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2712
2713         Unreviewed. Fix GTK+ debug build after r175046.
2714
2715         Remove invalid ASSERT.
2716
2717         * UIProcess/gtk/InputMethodFilter.cpp:
2718         (WebKit::InputMethodFilter::setCursorRect):
2719
2720 2014-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2721
2722         [GTK] Move GtkInputMethodFilter from Platform to WebKit2
2723         https://bugs.webkit.org/show_bug.cgi?id=137884
2724
2725         Reviewed by Gustavo Noronha Silva.
2726
2727         Merge WebViewBaseInputMethodFilter and GtkInputMethodFilter into a
2728         single class InputMethodFilter. The code is mostly the same, but
2729         instead of having a setWebView method only to get the WebPageProxy,
2730         it has a setPage method that passes the WebPageProxy. The GtkIMContext
2731         client window is set by the WebView when it's realized/unrealized.
2732
2733         * PlatformGTK.cmake:
2734         * Shared/NativeWebKeyboardEvent.h:
2735         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
2736         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
2737         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2738         (webkitWebViewBaseRealize):
2739         (webkitWebViewBaseUnrealize):
2740         (webkit_web_view_base_class_init):
2741         (webkitWebViewBaseCreateWebPage):
2742         (webkitWebViewBaseEnterFullScreen): Deleted.
2743         * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp: Removed.
2744         * UIProcess/API/gtk/WebViewBaseInputMethodFilter.h: Removed.
2745         * UIProcess/gtk/InputMethodFilter.cpp: Added.
2746         (WebKit::InputMethodFilter::handleCommitCallback):
2747         (WebKit::InputMethodFilter::handlePreeditStartCallback):
2748         (WebKit::InputMethodFilter::handlePreeditChangedCallback):
2749         (WebKit::InputMethodFilter::handlePreeditEndCallback):
2750         (WebKit::InputMethodFilter::InputMethodFilter):
2751         (WebKit::InputMethodFilter::~InputMethodFilter):
2752         (WebKit::InputMethodFilter::setEnabled):
2753         (WebKit::InputMethodFilter::setCursorRect):
2754         (WebKit::InputMethodFilter::handleKeyboardEvent):
2755         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
2756         (WebKit::InputMethodFilter::filterKeyEvent):
2757         (WebKit::InputMethodFilter::confirmComposition):
2758         (WebKit::InputMethodFilter::updatePreedit):
2759         (WebKit::InputMethodFilter::notifyFocusedIn):
2760         (WebKit::InputMethodFilter::notifyFocusedOut):
2761         (WebKit::InputMethodFilter::notifyMouseButtonPress):
2762         (WebKit::InputMethodFilter::confirmCurrentComposition):
2763         (WebKit::InputMethodFilter::cancelContextComposition):
2764         (WebKit::InputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents):
2765         (WebKit::InputMethodFilter::handleCommit):
2766         (WebKit::InputMethodFilter::handlePreeditStart):
2767         (WebKit::InputMethodFilter::handlePreeditChanged):
2768         (WebKit::InputMethodFilter::handlePreeditEnd):
2769         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
2770         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
2771         (WebKit::InputMethodFilter::logConfirmCompositionForTesting):
2772         (WebKit::InputMethodFilter::logSetPreeditForTesting):
2773         * UIProcess/gtk/InputMethodFilter.h: Added.
2774         (WebKit::InputMethodFilter::context):
2775         (WebKit::InputMethodFilter::setPage):
2776         (WebKit::InputMethodFilter::setTestingMode):
2777         (WebKit::InputMethodFilter::events):
2778
2779 2014-10-21  Tim Horton  <timothy_horton@apple.com>
2780
2781         Quick Look preview bubble has unnecessary controls
2782         https://bugs.webkit.org/show_bug.cgi?id=137940
2783         <rdar://problem/18731860>
2784
2785         Reviewed by Simon Fraser.
2786
2787         * UIProcess/API/mac/WKView.mm:
2788         (-[WKView _quickLookURLFromActionMenu:]):
2789         Temporarily use more SPI to allow us to hide the preview bubble's controls.
2790
2791 2014-10-21  Jeff Miller  <jeffm@apple.com>
2792
2793         Remove const from WKURLRequestRef parameter to WKContextDownloadURLRequest()
2794         https://bugs.webkit.org/show_bug.cgi?id=137928
2795
2796         Reviewed by Darin Adler.
2797
2798         * UIProcess/API/C/WKContext.cpp:
2799         (WKContextDownloadURLRequest):
2800         * UIProcess/API/C/WKContext.h:
2801
2802 2014-10-21  Anders Carlsson  <andersca@apple.com>
2803
2804         WKRemoteObjectCoder should handle floats
2805         https://bugs.webkit.org/show_bug.cgi?id=137926
2806         <rdar://problem/18695126>
2807
2808         Reviewed by Beth Dakin.
2809
2810         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2811         (encodeInvocation):
2812         (-[WKRemoteObjectEncoder encodeFloat:forKey:]):
2813         (decodeInvocationArguments):
2814         (-[WKRemoteObjectDecoder decodeFloatForKey:]):
2815
2816 2014-10-21  Jeff Miller  <jeffm@apple.com>
2817
2818         WKContext needs to provide an API to resume a download
2819         https://bugs.webkit.org/show_bug.cgi?id=137507
2820
2821         Reviewed by Darin Adler.
2822
2823         This patch adds WKContextResumeDownload(), which is only supported on the Mac, and requires the
2824         resume data from WKDownloadGetResumeData().
2825
2826         We have to create a sandbox extension for the partially downloaded file in the UI process so the
2827         network or web process can resume writing to it.
2828
2829         * NetworkProcess/NetworkProcess.cpp:
2830         (WebKit::NetworkProcess::resumeDownload):
2831         Added, calls through to DownloadManager::resumeDownload().
2832
2833         * NetworkProcess/NetworkProcess.h:
2834         Added resumeDownload().
2835
2836         * NetworkProcess/NetworkProcess.messages.in:
2837         Added ResumeDownload message.
2838
2839         * Shared/Downloads/Download.h:
2840         Added resume().
2841
2842         * Shared/Downloads/DownloadManager.cpp:
2843         (WebKit::DownloadManager::resumeDownload):
2844         Added. The URL being downloaded is part of the opaque resumeData, so we can't specify it when the
2845         Download is constructed.
2846
2847         * Shared/Downloads/DownloadManager.h:
2848         Added resumeDownload().
2849
2850         * Shared/Downloads/ios/DownloadIOS.mm:
2851         (WebKit::Download::resume):
2852         Added, not implemented on this platform.
2853
2854         * Shared/Downloads/mac/DownloadMac.mm:
2855         (WebKit::Download::resume):
2856         Added. Consumes the sandbox extension, resumes the download, and sets m_request after the
2857         NSURLDownload has been created. Note that we already have code to revoke the sandbox extension when
2858         the download is finished, canceled, or fails.
2859
2860         * Shared/Downloads/soup/DownloadSoup.cpp:
2861         (WebKit::Download::resume):
2862         Added, not implemented on this platform.
2863
2864         * UIProcess/API/C/WKContext.cpp:
2865         (WKContextResumeDownload):
2866         Added.
2867
2868         * UIProcess/API/C/WKContext.h:
2869         Added WKContextResumeDownload().
2870
2871         * UIProcess/WebContext.cpp:
2872         (WebKit::WebContext::resumeDownload):
2873         Added. Creates a sandbox extension for the existing file and includes it in the message to the
2874         network or web process.
2875
2876         * UIProcess/WebContext.h:
2877         Added resumeDownload().
2878
2879         * WebProcess/WebProcess.cpp:
2880         (WebKit::WebProcess::resumeDownload):
2881         Added, calls through to DownloadManager::resumeDownload().
2882
2883         * WebProcess/WebProcess.h:
2884         Added resumeDownload().
2885
2886         * WebProcess/WebProcess.messages.in:
2887         Added ResumeDownload message.
2888
2889 2014-10-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2890
2891         Change the default TLS errors policy to WEBKIT_TLS_ERRORS_POLICY_FAIL
2892         https://bugs.webkit.org/show_bug.cgi?id=137832
2893
2894         Reviewed by Carlos Garcia Campos.
2895
2896         Too many general-purpose browsers that really need this policy
2897         are not selecting it, so let's do so for them.
2898
2899         * UIProcess/API/gtk/WebKitWebContext.cpp:
2900         (createDefaultWebContext):
2901
2902 2014-10-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2903
2904         [SOUP] Disable SSLv3
2905         https://bugs.webkit.org/show_bug.cgi?id=137859
2906
2907         Reviewed by Carlos Garcia Campos.
2908
2909         Set G_TLS_GNUTLS_PRIORITY if unset.
2910
2911         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
2912         (main):
2913         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
2914         (main):
2915
2916 2014-10-20  Chris Dumez  <cdumez@apple.com>
2917
2918         ResourceRequest deserialization unnecessarily calls partitionName() on encoded cache partition
2919         https://bugs.webkit.org/show_bug.cgi?id=137797
2920
2921         Reviewed by Darin Adler.
2922
2923         This patch adds a |needsValidation| argument to
2924         ResourceRequest::setCachePartition() setter so that the caller can
2925         indicate that the partition name is valid (because it was already
2926         processed by partitionName() before). Use this new argument in
2927         ArgumentCoder<ResourceRequest>::decode() to spent a bit less time
2928         deserializing resource requests.
2929
2930         * Shared/WebCoreArgumentCoders.cpp:
2931         (IPC::ArgumentCoder<ResourceRequest>::decode):
2932
2933 2014-10-20  Beth Dakin  <bdakin@apple.com>
2934
2935         Action menu items should have tags
2936         https://bugs.webkit.org/show_bug.cgi?id=137898
2937
2938         Reviewed by Anders Carlsson.
2939
2940         * Shared/API/c/WKActionMenuItemTypes.h: Added.
2941         * UIProcess/API/mac/WKView.mm:
2942         (-[WKView _defaultMenuItemsForLink]):
2943         * WebKit2.xcodeproj/project.pbxproj:
2944
2945 2014-10-20  Beth Dakin  <bdakin@apple.com>
2946
2947         Add support for action menus
2948         https://bugs.webkit.org/show_bug.cgi?id=137891
2949         rdar://problem/18451638
2950         rdar://problem/18694470
2951
2952         Reviewed by Anders Carlsson.
2953
2954         Temporary artwork needed for menu item.
2955         * Resources/OpenInNewWindowTemplate.pdf: Added.
2956         * WebKit2.xcodeproj/project.pbxproj:
2957
2958         Add a preference that defaults to false for action menu support.
2959         * Shared/WebPreferencesDefinitions.h:
2960         * UIProcess/API/C/WKPreferences.cpp:
2961         (WKPreferencesSetActionMenuSupportEnabled):
2962         (WKPreferencesGetActionMenuSupportEnabled):
2963         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2964
2965         New SPI. WebKit clients can implement this method to customize the action menu.
2966         * UIProcess/API/Cocoa/WKViewPrivate.h:
2967
2968         Create the action menu if it is supported.
2969         * UIProcess/API/mac/WKView.mm:
2970         (-[WKView initWithFrame:context:configuration:webView:]):
2971
2972         Methods to implement the default menu actions.
2973         (-[WKView _openURLFromActionMenu:]):
2974         (-[WKView _addToReadingListFromActionMenu:]):
2975         (-[WKView _quickLookURLFromActionMenu:]):
2976
2977         Add action menus support for links. Populate the menu at the right time.
2978         (-[WKView _defaultMenuItemsForLink]):
2979         (-[WKView _defaultMenuItems]):
2980         (-[WKView prepareForMenu:withEvent:]):
2981         (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]):
2982
2983         New member variable caches the HitTestResult on mouse move.
2984         * UIProcess/WebPageProxy.cpp:
2985         (WebKit::WebPageProxy::mouseDidMoveOverElement):
2986         * UIProcess/WebPageProxy.h:
2987         (WebKit::WebPageProxy::activeActionMenuHitTestResult):
2988
2989 2014-10-20  Timothy Hatcher  <timothy@apple.com>
2990
2991         Web Inspector: Delay and white area when Web Inspector crashes
2992         https://bugs.webkit.org/show_bug.cgi?id=137230
2993
2994         Reviewed by Anders Carlsson.
2995
2996         * UIProcess/WebInspectorProxy.cpp:
2997         (WebKit::processDidCrash): Added.
2998         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Hook up loader client.
2999
3000 2014-10-20  Joseph Pecoraro  <pecoraro@apple.com>
3001
3002         Web Inspector: Generate all Inspector domains together in JavaScriptCore
3003         https://bugs.webkit.org/show_bug.cgi?id=137748
3004
3005         Reviewed by Brian Burg.
3006
3007         * PlatformGTK.cmake:
3008
3009 2014-10-19  Antti Koivisto  <antti@apple.com>
3010
3011         Avoid unnecessary NSURLResponse construction for QuickLook on iOS
3012         https://bugs.webkit.org/show_bug.cgi?id=137876
3013
3014         Reviewed by Andy Estes.
3015
3016         * WebProcess/Network/WebResourceLoader.cpp:
3017         (WebKit::WebResourceLoader::didReceiveResponse):
3018
3019             Switch to the modified QuickLookHandle interface that does not need NSURLResponse.
3020
3021 2014-10-16  Andy Estes  <aestes@apple.com>
3022
3023         [iOS] Capture WKActionSheetAssistant's interaction with WKContentView in a @protocol
3024         https://bugs.webkit.org/show_bug.cgi?id=137792
3025
3026         Reviewed by Tim Horton.
3027
3028         WKPDFView would like to use WKActionSheetAssistant to show an action sheet when long-pressing a link, but it
3029         can't so long as WKActionSheetAssistant is tightly coupled to WKContentView. Resolve this by factoring
3030         WKActionSheetAssistant's interaction with WKContentView into a new protocol called
3031         WKActionSheetAssistantDelegate and having WKContentView conform to this protocol.
3032
3033         * UIProcess/API/Cocoa/_WKElementAction.mm:
3034         (+[_WKElementAction elementActionWithTitle:actionHandler:]): Changed instances of WKContentView * to id <WKActionSheetAssistantDelegate>.
3035         (+[_WKElementAction elementActionWithType:customTitle:]): Ditto.
3036         (-[_WKElementAction _runActionWithElementInfo:delegate:]): Ditto.
3037         (copyElement): Deleted.
3038         (saveImage): Deleted.
3039         (-[_WKElementAction _runActionWithElementInfo:view:]): Deleted.
3040         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
3041         * UIProcess/ios/WKActionSheet.h:
3042         * UIProcess/ios/WKActionSheet.mm:
3043         (-[WKActionSheet init]): Renamed from initWithView: since WKActionSheet no longer needs to know about a view.
3044         (-[WKActionSheet _didRotateAndLayout]): Called -[WKActionSheetDelegate updatePositionInformation].
3045         (-[WKActionSheet initWithView:]): Deleted.
3046         * UIProcess/ios/WKActionSheetAssistant.h:
3047         * UIProcess/ios/WKActionSheetAssistant.mm:
3048         (-[WKActionSheetAssistant delegate]): Added a getter for the delegate property.
3049         (-[WKActionSheetAssistant setDelegate:]): Added a setter for the delegate property.
3050         (-[WKActionSheetAssistant initWithView:]): Changed argument type from WKContentView * to UIView *.
3051         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]): Returned CGRectZero if there is no delegate.
3052         Otherwise, retrieved positionInformation from the delegate.
3053         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]): Ditto.
3054         (-[WKActionSheetAssistant updatePositionInformation]): Called -[WKActionSheetAssistantDelegate updatePositionInformation].
3055         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Returned early if there is no delegate.
3056         Otherwise, retrieved positionInformation from the delegate.
3057         (-[WKActionSheetAssistant showImageSheet]): Ditto.
3058         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
3059         (-[WKActionSheetAssistant showDataDetectorsSheet]): Ditto.
3060         (-[WKActionSheetAssistant cleanupSheet]):
3061         * UIProcess/ios/WKContentViewInteraction.h:
3062         * UIProcess/ios/WKContentViewInteraction.mm:
3063         (-[WKContentView setupInteraction]): Installed self as WKActionSheetAssistant's delegate.
3064         (-[WKContentView updatePositionInformation]): Renamed from _updatePositionInformation.
3065         (-[WKContentView performAction:]): Renamed from _performAction:.
3066         (-[WKContentView openElementAtLocation:]): Called _attemptClickAtLocation:.
3067         (-[WKContentView actionsForElement:defaultActions:]): Called API::UIClient::actionsForElement().
3068         (-[WKContentView startInteractionWithElement:]): Called WebPageProxy::startInteractionWithElementAtPosition().
3069         (-[WKContentView stopInteraction]): Called WebPageProxy::stopInteraction().
3070         (-[WKContentView _updatePositionInformation]): Deleted.
3071         (-[WKContentView _performAction:]): Deleted.
3072
3073 2014-10-20  Carlos Garnacho  <carlosg@gnome.org>
3074
3075         [GTK] Improve zooming gesture positioning
3076         https://bugs.webkit.org/show_bug.cgi?id=137822
3077
3078         Reviewed by Carlos Garcia Campos.
3079
3080         * UIProcess/WebPageProxy.h:
3081         * UIProcess/gtk/GestureController.cpp:
3082         (WebKit::GestureController::ZoomGesture::center):
3083         (WebKit::GestureController::ZoomGesture::begin):
3084         (WebKit::GestureController::ZoomGesture::handleZoom):
3085         (WebKit::GestureController::ZoomGesture::scaleChanged): Calculate
3086         the proper view coordinates for the current offset/scale, based
3087         on the initial gesture center point in document coordinates, and
3088         the current center/scale.
3089         * UIProcess/gtk/GestureController.h:
3090         * UIProcess/gtk/WebPageProxyGtk.cpp:
3091         (WebKit::WebPageProxy::getCenterForZoomGesture): Added. Synchronous
3092         call to retrieve the zoom gesture anchor point, in document coordinates.
3093         * WebProcess/WebPage/WebPage.h:
3094         * WebProcess/WebPage/WebPage.messages.in: Added stub.
3095         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3096         (WebKit::WebPage::getCenterForZoomGesture): Added. Getter for the
3097         translated coordinates used as the anchor point of the zoom gesture.
3098
3099 2014-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3100
3101         [GTK] Remove the factory method from DragAndDropHandler
3102         https://bugs.webkit.org/show_bug.cgi?id=137872
3103
3104         Reviewed by Sergio Villar Senin.
3105
3106         Make the constructor public and use std::make_unique instead.
3107
3108         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3109         (webkitWebViewBaseDragAndDropHandler):
3110         * UIProcess/gtk/DragAndDropHandler.cpp:
3111         (WebKit::DragAndDropHandler::create): Deleted.
3112         * UIProcess/gtk/DragAndDropHandler.h:
3113
3114 2014-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3115
3116         [GTK] Add initial gestures support
3117         https://bugs.webkit.org/show_bug.cgi?id=137812
3118
3119         Reviewed by Sergio Villar Senin.
3120
3121         Now that GTK+ has support for gestures, we can use it to handle
3122         touch events and allow to scroll, zoom and tap with the fingers.
3123
3124         * PlatformGTK.cmake: Add new files to compilation.
3125         * UIProcess/API/gtk/PageClientImpl.cpp:
3126         (WebKit::PageClientImpl::doneWithTouchEvent): When the touch event
3127         hasn't been handled by the web process pass it to the
3128         GestureController and only fallback to pointer emulation when the
3129         GestureController doesn't handle the event.
3130         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3131         (webkitWebViewBaseTouchEvent): If the GestureController is
3132         currently processing gestures is because the START touch event was
3133         not handled by the web process, so pass any successive touch
3134         events to the GestureController directly.
3135         (webkitWebViewBaseGestureController): Create the GestureController
3136         on demand and return a reference.
3137         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3138         * UIProcess/gtk/GestureController.cpp: Added.
3139         (WebKit::GestureController::create): Create a GestureController.
3140         (WebKit::GestureController::GestureController): Initialize the
3141         Gesture memebers.
3142         (WebKit::GestureController::handleEvent): Pass the event to the gestures.
3143         (WebKit::GestureController::isProcessingGestures): Whether
3144         Gestures are active.
3145         (WebKit::GestureController::Gesture::Gesture): Base class for gestures.
3146         (WebKit::GestureController::Gesture::isActive): Whether the
3147         gesture is active.
3148         (WebKit::GestureController::Gesture::handleEvent): Pass the event
3149         to the GtkGesture to process it.
3150         (WebKit::GestureController::DragGesture::handleDrag): Send a wheel
3151         event corresponding to the drag gesture to the web process.
3152         (WebKit::GestureController::DragGesture::handleTap): Send move,
3153         press and release events corresponding to a tap gesture to the web process.
3154         (WebKit::GestureController::DragGesture::begin): Start a drag
3155         gesture and schedule a timer to discard tap gesture in case of
3156         long press.
3157         (WebKit::GestureController::DragGesture::update): If the actual
3158         drag hasn't started yet, check the drag threshold to decide
3159         whether to start the drag or not. Otherwise call handleDrag() to
3160         send the appropriate events to the web process.
3161         (WebKit::GestureController::DragGesture::end): If the drag gesture
3162         finishes and the drag didn't happen (it wasn't a long press and
3163         drag threshold was not reached), call handleTap() to emulate a
3164         click event.
3165         (WebKit::GestureController::DragGesture::DragGesture): Initialize
3166         the GtkGestureDrag.
3167         (WebKit::GestureController::ZoomGesture::begin): Save the current
3168         page scale factor and the center point of the gesture.
3169         (WebKit::GestureController::ZoomGesture::scaleChanged): Schedule a
3170         page scale change in an idle for the given scale value.
3171         (WebKit::GestureController::ZoomGesture::ZoomGesture): Initialize
3172         the GtkGestureZoom.
3173         * UIProcess/gtk/GestureController.h: Added.
3174
3175 2014-10-19  Chris Dumez  <cdumez@apple.com>
3176
3177         Use is<>() / downcast<>() for all remaining RenderObject subclasses
3178         https://bugs.webkit.org/show_bug.cgi?id=137845
3179
3180         Reviewed by Darin Adler.
3181
3182         Use is<>() / downcast<>() for all remaining RenderObject subclasses and 
3183         clean up the surrounding code.
3184
3185         * WebProcess/Plugins/PluginView.cpp:
3186         (WebKit::PluginView::pluginProcessCrashed):
3187         * WebProcess/WebPage/WebPage.cpp:
3188         (WebKit::WebPage::createPlugin):
3189
3190 2014-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3191
3192         [GTK] Move GtkDragAndDropHelper from Platform to WebKit2
3193         https://bugs.webkit.org/show_bug.cgi?id=137422
3194
3195         Reviewed by Martin Robinson.
3196
3197         WebKitWebViewBase is currently the only user of
3198         GtkDragAndDropHelper, that was added to share the code with
3199         WebKit1. Move all the drag and drop logic to a new class
3200         DragAndDropHandler.
3201
3202         * PlatformGTK.cmake: Add new files to compilation.
3203         * UIProcess/API/gtk/PageClientImpl.cpp:
3204         (WebKit::PageClientImpl::startDrag):
3205         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3206         (webkitWebViewBaseConstructed):
3207         (webkitWebViewBaseDragDataGet):
3208         (webkitWebViewBaseDragEnd):
3209         (webkitWebViewBaseDragDataReceived):
3210         (webkitWebViewBaseDragMotion):
3211         (webkitWebViewBaseDragLeave):
3212         (webkitWebViewBaseDragDrop):
3213         (webkitWebViewBaseDragAndDropHandler):
3214         (dragExitedCallback): Deleted.
3215         (webkitWebViewBaseStartDrag): Deleted.
3216         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3217         * UIProcess/gtk/DragAndDropHandler.cpp: Added.
3218         (WebKit::DragAndDropHandler::create):
3219         (WebKit::DragAndDropHandler::DragAndDropHandler):
3220         (WebKit::DragAndDropHandler::DroppingContext::DroppingContext):
3221         (WebKit::dragOperationToGdkDragActions):
3222         (WebKit::dragOperationToSingleGdkDragAction):
3223         (WebKit::gdkDragActionToDragOperation):
3224         (WebKit::DragAndDropHandler::startDrag):
3225         (WebKit::DragAndDropHandler::fillDragData):
3226         (WebKit::DragAndDropHandler::finishDrag):
3227         (WebKit::DragAndDropHandler::dataObjectForDropData):
3228         (WebKit::DragAndDropHandler::dragEntered):
3229         (WebKit::DragAndDropHandler::requestDragData):
3230         (WebKit::DragAndDropHandler::dragMotion):
3231         (WebKit::DragAndDropHandler::dragLeave):
3232         (WebKit::DragAndDropHandler::drop):
3233         * UIProcess/gtk/DragAndDropHandler.h: Added.
3234
3235 2014-10-18  Dan Bernstein  <mitz@apple.com>
3236
3237         WorkQueue dispatches functions but isn’t a FunctionDispatcher
3238         https://bugs.webkit.org/show_bug.cgi?id=137853
3239
3240         Reviewed by Anders Carlsson.
3241
3242         * Platform/WorkQueue.h: Changed to inherit from FunctionDispatcher.
3243
3244 2014-10-18  Michael Catanzaro  <mcatanzaro@igalia.com>
3245
3246         [GTK] Improve documentation of webkit_web_view_get_tls_info()
3247         https://bugs.webkit.org/show_bug.cgi?id=137852
3248
3249         Reviewed by Martin Robinson.
3250
3251         * UIProcess/API/gtk/WebKitWebView.cpp:
3252
3253 2014-10-17  Chris Dumez  <cdumez@apple.com>
3254
3255         Use is<>() / downcast<>() for RenderBox
3256         https://bugs.webkit.org/show_bug.cgi?id=137804
3257
3258         Reviewed by Andreas Kling.
3259
3260         Use is<>() / downcast<>() for RenderBox and clean up the surrounding
3261         code.
3262
3263         * WebProcess/WebPage/WebPage.cpp:
3264         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
3265         (WebKit::WebPage::plugInIsPrimarySize):
3266         * WebProcess/WebPage/ios/WebPageIOS.mm:
3267         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
3268
3269 2014-10-16  Simon Fraser  <simon.fraser@apple.com>
3270
3271         [iOS] Turn off font autosizing for iOS WebKitTestRunner
3272         https://bugs.webkit.org/show_bug.cgi?id=137806
3273
3274         Reviewed by Sam Weinig.
3275         
3276         Confusingly, WKPreferencesSetTextAutosizingEnabled() does nothing on iOS.
3277         Instead, we have to add WKPreferencesSetMinimumZoomFontSize() and set it to 0
3278         to disable font autosizing.
3279
3280         * UIProcess/API/C/WKPreferences.cpp:
3281         (WKPreferencesSetMinimumZoomFontSize):
3282         (WKPreferencesGetMinimumZoomFontSize):
3283         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3284
3285 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3286
3287         [EFL] REGRESSION(r173929): It broke the Web Inspector
3288         https://bugs.webkit.org/show_bug.cgi?id=137522
3289
3290         Reviewed by Csaba Osztrogonác.
3291
3292         r173929 let web inspector use a separate web process. Besides it changed that the inspector is shown
3293         as docking mode by default. However EFL port doesn't support to show web inspector as docking window yet.
3294         This patch is to show web inspector on EFL new window as before. Docking mode should be implemented by
3295         upcoming patch.
3296
3297         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3298         (WebKit::WebInspectorProxy::platformAttach):
3299
3300 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3301
3302         [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
3303         https://bugs.webkit.org/show_bug.cgi?id=137782
3304
3305         Reviewed by Sergio Villar Senin.
3306
3307         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3308         (WebKit::LayerTreeHostGtk::layerFlushTimerFired): Use microseconds
3309         instead of milliseconds.
3310
3311 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3312
3313         [GTK] Move touch events handling from Platform to WebKit2
3314         https://bugs.webkit.org/show_bug.cgi?id=137735
3315
3316         Reviewed by Sergio Villar Senin.
3317
3318         GtkTouchContextHelper was only used by WebKitWebViewBase, since
3319         it's the only one that can create touch events. The code has been
3320         simplified by processing the events in the view, and the native
3321         touch events are now created with the native event and touch points.
3322
3323         * Shared/NativeWebTouchEvent.h:
3324         (WebKit::NativeWebTouchEvent::touchContext): Deleted.
3325         * Shared/gtk/NativeWebTouchEventGtk.cpp:
3326         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Pass touch
3327         points instead of touch context to WebEventFactory::createWebTouchEvent().
3328         * Shared/gtk/WebEventFactory.cpp:
3329         (WebKit::WebEventFactory::createWebTouchEvent): Create the
3330         WebTouchEvent for the given native event and points.
3331         (WebKit::touchPhaseFromEvents): Deleted.
3332         (WebKit::appendTouchEvent): Deleted.
3333         * Shared/gtk/WebEventFactory.h:
3334         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3335         (appendTouchEvent): Helper function to create a
3336         WebPlatformTouchPoint for the given native event and add it to the
3337         list of touch points.
3338         (webkitWebViewBaseGetTouchPointForEvent): Build the touch point
3339         list for the event.
3340         (webkitWebViewBaseTouchEvent): Process the touch event.
3341         (webkitWebViewBaseDragDataReceived): Deleted.
3342
3343 2014-10-16  Pascal Jacquemart  <p.jacquemart@samsung.com>
3344
3345         Removing CUSTOM_PROTOCOLS guard
3346         https://bugs.webkit.org/show_bug.cgi?id=137741
3347
3348         Reviewed by Benjamin Poulain.
3349
3350         * NetworkProcess/NetworkProcess.cpp:
3351         (WebKit::NetworkProcess::NetworkProcess):
3352         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
3353         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
3354         * Shared/Network/CustomProtocols/CustomProtocolManager.messages.in:
3355         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
3356         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
3357         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
3358         * Shared/Network/NetworkProcessCreationParameters.cpp:
3359         (WebKit::NetworkProcessCreationParameters::encode):
3360         (WebKit::NetworkProcessCreationParameters::decode):
3361         * Shared/Network/NetworkProcessCreationParameters.h:
3362         * Shared/WebProcessCreationParameters.cpp:
3363         (WebKit::WebProcessCreationParameters::encode):
3364         (WebKit::WebProcessCreationParameters::decode):
3365         * Shared/WebProcessCreationParameters.h:
3366         * UIProcess/API/C/soup/WKAPICastSoup.h:
3367         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp:
3368         (WKSoupCustomProtocolRequestManagerGetTypeID):
3369         (WKSoupCustomProtocolRequestManagerSetClient):
3370         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
3371         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.messages.in:
3372         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
3373         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
3374         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
3375         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h:
3376         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
3377         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h:
3378         * UIProcess/Network/NetworkProcessProxy.cpp:
3379         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
3380         * UIProcess/Network/NetworkProcessProxy.h:
3381         * UIProcess/WebContext.cpp:
3382         (WebKit::WebContext::WebContext):
3383         (WebKit::WebContext::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
3384         (WebKit::WebContext::unregisterSchemeForCustomProtocol):
3385         * UIProcess/WebContext.h:
3386         * UIProcess/WebProcessProxy.cpp:
3387         (WebKit::WebProcessProxy::WebProcessProxy):
3388         * UIProcess/WebProcessProxy.h:
3389         * UIProcess/mac/WebContextMac.mm:
3390         (WebKit::WebContext::platformInitializeWebProcess):
3391         (WebKit::WebContext::platformInitializeNetworkProcess):
3392         * WebKit2Prefix.h:
3393         * WebProcess/WebProcess.cpp:
3394         (WebKit::WebProcess::WebProcess):
3395         * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
3396         (webkitSoupRequestGenericSendAsync):
3397         (webkitSoupRequestGenericSendFinish):
3398         * WebProcess/soup/WebKitSoupRequestGeneric.h:
3399
3400 2014-10-16  Simon Fraser  <simon.fraser@apple.com>
3401
3402         Crash under RemoteLayerTreeHost::getLayer() when closing a tab
3403         https://bugs.webkit.org/show_bug.cgi?id=137796
3404         rdar://problem/18547565
3405
3406         Reviewed by Tim Horton.
3407         
3408         CA can call our animation delegate after the RemoteLayerTreeHost has been
3409         destroyed. CAAnimation retains its delegate, so it's safe for us to null out
3410         the WKAnimationDelegate's pointer to the RemoteLayerTreeHost when tearing down
3411         the RemoteLayerTreeHost.
3412
3413         * UIProcess/mac/RemoteLayerTreeHost.mm:
3414         (WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost):
3415         (WebKit::RemoteLayerTreeHost::animationDidEnd):
3416         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3417         (-[WKAnimationDelegate invalidate]):
3418         (-[WKAnimationDelegate animationDidStart:]):
3419         (-[WKAnimationDelegate animationDidStop:finished:]):
3420
3421 2014-10-16  Tim Horton  <timothy_horton@apple.com>
3422
3423         Implement selection services menu for Legacy WebKit
3424         https://bugs.webkit.org/show_bug.cgi?id=137582
3425         <rdar://problem/18604241>
3426
3427         Reviewed by Brady Eidson.
3428
3429         * UIProcess/mac/WebContextMenuProxyMac.mm:
3430         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
3431         Add a note that we should transition to using replaceSelectionWithAttributedString.
3432
3433         * WebProcess/WebPage/mac/WebPageMac.mm:
3434         (WebKit::WebPage::handleSelectionServiceClick):
3435         Allow editor services in editable-but-not-rich-text areas, just like in WebKit1.
3436
3437 2014-10-16  Tim Horton  <timothy_horton@apple.com>
3438
3439         Various crashes in ViewGestureControllerIOS when closing a tab while a swipe gesture is in progress
3440         https://bugs.webkit.org/show_bug.cgi?id=137770
3441         <rdar://problem/17916459>
3442
3443         Reviewed by Dan Bernstein.
3444
3445         When tearing down a WKWebView in the middle of a swipe gesture, a variety of
3446         UI process crashes were observed. First, two uses of potentially deleted objects
3447         (the WebBackForwardListItem and ViewGestureController), which were fixed by
3448         extending the object's lifetime and checking for its liveness, respectively.
3449         Second, a potential null-deref of DrawingArea if the timing of endSwipeGesture
3450         vs. page teardown was such that DrawingArea was null but everything else was in line.
3451         Lastly, another case of messaging a potentially