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