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