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