4093ae117b1bf1e70d728f7f68ea2d52053c9831
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-04-18  Anders Carlsson  <andersca@apple.com>
2
3         Try to fix the Windows build.
4
5         * Scripts/webkit2/messages.py:
6
7 2011-04-18  Anders Carlsson  <andersca@apple.com>
8
9         Reviewed by Dan Bernstein.
10
11         Get rid of WebProcessProxyLegacyMessage
12         https://bugs.webkit.org/show_bug.cgi?id=58825
13
14         * GNUmakefile.am:
15         * Platform/CoreIPC/MessageID.h:
16         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h: Removed.
17         * UIProcess/WebProcessProxy.cpp:
18         * WebKit2.xcodeproj/project.pbxproj:
19         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
20         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
21         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
22         * WebProcess/WebPage/WebPage.cpp:
23         * win/WebKit2.vcproj:
24
25 2011-04-18  Anders Carlsson  <andersca@apple.com>
26
27         Fix build.
28
29         * UIProcess/Plugins/PluginInfoStore.h:
30
31 2011-04-18  Anders Carlsson  <andersca@apple.com>
32
33         Reviewed by Sam Weinig.
34
35         Use the message generator for the GetPluginProcessConnection message
36         https://bugs.webkit.org/show_bug.cgi?id=58815
37
38         * Platform/CoreIPC/HandleMessage.h:
39         (CoreIPC::callMemberFunction):
40         (CoreIPC::handleMessageDelayed):
41         Add helper functions.
42
43         * UIProcess/Plugins/PluginInfoStore.h:
44         Mark class noncopyable.
45
46         * UIProcess/Plugins/PluginProcessManager.cpp:
47         (WebKit::PluginProcessManager::getPluginProcessConnection):
48         This now takes a delayed reply.
49
50         * UIProcess/Plugins/PluginProcessProxy.cpp:
51         (WebKit::PluginProcessProxy::getPluginProcessConnection):
52         This now takes a delayed reply.
53
54         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
55         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
56         Call DelayedReply::send.
57
58         * UIProcess/WebProcessProxy.cpp:
59         (WebKit::WebProcessProxy::getPluginProcessConnection):
60         This now takes a delayed reply.
61         
62         (WebKit::WebProcessProxy::didReceiveSyncMessage):
63         No need to handle this message here.
64
65         * UIProcess/WebProcessProxy.messages.in:
66         Add GetPluginProcessConnection message.
67
68         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
69         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
70         Don't use deprecatedSendSync.
71
72 2011-04-18  Anders Carlsson  <andersca@apple.com>
73
74         Reviewed by Adam Roben.
75
76         Finish implementing delayed sync replies in the CoreIPC message generator
77         https://bugs.webkit.org/show_bug.cgi?id=58814
78
79         Put the DelayedReply function definitions in the .cpp file and fix bugs found by
80         actually trying to compile the generated files.
81
82         * Scripts/webkit2/messages.py:
83         * Scripts/webkit2/messages_unittest.py:
84
85 2011-04-18  Anders Carlsson  <andersca@apple.com>
86
87         Reviewed by Adam Roben.
88
89         Reproducible crash in Find on Page, on pages that use accelerated compositing
90         https://bugs.webkit.org/show_bug.cgi?id=58793
91         <rdar://problem/9295870>
92
93         Move the call to PageOverlay::setNeedsDisplay() back to WebPage::installPageOverlay;
94         it needs to be called after we've told the drawing area that a page overlay has been installed.
95
96         * WebProcess/WebPage/PageOverlay.cpp:
97         (WebKit::PageOverlay::setPage):
98         * WebProcess/WebPage/WebPage.cpp:
99         (WebKit::WebPage::installPageOverlay):
100
101 2011-04-18  Jeff Miller  <jeffm@apple.com>
102
103         Reviewed by Timothy Hatcher.
104
105         WKFrameLoadState should be a uint32_t to match our API conventions
106         https://bugs.webkit.org/show_bug.cgi?id=58785
107
108         * UIProcess/API/C/WKFrame.h: typedef WKFrameLoadState as a uint32_t and define its values as an anonymous enum.
109
110 2011-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
111
112         Unreviewed. Fix WebKit2 GTK build after 84017.
113
114         * GNUmakefile.am:
115         * Shared/NativeWebMouseEvent.h:
116         (WebKit::NativeWebMouseEvent::nativeEvent):
117         * Shared/gtk/NativeWebMouseEventGtk.cpp: Copied from Source/WebKit2/Shared/NativeWebMouseEvent.h.
118         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
119         * UIProcess/gtk/WebView.cpp:
120         (WebKit::WebView::handleMouseEvent):
121
122 2011-04-17  David Kilzer  <ddkilzer@apple.com>
123
124         <http://webkit.org/b/58463> Switch HTTP pipelining from user default to private setting
125         <rdar://problem/9268729>
126
127         Reviewed by Dan Bernstein.
128
129         This replaces support for the WebKitEnableHTTPPipelining user
130         default with methods on the WebCore::ResourceRequest class in
131         WebCore, the WebView class in WebKit1, and the WebContext class
132         in WebKit2.  It also removes support for the
133         WebKitForceHTTPPipeliningPriorityHigh user default which was not
134         needed.
135
136         * UIProcess/API/C/WKContext.cpp:
137         (_WKContextSetHTTPPipeliningEnabled): Added.
138         * UIProcess/API/C/WKContextPrivate.h:
139         (_WKContextSetHTTPPipeliningEnabled): Added declaration.
140         * UIProcess/WebContext.cpp:
141         (WebKit::WebContext::setHTTPPipeliningEnabled): Added.
142         (WebKit::WebContext::httpPipeliningEnabled): Added.
143         * UIProcess/WebContext.h:
144         (WebKit::WebContext::setHTTPPipeliningEnabled): Added declaration.
145         (WebKit::WebContext::httpPipeliningEnabled): Added declaration.
146
147 2011-04-17  Sam Weinig  <sam@webkit.org>
148
149         Reviewed by Geoffrey Garen.
150
151         Make more strings in WebKit2 localizable
152         https://bugs.webkit.org/show_bug.cgi?id=58757
153
154         * UIProcess/API/mac/PDFViewController.mm:
155         (-[WKPDFView menuForEvent:]):
156         * UIProcess/API/mac/PageClientImpl.mm:
157         (WebKit::PageClientImpl::setViewportArguments):
158         (WebKit::PageClientImpl::registerEditCommand):
159         * UIProcess/WebEditCommandProxy.cpp:
160         (WebKit::WebEditCommandProxy::nameForEditAction):
161         * UIProcess/WebEditCommandProxy.h:
162         Use WebCore's localization macro to make more strings localizable.
163
164 2011-04-17  Patrick Gansterer  <paroga@webkit.org>
165
166         Reviewed by Adam Barth.
167
168         Rename PLATFORM(CA) to USE(CA)
169         https://bugs.webkit.org/show_bug.cgi?id=58742
170
171         * WebProcess/WebPage/LayerTreeHost.cpp:
172         * WebProcess/WebPage/win/LayerTreeHostWin.cpp:
173         (WebKit::LayerTreeHost::supportsAcceleratedCompositing):
174
175 2011-04-17  Patrick Gansterer  <paroga@webkit.org>
176
177         Reviewed by Adam Barth.
178
179         Rename PLATFORM(CG) to USE(CG)
180         https://bugs.webkit.org/show_bug.cgi?id=58729
181
182         * Shared/ShareableBitmap.h:
183         * Shared/WebCoreArgumentCoders.cpp:
184         * Shared/WebCoreArgumentCoders.h:
185         * Shared/WebGraphicsContext.cpp:
186         (WebKit::WebGraphicsContext::WebGraphicsContext):
187         * Shared/WebGraphicsContext.h:
188         * Shared/win/PlatformCertificateInfo.cpp:
189         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
190         * UIProcess/win/WebView.cpp:
191         (WebKit::WebView::setFindIndicator):
192         * WebProcess/WebPage/WebPage.cpp:
193         (WebKit::WebPage::drawRectToPDF):
194         (WebKit::WebPage::drawPagesToPDF):
195         * WebProcess/WebPage/win/WebPageWin.cpp:
196         (WebKit::WebPage::platformPreferencesDidChange):
197         * config.h:
198
199 2011-04-16  Anders Carlsson  <andersca@apple.com>
200
201         Reviewed by Sam Weinig.
202
203         Crash when NPP_Write returns -1 when writing the manual stream
204         https://bugs.webkit.org/show_bug.cgi?id=58735
205         <rdar://problem/9124993>
206
207         If NPP_Write returns -1 we must cancel the stream.
208
209         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
210         (WebKit::NetscapePluginStream::deliverDataToPlugin):
211
212 2011-04-16  Sam Weinig  <sam@webkit.org>
213
214         Reviewed by Simon Fraser.
215
216         Pages in the PageCache don't have the correct visited link coloring after being restored
217         https://bugs.webkit.org/show_bug.cgi?id=58721
218
219         * WebProcess/WebProcess.cpp:
220         (WebKit::WebProcess::visitedLinkStateChanged):
221         (WebKit::WebProcess::allVisitedLinkStateChanged):
222         Mark all pages in the page cache as needing visited link style recalc
223         whenever visited link information changes.
224
225 2011-04-15  Daniel Bates  <dbates@webkit.org>
226
227         Attempt to fix the Qt Linux Release build after changeset 84064 <http://trac.webkit.org/changeset/84064>
228         (https://bugs.webkit.org/show_bug.cgi?id=58686).
229
230         * UIProcess/API/qt/qwkpage_p.h: Remove takeFocus().
231
232 2011-04-15  Shishir Agrawal  <shishir@chromium.org>
233
234         Reviewed by James Robinson.
235
236         Add a flag to guard Page Visibility API changes.
237         https://bugs.webkit.org/show_bug.cgi?id=58464
238
239         * Configurations/FeatureDefines.xcconfig:
240
241 2011-04-15  Jeff Miller  <jeffm@apple.com>
242
243         Reviewed by Sam Weinig.
244
245         Add takeFocus callback to WKPageUIClient
246         https://bugs.webkit.org/show_bug.cgi?id=58686
247
248         On Windows, we need to handle moving focus out of the web view in the client, so add a takeFocus callback to WKPageUIClient
249         and stop handling taking focus in the framework in WKView.mm on the Mac.
250
251         * UIProcess/API/C/WKPage.h: Added WKFocusDirection enum and takeFocus to WKPageUIClient.
252         * UIProcess/API/mac/PageClientImpl.h: Removed takeFocus().
253         * UIProcess/API/mac/PageClientImpl.mm: Removed takeFocus().
254         * UIProcess/API/mac/WKView.mm: Removed _takeFocus().
255         * UIProcess/API/mac/WKViewInternal.h: Removed _takeFocus().
256         * UIProcess/API/qt/ClientImpl.cpp:
257         (qt_wk_takeFocus): Added.
258         * UIProcess/API/qt/ClientImpl.h: Added qt_wk_takeFocus.
259         * UIProcess/API/qt/qwkpage.cpp: Remove takeFocus().
260         (QWKPage::QWKPage): Added takeFocus() callback.
261         * UIProcess/PageClient.h: Removed takeFocus().
262         * UIProcess/WebPageProxy.cpp:
263         (WebKit::WebPageProxy::takeFocus): Call m_uiClient to take focus.
264         * UIProcess/WebPageProxy.h: Pass FocusDirection as a uint32_t to takeFocus().
265         * UIProcess/WebPageProxy.messages.in: Pass FocusDirection as a uint32_t in TakeFocus message.
266         * UIProcess/WebUIClient.cpp:
267         (WebKit::WebUIClient::takeFocus): Added.
268         * UIProcess/WebUIClient.h: Added takeFocus().
269         * UIProcess/win/WebView.cpp: Removed takeFocus(), which was never implemented on Windows.
270         * UIProcess/win/WebView.h: Removed takeFocus().
271         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
272         (WebKit::WebChromeClient::takeFocus): Pass FocusDirection as a uint32_t in TakeFocus message.
273
274 2011-04-15  Alexey Proskuryakov  <ap@apple.com>
275
276         Reviewed by Sam Weinig.
277
278         WebKit2: Stop using deprecated NSInputManager
279         https://bugs.webkit.org/show_bug.cgi?id=58709
280
281         Changed all mouse related functions to give NSInputContext a chance to handle the event,
282         added logging. Removed -rightMouseMoved: method, which was added by accident.
283
284         * UIProcess/API/mac/WKView.mm:
285         (-[WKView mouseMoved:]):
286         (-[WKView mouseDown:]):
287         (-[WKView mouseUp:]):
288         (-[WKView mouseDragged:]):
289
290 2011-04-15  Jon Honeycutt  <jhoneycutt@apple.com>
291
292         Potential crash getting a JS wrapper.
293
294         <rdar://problem/8988741>
295
296         Reviewed by Brian Weinstein.
297
298         * WebProcess/WebPage/WebFrame.cpp:
299         (WebKit::WebFrame::jsWrapperForWorld):
300         Ensure that we have a valid m_coreFrame, because it can be cleared by
301         invalidate().
302
303 2011-04-08  Luiz Agostini  <luiz.agostini@openbossa.org>
304
305         Reviewed by Kenneth Rohde Christiansen.
306
307         [Qt] QWebPage MIME type handling inconsistency with other web browsers
308         https://bugs.webkit.org/show_bug.cgi?id=46968
309
310         Implementing mime type sniffing based on
311         http://tools.ietf.org/html/draft-abarth-mime-sniff-06.
312
313         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp:
314         (WebCore::WebFrameNetworkingContext::WebFrameNetworkingContext):
315         (WebCore::WebFrameNetworkingContext::MIMESniffingEnabled):
316         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h:
317
318 2011-04-15  Oliver Hunt  <oliver@apple.com>
319
320         GC allocate Structure
321         https://bugs.webkit.org/show_bug.cgi?id=58483
322
323         Rolling r83894 r83827 r83810 r83809 r83808 back in with
324         a workaround for the gcc bug seen by the gtk bots
325
326         * WebProcess/Plugins/Netscape/JSNPMethod.h:
327         (WebKit::JSNPMethod::createStructure):
328         * WebProcess/Plugins/Netscape/JSNPObject.h:
329         (WebKit::JSNPObject::createStructure):
330
331 2011-04-15  Anders Carlsson  <andersca@apple.com>
332
333         Reviewed by Sam Weinig.
334
335         Add API to get the bundle page overlay fade in fraction.
336
337         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
338         (WKBundlePageOverlayFractionFadedIn):
339         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
340
341 2011-04-15  Anders Carlsson  <andersca@apple.com>
342
343         Reviewed by Dan Bernstein.
344
345         Fade the find page overlay
346         https://bugs.webkit.org/show_bug.cgi?id=58697
347
348         * WebProcess/WebPage/FindController.cpp:
349         Make the color components floats.
350
351         (WebKit::overlayBackgroundColor):
352         (WebKit::holeShadowColor):
353         (WebKit::holeFillColor):
354         Add helper functions for returning the colors given the fraction faded in.
355
356         (WebKit::FindController::drawRect):
357         Use the new helper functions.
358
359         * WebProcess/WebPage/WebPage.cpp:
360         (WebKit::WebPage::installPageOverlay):
361         Start the fade animation unless we're replacing an already existing page overlay
362         with another.
363
364 2011-04-15  Anders Carlsson  <andersca@apple.com>
365
366         Fix Windows build.
367
368         * WebProcess/WebPage/PageOverlay.cpp:
369         (WebKit::PageOverlay::fadeAnimationTimerFired):
370
371 2011-04-15  Anders Carlsson  <andersca@apple.com>
372
373         Reviewed by Sam Weinig.
374
375         Add the ability for PageOverlays to fade in and out
376         https://bugs.webkit.org/show_bug.cgi?id=58694
377
378         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
379         (WKBundlePageUninstallPageOverlay):
380         WebPage::uninstallPageOverlay now takes a boolean. Default to false for now.
381
382         * WebProcess/WebPage/FindController.cpp:
383         (WebKit::FindController::findString):
384         Pass false to uninstallPageOverlay.
385
386         (WebKit::FindController::hideFindUI):
387         Pass true to uninstallPageOverlay.
388         
389         * WebProcess/WebPage/PageOverlay.cpp:
390         (WebKit::PageOverlay::PageOverlay):
391         Initialize new member variables.
392
393         (WebKit::PageOverlay::bounds):
394         Get rid of an unnecessary webPage() getter.
395
396         (WebKit::PageOverlay::setPage):
397         Stop the animation timer.
398
399         (WebKit::PageOverlay::startFadeInAnimation):
400         Update m_fractionFadedIn and call startFadeAnimation.
401
402         (WebKit::PageOverlay::startFadeOutAnimation):
403         Ditto.
404         
405         (WebKit::PageOverlay::startFadeAnimation):
406         Initialize m_fadeAnimationStartTime and start the fade animation timer.
407
408         (WebKit::PageOverlay::fadeAnimationTimerFired):
409         Update m_fractionFadedIn and call setNeedsDisplay().
410
411         * WebProcess/WebPage/PageOverlay.h:
412         * WebProcess/WebPage/WebPage.cpp:
413         (WebKit::WebPage::uninstallPageOverlay):
414         If fadeOut is true, tell the page overlay to start the fade out animation.
415         When the fade animation is complete, the page overlay will uninstall itself.
416
417 2011-04-15  Brian Weinstein  <bweinstein@apple.com>
418
419         Reviewed by Adam Roben.
420
421         Views should be made visible before painting in WM_PRINTCLIENT messages
422         https://bugs.webkit.org/show_bug.cgi?id=58676
423         <rdar://problem/9279211>
424
425         * UIProcess/win/WebView.cpp:
426         (WebKit::WebView::onPrintClientEvent): If our view isn't currently visible set it to visible
427             before painting, then reset it back to not visible after painting.
428         (WebKit::WebView::onShowWindowEvent): Call setIsVisible instead of duplicating logic.
429         (WebKit::WebView::setIsVisible): Set the m_isVisible flag and call viewStateDidChange.
430         * UIProcess/win/WebView.h:
431
432 2011-04-15  Jon Lee  <jonlee@apple.com>
433
434         Reviewed by Anders Carlsson.
435
436         onClick does not function with <select> elements in WebKit2
437         https://bugs.webkit.org/show_bug.cgi?id=57904
438         <rdar://problem/9217757>
439
440         Reviewed by Anders Carlsson.
441
442         * Shared/NativeWebMouseEvent.h: Copied from Source/WebKit2/UIProcess/WebPopupMenuProxy.h.
443         (WebKit::NativeWebMouseEvent::nativeEvent):
444         * Shared/mac/NativeWebMouseEventMac.mm: Added.
445         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
446         * Shared/qt/NativeWebMouseEventQt.cpp: Copied from Source/WebKit2/UIProcess/WebPopupMenuProxy.h.
447         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
448         * Shared/win/NativeWebMouseEventWin.cpp: Copied from Source/WebKit2/UIProcess/WebPopupMenuProxy.h.
449         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
450         * UIProcess/API/mac/WKView.mm:
451         (-[WKView mouseMoved:]):
452         (-[WKView _mouseHandler:]): Pre-compiler mouse handler calls need to use the new NativeWebMouseEvent class
453         * UIProcess/API/qt/qwkpage.cpp:
454         (QWKPagePrivate::mouseMoveEvent):
455         (QWKPagePrivate::mousePressEvent):
456         (QWKPagePrivate::mouseReleaseEvent):
457         (QWKPagePrivate::mouseDoubleClickEvent):
458         * UIProcess/WebPageProxy.cpp:
459         (WebKit::WebPageProxy::handleMouseEvent): keep track of mouse down event in order to be able to send a fake mouse up event on the select element
460         (WebKit::WebPageProxy::currentMouseDownEvent): for access by the popup menu proxy to dispatch the fake mouse up event
461         (WebKit::WebPageProxy::didReceiveEvent): clear out the cached mouse down event
462         (WebKit::WebPageProxy::processDidCrash): clear out the cached events since we assume that didReceiveEvent did not called prior to the crash
463         * UIProcess/WebPageProxy.h:
464         * UIProcess/WebPopupMenuProxy.h:
465         * UIProcess/mac/WebPopupMenuProxyMac.mm:
466         (WebKit::WebPopupMenuProxyMac::showPopupMenu): after notifying the popup menu client that the value changed, fake mouse up and mouse move events are posted
467         * UIProcess/win/WebPopupMenuProxyWin.cpp:
468         (WebKit::WebPopupMenuProxyWin::showPopupMenu): after notifying the popup menu client that the value changed, fake mouse up and mouse move events are posted
469         * UIProcess/win/WebView.cpp:
470         (WebKit::WebView::onMouseEvent):
471         * WebKit2.pro:
472         * WebKit2.xcodeproj/project.pbxproj:
473         * win/WebKit2.vcproj:
474
475 2011-04-15  Alexey Proskuryakov  <ap@apple.com>
476
477         Qt build fix.
478
479         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::selectionStateChanged): Wrap the variable
480         in PLATFORM(MAC), too, as it's unused on other platforms.
481
482 2011-04-15  Brady Eidson  <beidson@apple.com>
483
484         Reviewed by Dan Bernstein.
485
486         <rdar://problem/9287880> and https://bugs.webkit.org/show_bug.cgi?id=58596
487         WK2: Past searches not remembered for <input type=search results="5" autosave="foo">
488
489         Add SaveRecentSearches and LoadRecentSearches messages:
490         * UIProcess/WebPageProxy.messages.in:
491         * UIProcess/WebPageProxy.h:
492
493         Message up to the UIProcess for the save/load operations:
494         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
495         (WebKit::WebSearchPopupMenu::saveRecentSearches):
496         (WebKit::WebSearchPopupMenu::loadRecentSearches):
497         * WebProcess/WebCoreSupport/WebPopupMenu.h:
498         (WebKit::WebPopupMenu::page):
499
500         Save the values to disk CFPreference-style:
501         * UIProcess/cf/WebPageProxyCF.cpp:
502         (WebKit::autosaveKey):
503         (WebKit::WebPageProxy::saveRecentSearches):
504         (WebKit::WebPageProxy::loadRecentSearches):
505
506         Stubbed out for non-CF platforms:
507         * UIProcess/gtk/WebPageProxyGtk.cpp:
508         (WebKit::WebPageProxy::saveRecentSearches):
509         (WebKit::WebPageProxy::loadRecentSearches):
510         * UIProcess/qt/WebPageProxyQt.cpp:
511         (WebKit::WebPageProxy::saveRecentSearches):
512         (WebKit::WebPageProxy::loadRecentSearches):
513
514 2011-04-14  Alexey Proskuryakov  <ap@apple.com>
515
516         Reviewed by Dan Bernstein.
517
518         WebKit2: Password field input does not switch to ASCII-compatible source
519         https://bugs.webkit.org/show_bug.cgi?id=58583
520         <rdar://problem/9059651>
521
522         The implementation is more modern than what we have in WK1. Instead of returning a null
523         input context (as in non-editable content), we now set page context's properties.
524
525         * UIProcess/PageClient.h:
526         * UIProcess/API/mac/PageClientImpl.h:
527         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::updateSecureInputState):
528         Forward updateSecureInputState() call from WebPageProxy to WKView.
529
530         * UIProcess/API/mac/WKView.mm:
531         (-[WKView dealloc]): ASSERT that we didn't somehow leave secure input events enabled.
532         (-[WKView becomeFirstResponder]): Update secure event mode.
533         (-[WKView resignFirstResponder]): Disable secure event mode.
534         (-[WKView setMarkedText:selectedRange:replacementRange:]): Prevent most advanced editing
535         behaviors in password fields, matching NSSecureTextInputField.
536         (-[WKView attributedSubstringForProposedRange:actualRange:]): Disable TSM Document Access
537         in password fields. There is also a check in web process, but it doest't hurt to check twice.
538         (-[WKView _windowDidBecomeKey:]): Call _updateSecureInputState.
539         (-[WKView _windowDidResignKey:]): Call _updateSecureInputState.
540         (-[WKView _updateSecureInputState]): Update secure event mode and allowed input sources.
541
542         * UIProcess/API/mac/WKViewInternal.h: Added _updateSecureInputState.
543
544         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::selectionStateChanged): Update secure
545         input state when going in or out a password field.
546
547 2011-04-14  Jer Noble  <jer.noble@apple.com>
548
549         Reviewed by Eric Carlson.
550
551         REGRESSION: Rendering in <video> element appears to render quickly to catch up if it has been playing in a background tab
552         https://bugs.webkit.org/show_bug.cgi?id=58637
553
554         Notify AVFoundation that no one will be rendering when the view or window moves off screen.
555
556         * UIProcess/API/mac/PageClientImpl.mm:
557         (WebKit::PageClientImpl::isViewVisible): Return false if the view's window is not visible.
558         * UIProcess/API/mac/WKView.mm:
559         (-[WKView addWindowObserversForWindow:]): Observe orderOut and orderIn events.
560         (-[WKView removeWindowObservers]): Ditto.
561         (-[WKView _windowDidOrderOffScreen:]): Added.
562         (-[WKView _windowDidOrderOnScreen:]): Added.
563         * WebProcess/WebPage/DrawingAreaImpl.cpp:
564         (WebKit::DrawingAreaImpl::suspendPainting): Call LayerTreeHost::pauseRendering.
565         (WebKit::DrawingAreaImpl::resumePainting): Call LayerTreeHost::resumeRendering.
566         * WebProcess/WebPage/LayerTreeHost.h:
567         (WebKit::LayerTreeHost::pauseRendering): Added stub.
568         (WebKit::LayerTreeHost::resumeRendering): Added stub.
569         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
570         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
571         (WebKit::LayerTreeHostCAMac::pauseRendering): Added. Post a notification with our
572             intention to stop rendering.
573         (WebKit::LayerTreeHostCAMac::resumeRendering): Added. Post a notification with our
574             intention to start rendering.
575
576 2011-04-15  Jessie Berlin  <jberlin@apple.com>
577
578         Reviewed by Sam Weinig.
579
580         WebKit2: Need a way to keep the WebProcess alive for testing purposes.
581         https://bugs.webkit.org/show_bug.cgi?id=58592
582
583         * UIProcess/API/C/WKContext.cpp:
584         (WKContextDisableProcessTermination):
585         (WKContextEnableProcessTermination):
586         * UIProcess/API/C/WKContextPrivate.h:
587
588         * UIProcess/WebContext.cpp:
589         (WebKit::WebContext::WebContext):
590         Initialize m_processTerminationEnabled to true.
591         (WebKit::WebContext::enableProcessTermination):
592         Set m_processTerminationEnabled to true, and try to terminate the web process.
593         (WebKit::WebContext::shouldTerminate):
594         If !m_processTerminationEnabled, return false.
595         * UIProcess/WebContext.h:
596         (WebKit::WebContext::disableProcessTermination):
597         Set m_processTerminationEnabled to false;
598
599 2011-04-15  Nancy Piedra  <nancy.piedra@nokia.com>
600
601         Reviewed by Laszlo Gombos.
602
603         [Qt][Symbian] Need to export ViewportAttributes class
604         https://bugs.webkit.org/show_bug.cgi?id=58651
605
606         On Symbian, if the ViewportAttributes class is not exported we get
607         linking errors.
608
609         Since this is a compilation issue, no new tests added.
610
611         * UIProcess/API/qt/qwkpage.h:
612
613 2011-04-15  Anna Cavender  <annacc@chromium.org>
614
615         Reviewed by Eric Carlson.
616
617         Renaming TRACK feature define to VIDEO_TRACK
618         https://bugs.webkit.org/show_bug.cgi?id=53556
619
620         * Configurations/FeatureDefines.xcconfig:
621
622 2011-04-14  Anders Carlsson  <andersca@apple.com>
623
624         Reviewed by Sam Weinig.
625
626         Select All context menu item doesn't work in Flash
627         https://bugs.webkit.org/show_bug.cgi?id=58615
628         <rdar://problem/9225761>
629
630         In some cases, -[NSWindow isKeyWindow] will return false even if
631         a window is the key window, so we have to compare our window
632         against -[NSApplication keyWindow].
633
634         * UIProcess/API/mac/PageClientImpl.mm:
635         (WebKit::PageClientImpl::isViewWindowActive):
636
637 2011-04-14  Sam Weinig  <sam@webkit.org>
638
639         Reviewed by Anders Carlsson.
640
641         Add CFPreference based backend for WebKit2 preferences
642         https://bugs.webkit.org/show_bug.cgi?id=58605
643
644         * UIProcess/cf/WebPreferencesCF.cpp:
645         (WebKit::cfStringFromWebCoreString):
646         (WebKit::makeKey):
647         (WebKit::setStringValueIfInUserDefaults):
648         (WebKit::setBoolValueIfInUserDefaults):
649         (WebKit::setUInt32ValueIfInUserDefaults):
650         (WebKit::setDoubleValueIfInUserDefaults):
651         (WebKit::WebPreferences::platformInitializeStore):
652         (WebKit::WebPreferences::platformUpdateStringValueForKey):
653         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
654         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
655         (WebKit::WebPreferences::platformUpdateDoubleValueForKey):
656         Implement platform functions using CFPreferences API.
657
658 2011-04-14  Brady Eidson  <beidson@apple.com>
659
660         Reviewed by Sam Weinig.
661
662         <rdar://problem/8665102> and https://bugs.webkit.org/show_bug.cgi?id=58595
663         Menu is not displayed for <input type=search results="5">
664
665         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
666         (WebKit::WebSearchPopupMenu::enabled): Return true, like all good search popup menus should.
667
668         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
669         (WebKit::WebPopupMenu::setUpPlatformData): Remember the shouldPopOver-ness.
670
671         * Shared/PlatformPopupMenuData.cpp:
672         (WebKit::PlatformPopupMenuData::encode): Remember the shouldPopOver-ness.
673         (WebKit::PlatformPopupMenuData::decode): Remember the shouldPopOver-ness.
674         * Shared/PlatformPopupMenuData.h:
675
676         * UIProcess/mac/WebPopupMenuProxyMac.mm:
677         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Use the shouldPopOver-ness to adjust display position.
678
679 2011-04-14  Anders Carlsson  <andersca@apple.com>
680
681         Reviewed by Dan Bernstein.
682
683         Crash in NetscapePluginModule::tryGetSitesWithData when NPP_GetSitesWithData returns null
684         https://bugs.webkit.org/show_bug.cgi?id=58578
685         <rdar://problem/9275201>
686
687         It's OK for NPP_GetSitesWithData to return null.
688
689         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
690         (WebKit::NetscapePluginModule::tryGetSitesWithData):
691
692 2011-04-14  Sam Weinig  <sam@webkit.org>
693
694         Reviewed by Anders Carlsson.
695
696         Make creating WebPreferences lazy
697         https://bugs.webkit.org/show_bug.cgi?id=58570
698
699         * UIProcess/WebPageGroup.cpp:
700         (WebKit::WebPageGroup::WebPageGroup):
701         (WebKit::WebPageGroup::~WebPageGroup):
702         (WebKit::WebPageGroup::setPreferences):
703         (WebKit::WebPageGroup::preferences):
704         * UIProcess/WebPageGroup.h:
705         Don't create the WebPreference object until it is requested.
706
707 2011-04-14  Pratik Solanki  <psolanki@apple.com>
708
709         Reviewed by David Kilzer.
710
711         Set minimum priority for fast lane connections
712         https://bugs.webkit.org/show_bug.cgi?id=58353
713
714         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
715         (InitWebCoreSystemInterface): Support for new WKSI method WKSetHTTPPipeliningMinimumFastLanePriority.
716
717 2011-04-14  Anders Carlsson  <andersca@apple.com>
718
719         Clang warning fixes.
720
721         * UIProcess/API/mac/PageClientImpl.h:
722         * UIProcess/mac/TextCheckerMac.mm:
723         * WebProcess/Downloads/mac/DownloadMac.mm:
724
725 2011-04-14  Jessie Berlin  <jberlin@apple.com>
726
727         Reviewed by Timothy Hatcher.
728
729         WebKit2: Add an option for a PageGroup to be invisible to the History Client.
730         https://bugs.webkit.org/show_bug.cgi?id=58547
731
732         * Shared/WebPageGroupData.cpp:
733         (WebKit::WebPageGroupData::encode):
734         (WebKit::WebPageGroupData::decode):
735         * Shared/WebPageGroupData.h:
736
737         * UIProcess/WebInspectorProxy.cpp:
738         (WebKit::WebInspectorProxy::inspectorPageGroup):
739         The Web Inspector should not be visible to the History Client, because its HTML-based nature
740         should not be exposed through the API.
741
742         * UIProcess/WebPageGroup.cpp:
743         (WebKit::WebPageGroup::create):
744         (WebKit::WebPageGroup::WebPageGroup):
745         * UIProcess/WebPageGroup.h:
746
747         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
748         (WebKit::WebFrameLoaderClient::updateGlobalHistory):
749         Do not send the message to the WebContent for the history client.
750         (WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
751         Ditto.
752         (WebKit::WebFrameLoaderClient::setTitle):
753         Ditto.
754
755         * WebProcess/WebPage/WebPageGroupProxy.h:
756         (WebKit::WebPageGroupProxy::isVisibleToHistoryClient):
757
758 2011-04-14  Balazs Kelemen  <kbalazs@webkit.org>
759
760         Reviewed by Andreas Kling.
761
762         [Qt][WK2] Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1
763         https://bugs.webkit.org/show_bug.cgi?id=55719
764
765         Guard functionality related to complex text and implementations
766         that rely on MachPort with PLATFORM(MAC).
767         Based on Oleg Romashin's patch.
768
769         * PluginProcess/PluginControllerProxy.cpp:
770         * PluginProcess/PluginControllerProxy.messages.in:
771         * PluginProcess/PluginProcess.cpp:
772         (WebKit::PluginProcess::createWebProcessConnection):
773         * PluginProcess/WebProcessConnection.cpp:
774         (WebKit::WebProcessConnection::createPlugin):
775         * Shared/Plugins/PluginProcessCreationParameters.cpp:
776         (WebKit::PluginProcessCreationParameters::decode): Fix bad C++ that
777         does not compile with gcc-linux.
778         * UIProcess/Plugins/PluginProcessProxy.cpp:
779         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
780         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
781         * UIProcess/Plugins/PluginProcessProxy.h:
782         * UIProcess/Plugins/PluginProcessProxy.messages.in:
783         * WebKit2.pro: Move implementation that does not need external
784         visibility from WebKit2API.pri. Adding the headers as well.
785         * WebKit2API.pri:
786         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
787         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
788         * WebProcess/WebPage/WebPage.cpp:
789
790 2011-04-13  James Robinson  <jamesr@chromium.org>
791
792         Reviewed by Simon Fraser.
793
794         Allow setting composited backing stores for scrollbars and scroll corners
795         https://bugs.webkit.org/show_bug.cgi?id=57202
796
797         Update WebPopupMenuProxyWin to reflect ScrollableArea interface changes.
798
799         * UIProcess/win/WebPopupMenuProxyWin.h:
800         (WebKit::WebPopupMenuProxyWin::invalidateScrollCornerRect):
801         (WebKit::WebPopupMenuProxyWin::scrollCornerPresent):
802         (WebKit::WebPopupMenuProxyWin::scrollCornerRect):
803
804 2011-04-13  Jon Lee  <jonlee@apple.com>
805
806         Reviewed by Maciej Stachowiak.
807
808         REGRESSION(r81880): Paste menu is disabled for many edit fields (yahoo and google search, yahoo mail msg, forms, etc)
809         https://bugs.webkit.org/show_bug.cgi?id=58284
810         <rdar://problem/9246149>
811
812         * WebProcess/WebPage/WebPage.cpp:
813         (WebKit::WebPage::setFocused): Check for whether we are not supposed to be focused AND whether our platform behavior dictates to clear out the selection
814
815 2011-04-13  Dan Bernstein  <mitz@apple.com>
816
817         Reviewed by Sam Weinig.
818
819         Fixed a bug where WKView changed the cursor when the mouse was moving over other views.
820
821         * UIProcess/API/mac/WKView.mm:
822         (-[WKView mouseMoved:]): If getting this message because this view is the first responder,
823         ignore it unless it is inside the visible rect.
824
825 2011-04-13  Enrica Casucci  <enrica@apple.com>
826
827         Reviewed by Dan Bernstein.
828
829         Should not rely on WKEditableLinkBehavior being in synch
830         with WebCore::EditableLinkBehavior.
831         https://bugs.webkit.org/show_bug.cgi?id=58473
832
833         Adding conversion routines.
834
835         * UIProcess/API/C/WKAPICast.h:
836         (WebKit::toAPI):
837         (WebKit::toEditableLinkBehavior):
838         * UIProcess/API/C/WKPreferences.cpp:
839         (WKPreferencesSetEditableLinkBehavior):
840         (WKPreferencesGetEditableLinkBehavior):
841
842 2011-04-13  Anders Carlsson  <andersca@apple.com>
843
844         Reviewed by Dan Bernstein.
845
846         After closing the last window, re-opening my last visited website is over 2X slower
847         https://bugs.webkit.org/show_bug.cgi?id=58488
848         <rdar://problem/9233518>
849
850         Give the web process a 60 second termination timeout.
851
852         * WebProcess/WebProcess.cpp:
853         (WebKit::WebProcess::WebProcess):
854
855 2011-04-13  Anders Carlsson  <andersca@apple.com>
856
857         Reviewed by Adam Roben.
858
859         Convert WebProcess over to using disableTermination/enableTermination
860         https://bugs.webkit.org/show_bug.cgi?id=58485
861
862         * PluginProcess/PluginProcess.cpp:
863         (WebKit::PluginProcess::getSitesWithData):
864         (WebKit::PluginProcess::clearSiteData):
865         Use the LocalTerminationDisabler RAII class.
866
867         * Shared/ChildProcess.h:
868         (WebKit::ChildProcess::LocalTerminationDisabler::LocalTerminationDisabler):
869         (WebKit::ChildProcess::LocalTerminationDisabler::~LocalTerminationDisabler):
870         Add RAII class for calling disableTermination/enableTermination.
871
872         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
873         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
874         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
875         (WebKit::WebApplicationCacheManager::deleteAllEntries):
876         Use the LocalTerminationDisabler RAII class.
877
878         * WebProcess/Cookies/WebCookieManager.cpp:
879         (WebKit::WebCookieManager::getHostnamesWithCookies):
880         (WebKit::WebCookieManager::deleteCookiesForHostname):
881         (WebKit::WebCookieManager::deleteAllCookies):
882         (WebKit::WebCookieManager::startObservingCookieChanges):
883         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
884         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
885         Use the LocalTerminationDisabler RAII class.
886
887         * WebProcess/Downloads/Download.cpp:
888         (WebKit::Download::Download):
889         Call disableTermination().
890
891         (WebKit::Download::~Download):
892         Call enableTermination().
893
894         * WebProcess/Downloads/DownloadManager.cpp:
895         (WebKit::DownloadManager::downloadFinished):
896         Remove call to terminateIfPossible.
897
898         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
899         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
900         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
901         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
902         Use the LocalTerminationDisabler RAII class.
903         
904         * WebProcess/MediaCache/WebMediaCacheManager.cpp:
905         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache):
906         (WebKit::WebMediaCacheManager::clearCacheForHostname):
907         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames):
908         Use the LocalTerminationDisabler RAII class.
909         
910         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
911         (WebKit::WebResourceCacheManager::getCacheOrigins):
912         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
913         (WebKit::WebResourceCacheManager::clearCacheForAllOrigins):
914         Use the LocalTerminationDisabler RAII class.
915         
916         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
917         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
918         (WebKit::WebDatabaseManager::getDatabaseOrigins):
919         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
920         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
921         (WebKit::WebDatabaseManager::deleteAllDatabases):
922         (WebKit::WebDatabaseManager::setQuotaForOrigin):
923         Use the LocalTerminationDisabler RAII class.
924         
925         * WebProcess/WebProcess.cpp:
926         (WebKit::WebProcess::createWebPage):
927         Call disableTermination().
928
929         (WebKit::WebProcess::removeWebPage):
930         Call enableTermination().
931
932         (WebKit::WebProcess::shouldTerminate):
933         Move logic from terminateIfPossible over here.
934
935         (WebKit::WebProcess::terminate):
936         Move logic from terminateIfPossible over here.
937
938         (WebKit::WebProcess::getSitesWithPluginData):
939         (WebKit::WebProcess::clearPluginSiteData):
940         Use the LocalTerminationDisabler RAII class.
941
942         * WebProcess/WebProcess.h:
943         Publically inherit from ChildProcess, LocalTerminationDisabler needs to be accessible
944         from the WebProcess class.
945
946 2011-04-13  Steve Falkenburg  <sfalken@apple.com>
947
948         Reviewed by Adam Roben.
949
950         Follow-up to: WebKit2 will load two copies of the same plugin, but should not
951         https://bugs.webkit.org/show_bug.cgi?id=49075
952         
953         Use pathGetFileName instead of Win32 PathFindFileNameW.
954
955         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
956         (WebKit::PluginInfoStore::shouldUsePlugin):
957
958 2011-04-13  Sam Weinig  <sam@webkit.org>
959
960         Reviewed by Gavin Barraclough.
961
962         WebKit2 doesn't keep overlay scrollers shown while scroll gesture held
963         <rdar://problem/9260518>
964
965         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
966         (InitWebCoreSystemInterface):
967         Initialize new WKSI functions.
968
969 2011-04-13  Steve Falkenburg  <sfalken@apple.com>
970
971         Reviewed by Oliver Hunt.
972
973         WebKit2 will load two copies of the same plugin, but should not
974         https://bugs.webkit.org/show_bug.cgi?id=49075
975         <rdar://problem/8635947>
976
977         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
978         (WebKit::PluginInfoStore::shouldUsePlugin): Don't use a plug-in if we've already allowed a plug-in with the same filename.
979
980 2011-04-13  Timothy Hatcher  <timothy@apple.com>
981
982         Hide the dictionary panel when navigating or crashing.
983
984         <rdar://problem/9261202>
985
986         Reviewed by Sam Weinig.
987
988         * UIProcess/API/mac/PageClientImpl.h:
989         * UIProcess/API/mac/PageClientImpl.mm:
990         (WebKit::PageClientImpl::dismissDictionaryLookupPanel): Added. Call WKHideWordDefinitionWindow.
991         * UIProcess/PageClient.h:
992         * UIProcess/WebPageProxy.cpp:
993         (WebKit::WebPageProxy::didCommitLoadForFrame): Call PageClient::dismissDictionaryLookupPanel.
994         (WebKit::WebPageProxy::processDidCrash): Call dismissCorrectionPanel and PageClient::dismissDictionaryLookupPanel.
995
996 2011-04-13  Anders Carlsson  <andersca@apple.com>
997
998         Reviewed by Adam Roben.
999
1000         Add support for disabling/enabling termination to ChildProcess
1001         https://bugs.webkit.org/show_bug.cgi?id=58476
1002
1003         Add ChildProcess::disableTermination and ChildProcess::enableTermination and convert
1004         the PluginProcess class over to using them.
1005
1006         * PluginProcess/PluginProcess.cpp:
1007         (WebKit::PluginProcess::PluginProcess):
1008         The child process now takes a terminationTimeout argument. Get rid of the shutdown timer.
1009
1010         (WebKit::PluginProcess::removeWebProcessConnection):
1011         Call enableTermination().
1012
1013         (WebKit::PluginProcess::shouldTerminate):
1014         Always return true.
1015
1016         (WebKit::PluginProcess::createWebProcessConnection):
1017         Call disableTermination().
1018
1019         (WebKit::PluginProcess::getSitesWithData):
1020         Call disableTermination()/enableTermination().
1021
1022         (WebKit::PluginProcess::clearSiteData):
1023         Ditto.
1024
1025         * Shared/ChildProcess.cpp:
1026         (WebKit::ChildProcess::disableTermination):
1027         Increment the counter and stop the timer.
1028
1029         (WebKit::ChildProcess::enableTermination):
1030         Decrement the counter; if it's zero, start the timer.
1031
1032         (WebKit::ChildProcess::terminationTimerFired):
1033         Call shouldTerminate(). If it returns true, call terminate().
1034
1035         (WebKit::ChildProcess::terminate):
1036         Call RunLoop::quit().
1037
1038         * WebProcess/WebProcess.cpp:
1039         (WebKit::WebProcess::WebProcess):
1040         Just initialize the termination timeout to 0 for now.
1041
1042         (WebKit::WebProcess::shouldTerminate):
1043         Always return true; this isn't used yet.
1044
1045         * WebProcess/WebProcess.h:
1046
1047 2011-04-13  Enrica Casucci  <enrica@apple.com>
1048
1049         Reviewed by Dan Bernstein.
1050
1051         REGRESSION: Links are clickable when a contentEditable is set to true.
1052         https://bugs.webkit.org/show_bug.cgi?id=58473
1053         <rdar://problem/9256793>
1054         
1055         Added support for editable link behavior property.
1056
1057         * Shared/WebPreferencesStore.cpp:
1058         * Shared/WebPreferencesStore.h:
1059         * UIProcess/API/C/WKPreferences.cpp:
1060         (WKPreferencesSetEditableLinkBehavior):
1061         (WKPreferencesGetEditableLinkBehavior):
1062         * UIProcess/API/C/WKPreferencesPrivate.h:
1063         * WebProcess/WebPage/WebPage.cpp:
1064         (WebKit::WebPage::updatePreferences):
1065
1066 2011-04-12  Alexey Proskuryakov  <ap@apple.com>
1067
1068         Reviewed by Oliver Hunt.
1069
1070         REGRESSION (WebKit2): Input methods are active in non-editable content
1071         https://bugs.webkit.org/show_bug.cgi?id=58404
1072         <rdar://problem/9275940>
1073
1074         * UIProcess/API/mac/WKView.mm:
1075         (-[WKView insertText:]): Re-add the old variant of this function, because it's not only part
1076         of deprecated NSTextInput protocol, but it's also part of NSResponder, and it's called when
1077         the input context in nil.
1078         (-[WKView inputContext]): Return nil when not in editable content.
1079
1080 2011-04-12  Brady Eidson  <beidson@apple.com>
1081
1082         Reviewed by Maciej Stachowiak.
1083
1084         <rdar://problem/9029193> and https://bugs.webkit.org/show_bug.cgi?id=58406
1085         Bringing up the context menu on a link might also follow the link.
1086
1087         This patch adds a flag that is set just before the WebProcess tells the UIProcess to show a context menu.
1088
1089         As long as this flag is set, the WebProcess will ignore any other mouse events that might have queued up
1090         by the time the UIProcess gets around to showing the menu.
1091
1092         After the UIProcess is done showing the menu, it messages back telling the WebProcess to clear the flag
1093         and resume normal MouseEvent handling.
1094
1095         * UIProcess/WebPageProxy.cpp:
1096         (WebKit::WebPageProxy::showContextMenu): No matter what internalShowContextMenu does, always notify
1097           the WebProcess that any context menu is now hidden.
1098         (WebKit::WebPageProxy::internalShowContextMenu):
1099         * UIProcess/WebPageProxy.h:
1100
1101         * WebProcess/WebPage/WebContextMenu.cpp:
1102         (WebKit::WebContextMenu::show): Since we're telling the UIProcess to show the menu, tell the WebPage a
1103           context menu is showing so it will stop handling mouse events.
1104
1105         * WebProcess/WebPage/WebPage.cpp:
1106         (WebKit::WebPage::WebPage):
1107         (WebKit::WebPage::mouseEvent): Don't try to handle mouse events if a context menu is flagged as showing.
1108
1109         Add accessors to twiddle the "context menu showing" flag:
1110         * WebProcess/WebPage/WebPage.h:
1111         (WebKit::WebPage::contextMenuShowing):
1112         (WebKit::WebPage::contextMenuHidden):
1113         * WebProcess/WebPage/WebPage.messages.in: Add the ContextMenuHidden message.
1114
1115 2011-04-12  Sam Weinig  <sam@webkit.org>
1116
1117         Reviewed by Maciej Stachowiak.
1118
1119         Quarantine related sandbox denial when downloading files
1120         <rdar://problem/9203736>
1121
1122         * WebProcess/com.apple.WebProcess.sb:
1123
1124 2011-04-12  Sam Weinig  <sam@webkit.org>
1125
1126         Reviewed by Anders Carlsson.
1127
1128         Sandbox violations dragging an image to the desktop.
1129         <rdar://problem/9261834>
1130
1131         * WebProcess/com.apple.WebProcess.sb:
1132
1133 2011-04-12  Sam Weinig  <sam@webkit.org>
1134
1135         Reviewed by Cameron Zwarich.
1136
1137         Sandbox violations trying to access ~/Library/Keyboard Layouts and ~/Library/Input Methods
1138         <rdar://problem/8973159> 
1139
1140         * WebProcess/com.apple.WebProcess.sb:
1141
1142 2011-04-12  Enrica Casucci  <enrica@apple.com>
1143
1144         Reviewed by Alexey Proskuryakov and Sam Weinig.
1145
1146         Implement non-activating clicks to allow dragging out of a background window.
1147         https://bugs.webkit.org/show_bug.cgi?id=55053
1148         <rdar://problem/9042197>
1149
1150         Added methods to WKView to support non activating click. Unfortunately both
1151         methods require a synchronous call to the WebProcess to decide what to do.
1152         acceptFirstMouse is called only if shouldDelayWindowOrderingForEvent returns
1153         true. In order to minimize the number of synchronous calls, we send the request
1154         only if our window is not the key window.
1155
1156         * UIProcess/API/mac/WKView.mm:
1157         (-[WKView acceptsFirstMouse:]):
1158         (-[WKView shouldDelayWindowOrderingForEvent:]):
1159         * UIProcess/WebPageProxy.h:
1160         * UIProcess/mac/WebPageProxyMac.mm:
1161         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
1162         (WebKit::WebPageProxy::acceptsFirstMouse):
1163         * WebProcess/WebPage/WebPage.h:
1164         * WebProcess/WebPage/WebPage.messages.in:
1165         * WebProcess/WebPage/mac/WebPageMac.mm:
1166         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
1167         (WebKit::WebPage::acceptsFirstMouse):
1168
1169 2011-04-12  Alexey Proskuryakov  <ap@apple.com>
1170
1171         Reviewed by Oliver Hunt.
1172
1173         Crash when serializing a null AttributedString
1174         https://bugs.webkit.org/show_bug.cgi?id=58393
1175         <rdar://problem/9275326>
1176
1177         * Shared/mac/AttributedString.mm:
1178         (WebKit::AttributedString::encode):
1179         (WebKit::AttributedString::decode):
1180         Prefix the serialized value with an isNull tag.
1181
1182 2011-04-12  Enrica Casucci  <enrica@apple.com>
1183
1184         Reviewed by Alexey Proskuryakov.
1185
1186         Infinite recursion in WebHTMLView executeSavedKeypressCommands.
1187         https://bugs.webkit.org/show_bug.cgi?id=58382
1188         <rdar://problem/9239370>
1189
1190         Execution of some editing commands could trigger a call to selectedRange that
1191         internally calls executeSavedKeypressCommands creating an infinite recursion.
1192
1193         * UIProcess/API/mac/WKView.mm:
1194         (-[WKView _executeSavedKeypressCommands]): Added flag to avoid recursion.
1195         (-[WKView _interpretKeyEvent:withCachedTextInputState:savingCommandsTo:WebCore::]):
1196         Added flag initialization.
1197
1198 2011-04-12  Chris Marrin  <cmarrin@apple.com>
1199
1200         Reviewed by Simon Fraser.
1201
1202         Page tears and stutters in WebKit2 when page is > 2048 pixels wide
1203         https://bugs.webkit.org/show_bug.cgi?id=58330
1204
1205         Turn off tiling for nonCompositedContentLayer to avoid tearing when
1206         scrolling very wide (> 2048) windows.
1207
1208         * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
1209         (WebKit::LayerTreeHostCA::initialize):
1210
1211 2011-04-12  Anders Carlsson  <andersca@apple.com>
1212
1213         Reviewed by Adam Roben.
1214
1215         Assertion in DrawingAreaImpl::resumePainting() (m_isPaintingSuspended) when clicking a link at twitter.com
1216         https://bugs.webkit.org/show_bug.cgi?id=58377
1217         <rdar://problem/8976531>
1218
1219         Remove the assertion.
1220
1221         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1222         (WebKit::DrawingAreaImpl::resumePainting):
1223
1224 2011-04-11  Stephanie Lewis  <slewis@apple.com>
1225
1226         Reviewed by Oliver Hunt.
1227
1228         https://bugs.webkit.org/show_bug.cgi?id=58280
1229         <rdar://problem/9252824> javascript in an inconsistent state due to serialization returning an un-handled exception
1230         Change use of SerializedScriptValue::Create to use the same api as the rest of WebKit2.  This has the benefit
1231         of handling any exceptions so Javascript is not in an inconsistent state.
1232
1233         * Shared/API/c/WKSerializedScriptValue.h: fix a typo
1234         * WebProcess/WebPage/WebPage.cpp:
1235         (WebKit::WebPage::runJavaScriptInMainFrame):
1236
1237 2011-04-12  Jeff Miller  <jeffm@apple.com>
1238
1239         Reviewed by Adam Roben.
1240
1241         WebKit2: Pressing Tab in Web Inspector's console does not cycle through completion options
1242         https://bugs.webkit.org/show_bug.cgi?id=56020
1243
1244         Safari was always calling TranslateMessage() on key events since it has no way to know whether
1245         WebKit handled the event without a PageUIClient (which Safari only installs on pages inside
1246         a Safari window), which was generating a WM_CHAR message containing the tab in this case.  The fix
1247         is for Safari to never call TranslateMessage() on key events outside of a Safari window, but this
1248         means the WebPageProxy needs to do this for unhandled key events if there is no didNotHandleKeyEvent
1249         callback in the PageUIClient.
1250
1251         * UIProcess/WebPageProxy.cpp:
1252         (WebKit::WebPageProxy::didReceiveEvent): Call TranslateMessage() on Windows for unhandled key events that can't be handled by the PageUIClient.
1253         * UIProcess/WebUIClient.cpp:
1254         (WebKit::WebUIClient::canNotHandleKeyEvent): Added.
1255         * UIProcess/WebUIClient.h: Added canNotHandleKeyEvent().
1256
1257 2011-04-12  Alice Liu  <alice.liu@apple.com>
1258
1259         Reviewed by Sam Weinig.
1260
1261         https://bugs.webkit.org/show_bug.cgi?id=58292
1262         Provide new setting to allow site icon loading despite disabling automatic image loading in general.
1263
1264         * Shared/WebPreferencesStore.h: Add macro for setting default value.
1265         * UIProcess/API/C/WKPreferences.cpp:
1266         (WKPreferencesSetLoadsSiteIconsIgnoringImageLoadingPreference): Added setter.
1267         (WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference): Added getter.
1268         * UIProcess/API/C/WKPreferences.h:
1269         * WebProcess/WebPage/WebPage.cpp:
1270         (WebKit::WebPage::updatePreferences): Add to list of WebCore settings that get propagated to WebKit preferences.
1271
1272 2011-04-12  Jessie Berlin  <jberlin@apple.com>
1273
1274         Reviewed by Anders Carlsson.
1275
1276         WebKit2: Spelling and Grammar Checking: Make sure to remove the markings from the document
1277         when spelling and/or grammar checking is disabled.
1278         https://bugs.webkit.org/show_bug.cgi?id=58350
1279
1280         * UIProcess/API/mac/WKView.mm:
1281         (-[WKView toggleContinuousSpellChecking:]):
1282         Move the call to unmark the errors to the WebProcess.
1283         (-[WKView setGrammarCheckingEnabled:]):
1284         Ditto.
1285         (-[WKView toggleGrammarChecking:]):
1286         Ditto.
1287
1288         * UIProcess/WebPageProxy.cpp:
1289         Remove unused functions.
1290         * UIProcess/WebPageProxy.h:
1291         Ditto.
1292         * WebProcess/WebPage/WebPage.messages.in:
1293         Ditto.
1294         * WebProcess/WebPage/WebPage.h:
1295
1296         * WebProcess/WebProcess.cpp:
1297         (WebKit::WebProcess::setTextCheckerState):
1298         If grammar or spelling checking is disabled, unmark all the pages.
1299         Doing it here allows makes it possible to unmark all pages in a cross-platform way that is
1300         triggered both by selecting the the context menu items and by any other methods of updating
1301         the enabled / disabled state.
1302
1303 2011-04-12  Anders Carlsson  <andersca@apple.com>
1304
1305         Reviewed by Sam Weinig.
1306
1307         Cisco Meeting Center will not download or launch from Safari
1308         https://bugs.webkit.org/show_bug.cgi?id=58366
1309         <rdar://problem/8987139>
1310
1311         It's OK if a plug-in has less (or more) MIME type descriptions than actual MIME types.
1312         
1313         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1314         (WebKit::getPluginInfoFromCarbonResources):
1315
1316 2011-04-12  Anders Carlsson  <andersca@apple.com>
1317
1318         Reviewed by Sam Weinig.
1319
1320         Call PluginControllerProxy::platformGeometryDidChange before Plugin::geometryDidChange
1321         https://bugs.webkit.org/show_bug.cgi?id=58361
1322
1323         Since Plugin::geometryDidChange ends up calling plug-in code it can resize the plug-in which causes
1324         platformGeometryDidChange to be called with the wrong rect.
1325
1326         * PluginProcess/PluginControllerProxy.cpp:
1327         (WebKit::PluginControllerProxy::geometryDidChange):
1328         Call platformGeometryDidChange.
1329
1330         * PluginProcess/PluginControllerProxy.h:
1331         * PluginProcess/mac/PluginControllerProxyMac.mm:
1332         (WebKit::PluginControllerProxy::platformGeometryDidChange):
1333         Remove the parameters to platformGeometryDidChange and just use m_frameRect instead.
1334
1335 2011-04-12  Anders Carlsson  <andersca@apple.com>
1336
1337         Reviewed by Sam Weinig.
1338
1339         Move three Mac specific functions to PluginControllerProxyMac.mm.
1340         
1341 2011-04-12  Anders Carlsson  <andersca@apple.com>
1342
1343         Reviewed by Sam Weinig.
1344
1345         Cache the window and plug-in element NPObjects
1346         https://bugs.webkit.org/show_bug.cgi?id=58355
1347
1348         * PluginProcess/PluginControllerProxy.cpp:
1349         (WebKit::PluginControllerProxy::PluginControllerProxy):
1350         (WebKit::PluginControllerProxy::~PluginControllerProxy):
1351         (WebKit::PluginControllerProxy::windowScriptNPObject):
1352         (WebKit::PluginControllerProxy::pluginElementNPObject):
1353         * PluginProcess/PluginControllerProxy.h:
1354
1355 2011-04-12  Alejandro G. Castro  <alex@igalia.com>
1356
1357         Fixed GTK compilation after r83454.
1358
1359         * UIProcess/gtk/WebView.cpp:
1360         (WebKit::WebView::findStringInCustomRepresentation):
1361         (WebKit::WebView::countStringMatchesInCustomRepresentation):
1362         * UIProcess/gtk/WebView.h:
1363
1364 2011-04-11  Daniel Bates  <dbates@webkit.org>
1365
1366         Attempt to fix the Qt Linux Release build after changeset 83550 <http://trac.webkit.org/changeset/83550>
1367         (https://bugs.webkit.org/show_bug.cgi?id=54159).
1368
1369         * WebKit2API.pri: Append UIProcess/API/C/WKResourceCacheManager.cpp to the list WEBKIT2_API_SOURCES.
1370
1371 2011-04-11  Sam Weinig  <sam@webkit.org>
1372
1373         Reviewed by Anders Carlsson.
1374
1375         Move focus management out of WebKit via  the UIClient
1376         <rdar://problem/8784068>
1377         https://bugs.webkit.org/show_bug.cgi?id=58278
1378
1379         * UIProcess/API/C/WKPage.h:
1380         * UIProcess/API/mac/PageClientImpl.h:
1381         * UIProcess/API/mac/PageClientImpl.mm:
1382         * UIProcess/API/qt/qwkpage.cpp:
1383         (QWKPage::QWKPage):
1384         * UIProcess/API/qt/qwkpage_p.h:
1385         * UIProcess/PageClient.h:
1386         * UIProcess/WebPageProxy.cpp:
1387         (WebKit::WebPageProxy::setFocus):
1388         * UIProcess/WebUIClient.cpp:
1389         (WebKit::WebUIClient::focus):
1390         (WebKit::WebUIClient::unfocus):
1391         * UIProcess/WebUIClient.h:
1392         * UIProcess/gtk/WebView.cpp:
1393         * UIProcess/gtk/WebView.h:
1394         * UIProcess/win/WebView.h:
1395         Remove PageClient::setFocus() in favor of WebUIClient::focus and WebUIClient::unfocus. 
1396
1397 2011-04-11  Alexey Proskuryakov  <ap@apple.com>
1398
1399         Reviewed by Maciej Stachowiak.
1400
1401         WebKit2: Cannot use Ctrl-Delete as a custom keyboard shortcut
1402         https://bugs.webkit.org/show_bug.cgi?id=58265
1403         <rdar://problem/9221468>
1404
1405         * WebProcess/WebPage/WebPage.cpp:
1406         (WebKit::WebPage::keyEvent): Added a comment explaining that doing work after DOM event
1407         dispatch isn't great.
1408         * WebProcess/WebPage/mac/WebPageMac.mm:
1409         (WebKit::WebPage::performNonEditingBehaviorForSelector): Added a comment explaining how this
1410         might be moved down to WebCore.
1411         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): This is now empty, since both Space
1412         and Backspace behaviors are implemented in WebCore.
1413
1414 2011-04-11  Anders Carlsson  <andersca@apple.com>
1415
1416         Try to fix the Windows build.
1417
1418         * UIProcess/win/WebInspectorProxyWin.cpp:
1419         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1420
1421 2011-04-11  Alexey Proskuryakov  <ap@apple.com>
1422
1423         Reviewed by Dan Bernstein.
1424
1425         REGRESSION (r83081): Esc key no longer removes current Kotoeri text operation
1426         https://bugs.webkit.org/show_bug.cgi?id=58274
1427         <rdar://problem/9263683>
1428
1429         * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::getMarkedRange): Wrap the returned
1430         temporary in RefPtr.
1431
1432 2011-04-11  Anders Carlsson  <andersca@apple.com>
1433
1434         Reviewed by Sam Weinig.
1435
1436         Remove m_urlAtProcessExit from WebPageProxy
1437         https://bugs.webkit.org/show_bug.cgi?id=58275
1438
1439         Get rid of m_urlAtProcessExit and replace some zeros with nullptrs.
1440
1441         * UIProcess/WebPageProxy.cpp:
1442         (WebKit::WebPageProxy::processDidCrash):
1443         * UIProcess/WebPageProxy.h:
1444
1445 2011-04-11  Anders Carlsson  <andersca@apple.com>
1446
1447         Reviewed by Adam Roben.
1448
1449         Remove the WebContext member variable from WebPageProxy
1450         https://bugs.webkit.org/show_bug.cgi?id=58271
1451         <rdar://problem/9148125>
1452
1453         * UIProcess/API/C/WKPage.cpp:
1454         (WKPageGetContext):
1455         * UIProcess/WebPageProxy.cpp:
1456         (WebKit::WebPageProxy::create):
1457         (WebKit::WebPageProxy::WebPageProxy):
1458         (WebKit::WebPageProxy::process):
1459         (WebKit::WebPageProxy::reattachToWebProcess):
1460         (WebKit::WebPageProxy::canShowMIMEType):
1461         (WebKit::WebPageProxy::receivedPolicyDecision):
1462         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1463         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1464         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1465         (WebKit::WebPageProxy::didCommitLoadForFrame):
1466         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1467         (WebKit::WebPageProxy::didFinishLoadForFrame):
1468         (WebKit::WebPageProxy::didFailLoadForFrame):
1469         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1470         (WebKit::WebPageProxy::didReceiveTitleForFrame):
1471         (WebKit::WebPageProxy::didFirstLayoutForFrame):
1472         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
1473         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
1474         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
1475         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
1476         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1477         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1478         (WebKit::WebPageProxy::decidePolicyForResponse):
1479         (WebKit::WebPageProxy::unableToImplementPolicy):
1480         (WebKit::WebPageProxy::willSubmitForm):
1481         (WebKit::WebPageProxy::mouseDidMoveOverElement):
1482         (WebKit::WebPageProxy::showContextMenu):
1483         (WebKit::WebPageProxy::contextMenuItemSelected):
1484         * UIProcess/WebPageProxy.h:
1485         * UIProcess/WebProcessProxy.cpp:
1486         (WebKit::WebProcessProxy::createWebPage):
1487         * UIProcess/mac/WebInspectorProxyMac.mm:
1488         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1489
1490 2011-04-11  Eric Carlson  <eric.carlson@apple.com>
1491
1492         Reviewed by Adam Roben.
1493
1494         Ignore context change callbacks when not on the main thread
1495         https://bugs.webkit.org/show_bug.cgi?id=58256
1496         <rdar://problem/9266090>
1497
1498         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
1499         (WebKit::LayerTreeHostCAWin::contextDidChangeCallback): Do nothing when not called
1500             on the main thread. This should only happen when no changes have actually 
1501             been committed to the context, eg. when a video frame has been added to an image
1502             queue, so return without triggering animations etc.
1503
1504 2011-04-11  Anders Carlsson  <andersca@apple.com>
1505
1506         Reviewed by Sam Weinig.
1507
1508         First step towards simplifying WebPageProxy/WebProcessProxy/WebContext ownership
1509         https://bugs.webkit.org/show_bug.cgi?id=58266
1510         <rdar://problem/9148125>
1511
1512         With this patch, the WKView holds a strong reference to a WebPageProxy. The 
1513         WebPageProxy in turn holds a strong reference to its WebProcessProxy. Finally,
1514         The WebProcessProxy holds a strong reference to its WebContext.
1515
1516         The WebContext holds a strong reference to the running WebProcessProxy which results
1517         in a reference cycle that's broken when the web process exits.
1518
1519         The reason for is to avoid crashes where WebPageProxy::process() returns null if the web process
1520         has crashed but has not yet been relaunched.
1521
1522         * UIProcess/WebContext.cpp:
1523         (WebKit::WebContext::disconnectProcess):
1524         Add comment.
1525
1526         (WebKit::WebContext::createWebPage):
1527         Return a PassRefPtr.
1528
1529         (WebKit::WebContext::relaunchProcessIfNecessary):
1530         Change this to return a WebPageProxy.
1531
1532         * UIProcess/WebPageProxy.cpp:
1533         (WebKit::WebPageProxy::create):
1534         This now takes a PassRefPtr<WebProcessProxy>.
1535
1536         (WebKit::WebPageProxy::WebPageProxy):
1537         Ditto.
1538
1539         (WebKit::WebPageProxy::~WebPageProxy):
1540         Call close() if necessary.
1541
1542         (WebKit::WebPageProxy::reattachToWebProcess):
1543         Replace the current process with the new process.
1544
1545         * UIProcess/WebProcessProxy.cpp:
1546         (WebKit::WebProcessProxy::create):
1547         Take a PassRefPtr<WebContext>.
1548         
1549         (WebKit::WebProcessProxy::WebProcessProxy):
1550         Ditto.
1551
1552         (WebKit::WebProcessProxy::webPage):
1553         Remove .get() now that the page map uses weak references.
1554
1555         (WebKit::WebProcessProxy::createWebPage):
1556         This now returns the created web page proxy.
1557
1558 2011-04-11  Adam Roben  <aroben@apple.com>
1559
1560         Dispatch sent messages to windows owned by the web process when waiting a sync CoreIPC reply
1561
1562         On Windows, windowed plugins' HWNDs are created as children of the WKView's window. This
1563         creates a cross-process window hierarchy, which in turn attaches the input states of the UI
1564         process's and web process's main threads (as if ::AttachThreadInput has been called). Having
1565         the input states attached means that changes to the input state (e.g., changing the focus
1566         window) can result in synchronous window messages being sent between the processes. This can
1567         result in deadlocks if the UI process changes the input state while handling a synchronous
1568         CoreIPC message from the web process. Since the web process isn't running its message loop
1569         while waiting for the reply, it never processes the messages Windows is sending it from the
1570         UI process.
1571
1572         The solution taken in this patch is to continue to dispatch sent (not posted) messages to
1573         windows created by the web process while waiting for a sync CoreIPC reply. Someday we can
1574         hopefully reduce the number of cases in which the UI process modifies the thread's input
1575         state while handling a synchronous message; see the bug for details.
1576
1577         Fixes <http://webkit.org/b/58239> <rdar://problem/8769302> REGRESSION (WebKit2): Deadlock
1578         clicking Flash plugin
1579
1580         Reviewed by Anders Carlsson.
1581
1582         * Platform/CoreIPC/BinarySemaphore.h:
1583         (CoreIPC::BinarySemaphore::event): Added. Simple getter to expose the underlying event
1584         HANDLE.
1585
1586         * Platform/CoreIPC/Connection.cpp:
1587         (CoreIPC::Connection::SyncMessageState::waitWhileDispatchingSentMessages): New Windows-only
1588         function that is used instead of wait() so that sent messages will continue to be
1589         dispatched.
1590         (CoreIPC::Connection::waitForSyncReply): Use waitWhileDispatchingSentMessages instead of
1591         wait on Windows. Our Client gives us the set of windows that need to have windows delivered
1592         to them.
1593
1594         * Platform/CoreIPC/Connection.h: Added new
1595         windowsToReceiveSentMessagesWhileWaitingForSyncReply function to Client.
1596
1597         * Platform/RunLoop.h: Added new dispatchSentMessagesUntil function to be used while waiting
1598         for a sync CoreIPC reply.
1599
1600         * Platform/win/RunLoopWin.cpp:
1601         (RunLoop::dispatchSentMessagesUntil): Added. If we have no windows to dispatch messages to,
1602         then just wait on the semaphore. Otherwise spin a ::MsgWaitForMultipleObjectsEx loop to
1603         detect when the semaphore is signaled, the timeout elapses, or sent messages are available,
1604         and handle each case appropriately.
1605
1606         * UIProcess/WebProcessProxy.h: Added new CoreIPC::Connection::Client function.
1607
1608         * UIProcess/win/WebProcessProxyWin.cpp: Added.
1609         (WebKit::WebProcessProxy::windowsToReceiveSentMessagesWhileWaitingForSyncReply): Just return
1610         an empty Vector. The web process never modifies the thread's input state while responding to
1611         a synchronous message, so we don't have anything to worry about here.
1612
1613         * WebProcess/WebProcess.h: Added new CoreIPC::Connection::Client function.
1614
1615         * WebProcess/win/WebProcessWin.cpp:
1616         (WebKit::addWindowToVectorIfOwnedByCurrentThread): New helper function to be called by
1617         ::EnumThreadWindows/::EnumChildWindows. Does what it says.
1618         (WebKit::WebProcess::windowsToReceiveSentMessagesWhileWaitingForSyncReply): Added. Returns
1619         all top-level windows created by this thread, descendants of those windows created by this
1620         thread, and descendants of WKViews' windows created by this thread.
1621
1622         * win/WebKit2.vcproj: Added WebProcessProxyWin.cpp.
1623
1624 2011-04-11  Jessie Berlin  <jberlin@apple.com>
1625
1626         Reviewed by Anders Carlsson.
1627
1628         WebKit2: Implement TextChecker on Windows
1629         https://bugs.webkit.org/show_bug.cgi?id=57862
1630
1631         Part 7: Implement getGuessesForWord, learnWord, and ignoreWord.
1632
1633         * UIProcess/API/C/win/WKTextChecker.cpp:
1634         (WKTextCheckerChangeSpellingToWord):
1635         * UIProcess/API/C/win/WKTextChecker.h:
1636
1637         * UIProcess/WebPageProxy.cpp:
1638         (WebKit::WebPageProxy::changeSpellingToWord):
1639         Make this function const since it does not modify the WebPageProxy and making it const
1640         allows WebTextChecker::changeSpellingToWord to take a const WebPageProxy.
1641         (WebKit::WebPageProxy::learnWord):
1642         * UIProcess/WebPageProxy.h:
1643
1644         * UIProcess/TextChecker.h:
1645         * UIProcess/win/TextCheckerWin.cpp:
1646         (WebKit::TextChecker::getGuessesForWord):
1647         Ask the TextCheckerClient for the guesses.
1648         (WebKit::TextChecker::learnWord):
1649         Tell the TextCheckerClient.
1650         (WebKit::TextChecker::ignoreWord):
1651         Ditto.
1652         * UIProcess/gtk/TextCheckerGtk.cpp:
1653         (WebKit::TextChecker::learnWord):
1654         Add an unused param that is necessary for Windows.
1655         * UIProcess/mac/TextCheckerMac.mm:
1656         (WebKit::TextChecker::learnWord):
1657         Ditto.
1658         * UIProcess/qt/TextCheckerQt.cpp:
1659         (WebKit::TextChecker::learnWord):
1660         Ditto.
1661
1662         * UIProcess/win/WebTextChecker.cpp:
1663         (WebKit::WebTextChecker::changeSpellingToWord):
1664         Tell the page.
1665         * UIProcess/win/WebTextChecker.h:
1666
1667         * UIProcess/win/WebTextCheckerClient.cpp:
1668         (WebKit::WebTextCheckerClient::guessesForWord):
1669         (WebKit::WebTextCheckerClient::learnWord):
1670         (WebKit::WebTextCheckerClient::ignoreWord):
1671         * UIProcess/win/WebTextCheckerClient.h:
1672
1673 2011-04-11  Anders Carlsson  <andersca@apple.com>
1674
1675         Reviewed by Sam Weinig.
1676
1677         Remove unused WebProcessProxy functions
1678         https://bugs.webkit.org/show_bug.cgi?id=58262
1679
1680         * UIProcess/WebProcessProxy.cpp:
1681         * UIProcess/WebProcessProxy.h:
1682
1683 2011-04-11  Anders Carlsson  <andersca@apple.com>
1684
1685         Reviewed by Sam Weinig.
1686
1687         Crash in WebPageProxy::countStringMatches
1688         https://bugs.webkit.org/show_bug.cgi?id=58255
1689         <rdar://problem/9243837>
1690
1691         * UIProcess/WebPageProxy.cpp:
1692         (WebKit::WebPageProxy::countStringMatches):
1693         Return early if the page is not valid.
1694
1695 2011-04-11  Sam Weinig  <sam@webkit.org>
1696
1697         Reviewed by Anders Carlsson.
1698
1699         WebKit2: links don’t update to look visited
1700         <rdar://problem/8806254>
1701         https://bugs.webkit.org/show_bug.cgi?id=58252
1702
1703         * WebProcess/WebProcess.cpp:
1704         (WebKit::WebProcess::visitedLinkStateChanged):
1705         (WebKit::WebProcess::allVisitedLinkStateChanged):
1706         * WebProcess/WebProcess.h:
1707         Remove use of vestigial sharedPageGroup and instead iterate set of
1708         page groups in use by the process.
1709
1710 2011-04-11  Brian Weinstein  <bweinstein@apple.com>
1711
1712         Reviewed by Adam Roben.
1713
1714         WebKit2: Windows 7 Gestures Window Bounce shouldn't require a sync message
1715         https://bugs.webkit.org/show_bug.cgi?id=58167
1716         <rdar://problem/9259813>
1717         
1718         Instead of making GestureDidScroll sync, have WebPageWin call from WebProcess ->
1719         UIProcess when the gesture causes the page to scroll to the beginning or the
1720         end of the document.
1721
1722         * UIProcess/PageClient.h:
1723         * UIProcess/WebPageProxy.cpp:
1724         (WebKit::WebPageProxy::gestureDidScroll): Not a sync message anymore.
1725         (WebKit::WebPageProxy::setGestureScrollingLimitReached): Tell the page client that the gesture
1726             scrolling limnit was reached.
1727         * UIProcess/WebPageProxy.h:
1728         * UIProcess/WebPageProxy.messages.in: Add a new message.
1729         * UIProcess/win/WebView.cpp:
1730         (WebKit::WebView::WebView): Initialize new variable.
1731         (WebKit::WebView::onGesture): Use the state of the member variable, not the response from
1732             the sync message.
1733         * UIProcess/win/WebView.h:
1734         (WebKit::WebView::setGestureScrollingLimitReached):
1735         * WebProcess/WebPage/WebPage.h:
1736         * WebProcess/WebPage/WebPage.messages.in:
1737         * WebProcess/WebPage/win/WebPageWin.cpp:
1738         (WebKit::scrollbarAtTopOfBottomOrDocument): Returns whether or not the scrollbar is at the
1739             top or bottom of the document.
1740         (WebKit::WebPage::gestureDidScroll): Track whether or not we started at the beginning
1741             or end of the document, and whether or not we ended at the beginning or end of the document,
1742             and send a message if the value changed.
1743
1744 2011-04-04  Jer Noble  <jer.noble@apple.com>
1745
1746         Reviewed by Maciej Stachowiak.
1747
1748         WK2: PDF: Find in page
1749         https://bugs.webkit.org/show_bug.cgi?id=57765
1750
1751         Support searching text within PDF documents.  Find requests must be routed from the
1752         WebPageProxy, through the PageClient, and to the WKView, where they can be passed to 
1753         the PDFViewController.
1754
1755         * UIProcess/API/mac/PDFViewController.h:
1756         * UIProcess/API/mac/PDFViewController.mm:
1757         (_PDFSelectionsAreEqual): Copied from WebPDFView.
1758         (-[WKPDFView _nextMatchFor:direction:caseSensitive:wrap:fromSelection:startInSelection:]): Copied from WebPDFView.
1759         (-[WKPDFView _countMatches:caseSensitive:]): Added.
1760         (WebKit::PDFViewController::findString): Added.
1761         (WebKit::PDFViewController::countStringMatches): Added.
1762         * UIProcess/PageClient.h:
1763         * UIProcess/API/mac/PageClientImpl.h:
1764         * UIProcess/API/mac/PageClientImpl.mm:
1765         (WebKit::PageClientImpl::findStringInCustomRepresentation): Added.
1766         (WebKit::PageClientImpl::countStringMatchesInCustomRepresentation): Added.
1767         * UIProcess/API/mac/WKViewInternal.h:
1768         * UIProcess/API/mac/WKView.mm:
1769         (-[WKView _findStringInCustomRepresentation:withFindOptions:maxMatchCount:]): Added.
1770         (-[WKView _countStringMatchesInCustomRepresentation:withFindOptions:maxMatchCount:]): Added.
1771         * UIProcess/WebPageProxy.h: Moved a number of find-related functions from private: to public: so
1772             they could be called from PDFViewController.
1773         * UIProcess/WebPageProxy.cpp:
1774         (WebKit::WebPageProxy::findString): Added. 
1775         (WebKit::WebPageProxy::countStringMatches): Added.
1776         * UIProcess/win/WebView.cpp:
1777         (WebKit::WebView::findStringInCustomRepresentation): Added stub.
1778         (WebKit::WebView::countStringMatchesInCustomRepresentation): Ditto.
1779         * UIProcess/win/WebView.h:
1780         * UIProcess/API/qt/qwkpage_p.h:
1781         (QWKPagePrivate::findStringInCustomRepresentation): Added stub.
1782         (QWKPagePrivate::countStringMatchesInCustomRepresentation): Added stub.
1783
1784 2011-04-11  Jessie Berlin  <jberlin@apple.com>
1785
1786         Reviewed by Anders Carlsson.
1787
1788         WebKit2: Implement TextChecker on Windows
1789         https://bugs.webkit.org/show_bug.cgi?id=57862
1790
1791         Part 6: Update the Spelling UI with the spelling and grammar mistakes.
1792
1793         * UIProcess/API/C/win/WKAPICastWin.h:
1794         (WebKit::toAPI):
1795         Make it possible to go from a WebCore::GrammarDetail to a WebGrammarDetail.
1796  
1797         * UIProcess/API/C/win/WKGrammarDetail.cpp:
1798         (WKGrammarDetailCreate):
1799         (WKGrammarDetailGetLocation):
1800         (WKGrammarDetailGetLength):
1801         (WKGrammarDetailCopyGuesses):
1802         (WKGrammarDetailCopyUserDescription):
1803         * UIProcess/API/C/win/WKGrammarDetail.h:
1804
1805         * UIProcess/API/C/win/WKTextChecker.cpp:
1806         (WKTextCheckerCheckSpelling):
1807         Tell the WebTextChecker.
1808         * UIProcess/API/C/win/WKTextChecker.h:
1809
1810         * UIProcess/WebPageProxy.cpp:
1811         (WebKit::WebPageProxy::contextMenuItemSelected):
1812         If the show/hide spelling UI is selected and the spelling UI is not showing, make sure to
1813         advance to the next misspelling (in this case, the first).
1814         This behavior matches that in WebCore and WKView.mm.
1815         (WebKit::WebPageProxy::advanceToNextMisspelling):
1816         Make this function const since it does not modify the WebPageProxy and making it const
1817         allows WebTextChecker::checkSpelling to take a const WebPageProxy.
1818         (WebKit::WebPageProxy::spellDocumentTag):
1819         (WebKit::WebPageProxy::updateSpellingUIWithMisspelledWord):
1820         (WebKit::WebPageProxy::updateSpellingUIWithGrammarString):
1821         * UIProcess/WebPageProxy.h:
1822
1823         * UIProcess/TextChecker.h:
1824         * UIProcess/win/TextCheckerWin.cpp:
1825         (WebKit::TextChecker::uniqueSpellDocumentTag):
1826         Tell the TextCheckerClient which WebPageProxy this tag is for.
1827         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
1828         Tell the TextCheckerClient.
1829         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
1830         Ditto.
1831         * UIProcess/mac/TextCheckerMac.mm:
1832         (WebKit::TextChecker::uniqueSpellDocumentTag):
1833         Add the new argument that is unused by this port.
1834         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
1835         Ditto.
1836         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
1837         Ditto.
1838         * UIProcess/gtk/TextCheckerGtk.cpp:
1839         (WebKit::TextChecker::uniqueSpellDocumentTag):
1840         Ditto.
1841         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
1842         Ditto.
1843         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
1844         Ditto.
1845         * UIProcess/qt/TextCheckerQt.cpp:
1846         (WebKit::TextChecker::uniqueSpellDocumentTag):
1847         Ditto.
1848         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
1849         Ditto.
1850         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
1851         Ditto.
1852
1853         * UIProcess/win/WebGrammarDetail.cpp:
1854         (WebKit::WebGrammarDetail::create):
1855         (WebKit::WebGrammarDetail::WebGrammarDetail):
1856         (WebKit::WebGrammarDetail::guesses):
1857         * UIProcess/win/WebGrammarDetail.h:
1858         (WebKit::WebGrammarDetail::location):
1859         (WebKit::WebGrammarDetail::length):
1860         (WebKit::WebGrammarDetail::userDescription):
1861
1862         * UIProcess/win/WebTextChecker.cpp:
1863         (WebKit::WebTextChecker::checkSpelling):
1864         Tell the page to advance to the next misspelling. This matches the WK1 WebView.cpp logic.
1865
1866         * UIProcess/win/WebTextChecker.h:
1867         * UIProcess/win/WebTextCheckerClient.cpp:
1868         (WebKit::WebTextCheckerClient::uniqueSpellDocumentTag):
1869         (WebKit::WebTextCheckerClient::toggleSpellingUIIsShowing):
1870         (WebKit::WebTextCheckerClient::updateSpellingUIWithMisspelledWord):
1871         (WebKit::WebTextCheckerClient::updateSpellingUIWithGrammarString):
1872         * UIProcess/win/WebTextCheckerClient.h:
1873
1874 2011-04-10  Maciej Stachowiak  <mjs@apple.com>
1875
1876         Not reviewed.
1877
1878         Remove extra inadvertantly commiteed changes from last change.
1879
1880         * WebProcess/com.apple.WebProcess.sb:
1881
1882 2011-04-10  Maciej Stachowiak  <mjs@apple.com>
1883
1884         Reviewed by Dan Bernstein.
1885
1886         REGRESSION: WebProcess spews sandboxing violations for outbound network traffic
1887         https://bugs.webkit.org/show_bug.cgi?id=58215
1888         <rdar://problem/9251695>
1889         
1890         * WebProcess/com.apple.WebProcess.sb: Restore some previously removed rules.
1891
1892 2011-04-10  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
1893
1894         Reviewed by Eric Seidel.
1895
1896         Require no undefined symbols during compilation.
1897
1898         [Qt] [WK2] WebKitTestRunner, QtWebProcess and WTRInjectBundle should fail to compile when there's undefined symbols
1899         https://bugs.webkit.org/show_bug.cgi?id=54896
1900         
1901         Add -Wl,--no-undefined to catch missing symbols early.
1902
1903         * WebProcess.pro:
1904
1905 2011-04-09  Geoffrey Garen  <ggaren@apple.com>
1906
1907         Not reviewed.
1908         
1909         Try recommitting some things svn left out of my last commit.
1910
1911         * WebProcess/Plugins/Netscape/NPJSObject.h:
1912
1913 2011-04-09  Geoffrey Garen  <ggaren@apple.com>
1914
1915         Not reviewed.
1916         
1917         Try recommitting some things svn left out of my last commit.
1918
1919         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1920         (WebKit::NPRuntimeObjectMap::evaluate):
1921
1922 2011-04-08  Alexey Proskuryakov  <ap@apple.com>
1923
1924         Reviewed by Darin Adler.
1925
1926         WebKit2: Safari doesn't respect cmd-arrows (and variations) as custom keyboard shortcuts
1927         https://bugs.webkit.org/show_bug.cgi?id=58175
1928         <rdar://problem/9060555>
1929
1930         The problem is that command handling should be different for events that come as keyDown:
1931         and those that come as performKeyEquivalent:. WebKit1 only tries custom "key bindings"
1932         when handling a keyDown:, letting a performKeyEquivalent: run through the whole responder
1933         chain first.
1934
1935         This would be very difficult to implement in WebKit2 because of how it re-sends the same
1936         event after web process handling. Luckily, we can both fix the bug and make the behavior
1937         more robust by not hardcoding key combinations.
1938
1939         * WebProcess/WebPage/WebPage.h: Edit performNonEditingBehaviorForSelector.
1940         * WebProcess/WebPage/mac/WebPageMac.mm:
1941         (WebKit::WebPage::executeKeypressCommandsInternal): When executing commands, also try
1942         executing editor commands in their non-editing meaning, which is usually scrolling.
1943         (WebKit::WebPage::performNonEditingBehaviorForSelector): Naive implementation with a chain
1944         of ifs, which is hopefully ok performance-wise for a dozen check.
1945         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Only kept two commands here that I
1946         couldn't easily move.
1947
1948 2011-04-08  Jessie Berlin  <jberlin@apple.com>
1949
1950         Reviewed by Anders Carlsson.
1951
1952         WebKit2: Show the substitutions panel on Mac and make sure the menu items titles are
1953         updated correctly.
1954         https://bugs.webkit.org/show_bug.cgi?id=58179
1955
1956         * UIProcess/API/mac/WKView.mm:
1957         (-[WKView validateUserInterfaceItem:]):
1958         The title of the context menu item should be opposite of whether or not the spelling panel
1959         is visible.
1960
1961         * UIProcess/WebPageProxy.cpp:
1962         (WebKit::WebPageProxy::contextMenuItemSelected):
1963         If the "Show/Hide" Substitutions item is selected, call toggleSubstitutionsPanelIsShowing.
1964         (WebKit::WebPageProxy::substitutionsPanelIsShowing):
1965         Ask the TextChecker.
1966         * UIProcess/WebPageProxy.h:
1967         * UIProcess/WebPageProxy.messages.in:
1968
1969         * UIProcess/TextChecker.h:
1970         * UIProcess/mac/TextCheckerMac.mm:
1971         (WebKit::TextChecker::substitutionsPanelIsShowing):
1972         As the shared NSSpellChecker if the substitutionsPanel is visible.
1973         (WebKit::TextChecker::toggleSubstitutionsPanelIsShowing):
1974         Order the substitutionsPanel out or front (copied from WKView.mm).
1975
1976         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1977         (WebKit::WebEditorClient::substitutionsPanelIsShowing):
1978         Send a sync message to the UI process to find out.
1979         It needs to be sync because the editor code relies on the value returned.
1980
1981 2011-04-08  Dan Bernstein  <mitz@apple.com>
1982
1983         Reviewed by Adele Peterson.
1984
1985         Fixed a bug where right-to-left frames incorrectly reported that they were pinned to the left
1986         when they were actually not.
1987
1988         * WebProcess/WebPage/WebPage.cpp:
1989         (WebKit::WebPage::didChangeScrollOffsetForMainFrame): Do not assume that the minimum scroll offset
1990         is zero, because it is not.
1991
1992 2011-04-08  Anders Carlsson  <andersca@apple.com>
1993
1994         Fix the Windows build.
1995
1996         * UIProcess/win/WebView.cpp:
1997         (WebKit::WebView::Drop):
1998
1999 2011-04-08  Jessie Berlin  <jberlin@apple.com>
2000
2001         Reviewed by Anders Carlsson.
2002
2003         WebKit2: Implement TextChecker on Windows
2004         https://bugs.webkit.org/show_bug.cgi?id=57862
2005
2006         Part 5: Implement the code show and hide the Spelling UI via the context menu item (both
2007         Windows and Mac).
2008
2009         * UIProcess/API/C/win/WKTextChecker.h:
2010         Add the new WKTextCheckerClient funtions.
2011
2012         * UIProcess/API/mac/WKView.mm:
2013         (-[WKView validateUserInterfaceItem:]):
2014         The title of the context menu item should be opposite of whether or not the spelling panel
2015         is visible.
2016
2017         * UIProcess/WebPageProxy.cpp:
2018         (WebKit::WebPageProxy::contextMenuItemSelected):
2019         If the "Show/Hide Spelling and Grammar" item is selected, call toggleSpellingUIIsShowing.
2020         (WebKit::WebPageProxy::spellingUIIsShowing):
2021         Call through to TextChecker.
2022         * UIProcess/WebPageProxy.h:
2023         * UIProcess/WebPageProxy.messages.in:
2024
2025         * UIProcess/TextChecker.h:
2026        * UIProcess/win/TextCheckerWin.cpp:
2027         (WebKit::TextChecker::spellingUIIsShowing):
2028         Call the TextCheckerClient.
2029         (WebKit::TextChecker::toggleSpellingUIIsShowing):
2030         Ditto.
2031         * UIProcess/mac/TextCheckerMac.mm:
2032         (WebKit::TextChecker::spellingUIIsShowing):
2033         Ask the shared NSSpellChecker if the spellingPanel is visible.
2034         (WebKit::TextChecker::toggleSpellingUIIsShowing):
2035         Order the spellingPanel out or front (copied from WKView.mm).
2036         * UIProcess/qt/TextCheckerQt.cpp:
2037         (WebKit::TextChecker::spellingUIIsShowing):
2038         Call notImplemented.
2039         (WebKit::TextChecker::toggleSpellingUIIsShowing):
2040         Ditto.
2041         * UIProcess/gtk/TextCheckerGtk.cpp:
2042         (WebKit::TextChecker::spellingUIIsShowing):
2043         Ditto.
2044         (WebKit::TextChecker::toggleSpellingUIIsShowing):
2045         Ditto.
2046  
2047         * UIProcess/win/WebTextCheckerClient.cpp:
2048         (WebKit::WebTextCheckerClient::spellingUIIsShowing):
2049         Call the client.
2050         (WebKit::WebTextCheckerClient::toggleSpellingUIIsShowing):
2051         Ditto.
2052         * UIProcess/win/WebTextCheckerClient.h:
2053
2054         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2055         (WebKit::WebEditorClient::spellingUIIsShowing):
2056         Send a sync message to the UI process to find out.
2057         It needs to be sync because the Editor code relies on the value returned.
2058
2059 2011-04-08  Anders Carlsson  <andersca@apple.com>
2060
2061         Reviewed by Dan Bernstein.
2062
2063         Sandboxing doesn't work if a local file is dropped on the content area
2064         https://bugs.webkit.org/show_bug.cgi?id=58177
2065         <rdar://problem/9019253>
2066
2067         When performing a drag and the dragging pasteboard contains a local file, create a
2068         sandbox extension and pass it along. If we end up loading the file, the sandbox extension
2069         tracker will consume the extension.
2070
2071         * UIProcess/API/mac/WKView.mm:
2072         (maybeCreateSandboxExtensionFromPasteboard):
2073         Add helper function.
2074
2075         (-[WKView performDragOperation:]):
2076         Create a sandbox extension handle and pass it to performDrag.
2077
2078         * UIProcess/WebPageProxy.cpp:
2079         (WebKit::WebPageProxy::dragEntered):
2080         (WebKit::WebPageProxy::dragUpdated):
2081         (WebKit::WebPageProxy::dragExited):
2082         Pass an empty sandbox extension handle to performDragControllerAction.
2083
2084         (WebKit::WebPageProxy::performDrag):
2085         Pass the sandbox extension handle along to performDragControllerAction.
2086
2087         (WebKit::WebPageProxy::performDragControllerAction):
2088         Send along the sandbox extension handle.
2089
2090         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2091         (WebKit::WebDragClient::willPerformDragDestinationAction):
2092         If the destination action is a load action, call WebPage::willPerformLoadDragDestinationAction.
2093
2094         * WebProcess/WebPage/WebPage.cpp:
2095         (WebKit::WebPage::performDragControllerAction):
2096         Create a sandbox extension.
2097
2098         (WebKit::WebPage::willPerformLoadDragDestinationAction):
2099         If we have a sandbox extension, pass it along to the sandbox extension tracker.
2100
2101         (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction):
2102         Call setPendingProvisionalSandboxExtension.
2103
2104         (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
2105         Call setPendingProvisionalSandboxExtension.
2106
2107         (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension):
2108         Factor code from beginLoad out into a separate function.
2109
2110         * WebProcess/WebPage/WebPage.messages.in:
2111         PerformDragControllerAction now takes a sandbox extension handle.
2112
2113 2011-04-08  Alice Liu  <alice.liu@apple.com>
2114
2115         Reviewed by Adam Roben.
2116
2117         https://bugs.webkit.org/show_bug.cgi?id=58151
2118         Crash after closing a Webview, in WebKit!WebCore::WindowMessageBroadcaster::SubclassedWndProc
2119
2120         * UIProcess/win/WebView.cpp:
2121         (WebKit::WebView::close):
2122         Resolve a difference between old WebKit WebView and WebKit2 WebView by destroying and clearing
2123         out WebKit2 WebView's HWND when closing. Not doing so was causing the WebView to remain in the
2124         list of WindowMessageBroadcaster listeners, and after closing the WebView, WindowMessageBroadcaster
2125         would message a dead WebView and crash.
2126
2127 2011-04-08  Anders Carlsson  <andersca@apple.com>
2128
2129         Reviewed by Adam Roben.
2130
2131         Make the drag operations be different functions
2132         https://bugs.webkit.org/show_bug.cgi?id=58169
2133
2134         Since we want performDrag to take a sandbox extension, separate the four
2135         drag operations out into different functions. No functionality change.
2136
2137         * UIProcess/API/mac/WKView.mm:
2138         (-[WKView draggingEntered:]):
2139         (-[WKView draggingUpdated:]):
2140         (-[WKView draggingExited:]):
2141         (-[WKView performDragOperation:]):
2142         * UIProcess/WebPageProxy.cpp:
2143         (WebKit::WebPageProxy::dragEntered):
2144         (WebKit::WebPageProxy::dragUpdated):
2145         (WebKit::WebPageProxy::dragExited):
2146         (WebKit::WebPageProxy::performDrag):
2147         * UIProcess/WebPageProxy.h:
2148         * UIProcess/win/WebView.cpp:
2149         (WebKit::WebView::DragEnter):
2150         (WebKit::WebView::DragOver):
2151         (WebKit::WebView::DragLeave):
2152         (WebKit::WebView::Drop):
2153
2154 2011-04-08  Anders Carlsson  <andersca@apple.com>
2155
2156         Reviewed by Adam Roben.
2157
2158         Parse 'DispatchOnConnectionQueue' in messages.in files
2159         https://bugs.webkit.org/show_bug.cgi?id=58168
2160
2161         Handle parsing multiple, space-separated attributes in .messages.in files. Keep track of
2162         'DispatchOnConnectionQueue' and rename 'delayed' to 'Delayed'.
2163
2164         * Scripts/webkit2/messages.py:
2165         * Scripts/webkit2/messages_unittest.py:
2166
2167 2011-04-08  Alpha Lam  <hclam@chromium.org>
2168
2169         Unreviewed, rolling out r83335.
2170         http://trac.webkit.org/changeset/83335
2171         https://bugs.webkit.org/show_bug.cgi?id=53556
2172
2173         GTK and QT bots are broken
2174
2175         * Configurations/FeatureDefines.xcconfig:
2176
2177 2011-04-07  Anna Cavender  <annacc@chromium.org>
2178
2179         Reviewed by Eric Carlson.
2180
2181         Setup ENABLE(TRACK) feature define
2182         https://bugs.webkit.org/show_bug.cgi?id=53556
2183
2184         * Configurations/FeatureDefines.xcconfig:
2185
2186 2011-04-07  Alexey Proskuryakov  <ap@apple.com>
2187
2188         Reviewed by Darin Alder.
2189
2190         REGRESSION (WebKit2): AppKit thinks that web views don't support DocumentAccess
2191         https://bugs.webkit.org/show_bug.cgi?id=58102
2192         <rdar://problem/9223246>
2193
2194         * UIProcess/API/mac/WKView.h:
2195         * UIProcess/API/mac/WKView.mm:
2196         (-[WKView doCommandBySelector:]):
2197         (-[WKView insertText:replacementRange:]):
2198         (-[WKView validAttributesForMarkedText]):
2199         (-[WKView setMarkedText:selectedRange:replacementRange:]):
2200         (-[WKView attributedSubstringForProposedRange:actualRange:]):
2201         (-[WKView firstRectForCharacterRange:actualRange:]):
2202         Switch to NSTextInputClient, opting out of optimizations and optional features for now.
2203
2204 2011-04-08  Siddharth Mathur  <siddharth.mathur@nokia.com>
2205
2206         Reviewed by Martin Robinson.
2207
2208         [Qt][WK2][Symbian] Remove use of stack arrays with variable size
2209         https://bugs.webkit.org/show_bug.cgi?id=57877
2210
2211         For better compiler portability, use new/delete for arrays when size
2212         isn't known at compile time. Also fix one compiler warning about bitshift
2213         operations on signed integer
2214         * Platform/CoreIPC/unix/ConnectionUnix.cpp:
2215         (CoreIPC::Connection::readyReadHandler):
2216         (CoreIPC::Connection::sendOutgoingMessage):
2217
2218 2011-04-08  Martin Robinson  <mrobinson@igalia.com>
2219
2220         Reviewed by Xan Lopez.
2221
2222         [GTK] Fix the WebKit2 build for older versions of GTK+
2223         https://bugs.webkit.org/show_bug.cgi?id=58095
2224
2225         * UIProcess/gtk/ChunkedUpdateDrawingAreaProxyGtk.cpp: Include the GtkVersioning.h header.
2226
2227 2011-04-07  Balazs Kelemen  <kbalazs@webkit.org>
2228
2229         Reviewed by Kenneth Rohde Christiansen.
2230
2231         [WK2][Qt][GTK] Introduce common use flag for the shared UNIX domain socket IPC implementation
2232         https://bugs.webkit.org/show_bug.cgi?id=58030
2233
2234         Replace "PLATFORM(QT) || PLATFORM(GTK)" conditions in IPC code with
2235         USE(UNIX_DOMAIN_SOCKETS).
2236
2237         * Platform/CoreIPC/Attachment.h:
2238         * Platform/CoreIPC/Connection.h:
2239         * Platform/SharedMemory.h:
2240
2241 2011-04-07  Anders Carlsson  <andersca@apple.com>
2242
2243         Reviewed by Simon Fraser.
2244
2245         Clicks not recognized on http://www.nibblestutorials.net/ which uses Silverlight
2246         https://bugs.webkit.org/show_bug.cgi?id=58108
2247         <rdar://problem/9167611>
2248
2249         Change platformHandleMouseEvent to return true, which means that the plug-in has handled the
2250         event. Some plug-ins (like Silverlight) will return false from NPP_HandleEvent even though the
2251         event has been handled. In this case it lead to a very subtle bug where the plug-in element would
2252         lose focus right after a mouse down even had been sent.
2253
2254         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2255         (WebKit::NetscapePlugin::platformHandleMouseEvent):
2256
2257 2011-04-07  Adam Roben  <aroben@apple.com>
2258
2259         Pass NPP_SetWindow a null window handle during plugin destruction on non-Mac platforms
2260
2261         This matches WebKit1.
2262
2263         Fixes <http://webkit.org/b/47009> WebKit2 needs to call NPP_SetWindow when destroying a
2264         plugin
2265
2266         Reviewed by Anders Carlsson.
2267
2268         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2269         (WebKit::NetscapePlugin::destroy): Null out our NPWindow's window handle and pass it to
2270         NPP_SetWindow (unless we're on Mac).
2271
2272 2011-04-08  Jamie Cooley  <james.cooley@nokia.com>
2273
2274         Reviewed by Benjamin Poulain.
2275
2276         [Qt][WK2] Make sure qwkhistory.h is copied into includes/WebKit2
2277         https://bugs.webkit.org/show_bug.cgi?id=57945
2278
2279         * UIProcess/API/qt/WKView.h:
2280         * UIProcess/API/qt/qwkhistory.h:
2281
2282 2011-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2283
2284         Reviewed by Martin Robinson.
2285
2286         [GTK] Do not destroy WorkQueue event sources unless they have been cancelled
2287         https://bugs.webkit.org/show_bug.cgi?id=57611
2288
2289         * Platform/WorkQueue.h:
2290         * Platform/gtk/WorkQueueGtk.cpp:
2291         (WorkQueue::EventSource::EventSource): Remove unused member
2292         m_dispatchSource.
2293         (WorkQueue::EventSource::executeEventSource): Make it return void
2294         instead of boolean since we are always ignoring the return value.
2295         (WorkQueue::EventSource::performWork): Return FALSE from the
2296         callback only when the source has been cancelled (condition = 0)
2297         to make sure it's destroyed when the even source handler is
2298         unregistered.
2299         (WorkQueue::registerEventSourceHandler): Use GRefPtr for the
2300         source, to avoid leaking it.
2301         (WorkQueue::scheduleWorkOnSource): Receive the source callback as
2302         parameter so that it can be used by scheduleWorkOnTermination() too.
2303         (WorkQueue::scheduleWork):
2304         (WorkQueue::scheduleWorkAfterDelay):
2305         (WorkQueue::scheduleWorkOnTermination): Use
2306         scheduleWorkOnSource().
2307
2308 2011-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2309
2310         Reviewed by Martin Robinson.
2311
2312         [GTK] Close connection when web process finishes
2313         https://bugs.webkit.org/show_bug.cgi?id=57540
2314
2315         * Platform/CoreIPC/Connection.h:
2316         * Platform/CoreIPC/unix/ConnectionUnix.cpp:
2317         * Platform/PlatformProcessIdentifier.h: Use GPid as process
2318         identifier.
2319         * Platform/WorkQueue.h:
2320         * Platform/gtk/WorkQueueGtk.cpp:
2321         (WorkQueue::EventSource::EventSource): Add cancellable parameter.
2322         (WorkQueue::EventSource::cancel): New method to cancel the source.
2323         (WorkQueue::EventSource::performWorkOnTermination): New method to
2324         execute a work item called when child process has finished.
2325         (WorkQueue::registerEventSourceHandler): Create a GCancellable for
2326         the socket source.
2327         (WorkQueue::unregisterEventSourceHandler): Cancel the source
2328         instead of destroying it, this will cause the source to trigger
2329         with condition = 0, which makes the callback return FALSE and the
2330         source is destroyed.
2331         (WorkQueue::scheduleWorkOnSource): Pass NULL as cancellable for
2332         idle and timeout sources.
2333         (WorkQueue::scheduleWorkOnTermination): Create a child watch
2334         source to monitor the child process.
2335         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2336         (WebKit::ProcessLauncher::launchProcess): Use GPid instead of int
2337         as process identifier.
2338         * UIProcess/WebProcessProxy.cpp:
2339         (WebKit::WebProcessProxy::didFinishLaunching): Call
2340         WorkQueue::scheduleWorkOnTermination() for GTK platform too when
2341         web process has been launched.
2342
2343 2011-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2344
2345         Reviewed by Martin Robinson.
2346
2347         [GTK] Implement scheduleWorkAfterDelay() in WorkQueueGtk
2348         https://bugs.webkit.org/show_bug.cgi?id=57434
2349
2350         * Platform/WorkQueue.h:
2351         * Platform/gtk/WorkQueueGtk.cpp:
2352         (WorkQueue::EventSource::executeEventSource): This new method
2353         contains the common code to execute a work item.
2354         (WorkQueue::EventSource::performWorkOnce): Use
2355         executeEventSource() to execute the work item.
2356         (WorkQueue::EventSource::performWork): Use executeEventSource() to
2357         execute the work item.
2358         (WorkQueue::registerEventSourceHandler): Use a GSocket instead of
2359         a GIOChannel since the API is newer and allows us to pass a
2360         cancellable object to be able to cancel the source.
2361         (WorkQueue::scheduleWorkOnSource): This new method contains the
2362         common code to attach a source to a context. It doesn't use a lock
2363         anymore, since g_source_attach() uses its own mutex internally.
2364         (WorkQueue::scheduleWork): Use an idle source instead of a timeout
2365         one, changing the priority to G_PRIORITY_DEFAULT.
2366         (WorkQueue::scheduleWorkAfterDelay): Implement it using a timeout
2367         source with the given delay.
2368
2369 2011-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2370
2371         Reviewed by Martin Robinson.
2372
2373         [GTK] Use glib API instead of fork + execl in ProcessLauncherGtk
2374         https://bugs.webkit.org/show_bug.cgi?id=57234
2375
2376         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2377         (WebKit::childSetupFunction): close the socket and use prctl()
2378         when platform is Linux to kill the child process when the parent
2379         finishes.
2380         (WebKit::ProcessLauncher::launchProcess): Use g_spawn_async() to
2381         launch the web process.
2382
2383 2011-04-07  Geoffrey Garen  <ggaren@apple.com>
2384
2385         Some Handle<T> cleanup
2386         https://bugs.webkit.org/show_bug.cgi?id=58109
2387
2388         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2389         (WebKit::NPJSObject::NPJSObject): Updated for new null constructor.
2390
2391 2011-04-07  Jessie Berlin  <jberlin@apple.com>
2392
2393         Max build fix.
2394
2395         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2396         (WebKit::WebEditorClient::checkSpellingOfString):
2397         Do not risk an overflow.
2398         (WebKit::WebEditorClient::checkGrammarOfString):
2399         Ditto.
2400
2401 2011-04-07  Jessie Berlin  <jberlin@apple.com>
2402
2403         Reviewed by Brian Weinstein.
2404
2405         WebKit2: Implement TextChecker on Windows
2406         https://bugs.webkit.org/show_bug.cgi?id=57862
2407
2408         Part 4: Implement checkGrammarOfString.
2409
2410         * Scripts/webkit2/messages.py:
2411         The generated files should include TextCheckerClient.h for WebCore::GrammarDetail.
2412
2413         * Shared/API/c/win/WKBaseWin.h:
2414         * Shared/APIObject.h:
2415         * UIProcess/API/C/win/WKAPICastWin.h:
2416
2417         * UIProcess/API/C/win/WKGrammarDetail.cpp: Added.
2418         (WKGrammarDetailGetTypeID):
2419         (WKGrammarDetailCreate):
2420         * UIProcess/API/C/win/WKGrammarDetail.h: Added.
2421
2422         * UIProcess/API/C/win/WKTextChecker.h:
2423         Add the checkGrammarOfString WKTextCheckerClient function.
2424
2425         * UIProcess/WebPageProxy.cpp:
2426         (WebKit::WebPageProxy::checkGrammarOfString):
2427         * UIProcess/WebPageProxy.h:
2428         * UIProcess/WebPageProxy.messages.in:
2429
2430         * UIProcess/TextChecker.h:
2431         * UIProcess/win/TextCheckerWin.cpp:
2432         (WebKit::TextChecker::checkGrammarOfString):
2433         Call the TextCheckerClient.
2434         * UIProcess/mac/TextCheckerMac.mm:
2435         (WebKit::TextChecker::checkSpellingOfString):
2436         Add a comment about this not being used on Mac.
2437         (WebKit::TextChecker::checkGrammarOfString):
2438         Ditto, and call notImplemented.
2439         * UIProcess/gtk/TextCheckerGtk.cpp:
2440         (WebKit::TextChecker::checkGrammarOfString):
2441         Call notImplemented.
2442         * UIProcess/qt/TextCheckerQt.cpp:
2443         (WebKit::TextChecker::checkGrammarOfString):
2444         Ditto.
2445
2446         * UIProcess/win/WebGrammarDetail.cpp: Added.
2447         (WebKit::WebGrammarDetail::create):
2448         (WebKit::WebGrammarDetail::WebGrammarDetail):
2449         Initialize the underlying WebCore::GrammarDetail.
2450         * UIProcess/win/WebGrammarDetail.h: Added.
2451         (WebKit::WebGrammarDetail::grammarDetail):
2452         (WebKit::WebGrammarDetail::type):
2453
2454         * UIProcess/win/WebTextCheckerClient.cpp:
2455         (WebKit::WebTextCheckerClient::checkGrammarOfString):
2456         Populate the Vector of WebCore::GrammarDetails with the WebGrammarDetails.
2457         * UIProcess/win/WebTextCheckerClient.h:
2458
2459         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2460         (WebKit::WebEditorClient::checkSpellingOfString):
2461         Use WTF::notFound as the initial value for resultLocation.
2462         (WebKit::WebEditorClient::checkGrammarOfString):
2463         Send a sync message to the UI Process (similar to checkSpellingOfString and checkTextOfParagraph).
2464
2465         * win/WebKit2.vcproj:
2466         Add WKGrammarDetail.h/.cpp and WebGrammarDetail.h/.cpp.
2467         * win/WebKit2Generated.make:
2468         Copy over WKGrammarDetail.h.
2469
2470 2011-04-07  Enrica Casucci  <enrica@apple.com>
2471
2472         Reviewed by Oliver Hunt.
2473
2474         REGRESSION(WebKit2): execCommand('undo') doesn't work (Windows).
2475         https://bugs.webkit.org/show_bug.cgi?id=58056
2476         <rdar://problem/8862023>
2477         
2478         Adding support for execCommand('undo') and execCommand('redo')
2479         in WebKit2 for Windows.
2480
2481         * UIProcess/API/C/win/WKView.h:
2482         * UIProcess/win/WebUndoClient.cpp:
2483         (WebKit::WebUndoClient::canUndoRedo):
2484         (WebKit::WebUndoClient::executeUndoRedo):
2485         * UIProcess/win/WebUndoClient.h:
2486         * UIProcess/win/WebView.cpp:
2487         (WebKit::WebView::canUndoRedo):
2488         (WebKit::WebView::executeUndoRedo):
2489
2490 2011-04-07  Andrew Scherkus  <scherkus@chromium.org>
2491
2492         Revert ENABLE_TRACK patch due to compile failures.
2493
2494         * Configurations/FeatureDefines.xcconfig:
2495
2496 2011-04-07  Martin Robinson  <mrobinson@igalia.com>
2497
2498         Fix the WebKit2 GTK+ build for older versions of GTK+.
2499
2500         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Include the GtkVersioning.h header.
2501
2502 2011-04-07   Amruth Raj  <amruthraj@motorola.com> and Martin Robinson  <mrobinson@igalia.com>
2503
2504         Reviewed by Kenneth Rohde Christiansen.
2505
2506         [GTK] Implement SharedMemory for WebKit2
2507         https://bugs.webkit.org/show_bug.cgi?id=49791
2508
2509         Share the SharedMemory, Attachment and Connection implementations with the Qt port.
2510         Both implementation are, in fact, general Unix implementations using standard Unix
2511         domain sockets and sendmsg / recvmsg. This should reduce the amount of duplicated code
2512         greatly and lay the groundwork for GTK+/Qt implementations for other operating systems.
2513
2514         * GNUmakefile.am: Replaced GTK+ versions of files with the Unix ones.
2515         * Platform/CoreIPC/ArgumentDecoder.cpp: Extended Qt #ifdefs to include GTK.
2516         (CoreIPC::ArgumentDecoder::~ArgumentDecoder):
2517         * Platform/CoreIPC/ArgumentEncoder.cpp: Ditto.
2518         (CoreIPC::ArgumentEncoder::~ArgumentEncoder):
2519         * Platform/CoreIPC/Attachment.h: Ditto.
2520         * Platform/CoreIPC/Connection.h: Combined the GTK+ and Qt sections.
2521         * Platform/CoreIPC/unix/AttachmentUnix.cpp: Renamed from Source/WebKit2/Platform/CoreIPC/qt/AttachmentQt.cpp.
2522         * Platform/CoreIPC/unix/ConnectionUnix.cpp: Renamed from Source/WebKit2/Platform/CoreIPC/qt/ConnectionQt.cpp.
2523         * Platform/unix/SharedMemoryUnix.cpp: Renamed from Source/WebKit2/Platform/qt/SharedMemoryQt.cpp.
2524         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2525         (WebKit::ProcessLauncher::launchProcess): Use SOCK_DGRAM instead of SOCK_STREAM to match Qt.
2526         * WebKit2.pro: Updated source list to reflect file renaming.
2527
2528 2011-04-07  Alexey Proskuryakov  <ap@apple.com>
2529
2530         Reviewed by Brian Weinstein.
2531
2532         REGRESSION (r83081): Use of deallocated memory in WebEditorClient::respondToChangedSelection()
2533         https://bugs.webkit.org/show_bug.cgi?id=58082
2534
2535         * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::respondToChangedSelection):
2536         Now that the Range is used outside the full expression where it's created, it needs to be
2537         protected with RefPtr.
2538
2539 2011-04-07  Mark Rowe  <mrowe@apple.com>
2540
2541         Reviewed by Dan Bernstein.
2542
2543         <rdar://problem/9251566> WebBackForwardList::createCFDictionaryRepresentation's current item index
2544         doesn't account for items removed by filter callback.
2545
2546         * UIProcess/cf/WebBackForwardListCF.cpp:
2547         (WebKit::WebBackForwardList::createCFDictionaryRepresentation): Update the current item index
2548         when we omit an item due to the filter callback.
2549
2550 2011-04-07  Alexey Proskuryakov  <ap@apple.com>
2551
2552         Reviewed by Anders Carlsson.
2553
2554         REGRESSION (WebKit2): Reverse conversion doesn't work in Kotoeri
2555         https://bugs.webkit.org/show_bug.cgi?id=58066
2556         <rdar://problem/8965302>
2557
2558         * Scripts/webkit2/messages.py:
2559         * Shared/mac/AttributedString.h: Added.
2560         * Shared/mac/AttributedString.mm: Added.
2561         (WebKit::AttributedString::encode):
2562         (WebKit::AttributedString::decode):
2563         Added an class that wraps NSAttributedString. As far as I can tell, one can't pass a CF
2564         or NS object to another process without wrapping it in a C++ one.
2565         
2566         * Shared/mac/ArgumentCodersMac.h: Added.
2567         * Shared/mac/ArgumentCodersMac.mm: Added.
2568         Added coders for Foundation objects, similar to ArgumentCodersCF. There are two reasons why
2569         these are needed:
2570         1) Even though most Foundation objects are toll free bridged with CF, CFGetTypeID() doesn't
2571         work properly for them (I've been just getting 1).
2572         2) NSColor isn't toll free bridged to CF.
2573         This adds just the types necessary for editing NSAttributedString (and I don't yet know what
2574         happens with attachments).
2575
2576         * UIProcess/API/mac/WKView.mm: (-[WKView attributedSubstringFromRange:]):
2577         * UIProcess/WebPageProxy.h:
2578         * UIProcess/mac/WebPageProxyMac.mm:
2579         (WebKit::WebPageProxy::getAttributedSubstringFromRange):
2580         * WebKit2.xcodeproj/project.pbxproj:
2581         * WebProcess/WebPage/WebPage.h:
2582         * WebProcess/WebPage/WebPage.messages.in:
2583         Boilerplate code for making a sync call to web process.
2584
2585         * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::getAttributedSubstringFromRange):
2586         Ported from WebHTMLView.
2587
2588 2011-04-07  Jeff Miller  <jeffm@apple.com>
2589
2590         Mac build fix.
2591
2592         * Shared/WebString.h:
2593         (WebKit::WebString::getCharacters): Add explict cast when using std::min().
2594
2595 2011-04-07  Jeff Miller  <jeffm@apple.com>
2596
2597         Reviewed by Adam Roben.
2598
2599         Replace WKStringGetCharactersPtr() with WKStringGetCharacters()
2600         https://bugs.webkit.org/show_bug.cgi?id=58058
2601         
2602         WKStringGetCharactersPtr() exposes the internal implementation of WKString, so change this to WKStringGetCharacters(), which makes a UTF-16 copy.
2603
2604         * Shared/API/c/WKString.cpp:
2605         (WKStringGetCharacters): Added, replaces WKStringGetCharactersPtr().
2606         * Shared/API/c/WKString.h: Replaced WKStringGetCharactersPtr() with WKStringGetCharacters().
2607         * Shared/WebString.h:
2608         (WebKit::WebString::getCharacters): Added.
2609
2610 2011-04-07  Brian Weinstein  <bweinstein@apple.com>
2611
2612         Reviewed by Adam Roben.
2613
2614         WebKit2: Support window bounce when panning.
2615         https://bugs.webkit.org/show_bug.cgi?id=58065
2616         <rdar://problem/9244367>
2617         
2618         Make gestureDidScroll synchronous, as once we scroll, we need to know
2619         whether or not we are at the beginning or end of the scrollable document.
2620         
2621         If we are at either end of the scrollable document, we call the Windows 7
2622         API to bounce the window to give an indication that you are past an end
2623         of the document.
2624
2625         * UIProcess/WebPageProxy.cpp:
2626         (WebKit::WebPageProxy::gestureDidScroll): Pass a boolean for the reply, and return it.
2627         * UIProcess/WebPageProxy.h:
2628         * UIProcess/win/WebView.cpp:
2629         (WebKit::WebView::WebView): Inititalize a new variable.
2630         (WebKit::WebView::onGesture): Once we send the message to scroll, check if have gone to
2631             an end of the document, and if we have, bounce the window.
2632         * UIProcess/win/WebView.h:
2633         * WebProcess/WebPage/WebPage.h:
2634         * WebProcess/WebPage/WebPage.messages.in: GestureDidScroll is now sync.
2635         * WebProcess/WebPage/win/WebPageWin.cpp:
2636         (WebKit::WebPage::gestureDidScroll): When we are done scrolling, check if we have a vertical
2637             scrollbar and if we are at the beginning or the end of the scrollable document.
2638
2639 2011-04-07  Chang Shu  <cshu@webkit.org>
2640
2641         Reviewed by Darin Adler.
2642
2643         WebKitTestRunner needs layoutTestController.isPageBoxVisible
2644         https://bugs.webkit.org/show_bug.cgi?id=42695
2645
2646         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2647         (WKBundleIsPageBoxVisible):
2648         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2649         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2650         (WebKit::InjectedBundle::isPageBoxVisible):
2651         * WebProcess/InjectedBundle/InjectedBundle.h:
2652
2653 2011-04-07  Enrica Casucci  <enrica@apple.com>
2654
2655         Reviewed by Oliver Hunt.
2656
2657         REGRESSION(WebKit2): execCommand('undo') doesn't work (Mac).
2658         https://bugs.webkit.org/show_bug.cgi?id=58055
2659         <rdar://problem/8862023>
2660         
2661         Adding support for execCommand('undo') and execCommand('redo')
2662         in WebKit2 for Mac.
2663
2664         * UIProcess/API/mac/PageClientImpl.h:
2665         * UIProcess/API/mac/PageClientImpl.mm:
2666         (WebKit::PageClientImpl::canUndoRedo): Added interaction with undomanager.
2667         (WebKit::PageClientImpl::executeUndoRedo): Added interaction with undomanager.
2668         
2669         Added new empty PageClient methods for other platforms.
2670         * UIProcess/API/qt/qwkpage.cpp:
2671         (QWKPagePrivate::canUndoRedo):
2672         (QWKPagePrivate::executeUndoRedo):
2673         * UIProcess/API/qt/qwkpage_p.h:
2674         * UIProcess/PageClient.h:
2675         * UIProcess/gtk/WebView.cpp:
2676         (WebKit::WebView::canUndoRedo):
2677         (WebKit::WebView::executeUndoRedo):
2678         * UIProcess/gtk/WebView.h:
2679         * UIProcess/win/WebView.cpp:
2680         (WebKit::WebView::canUndoRedo):
2681         (WebKit::WebView::executeUndoRedo):
2682         * UIProcess/win/WebView.h:
2683
2684         * UIProcess/WebEditCommandProxy.cpp:
2685         (WebKit::WebEditCommandProxy::unapply): Added flag to allow dispatching
2686         of asychronous messages while waiting for a sync message reply.
2687         (WebKit::WebEditCommandProxy::reapply): Same as above.
2688         * UIProcess/WebPageProxy.cpp:
2689         (WebKit::WebPageProxy::canUndoRedo):
2690         (WebKit::WebPageProxy::executeUndoRedo):
2691         * UIProcess/WebPageProxy.h:
2692         * UIProcess/WebPageProxy.messages.in:
2693         * WebProcess/WebCoreSupport/WebEditorClient.cpp: Added missing implementation.
2694         (WebKit::WebEditorClient::canUndo):
2695         (WebKit::WebEditorClient::canRedo):
2696         (WebKit::WebEditorClient::undo):
2697         (WebKit::WebEditorClient::redo):
2698
2699 2011-04-07  Brady Eidson  <beidson@apple.com>
2700
2701         Reviewed by Maciej Stachowiak.
2702
2703         <rdar://problem/9250368> and https://bugs.webkit.org/show_bug.cgi?id=58062
2704
2705         * UIProcess/API/C/WKIconDatabase.cpp:
2706         (WKIconDatabaseClose):
2707         * UIProcess/API/C/WKIconDatabase.h:
2708         
2709         * UIProcess/WebIconDatabase.cpp:
2710         (WebKit::WebIconDatabase::close):
2711         * UIProcess/WebIconDatabase.h:
2712
2713 2011-04-07  Jessie Berlin  <jberlin@apple.com>
2714
2715         Reviewed by Adam Roben.
2716
2717         WebKit2: Implement TextChecker on Windows
2718         https://bugs.webkit.org/show_bug.cgi?id=57862
2719  
2720         Part 3: Implement checkSpellingOfString
2721
2722         In WebCore, checkTextOfParagraph is only defined and used on platforms where
2723         WTF_USE_UNIFIED_TEXT_CHECKING is defined (which right now is only non-Leopard and non-Tiger
2724         Mac builds).
2725  
2726         On other platforms, checkSpellingOfString and checkGrammarOfString (coming in a separate
2727         patch in an attempt to keep things easier to review) are used.
2728
2729         * UIProcess/API/C/win/WKTextChecker.h:
2730         * UIProcess/TextChecker.h:
2731         Surround checkTextOfParagraph by #if USE(UNIFIED_TEXT_CHECKING) and add
2732         checkSpellingOfString.
2733
2734         * UIProcess/WebPageProxy.cpp:
2735         (WebKit::WebPageProxy::checkTextOfParagraph):
2736         Surround this by #if USE(UNIFIED_TEXT_CHECKING).
2737         (WebKit::WebPageProxy::checkSpellingOfString):
2738         Call through to the client.
2739         * UIProcess/WebPageProxy.h:
2740         * UIProcess/WebPageProxy.messages.in:
2741         Surround checkTextOfParagraph by #if USE(UNIFIED_TEXT_CHECKING) and add
2742         checkSpellingOfString.
2743
2744         * UIProcess/win/TextCheckerWin.cpp:
2745         (WebKit::TextChecker::checkSpellingOfString):
2746         Call through to the WebTextCheckerClient.
2747         * UIProcess/mac/TextCheckerMac.mm:
2748         (WebKit::TextChecker::checkTextOfParagraph):
2749         Surround this by #if USE(UNIFIED_TEXT_CHECKING) for clarity.
2750         (WebKit::TextChecker::checkSpellingOfString):
2751         Add a call to notImplemented.
2752         * UIProcess/qt/TextCheckerQt.cpp:
2753         (WebKit::TextChecker::checkSpellingOfString):
2754         Ditto, and remove the implementation for checkTextOfParagraph.
2755         * UIProcess/gtk/TextCheckerGtk.cpp:
2756         (WebKit::TextChecker::checkSpellingOfString):
2757         Ditto.
2758
2759         * UIProcess/win/WebTextCheckerClient.cpp:
2760         (WebKit::WebTextCheckerClient::checkSpellingOfString):
2761         * UIProcess/win/WebTextCheckerClient.h:
2762
2763         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2764         (WebKit::WebEditorClient::checkSpellingOfString):
2765         Send a sync message to the UI Process (similar to the sync message used for
2766         checkTextOfParagraph).
2767
2768 2011-04-07  Siddharth Mathur  <siddharth.mathur@nokia.com>
2769
2770         Reviewed by Laszlo Gombos.
2771
2772         [Qt][WK2][Symbian] Temporary build fix until native Symbian IPC is done. Implement fake socketpair() as it's not available. 
2773         https://bugs.webkit.org/show_bug.cgi?id=57877
2774
2775         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2776         (WebKit::socketpair): socketpair() which returns -1
2777
2778 2011-04-07  Michael Saboff  <msaboff@apple.com>
2779
2780         Reviewed by Maciej Stachowiak.
2781
2782         WebKit2: Memory leak in decodeResourceError
2783         https://bugs.webkit.org/show_bug.cgi?id=58004
2784
2785         Release the local NSError after it is used to create a ResourceError
2786         object assigned to the reference argument.
2787
2788         * Shared/mac/WebCoreArgumentCodersMac.mm:
2789         (CoreIPC::decodeResourceError):
2790
2791 2011-04-07  Maciej Stachowiak  <mjs@apple.com>
2792
2793         Reviewed by Adam Barth.
2794
2795         Remove temporary WebProcess sandbox rules that are unnecessary now that plugins are in their own process
2796         https://bugs.webkit.org/show_bug.cgi?id=58023
2797
2798         * WebProcess/com.apple.WebProcess.sb:
2799
2800 2011-04-07  Maciej Stachowiak  <mjs@apple.com>
2801
2802         Reviewed by Dan Bernstein.
2803
2804         Remove some no longer needed WebProcess sandbox allowances
2805         https://bugs.webkit.org/show_bug.cgi?id=58015
2806         <rdar://problem/9232592>
2807
2808         * WebProcess/com.apple.WebProcess.sb: Remove no-longer needed extra network
2809         and launching privileges, since the bugs that required them are fixed.
2810
2811 2011-04-06  Chang Shu  <cshu@webkit.org>
2812
2813         Reviewed by Darin Adler.
2814
2815         WebKitTestRunner needs layoutTestController.pageSizeAndMarginsInPixels
2816         https://bugs.webkit.org/show_bug.cgi?id=57984
2817
2818         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2819         (WKBundlePageSizeAndMarginsInPixels):
2820         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2821         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2822         (WebKit::InjectedBundle::pageSizeAndMarginsInPixels):
2823         * WebProcess/InjectedBundle/InjectedBundle.h:
2824
2825 2011-04-06  Siddharth Mathur  <siddharth.mathur@nokia.com>
2826
2827         Reviewed by Benjamin Poulain.
2828
2829         [Qt][WK2][Symbian] Remove use of stack arrays with variable size
2830         https://bugs.webkit.org/show_bug.cgi?id=57877
2831         
2832         For better compiler portability, use new/delete for arrays when size
2833         isn't known at compile time. Also fix one compiler warning about bitshift
2834         operations on signed integers. 
2835         * Platform/CoreIPC/qt/ConnectionQt.cpp: 
2836         (CoreIPC::Connection::readyReadHandler): 
2837         (CoreIPC::Connection::sendOutgoingMessage):
2838
2839 2011-04-06  Brian Weinstein  <bweinstein@apple.com>
2840
2841         Reviewed by Adam Roben.
2842
2843         WebKit2: Support Windows 7 Gestures
2844         https://bugs.webkit.org/show_bug.cgi?id=49824
2845         <rdar://problem/8689728>
2846         
2847         Port code from WebKit1 -> WebKit2 to handle Windows 7 gestures.
2848         
2849         The UIProcess gets a WM_GESTURENOTIFY message, it sends a sync message to the WebProcess to ask
2850         if we should allow panning. The WebProcess checks if we're in a scrollable area, and the mouse
2851         isn't over a scrollbar.
2852
2853         The UIProcess then gets a WM_GESTURE message, and if it is a pan gesture, it sends a message to
2854         the WebProcess to scroll by the amount fingers have moved since the last WM_GESTURE messeage. The
2855         X and Y are reversed because panning up -> moving the page down, and vice versa.
2856
2857         * UIProcess/WebPageProxy.cpp:
2858         (WebKit::WebPageProxy::gestureWillBegin): Send a sync message to the WebProcess
2859             to initialize the gesture. The WebProcess returns whether or not we can start a pan
2860             gesture from where we are.
2861         (WebKit::WebPageProxy::gestureDidScroll): Send a message to the WebProcess to scroll by
2862             pan gesture.
2863         (WebKit::WebPageProxy::gestureDidEnd): Send a message to the WebProcess that the gesture has ended.
2864         * UIProcess/WebPageProxy.h:
2865         * UIProcess/win/WebView.cpp:
2866         (WebKit::WebView::wndProc): Add WM_GESTURE and WM_GESTURENOTIFY handlers.
2867         (WebKit::WebView::WebView): Initialize two new variables.
2868         (WebKit::WebView::onGestureNotify): Figure out which gestures we should support based on where
2869             the gesture is beginning.
2870         (WebKit::WebView::onGesture): Support starting a gesture, ending a gesture, and panning.
2871         * UIProcess/win/WebView.h:
2872         * WebProcess/WebPage/WebPage.h:
2873         * WebProcess/WebPage/WebPage.messages.in: Add messages needed for gestures.
2874         * WebProcess/WebPage/win/WebPageWin.cpp:
2875         (WebKit::WebPage::gestureWillBegin): Set the node that the gesture started on (so we 
2876             know which layer to scroll if the user pans), and determine whether or not we should allow
2877             panning. If the page can't scroll, or the user is on a scrollbar, disallow panning.
2878         (WebKit::WebPage::gestureDidScroll): Scroll the enclosing layer of the element the gesture
2879             started on.
2880         (WebKit::WebPage::gestureDidEnd): Clear the node the gesture started on.
2881
2882 2011-04-06  Jeff Miller  <jeffm@apple.com>
2883
2884         Reviewed by Adam Roben.
2885
2886         Add WKStringGetCharactersPtr() and WKStringGetLength() to WebKit2 C API
2887         https://bugs.webkit.org/show_bug.cgi?id=57989
2888         
2889         Note that WKChar, which is returned by WKStringGetCharactersPtr(), is defined the same way we define JSChar in JSStringRef.h.
2890
2891         * Shared/API/c/WKString.cpp:
2892         (WKStringGetLength): Added.
2893         (WKStringGetCharactersPtr): Added.
2894         * Shared/API/c/WKString.h: Define WKChar and added WKStringGetLength() and WKStringGetCharactersPtr().
2895         * Shared/WebString.h:
2896         (WebKit::WebString::length): Added.
2897         (WebKit::WebString::characters): Added.
2898
2899 2011-04-06  Anders Carlsson  <andersca@apple.com>
2900
2901         Reviewed by Oliver Hunt.
2902
2903         Dock stays in front of Hulu.com full screen video output
2904         https://bugs.webkit.org/show_bug.cgi?id=57988
2905         <rdar://problem/9216260>
2906
2907         Instead of using -[NSMenu setMenuBarVisible:] to toggle full screen, use
2908         -[NSApp setPresentationOptions:]. Also, make the UI process the front most app before
2909         setting the presentation options when exiting full screen, otherwise the dock won't
2910         be restored correctly.
2911
2912         * PluginProcess/mac/PluginProcessShim.mm:
2913         Remove some shim functions that aren't needed.
2914
2915         * UIProcess/Plugins/PluginProcessProxy.cpp:
2916         (WebKit::PluginProcessProxy::PluginProcessProxy):
2917         Initialize m_preFullscreenAppPresentationOptions.
2918
2919         * UIProcess/Plugins/PluginProcessProxy.h:
2920         Add m_preFullscreenAppPresentationOptions.
2921
2922         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2923         (WebKit::PluginProcessProxy::enterFullscreen):
2924         Change the presentation options for the app.
2925
2926         (WebKit::PluginProcessProxy::exitFullscreen):
2927         Restore the presentation options.
2928
2929 2011-04-06  Mark Rowe  <mrowe@apple.com>
2930
2931         Reviewed by Darin Adler.
2932
2933         Expose the original URL of a WKBackForwardListItem.
2934
2935         Needed for <rdar://problem/9074651>.
2936
2937         * UIProcess/API/C/WKBackForwardListItem.cpp:
2938         (WKBackForwardListItemCopyOriginalURL):
2939         * UIProcess/API/C/WKBackForwardListItem.h:
2940
2941 2011-04-06  Brady Eidson  <beidson@apple.com>
2942
2943         Reviewed by Anders Carlsson.
2944
2945         https://bugs.webkit.org/show_bug.cgi?id=57973 and https://bugs.webkit.org/show_bug.cgi?id=57973
2946         WK2 icon database should be able to get a CGImage of a specific size
2947
2948         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
2949         (WKIconDatabaseTryGetCGImageForURL): Change this API to take a requested size, and find the first matching
2950           CGImage in the icon.
2951         * UIProcess/API/C/cg/WKIconDatabaseCG.h:
2952
2953 2011-04-06  Jessie Berlin  <jberlin@apple.com>
2954
2955         Reviewed by Anders Carlsson.
2956
2957         WebKit2: Implement TextChecker on Windows
2958         https://bugs.webkit.org/show_bug.cgi?id=57862
2959
2960         Part 2: Implement uniqueSpellDocumentTag and closeSpellDocumentWithTag.
2961
2962         * UIProcess/API/C/win/WKTextChecker.h:
2963         * UIProcess/win/TextCheckerWin.cpp:
2964         (WebKit::TextChecker::uniqueSpellDocumentTag):
2965         (WebKit::TextChecker::closeSpellDocumentWithTag):
2966         * UIProcess/win/WebTextCheckerClient.cpp:
2967         (WebKit::WebTextCheckerClient::uniqueSpellDocumentTag):
2968         (WebKit::WebTextCheckerClient::closeSpellDocumentWithTag):
2969         * UIProcess/win/WebTextCheckerClient.h:
2970
2971 2011-04-06  Robert Sesek  <rsesek@chromium.org>
2972
2973         Reviewed by Alexey Proskuryakov.
2974
2975         Move code duplicated between the WebKit/mac and WebKit2 down to WebCore because Chromium will need it too
2976         https://bugs.webkit.org/show_bug.cgi?id=54969
2977
2978         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2979         (WebKit::WebEditorClient::respondToChangedSelection): Moved duplicated code to WebCore
2980         * WebProcess/WebPage/mac/WebPageMac.mm: Moved duplicated code to WebCore
2981         (WebKit::WebPage::getMarkedRange):
2982         (WebKit::WebPage::getSelectedRange):
2983         (WebKit::WebPage::characterIndexForPoint):
2984         (WebKit::WebPage::performDictionaryLookupAtLocation):
2985
2986 2011-04-06  Chang Shu  <cshu@webkit.org>
2987
2988         Reviewed by Darin Adler.
2989
2990         WebKitTestRunner needs layoutTestController.pageNumberForElementById
2991         https://bugs.webkit.org/show_bug.cgi?id=42329
2992
2993         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2994         (WKBundlePageNumberForElementById):
2995         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2996         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2997         (WebKit::InjectedBundle::pageNumberForElementById):
2998         * WebProcess/InjectedBundle/InjectedBundle.h:
2999
3000 2011-04-05  Enrica Casucci  <enrica@apple.com>
3001
3002         Reviewed by Darin Adler.
3003
3004         REGRESSION: Drag & Drop Gmail Attachments doesn't work.
3005         https://bugs.webkit.org/show_bug.cgi?id=57909
3006         <rdar://problem/9103220>
3007
3008         Added _hitTest method to support drag and drop when the drag types cannot be matched.
3009         This is the case for elements that do not place content
3010         in the drag pasteboard automatically when the drag start (i.e. dragging a DIV element).
3011                
3012         * UIProcess/API/mac/WKView.mm:
3013         (-[WKView _hitTest:dragTypes:]): Added.
3014
3015 2011-04-06  Csaba Osztrogonác  <ossy@webkit.org>
3016
3017         Reviewed by Darin Adler.
3018
3019         Fix using UNUSED_PARAM introduced in r82907
3020         https://bugs.webkit.org/show_bug.cgi?id=57940
3021
3022         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
3023         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
3024
3025 2011-04-06  Jessie Berlin  <jberlin@apple.com>
3026
3027         Reviewed by Anders Carlsson.
3028
3029         WebKit2: Implement TextChecker on Windows
3030         https://bugs.webkit.org/show_bug.cgi?id=57862
3031
3032         Part 1: Get and set the state.
3033
3034         * Shared/API/c/win/WKBaseWin.h:
3035         * Shared/APIObject.h:
3036         * UIProcess/API/C/win/WKAPICastWin.h:
3037  
3038         * UIProcess/API/C/win/WKTextChecker.cpp: Added.
3039         (WKTextCheckerSetClient):
3040         (WKTextCheckerContinuousSpellCheckingEnabledStateChanged):
3041         (WKTextCheckerGrammarCheckingEnabledStateChanged):
3042         * UIProcess/API/C/win/WKTextChecker.h: Added.
3043  
3044         * UIProcess/TextChecker.h:
3045         * UIProcess/win/TextCheckerWin.cpp:
3046         (WebKit::TextChecker::state):
3047         Do the initalization for the state only once so that it is not necessary to call the client
3048         every time the state is requested.
3049         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
3050         Call the client.
3051         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
3052         Update the state and tell the client.
3053         (WebKit::TextChecker::setGrammarCheckingEnabled):
3054         Ditto.
3055         (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
3056         Update the state.
3057         (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
3058         Update the state.
3059
3060         * UIProcess/win/WebTextChecker.cpp: Added.
3061         (WebKit::WebTextChecker::shared):
3062         Make the WebTextChecker available globally.
3063         (WebKit::WebTextChecker::WebTextChecker):
3064         (WebKit::WebTextChecker::setClient):
3065         (WebKit::updateStateForAllWebProcesses):
3066         (WebKit::WebTextChecker::continuousSpellCheckingEnabledStateChanged):
3067         Tell the TextChecker that the state has changed, and then tell the
3068         WebProcessProxies to send the new state to the WebProcesses.
3069         (WebKit::WebTextChecker::grammarCheckingEnabledStateChanged):
3070         Ditto.
3071         * UIProcess/win/WebTextChecker.h: Added.
3072         (WebKit::WebTextChecker::client):
3073         (WebKit::WebTextChecker::type):
3074
3075         * UIProcess/win/WebTextCheckerClient.cpp: Added.
3076         (WebKit::WebTextCheckerClient::continuousSpellCheckingAllowed):
3077         (WebKit::WebTextCheckerClient::continuousSpellCheckingEnabled):
3078         (WebKit::WebTextCheckerClient::setContinuousSpellCheckingEnabled):
3079         (WebKit::WebTextCheckerClient::grammarCheckingEnabled):
3080         (WebKit::WebTextCheckerClient::setGrammarCheckingEnabled):
3081         * UIProcess/win/WebTextCheckerClient.h: Added.
3082  
3083         * win/WebKit2.vcproj:
3084         Add WKTextChecker.h/.cpp, WebTextChecker.h/.cpp, and WebTextCheckerClient.h/.cpp.
3085         * win/WebKit2Generated.make:
3086         Copy over WKTextChecker.h.
3087
3088 2011-04-05  Chang Shu  <cshu@webkit.org>
3089
3090         Reviewed by Darin Adler.
3091
3092         WebKitTestRunner needs layoutTestController.numberOfPages
3093         https://bugs.webkit.org/show_bug.cgi?id=42694
3094
3095         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3096         (WKBundleNumberOfPages):
3097         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3098         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3099         (WebKit::InjectedBundle::numberOfPages):
3100         * WebProcess/InjectedBundle/InjectedBundle.h:
3101
3102 2011-04-05  Darin Adler  <darin@apple.com>
3103
3104         Reviewed by Alexey Proskuryakov.
3105
3106         [Mac] WebKit2: Escape key does not stop page loads when focus is on the web page
3107         https://bugs.webkit.org/show_bug.cgi?id=57893
3108         <rdar://problem/9130486>
3109
3110         * UIProcess/API/mac/PageClientImpl.h: Added executeSavedCommandBySelector.
3111         * UIProcess/API/mac/PageClientImpl.mm: Renamed internal Objective-C classes to use
3112         the WebKit2 Objective-C class prefix, WK, rather than the WebKit1 Objective-C class
3113         prefix, Web. Removed some unneeded explicit WebKit namespace prefixes.
3114         (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Removed unneeded WebKit
3115         namespace prefix.
3116         (-[WKEditCommandObjC command]): Ditto.
3117         (-[WKEditorUndoTargetObjC undoEditing:]): Updated for new class name.
3118         (-[WKEditorUndoTargetObjC redoEditing:]): Ditto.
3119         (WebKit::PageClientImpl::PageClientImpl): Ditto.
3120         (WebKit::PageClientImpl::registerEditCommand): Ditto.
3121         (WebKit::PageClientImpl::executeSavedCommandBySelector): Added.
3122
3123         * UIProcess/API/mac/WKView.mm: Renamed internal Objective-C categories to use the
3124         WebKit2 Objective-C prefix, WK, rather than the WebKit1 Objective-C prefix, Web,
3125         or no prefix at all. Tweaked use of extern "C" a little.
3126         (-[WKView doCommandBySelector:]): Tweaked the comment.
3127         (-[WKView _executeSavedCommandBySelector:]): Added. For use when command is not handled
3128         by WebCore.
3129         (-[WKResponderChainSink initWithResponderChain:]): Added. Based on the
3130         WebResponderChainSink class in WebKit1.
3131         (-[WKResponderChainSink detach]): Added.
3132         (-[WKResponderChainSink didReceiveUnhandledCommand]): Added.
3133         (-[WKResponderChainSink noResponderFor:]): Added.
3134         (-[WKResponderChainSink doCommandBySelector:]): Added.
3135         (-[WKResponderChainSink tryToPerform:with:]): Added.
3136
3137         * UIProcess/API/mac/WKViewInternal.h: Added declaration of _executeSavedCommandBySelector:
3138         method. Also removed unneeded includes.
3139
3140         * UIProcess/PageClient.h: Added executeSavedCommandBySelector.
3141         * UIProcess/WebPageProxy.h: Added executeSavedCommandBySelector.
3142         * UIProcess/WebPageProxy.messages.in: Added ExecuteSavedCommandBySelector.
3143
3144         * UIProcess/mac/WebFullScreenManagerProxyMac.mm: Updated includes.
3145
3146         * UIProcess/mac/WebPageProxyMac.mm:
3147         (WebKit::WebPageProxy::executeSavedCommandBySelector): Added.
3148
3149         * WebProcess/WebPage/mac/WebPageMac.mm:
3150         (WebKit::WebPage::executeKeypressCommandsInternal): Send the synchronous
3151         ExecuteSavedCommandBySelector message when a command is not handled by WebCore.
3152
3153 2011-04-05  Anders Carlsson  <andersca@apple.com>
3154
3155         Reviewed by Alexey Proskuryakov.
3156
3157         Some plug-in content is displayed upside down in Unity plug-in
3158         https://bugs.webkit.org/show_bug.cgi?id=57895
3159         <rdar://problem/9212003>
3160
3161         Create the flipped geometry layer in the web process instead of the plug-in process,
3162         which matches what we do in WebKit1.
3163
3164         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3165         (WebKit::NetscapePlugin::platformPostInitialize):
3166         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
3167         (WebKit::PluginProxy::pluginLayer):
3168
3169 2011-04-05  Anders Carlsson  <andersca@apple.com>
3170
3171         Reviewed by Darin Adler.
3172
3173         Assertion failure when navigating quickly between file URLs
3174         https://bugs.webkit.org/show_bug.cgi?id=57884
3175         <rdar://problem/9080559>
3176
3177         Remove bogus assertion. The pending provisional sandbox extension can be
3178         non-null if the current provisional load fails because we're about to load a new
3179         page that also has a sandbox extension.
3180
3181         * WebProcess/WebPage/WebPage.cpp:
3182         (WebKit::WebPage::SandboxExtensionTracker::didFailProvisionalLoad):
3183
3184 2011-04-05  Anders Carlsson  <andersca@apple.com>
3185
3186         Reviewed by Adam Roben.
3187
3188         Grant the web process access to ~/Library/Preferences/com.apple.universalaccess.plist
3189         https://bugs.webkit.org/show_bug.cgi?id=57879
3190
3191         The web process needs access to the unviersal access preferences to determine if full keyboard
3192         access is enabled. I've filed <rdar://problem/9237619> which tracks reading this preference in the UI
3193         process and sending it over to the web process whenever it changes.
3194
3195         * WebProcess/com.apple.WebProcess.sb:
3196
3197 2011-04-05  Dean Jackson  <dino@apple.com>
3198
3199         Reviewed by Simon Fraser.
3200
3201         Add parentheses around && within || to avoid clang warning.
3202
3203         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3204         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
3205
3206 2011-04-05  Anders Carlsson  <andersca@apple.com>
3207
3208         Reviewed by Adam Roben.
3209
3210         Add two more entries to the sandbox profile
3211         https://bugs.webkit.org/show_bug.cgi?id=57875
3212
3213         Allow read-access to /Library/Dictionaries since WebCore::nextBreakablePosition
3214         ends up calling into ICU which accesses the dictionary.
3215
3216         Allow Mach access to com.apple.networkd since it's used by CFNetwork.
3217
3218         * WebProcess/com.apple.WebProcess.sb:
3219
3220 2011-04-05  Anders Carlsson  <andersca@apple.com>
3221
3222         Reviewed by Oliver Hunt.
3223
3224         Invalidate callbacks if the WebPageProxy is no longer valid
3225         https://bugs.webkit.org/show_bug.cgi?id=57873
3226         <rdar://problem/9059717>
3227
3228         Audit all function calls that take callbacks and make sure to invalidate the callbacks
3229         if the web page is no longer valid.
3230
3231         * UIProcess/WebPageProxy.cpp:
3232         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
3233         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
3234         (WebKit::WebPageProxy::getSourceForFrame):
3235         (WebKit::WebPageProxy::getContentsAsString):
3236         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
3237         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
3238         (WebKit::WebPageProxy::getResourceDataFromFrame):
3239         (WebKit::WebPageProxy::getWebArchiveOfFrame):
3240         (WebKit::WebPageProxy::forceRepaint):
3241         (WebKit::WebPageProxy::computePagesForPrinting):
3242         (WebKit::WebPageProxy::drawRectToPDF):
3243         (WebKit::WebPageProxy::drawPagesToPDF):
3244
3245 2011-04-05  Adam Roben  <aroben@apple.com>
3246
3247         Disable accelerated compositing on Windows machines that don't support it
3248
3249         This includes machines without the necessary graphics hardware, and machines without
3250         WebKitQuartzCoreAdditions (like the Windows 7 Release (WebKit2 Tests) bots).
3251
3252         Fixes <http://webkit.org/b/57870> REGRESSION (r82960): Lots of tests crashing in
3253         DrawingAreaImpl::enterAcceleratedCompositingMode on Windows 7 Release (WebKit2 Tests)
3254
3255         Reviewed by Anders Carlsson.
3256
3257         * WebProcess/WebPage/LayerTreeHost.h:
3258         (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Added. On platforms other than
3259         Windows, this always returns true.
3260
3261         * WebProcess/WebPage/WebPage.cpp:
3262         (WebKit::WebPage::updatePreferences): Only enable accelerated compositing-related
3263         preferences if the machine supports accelerated compositing.
3264
3265         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
3266         (WebKit::LayerTreeHostCAWin::supportsAcceleratedCompositing): Added. Creates a view, asks it
3267         if it can draw, and returns the result.
3268
3269         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added supportsAcceleratedCompositing.
3270
3271         * WebProcess/WebPage/win/LayerTreeHostWin.cpp: Added.
3272         (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Added. Calls through to
3273         LayerTreeHostCAWin in configurations that support that class. Otherwise just returns false.
3274
3275         * win/WebKit2.vcproj: Added LayerTreeHostWin.cpp. Let VS reorder some other files.
3276
3277 2011-04-05  Adam Roben  <aroben@apple.com>
3278
3279         Make accelerated compositing work in WebKit2 on Windows
3280
3281         LayerTreeHostCAWin uses WKCACFView to render each frame to an image, then has
3282         DrawingAreaImpl send that image over to the UI process (just like it does for
3283         non-accelerated rendering). It's unfortunate that this requires reading every frame back
3284         from the GPU into system memory. More efficient solutions can be explored in the future.
3285
3286         Fixes <http://webkit.org/b/45567>.
3287
3288         Reviewed by Anders Carlsson.
3289
3290         * DerivedSources.make: Added $(WebKit2) to the VPATH so that DerivedSources.make can be
3291         found when used as a target dependency. Added rules to generate a HeaderDetection.h file on
3292         Windows. If we can find WebKitQuartzCoreAdditions headers, we define HAVE_WKQCA in
3293         HeaderDetection.h.
3294
3295         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3296         (WebKit::DrawingAreaImpl::setLayerHostNeedsDisplay):
3297         * WebProcess/WebPage/DrawingAreaImpl.h:
3298         Added setLayerHostNeedsDisplay. Lets the layer host tell the DrawingAreaImpl that it has a
3299         new frame to render. This should only be called by layer hosts that participate in
3300         DrawingAreaImpl's display mechanism.
3301
3302         * WebProcess/WebPage/LayerTreeHost.cpp:
3303         (WebKit::LayerTreeHost::create): Only try to instantiate LayerTreeHostCAWin if we have
3304         WebKitQuartzCoreAdditions, since it depends on that library.
3305
3306         * WebProcess/WebPage/WebPage.cpp:
3307         (WebKit::WebPage::updatePreferences): Removed code that forced accelerated compositing to be
3308         disabled on Windows.
3309
3310         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
3311         (WebKit::registerDummyWindowClass): Registers the window class we use for the dummy window.
3312         (WebKit::createDummyWindow): Creates the dummy window we pass to WKCACFView so that D3D can
3313         determine the display mode, etc. (The window is never shown on screen.)
3314         (WebKit::LayerTreeHostCAWin::LayerTreeHostCAWin): Initialize new members.
3315         (WebKit::LayerTreeHostCAWin::platformInitialize): Create our dummy window and view and
3316         associate the two. We set ourselves as the view's context's user data so that
3317         PlatformCALayer can get our AbstractCACFLayerTreeHost pointer as needed.
3318         (WebKit::LayerTreeHostCAWin::invalidate): Cancel any pending flushes, tear down our view,
3319         and destroy the dummy window if no other layer host is using it.
3320         (WebKit::LayerTreeHostCAWin::scheduleLayerFlush): Ask LayerChangesFlusher to call us back
3321         soon to perform the flush.
3322         (WebKit::LayerTreeHostCAWin::participatesInDisplay): Added. Returns true, since we render
3323         each frame to an image.
3324         (WebKit::LayerTreeHostCAWin::needsDisplay): Added. Returns true if it's now time to
3325         displayReturns true if it's now time to display.
3326         (WebKit::LayerTreeHostCAWin::timeUntilNextDisplay): Added. Returns how many seconds remain
3327         before we need to display again.
3328         (WebKit::size): Added. Helper function to get the size of a WKCACFImage.
3329         (WebKit::toShareableBitmap): Added. Helper function to convert a WKCACFImage to a
3330         ShareableBitmap.
3331         (WebKit::LayerTreeHostCAWin::display): Added. Renders the next frame to an image and stuffs
3332         the image into the UpdateInfo struct.
3333         (WebKit::LayerTreeHostCAWin::sizeDidChange): Added. Tells the view about the new size.
3334         (WebKit::LayerTreeHostCAWin::forceRepaint): Added. Flushes any pending changes to the view.
3335         (WebKit::LayerTreeHostCAWin::contextDidChangeCallback): Added. WKCACFView calls this
3336         whenever any changes made to the view or its layer tree have been flushed. Just calls
3337         through to contextDidChange.
3338         (WebKit::LayerTreeHostCAWin::contextDidChange): Added. Tells layers that they've started
3339         animating, and tells the DrawingAreaImpl that we need to display again.
3340         (WebKit::LayerTreeHostCAWin::rootLayer): Added. Gets the root layer's PlatformCALayer.
3341         (WebKit::LayerTreeHostCAWin::addPendingAnimatedLayer): Added. Stores the layer so that we
3342         can tell it animations have started the next time we get a contextDidChange callback.
3343         (WebKit::LayerTreeHostCAWin::layerTreeDidChange): Added. Schedules a flush, unless we're
3344         already in the process of flushing. This code came from WebCore::WKCACFViewLayerTreeHost.
3345         (WebKit::LayerTreeHostCAWin::flushPendingLayerChangesNow): Added. Performs the flush. This
3346         code was adapted from WebCore::WKCACFViewLayerTreeHost.
3347
3348         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Wrapped this whole header in HAVE(WKQCA),
3349         since this class only works when WebKitQuartzCoreAdditions is available. Added a bunch of
3350         new members.
3351
3352 2011-04-04  Adam Roben  <aroben@apple.com>
3353
3354         Add a way for LayerTreeHost to participate in DrawingAreaImpl's normal display mechanism
3355
3356         When LayerTreeHost participates in display, it renders each frame into a bitmap.
3357         DrawingAreaImpl sends the bitmap to the UI process in an Update message, just like in
3358         non-accelerated compositing mode. The UI process never knows that accelerated compositing is
3359         going on. (When LayerTreeHost does not participate in display, as on Mac, it is responsible
3360         for getting bits from the web process to the UI process.)
3361
3362         No LayerTreeHost uses this mechanism (yet). This patch should cause no change in behavior.
3363
3364         Fixes <http://webkit.org/b/57792> LayerTreeHost needs a way to render frames to a bitmap
3365
3366         Reviewed by Anders Carlsson.
3367
3368         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3369         (WebKit::DrawingAreaImpl::forceRepaint): If the layer tree host participates in display,
3370         perform a display (like in the non-accelerated case).
3371         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers): Don't send an
3372         EnterAcceleratedCompositing message to the UI process if the layer tree host participates in
3373         display. In that case, the UI process doesn't even need to know we're using accelerated
3374         compositing in the web process.
3375         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): Go through the normal display
3376         mechanism if we have a layer tree host that participates in display.
3377         (WebKit::DrawingAreaImpl::didUpdate): Don't ignore DidUpdate messages when we have a layer
3378         tree host that participates in display.
3379         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): If the new layer tree host
3380         participates in display, let the display timer continue to run and continue to expect
3381         DidUpdate messages so that we don't interrupt the normal display mechanism. We still clear
3382         out m_dirtyRegion, m_scrollRect, and m_scrollOffset, though, because the layer tree host is
3383         still responsible for keeping track of those things even when it participates in display.
3384         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): If the outgoing layer tree host
3385         was participating in display, just send another Update message instead of an
3386         ExitAcceleratedCompositing message, since the UI process never even knew we were using
3387         accelerated compositing.
3388         (WebKit::DrawingAreaImpl::displayTimerFired): If we have a layer tree host that's
3389         participating in display, ask it when it next needs to display when scheduling our timer.
3390
3391         (WebKit::DrawingAreaImpl::scheduleDisplay):
3392         (WebKit::DrawingAreaImpl::display):
3393         If we have a layer tree host that's participating in display, it will keep track of its own
3394         dirty region, so ask it if it needs display rather than checking our own dirty region.
3395
3396         (WebKit::DrawingAreaImpl::display): If we have a layer tree host that's participating in
3397         display, don't bail out. Instead, tell it to display rather than asking the page to paint.
3398         Moved the setting of updateInfo.viewSize earlier so that it will be set even when the layer
3399         tree host is displaying. Other changes are just due to indentation.
3400
3401         * WebProcess/WebPage/LayerTreeHost.h:
3402         (WebKit::LayerTreeHost::participatesInDisplay):
3403         (WebKit::LayerTreeHost::needsDisplay):
3404         (WebKit::LayerTreeHost::timeUntilNextDisplay):
3405         (WebKit::LayerTreeHost::display):
3406         Stubbed out these functions. Derived classes can override them to participate in display.
3407
3408 2011-04-04  MORITA Hajime  <morrita@google.com>
3409
3410         Reviewed by Ryosuke Niwa.
3411
3412         [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
3413         https://bugs.webkit.org/show_bug.cgi?id=56085
3414         
3415         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3416         (WebKit::WebEditorClient::requestCheckingOfString):
3417         * WebProcess/WebCoreSupport/WebEditorClient.h:
3418         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3419         (WebKit::WebEditorClient::checkTextOfParagraph):
3420
3421 2011-04-05  Alejandro G. Castro  <alex@igalia.com>
3422
3423         Another compilation fix after r82929 horrible patch merge.
3424
3425         * UIProcess/WebPageProxy.messages.in:
3426
3427 2011-04-05  Alejandro G. Castro  <alex@igalia.com>
3428
3429         Fix compilation error after r82929.
3430
3431         * WebProcess/WebPage/WebPage.h:
3432
3433 2011-04-05  Amruth Raj  <amruthraj@motorola.com>, Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
3434
3435         Reviewed by Martin Robinson.
3436
3437         [GTK] Implement WebPage class for WebKit2
3438         https://bugs.webkit.org/show_bug.cgi?id=54230
3439
3440         Added functions to handle the generation of commands from the
3441         keycodes.
3442
3443         * GNUmakefile.am:
3444         * Scripts/webkit2/messages.py:
3445         * UIProcess/PageClient.h:
3446         * UIProcess/WebPageProxy.h:
3447         * UIProcess/WebPageProxy.messages.in:
3448         * UIProcess/gtk/WebPageProxyGtk.cpp:
3449         (WebKit::WebPageProxy::getEditorCommandsForKeyEvent):
3450         * UIProcess/gtk/WebView.cpp:
3451         (WebKit::backspaceCallback):
3452         (WebKit::selectAllCallback):
3453         (WebKit::cutClipboardCallback):
3454         (WebKit::copyClipboardCallback):
3455         (WebKit::pasteClipboardCallback):
3456         (WebKit::toggleOverwriteCallback):
3457         (WebKit::popupMenuCallback):
3458         (WebKit::showHelpCallback):
3459         (WebKit::deleteFromCursorCallback):
3460         (WebKit::moveCursorCallback):
3461         (WebKit::WebView::WebView):
3462         (WebKit::WebView::getEditorCommandsForKeyEvent):
3463         * UIProcess/gtk/WebView.h:
3464         (WebKit::WebView::addPendingEditorCommand):
3465         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3466         * WebProcess/WebCoreSupport/WebEditorClient.h:
3467         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: Added.
3468         (WebKit::WebEditorClient::getEditorCommandsForKeyEvent):
3469         (WebKit::WebEditorClient::executePendingEditorCommands):
3470         (WebKit::WebEditorClient::handleKeyboardEvent):
3471         (WebKit::WebEditorClient::handleInputMethodKeydown):
3472         * WebProcess/WebPage/WebPage.cpp:
3473         * WebProcess/WebPage/WebPage.h:
3474         * WebProcess/WebPage/gtk/WebPageGtk.cpp: Added.
3475         (WebKit::WebPage::platformInitialize):
3476         (WebKit::WebPage::platformPreferencesDidChange):
3477         (WebKit::scroll):
3478         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
3479         (WebKit::WebPage::platformHasLocalDataForURL):
3480         (WebKit::WebPage::cachedResponseMIMETypeForURL):
3481         (WebKit::WebPage::platformCanHandleRequest):
3482
3483 2011-04-05  Csaba Osztrogonác  <ossy@webkit.org>
3484
3485         Remove duplicate API from WKContext
3486         <rdar://problem/8727879>
3487         https://bugs.webkit.org/show_bug.cgi?id=57815
3488
3489         Unreviewed buildfix after r82906.
3490
3491         Add UNUSED_PARAM to resourceCachesToClear, because
3492         it is only used within #if USE(CFURLCACHE) guard.
3493
3494         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
3495         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
3496
3497 2011-04-04  Sam Weinig  <sam@webkit.org>
3498
3499         Reviewed by Brian Weinstein.
3500
3501         Remove duplicate API from WKContext
3502         <rdar://problem/8727879>
3503         https://bugs.webkit.org/show_bug.cgi?id=57815
3504
3505         - Remove WKContextClearResourceCaches and WKContextClearApplicationCache in favor
3506           of their more modern counterparts WKResourceCacheManagerClearCacheForAllOrigins
3507           and WKApplicationCacheManagerDeleteAllEntries.
3508
3509         - Expand clearing functionality of WKResourceCacheManager by adding type of resources
3510           to clear.
3511
3512         * Shared/WebProcessCreationParameters.cpp:
3513         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
3514         (WebKit::WebProcessCreationParameters::encode):
3515         (WebKit::WebProcessCreationParameters::decode):
3516         * Shared/WebProcessCreationParameters.h:
3517         Remove clearing bools.
3518
3519         * UIProcess/API/C/WKAPICast.h:
3520         (WebKit::toResourceCachesToClear):
3521         Update for new name of enum.
3522
3523         * UIProcess/API/C/WKContext.cpp:
3524         * UIProcess/API/C/WKContext.h:
3525         Remove WKContextClearResourceCaches and WKContextClearApplicationCache.
3526
3527         * UIProcess/API/C/WKResourceCacheManager.cpp:
3528         (WKResourceCacheManagerClearCacheForOrigin):
3529         (WKResourceCacheManagerClearCacheForAllOrigins):
3530         * UIProcess/API/C/WKResourceCacheManager.h:
3531         Add WKResourceCachesToClear enum and use it in the clearing functions.
3532
3533         * UIProcess/WebContext.cpp:
3534         (WebKit::WebContext::WebContext):
3535         (WebKit::WebContext::ensureWebProcess):
3536         * UIProcess/WebContext.h:
3537         * WebProcess/WebProcess.messages.in:
3538         Remove clearing functions and setting of bools for clear on launch.
3539
3540         * UIProcess/WebFullScreenManagerProxy.cpp:
3541         Remove unnecessary #include.
3542
3543         * UIProcess/WebResourceCacheManagerProxy.cpp:
3544         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
3545         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins):
3546         * UIProcess/WebResourceCacheManagerProxy.h:
3547         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
3548         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
3549         (WebKit::WebResourceCacheManager::clearCacheForAllOrigins):
3550         * WebProcess/ResourceCache/WebResourceCacheManager.h:
3551         * WebProcess/ResourceCache/WebResourceCacheManager.messages.in:
3552         Add enum parameter describing what type of caches to clear.
3553
3554         * WebProcess/WebProcess.cpp:
3555         (WebKit::WebProcess::initializeWebProcess):
3556         (WebKit::WebProcess::clearResourceCaches):
3557         * WebProcess/WebProcess.h:
3558         No longer need to use opaque type now that it is not a message receiver.
3559
3560 2011-04-04  David Kilzer  <ddkilzer@apple.com>
3561
3562         <http://webkit.org/b/57384> CFNetwork and WebCore load priorities should match
3563
3564         Reviewed by Alexey Proskuryakov.
3565
3566         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3567         (InitWebCoreSystemInterface): Added initialization for
3568         wkSetHTTPPipeliningMaximumPriority().
3569
3570 2011-04-04  Anders Carlsson  <andersca@apple.com>
3571
3572         Reviewed by Darin Adler.
3573
3574         Send NPCocoaEventFlagsChanged events
3575         https://bugs.webkit.org/show_bug.cgi?id=57811
3576         <rdar://problem/9215600>
3577
3578         * Shared/WebEvent.h:
3579         (WebKit::WebEvent::capsLockKey):
3580         Add CapsLock modifier and getter.
3581
3582         * Shared/mac/WebEventFactory.mm:
3583         (WebKit::modifiersForEvent):
3584         Check for NSAlphaShiftKeyMask and set the CapsLockKey modifier.
3585
3586         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3587         (WebKit::modifierFlags):
3588         Check for CapsLockKey and set NSAlphaShiftKeyMask.
3589
3590         (WebKit::isFlagsChangedEvent):
3591         Return whether a given event is a Cocoa flags changed event.
3592
3593         (WebKit::initializeKeyboardEvent):
3594         If this is a flags changed event, set the event type to NPCocoaEventFlagsChanged.
3595
3596 2011-04-04  Anders Carlsson  <andersca@apple.com>
3597
3598         Reviewed by Darin Adler.
3599
3600         Don't discard the backing stores of WKViews in the key window
3601         https://bugs.webkit.org/show_bug.cgi?id=57808
3602         <rdar://problem/9110793>
3603         <rdar://problem/9194284>
3604         <rdar://problem/9222216>
3605
3606         * UIProcess/DrawingAreaProxy.h:
3607         (WebKit::DrawingAreaProxy::setBackingStoreIsDiscardable):
3608         Add empty stub.
3609
3610         * UIProcess/DrawingAreaProxyImpl.cpp:
3611         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
3612         Initialize m_isBackingStoreDiscardable to true.
3613
3614         (WebKit::DrawingAreaProxyImpl::setBackingStoreIsDiscardable):
3615         Set m_isBackingStoreDiscardable and schedule or stop the discard backing store timer.
3616
3617         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
3618         Don't start the timer if m_isBackingStoreDiscardable is false.
3619
3620         * UIProcess/DrawingAreaProxyImpl.h:
3621         Add m_isBackingStoreDiscardable.
3622
3623         * UIProcess/WebPageProxy.cpp:
3624         (WebKit::WebPageProxy::viewStateDidChange):
3625         Mark the backing store as discardable if the view is hidden or if the containing window
3626         is not active.
3627
3628 2011-04-04  Jade Han  <jade.han@nokia.com>
3629
3630         Reviewed by Csaba Osztrogonác.
3631
3632         Symbian build fix.
3633         https://bugs.webkit.org/show_bug.cgi?id=54977
3634
3635         * config.h:
3636
3637 2011-04-04  Brady Eidson  <beidson@apple.com>
3638
3639         Rubberstamped by Adam Roben.
3640
3641         Add WKIconDatabase* headers to the WebKit2 export for Windows:
3642         * win/WebKit2Generated.make:
3643
3644 2011-04-04  Anders Carlsson  <andersca@apple.com>
3645
3646         Reviewed by Dan Bernstein.
3647
3648         Get rid of WebContext::process() in more places
3649         https://bugs.webkit.org/show_bug.cgi?id=57787
3650
3651         Migrate calls to WebContext::process() over to sendToAllProcesses and
3652         sendToAllProcessesRelaunchingThemIfNecessary.
3653
3654         Add FIXMEs for things that need to be fixed in order to support multiple web processes.
3655                 
3656         * UIProcess/Downloads/DownloadProxy.cpp:
3657         (WebKit::DownloadProxy::cancel):
3658         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
3659         (WebKit::WebPluginSiteDataManager::getSitesWithData):
3660         (WebKit::WebPluginSiteDataManager::clearSiteData):
3661         * UIProcess/VisitedLinkProvider.cpp:
3662         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
3663         * UIProcess/WebApplicationCacheManagerProxy.cpp:
3664         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
3665         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin):
3666         (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries):
3667         * UIProcess/WebCookieManagerProxy.cpp:
3668         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
3669         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
3670         * UIProcess/WebDatabaseManagerProxy.cpp:
3671         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
3672         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
3673         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
3674         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
3675         (WebKit::WebDatabaseManagerProxy::deleteAllDatabases):
3676         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
3677         * UIProcess/WebGeolocationManagerProxy.cpp:
3678         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
3679         (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition):
3680         * UIProcess/WebIconDatabase.cpp:
3681         (WebKit::WebIconDatabase::getLoadDecisionForIconURL):
3682         (WebKit::WebIconDatabase::didFinishURLImport):
3683         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
3684         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
3685         (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
3686         (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
3687         * UIProcess/WebMediaCacheManagerProxy.cpp:
3688         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
3689         (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname):
3690         (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames):
3691         * UIProcess/WebResourceCacheManagerProxy.cpp:
3692         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
3693         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
3694         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins):
3695
3696 2011-04-04  Alexey Proskuryakov  <ap@apple.com>
3697
3698         Reviewed by Dan Bernstein.
3699
3700         REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2
3701         https://bugs.webkit.org/show_bug.cgi?id=51230
3702         <rdar://problem/8780989>
3703
3704         <rdar://problem/9015250> REGRESSION (WebKit2): Key events not fired for modifier keys
3705
3706         * UIProcess/API/mac/WKView.mm:
3707         (-[WKView flagsChanged:]): Ported from WebHTMLView.
3708         (-[WKView _interpretKeyEvent:withCachedTextInputState:savingCommandsTo:WebCore::]):
3709         AppKit isn't happy about attempts to interpret NSFlagsChanged, but WK2 lacked the check.
3710
3711 2011-04-04  Steve Falkenburg  <sfalken@apple.com>
3712
3713         Reviewed by Adam Roben.
3714
3715         Remove unused AnalyzeWithLargeStack code from Windows build files
3716         https://bugs.webkit.org/show_bug.cgi?id=57771
3717         
3718         This was used for us to build with prefast automatically,
3719         but it is out-of-date and hasn't been used for some time.
3720         Removing completely for now.
3721
3722         * win/WebKitPreBuild.cmd:
3723
3724 2011-04-04  Anders Carlsson  <andersca@apple.com>
3725
3726         Attempt to fix the Windows build.
3727
3728         * UIProcess/win/WebContextWin.cpp:
3729         (WebKit::WebContext::setShouldPaintNativeControls):
3730
3731 2011-04-04  Anders Carlsson  <andersca@apple.com>
3732
3733         Reviewed by Adam Roben.
3734
3735         Make it easier to send a message to all processes in a context
3736         https://bugs.webkit.org/show_bug.cgi?id=57776
3737
3738         Add WebContext::sendToAllProcesses and WebContext::sendToAllProcessesRelaunchingThemIfNecessary
3739         as a first step towards getting rid of WebContext::process() and getting rid of a class of crashers
3740         where WebContext::process() is null.
3741
3742         * UIProcess/WebContext.cpp:
3743         (WebKit::WebContext::initializeHistoryClient):
3744         (WebKit::WebContext::languageChanged):
3745         (WebKit::WebContext::setAlwaysUsesComplexTextCodePath):
3746         (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
3747         (WebKit::WebContext::registerURLSchemeAsSecure):
3748         (WebKit::WebContext::setDomainRelaxationForbiddenForURLScheme):
3749         (WebKit::WebContext::setCacheModel):
3750         (WebKit::WebContext::setDefaultRequestTimeoutInterval):
3751         (WebKit::WebContext::clearResourceCaches):
3752         (WebKit::WebContext::clearApplicationCache):
3753         (WebKit::WebContext::setEnhancedAccessibility):
3754         (WebKit::WebContext::startMemorySampler):
3755         Use sendToAllProcesses.
3756
3757         (WebKit::WebContext::stopMemorySampler):
3758         Use sendToAllProcesses. This is a slight policy change where we now create a sandbox extension even
3759         if there's no process around. Since this is a debugging tool it seems OK to do this.
3760
3761         * UIProcess/WebContext.h:
3762         Get rid of hasValidProcess.
3763
3764         (WebKit::WebContext::sendToAllProcesses):
3765         If we have a process and we can send messages to it, then do so.
3766
3767         (WebKit::WebContext::sendToAllProcessesRelaunchingThemIfNecessary):
3768         Relaunch the web process and send the message.
3769
3770         * UIProcess/WebCookieManagerProxy.cpp:
3771         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
3772         (WebKit::WebCookieManagerProxy::deleteAllCookies):
3773         (WebKit::WebCookieManagerProxy::startObservingCookieChanges):
3774         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
3775         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
3776         Use sendToAllProcesses and sendToAllProcessesRelaunchingThemIfNecessary.
3777
3778 2011-04-04  Adam Roben  <aroben@apple.com>
3779
3780         Move a teensy bit of non-Mac-specific code up to LayerTreeHostCA
3781
3782         Fixes <http://webkit.org/b/57774> LayerTreeHostCA should know how to flip the root layer
3783
3784         Reviewed by Anders Carlsson.
3785
3786         * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
3787         (WebKit::LayerTreeHostCA::initialize): Cross-platformized and moved some code here...
3788
3789         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
3790         (WebKit::LayerTreeHostCAMac::platformInitialize): ...from here.
3791
3792 2011-04-01  Enrica Casucci  <enrica@apple.com>
3793
3794         Reviewed by Darin Adler.
3795
3796         WK2: Reproducible crash when dragging out of or over Safari window.
3797         https://bugs.webkit.org/show_bug.cgi?id=57654
3798         <rdar://problem/9139755>
3799         
3800         AppKit does not retain the owner given to the pasteboard, therefore we
3801         need to give the ownership of the retained pointer to NSPasteboard.
3802         Also, dragImage will release the NSFilePromiseDragSource object, therefore
3803         we retain it before calling dragImage to be able to control its lifetime.
3804         
3805         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3806         (WebKit::WebDragClient::declareAndWriteDragImage): Passing ownership
3807         of the pointer to AppKit when providing the owner pointer to the NSPasteboard
3808         object.
3809         * WebProcess/WebPage/mac/WebPageMac.mm:
3810         (WebKit::WebPage::platformDragEnded): Retaining the NSFilePromiseDragSource
3811         since dragImage will release it.
3812
3813 2011-03-30  Jer Noble  <jer.noble@apple.com>
3814
3815         Reviewed by Dan Bernstein.
3816
3817         WebKit2: No "open in preview" contextual menu item for PDFs
3818         https://bugs.webkit.org/show_bug.cgi?id=57527
3819
3820         Add support for opening a PDF in the associated application from the
3821         context menu.
3822
3823         * UIProcess/API/mac/PDFViewController.mm:
3824         (_applicationInfoForMIMEType): Added, copied from WebKit/WebPDFView.mm
3825         (-[WKPDFView _openWithFinder:]): Added.
3826         (-[WKPDFView hitTest:]): Added, copied from WebKit/WebPDFView.mm.
3827         (-[WKPDFView menuForEvent:]): Added, adapted from WebKit/WebPDFVie.mm.
3828         (-[WKPDFView validateUserInterfaceItem:]): Added.
3829
3830 2011-04-04  Chang Shu  <cshu@webkit.org>
3831
3832         Reviewed by Darin Adler.
3833
3834         WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
3835         https://bugs.webkit.org/show_bug.cgi?id=57572
3836
3837         * Shared/WebPreferencesStore.cpp:
3838         (WebKit::WebPreferencesStore::decode):
3839         (WebKit::WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner):
3840         * Shared/WebPreferencesStore.h:
3841         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3842         (WKBundleSetAllowFileAccessFromFileURLs):
3843         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3844         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3845         (WebKit::InjectedBundle::setAllowFileAccessFromFileURLs):
3846         * WebProcess/InjectedBundle/InjectedBundle.h:
3847
3848 2011-04-04  Brady Eidson  <beidson@apple.com>
3849
3850         Reviewed by Darin Adler.
3851
3852         https://bugs.webkit.org/show_bug.cgi?id=57683
3853         Flesh out WK2 Icon Database API
3854
3855         For now the new API will add a client interface where the WK1 version used NSNotifications.
3856
3857         If we decide we'd like the granularity of specific callback functions later, 
3858         they can easily be added on.
3859
3860         Project file nonsense:
3861         * GNUmakefile.am:
3862         * WebKit2.pro:
3863         * WebKit2.xcodeproj/project.pbxproj:
3864         * win/WebKit2.vcproj:
3865
3866         Add a WKIconDatabaseClient and some new API:
3867         * UIProcess/API/C/WKIconDatabase.cpp:
3868         (WKIconDatabaseSetIconDatabaseClient):
3869         (WKIconDatabaseRemoveAllIcons):
3870         (WKIconDatabaseCheckIntegrityBeforeOpening):
3871         * UIProcess/API/C/WKIconDatabase.h:
3872         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
3873         (WKIconDatabaseTryGetCGImageForURL): Renamed to "try" for subtle clarification.
3874         * UIProcess/API/C/cg/WKIconDatabaseCG.h:
3875
3876         Implementations for the new APIs:
3877         * UIProcess/WebIconDatabase.cpp:
3878         (WebKit::WebIconDatabase::retainIconForPageURL): Remove excessive logging.
3879         (WebKit::WebIconDatabase::releaseIconForPageURL): Ditto.
3880         (WebKit::WebIconDatabase::imageForPageURL):
3881         (WebKit::WebIconDatabase::removeAllIcons):
3882         (WebKit::WebIconDatabase::checkIntegrityBeforeOpening):
3883         (WebKit::WebIconDatabase::initializeIconDatabaseClient):
3884         (WebKit::WebIconDatabase::didImportIconURLForPageURL): Dispatch a client callback,
3885           much like the WK1 API uses notifications.
3886         (WebKit::WebIconDatabase::didImportIconDataForPageURL): Ditto.
3887         (WebKit::WebIconDatabase::didChangeIconForPageURL): Ditto.
3888         (WebKit::WebIconDatabase::didRemoveAllIcons): Ditto.
3889         * UIProcess/WebIconDatabase.h:
3890         * UIProcess/WebIconDatabaseClient.cpp: Added.
3891         (WebKit::WebIconDatabaseClient::didChangeIconForPageURL):
3892         (WebKit::WebIconDatabaseClient::didRemoveAllIcons):
3893         * UIProcess/WebIconDatabaseClient.h: Added.
3894
3895 2011-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3896
3897         Reviewed by Martin Robinson.
3898
3899         [GTK] Main loop sources are leaked in RunLoopGtk
3900         https://bugs.webkit.org/show_bug.cgi?id=57618
3901
3902         * Platform/RunLoop.h:
3903         (RunLoop::TimerBase::isRepeating):
3904         * Platform/gtk/RunLoopGtk.cpp:
3905         (RunLoop::~RunLoop): Make sure main loop is currently running
3906         before calling g_main_loop_quit(), RunLoop::stop() might have been
3907         called.
3908         (RunLoop::wakeUp): Use an idle source with default priority
3909         instead of a timeout one with a 0 interval.
3910         (RunLoop::TimerBase::clearTimerSource): New method to clear the
3911         timer.
3912         (RunLoop::TimerBase::destroyNotifyCallback): Destroy notify
3913         callback called when the source is destroyed to clear the timer.
3914         (RunLoop::TimerBase::timerFiredCallback): Use the same callback for
3915         repeating and no repeating timers.
3916         (RunLoop::TimerBase::start): g_source_attach() increments the
3917         source reference counter, so use GRefPtr to make sure the source
3918         is freed.
3919         (RunLoop::TimerBase::stop): Use clearTimerSource().
3920
3921 2011-04-03  Dan Bernstein  <mitz@apple.com>
3922
3923         Build fix.
3924
3925         * Shared/DictionaryPopupInfo.cpp:
3926         (WebKit::DictionaryPopupInfo::encode):
3927         (WebKit::DictionaryPopupInfo::decode):
3928         * Shared/DictionaryPopupInfo.h:
3929
3930 2011-04-03  Dan Bernstein  <mitz@apple.com>
3931
3932         Reviewed by Maciej Stachowiak.
3933
3934         <rdar://problem/9227839> REGRESSION: Reproducible crash in Snow Leopard when trying to show the Dictionary panel or application
3935         https://bugs.webkit.org/show_bug.cgi?id=57739
3936
3937         * Shared/DictionaryPopupInfo.cpp:
3938         (WebKit::DictionaryPopupInfo::encode): Do not encode the options dictionary on Snow Leopard.
3939         (WebKit::DictionaryPopupInfo::decode): Do not decode the options dictionary on Snow Leopard.
3940         * Shared/DictionaryPopupInfo.h: Removed the options member variable on Snow Leopard.
3941         * Shared/Plugins/PluginQuirks.h:
3942         * WebProcess/WebPage/mac/WebPageMac.mm:
3943         (WebKit::WebPage::performDictionaryLookupForRange): Do not set the options member variable on
3944         Snow Leopard.
3945
3946 2011-04-02  Sam Weinig  <sam@webkit.org>
3947
3948         Reviewed by Beth Dakin.
3949
3950         https://bugs.webkit.org/show_bug.cgi?id=57605
3951         Frame::pageScaleFactor() should not affect getBoundingClientRect() or 
3952         getClientRects()
3953         -and corresponding-
3954         <rdar://problem/9194541>
3955
3956         Add DRT support for the scaleWebView SPI.
3957         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3958         (WKBundlePageSetScaleAtOrigin):
3959         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
3960
3961 2011-04-02  Sam Weinig  <sam@webkit.org>
3962
3963         Reviewed by Oliver Hunt.
3964
3965         "Search in Spotlight" broken in WebKit2
3966         https://bugs.webkit.org/show_bug.cgi?id=57712
3967
3968         Proxy spotlight searching to the UIProcess.
3969
3970         * UIProcess/WebPageProxy.messages.in:
3971         Add new message. Re-organize messages to put all mac specific ones together.
3972
3973         * UIProcess/WebPageProxy.h:
3974         * UIProcess/mac/WebPageProxyMac.mm:
3975         (WebKit::WebPageProxy::speak):
3976         (WebKit::WebPageProxy::searchWithSpotlight):
3977         Moved code to trigger spotlight here. Use WTF::String -> NSString conversion function
3978         instead of relying on the built in conversion since it doesn't always work in the UIProcess.
3979
3980         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
3981         (WebKit::WebContextMenuClient::searchWithSpotlight):
3982         Post message to the UIProcess to do the searching.
3983
3984 2011-04-02  Jeff Miller  <jeffm@apple.com>
3985
3986         Reviewed by Dan Bernstein.
3987
3988         WebKit2: Specify the certificate store in WKBundleSetClientCertificate()
3989         https://bugs.webkit.org/show_bug.cgi?id=57707
3990
3991         Include the name of the system certificate store that the client certificate came from in WKBundleSetClientCertificate().
3992
3993         The PCCERT_CONTEXT for the client certificate we create from the message from the UI process doesn't contain enough information to actually use it in a request, we need to get the real certificate from the certificate store (which is typically the "MY" store).
3994
3995         * WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp:
3996         (WKBundleSetClientCertificate): Add certificateSystemStoreName to parameters.
3997         * WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h: Add certificateSystemStoreName to WKBundleSetClientCertificate() parameters.
3998         * WebProcess/InjectedBundle/InjectedBundle.h: Add certificateSystemStoreName to setClientCertificate() parameters.
3999         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
4000         (WebKit::InjectedBundle::setClientCertificate): Read the real certificate from the certificate store.
4001
4002 2011-04-02  Sam Weinig  <sam@webkit.org>
4003
4004         Reviewed by Dan Bernstein.
4005
4006         Implement WKBundleFrameHasHorizontalScrollbar/WKBundleFrameHasVerticalScrollbar
4007         <rdar://problem/9225772>
4008         https://bugs.webkit.org/show_bug.cgi?id=57709
4009
4010         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
4011         (WKBundleFrameHasHorizontalScrollbar):
4012         (WKBundleFrameHasVerticalScrollbar):
4013         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
4014         * WebProcess/WebPage/WebFrame.cpp:
4015         (WebKit::WebFrame::hasHorizontalScrollbar):
4016         (WebKit::WebFrame::hasVerticalScrollbar):
4017         * WebProcess/WebPage/WebFrame.h:
4018
4019 2011-04-01  Jon Lee  <jonlee@apple.com>
4020
4021         Reviewed by Darin Adler.
4022
4023         WebKit2: Type-to-select doesn't work in open <select> menu (53023)
4024         https://bugs.webkit.org/show_bug.cgi?id=53023
4025         <rdar://problem/8907678>
4026
4027         * UIProcess/WebPageProxy.h:
4028         * UIProcess/WebPageProxy.messages.in: adding new setPopupMenuSelectedIndex message for windows platform
4029         * UIProcess/win/WebPageProxyWin.cpp:
4030         (WebKit::WebPageProxy::setPopupMenuSelectedIndex):
4031         * UIProcess/win/WebPopupMenuProxyWin.h: moving setFocusedIndex() into public method
4032         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
4033         (WebKit::WebPopupMenu::updateFromElement): send message back to UIProcess to update the selected element
4034
4035 2011-04-01  Alexey Proskuryakov  <ap@apple.com>
4036
4037         Reviewed by Darin Adler.
4038
4039         REGRESSION: Assertion failure when executing a complex custom key binding
4040         https://bugs.webkit.org/show_bug.cgi?id=57681
4041
4042         Also completes a fix for
4043         <rdar://problem/9063782> WebKit2: Text fields in Safari don't honor custom key bindings
4044
4045         * UIProcess/API/mac/WKView.mm: (-[WKView hasMarkedText]): There is no need to execute saved
4046         commands when they can't possibly change the result.
4047
4048 2011-04-01  Brian Weinstein  <bweinstein@apple.com>
4049
4050         Reviewed by Anders Carlsson.
4051
4052         Crash when calling WebPageProxy::setMemoryCacheClientCallsEnabled with an invalid Web Process
4053         https://bugs.webkit.org/show_bug.cgi?id=57680
4054         <rdar://problem/9202909>
4055
4056         * UIProcess/WebPageProxy.cpp:
4057         (WebKit::WebPageProxy::setMemoryCacheClientCallsEnabled): Add an isValid check before sending
4058             the message.
4059
4060 2011-03-31  Jer Noble  <jer.noble@apple.com>
4061
4062         Reviewed by Dan Bernstein.
4063
4064         WebKit2: Save as PDF in Safari provides Untitled as default file name
4065         https://bugs.webkit.org/show_bug.cgi?id=57529
4066
4067         Set the NSPrintOperation's jobTitle to the printing frame's title.
4068
4069         * UIProcess/API/mac/WKView.mm:
4070         (-[WKView printOperationWithPrintInfo:forFrame:]):
4071
4072 2011-04-01  Jer Noble  <jer.noble@apple.com>
4073
4074         Reviewed by Darin Adler.
4075
4076         WebKit2: Link from PDF opens in a new tab instead of in the same tab
4077         https://bugs.webkit.org/show_bug.cgi?id=57528
4078
4079         Notify the WebProcess that a link has been clicked so that the normal policy
4080         lookup can occur.
4081
4082         * Shared/WebEvent.cpp:
4083         (WebKit::WebEvent::WebEvent): Initialize ivars in the default constructor.
4084         * Shared/WebEvent.h: Add WebEvent::NoType to Type enum.
4085         * Shared/WebMouseEvent.cpp: 
4086         (WebKit::WebMouseEvent::WebMouseEvent): Ditto.
4087         * UIProcess/API/mac/PDFViewController.mm:
4088         (-[WKPDFView PDFViewWillClickOnLink:withURL:]): Handle the delegate
4089             function and override the PDFView default behavior.
4090         * UIProcess/WebPageProxy.cpp:
4091         (WebKit::WebPageProxy::didReceiveEvent): Handle the new WebEvent::NoType enum.
4092         (WebKit::WebPageProxy::linkClicked): Added.  Send event through to WebPage.
4093         * UIProcess/WebPageProxy.h:
4094         * WebProcess/WebPage/WebPage.cpp:
4095         (WebKit::WebPage::linkClicked): Added.  Call loadFrameRequest().