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