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