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