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