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