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