2011-01-07 James Robinson <jamesr@chromium.org>
[WebKit-https.git] / WebKit2 / ChangeLog
1 2011-01-07  James Robinson  <jamesr@chromium.org>
2
3         Revert "Implement mozilla's animationTime property"
4         https://bugs.webkit.org/show_bug.cgi?id=51952
5
6         This approach isn't quite right.
7
8         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
9         (WebKit::ChunkedUpdateDrawingArea::display):
10         (WebKit::ChunkedUpdateDrawingArea::setSize):
11         * WebProcess/WebPage/WebPage.cpp:
12         (WebKit::WebPage::drawRect):
13         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
14         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
15
16 2011-01-07 Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com>
17
18         Reviewed by Martin Robinson.
19
20         [GTK] WebKit2 GNUmakefile is out of date from trunk
21         Adding new stub files for compiling on latest revision
22         https://bugs.webkit.org/show_bug.cgi?id=51883
23
24         * UIProcess/gtk: Added.
25         * UIProcess/gtk/TextCheckerGtk.cpp: Added.
26         (WebKit::TextChecker::state):
27         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
28         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
29         (WebKit::TextChecker::setGrammarCheckingEnabled):
30         (WebKit::TextChecker::uniqueSpellDocumentTag):
31         (WebKit::TextChecker::closeSpellDocumentWithTag):
32         (WebKit::TextChecker::checkTextOfParagraph):
33         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
34         (WebKit::TextChecker::getGuessesForWord):
35         (WebKit::TextChecker::learnWord):
36         (WebKit::TextChecker::ignoreWord):
37         * UIProcess/gtk/WebInspectorGtk.cpp: Added.
38         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
39         (WebKit::WebInspectorProxy::platformOpen):
40         (WebKit::WebInspectorProxy::platformClose):
41         (WebKit::WebInspectorProxy::inspectorPageURL):
42         * UIProcess/gtk/WebPageProxyGtk.cpp: Added.
43         (WebKit::WebPageProxy::standardUserAgent):
44         * UIProcess/gtk/WebPreferencesGtk.cpp: Added.
45         (WebKit::WebPreferences::platformInitializeStore):
46         (WebKit::WebPreferences::platformUpdateStringValueForKey):
47         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
48         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
49         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp: Added.
50         (WebKit::WebContextMenuClient::lookUpInDictionary):
51         (WebKit::WebContextMenuClient::isSpeaking):
52         (WebKit::WebContextMenuClient::speak):
53         (WebKit::WebContextMenuClient::stopSpeaking):
54         * WebProcess/WebCoreSupport/gtk/WebDatabaseManagerGtk.cpp: Added.
55         (WebKit::WebDatabaseManager::databaseDirectory):
56         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp: Added.
57         (WebKit::WebPopupMenu::setUpPlatformData):
58         * WebProcess/WebPage/gtk: Added.
59         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp: Added.
60         (WebKit::WebInspector::localizedStringsURL):
61
62 2011-01-06  Adam Roben  <aroben@apple.com>
63
64         Don't ever call ::SetCursor(0)
65
66         Doing so makes the cursor disappear from the screen.
67
68         Fixes <http://webkit.org/b/52024> Mouse cursor flashes when moving it
69         around a WKView before the web process has finished launching
70
71         Reviewed by Jon Honeycutt.
72
73         * UIProcess/win/WebView.cpp:
74         (WebKit::WebView::onSetCursor): If we don't have a cursor to set, just
75         let Windows do its default thing (which is to set the cursor to the
76         window class's cursor, which in our case is the arrow cursor).
77         (WebKit::WebView::cursorToShow): Just return 0 when the page has
78         crashed so that we'll show the default cursor (which is the arrow
79         cursor). This change has no visible effect, but seems slightly better
80         conceptually.
81         (WebKit::WebView::updateNativeCursor): Don't do anything if we don't
82         have a cursor to set.
83
84 2011-01-06  Adam Roben  <aroben@apple.com>
85
86         Fill the WKView with white when the web process hasn't drawn anything
87         yet
88
89         Fixes <http://webkit.org/b/52023> WKView accumulates pixel garbage
90         before web process has had a chance to draw anything (if Aero is
91         disabled)
92
93         Reviewed by Jon Honeycutt.
94
95         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
96         (WebKit::ChunkedUpdateDrawingAreaProxy::paint):
97         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
98         * UIProcess/DrawingAreaProxy.h:
99         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
100         (WebKit::LayerBackedDrawingAreaProxy::paint):
101         * UIProcess/LayerBackedDrawingAreaProxy.h:
102         * UIProcess/TiledDrawingAreaProxy.cpp:
103         (WebKit::TiledDrawingAreaProxy::paint):
104         * UIProcess/TiledDrawingAreaProxy.h:
105         * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
106         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
107         * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
108         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
109         * UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp:
110         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
111         * UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp:
112         (WebKit::LayerBackedDrawingAreaProxy::paint):
113         Changed these functions to return a boolean indicating whether we
114         actually painted anything.
115
116         * UIProcess/win/WebView.cpp:
117         (WebKit::WebView::onPaintEvent): Fill with white (and don't call
118         didDraw) when the DrawingAreaProxy isn't able to paint.
119
120 2011-01-06  Jessie Berlin  <jberlin@apple.com>
121
122         Reviewed by Jon Honeycutt.
123
124         WebKit2: Need WKBundlePagePrivate equivalent of WebKit1's WebViewPrivate's setDefersCallbacks
125         https://bugs.webkit.org/show_bug.cgi?id=52038
126
127         The implementation of WebKit1's WebViewPrivate's setDefersCallbacks on both Windows and Mac
128         calls WebCore::Page::setDefersLoading.
129
130         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
131         (WKBundlePageSetDefersLoading):
132         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
133         * WebProcess/WebPage/WebPage.cpp:
134         (WebKit::WebPage::setDefersLoading):
135         * WebProcess/WebPage/WebPage.h:
136
137 2011-01-06  Brady Eidson  <beidson@apple.com>
138
139         Reviewed by Darin Adler.
140
141         <rdar://problem/8261624> and https://bugs.webkit.org/show_bug.cgi?id=47355
142         Change WebKit2 session restoring to restore the full back/forward list.
143
144         * UIProcess/WebProcessProxy.cpp:
145         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem): Let the UIProcess register its own
146           WebBackForwardListItems in its ID map upon creation.
147         * UIProcess/WebProcessProxy.h:
148
149         * UIProcess/cf/WebPageProxyCF.cpp:
150         (WebKit::WebPageProxy::restoreFromSessionStateData): Register each new list entry in the
151           UIProcess ID map.
152
153         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
154         (WebKit::WebBackForwardListProxy::addItemFromUIProcess): Add this method to register UIProcess
155           created items without doing any of the other work normally associated with adding a new back/forward item
156           (such as notifying the UIProcess).
157         * WebProcess/WebPage/WebBackForwardListProxy.h:
158
159         * WebProcess/WebPage/WebPage.cpp:
160         (WebKit::WebPage::restoreSession): Map all of the back/forward list entries from the UIProcess then
161           cause a load of the current entry.
162
163 2011-01-06  Adam Roben  <aroben@apple.com>
164
165         Always show the arrow cursor when the web process has crashed
166
167         Fixes <http://webkit.org/b/52006> WKView shows a stale cursor when the
168         web process crashes
169
170         Reviewed by Ada Chan.
171
172         * UIProcess/win/WebView.cpp:
173         (WebKit::WebView::processDidCrash):
174         (WebKit::WebView::didRelaunchProcess):
175         Update the cursor to reflect the new state.
176
177         (WebKit::WebView::cursorToShow): Always show the arrow cursor when the
178         web process has crashed.
179
180 2011-01-06  Adam Roben  <aroben@apple.com>
181
182         Reduce code duplication in WebView::updateNativeCursor
183
184         Fixes <http://webkit.org/b/52005> It's not easy to add new behavior to
185         WebView::updateNativeCursor
186
187         Reviewed by Ada Chan.
188
189         * UIProcess/win/WebView.cpp:
190         (WebKit::WebView::cursorToShow): Moved code to choose a cursor here...
191         (WebKit::WebView::updateNativeCursor): ...from here.
192
193         * UIProcess/win/WebView.h: Added cursorToShow.
194
195 2011-01-06  Adam Roben  <aroben@apple.com>
196
197         Make WKView fill with white when the web process has crashed
198
199         Previously we would just draw whatever we had last drawn into the
200         WKView (i.e., a stale picture of the web page), which was confusing
201         (because the web page would mysteriously not respond to input) and ugly
202         (because it wouldn't behave properly if the window was resized).
203
204         Fixes <http://webkit.org/b/52004> WKView keeps painting a stale
205         picture of the web page when the web process crashes
206
207         Reviewed by Ada Chan.
208
209         * UIProcess/win/WebView.cpp:
210         (WebKit::WebView::onPaintEvent): Ported code from -[WKView drawRect:]
211         to fill with white if the page is invalid or has no DrawingArea. As a
212         bonus, also ported the call to WebPageProxy::didDraw from that method.
213
214         (WebKit::WebView::processDidCrash):
215         (WebKit::WebView::didRelaunchProcess):
216         Invalidate our window so that we'll redraw with white or the new page.
217
218 2011-01-06  Adam Roben  <aroben@apple.com>
219
220         Make WKViews work on Windows after a crashed web process gets relaunched
221
222         Fixes <http://webkit.org/b/52001> Relaunching the web process fails to
223         revivify WKViews on Windows
224
225         Reviewed by Ada Chan.
226
227         * UIProcess/win/WebView.cpp:
228         (WebKit::WebView::didRelaunchProcess): Implemented by porting code from
229         -[WKView _didRelaunchProcess].
230
231 2011-01-06  Adam Roben  <aroben@apple.com>
232
233         Remove WebView::m_rect
234
235         It was only used in the constructor, and wasn't even kept up-to-date as
236         the WebView's size changed.
237
238         Fixes <http://webkit.org/b/52000> WebView::m_rect is unnecessary
239
240         Reviewed by Ada Chan.
241
242         * UIProcess/win/WebView.cpp:
243         * UIProcess/win/WebView.h:
244
245 2011-01-05  Brian Weinstein  <bweinstein@apple.com>
246
247         Reviewed by Ada Chan.
248
249         WebKit2: Should be able to call into injected bundle to ask if we should allow resource loads
250         https://bugs.webkit.org/show_bug.cgi?id=51969
251         
252         Add the ability to call into the injected bundle to ask if we should allow resource loads.
253         If the injected bundle says we should cancel, we clear out the ResourceRequest that was
254         passed into willSendRequest, which cancels the resource load.
255
256         * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Add the new callback for allowing/cancelling
257             resource loads.
258         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
259         (WebKit::InjectedBundlePageLoaderClient::shouldLoadResourceForFrame): Calls through to the client.
260         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
261         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
262         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest): Ask the InjectedBundlePageLoaderClient if we
263             should load the resource or not.
264
265 2011-01-06  Jeff Miller  <jeffm@apple.com>
266
267         Reviewed by Darin Adler.
268
269         WebKit2: Add APIs to WKBundleFrame to get content bounds and scroll offset
270         https://bugs.webkit.org/show_bug.cgi?id=51968
271
272         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
273         (WKBundleFrameGetContentBounds):
274         (WKBundleFrameGetScrollOffset):
275         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
276         Add WKBundleFrameGetContentBounds() and WKBundleFrameGetScrollOffset().
277
278 2011-01-06  James Robinson  <jamesr@chromium.org>
279
280         Reviewed by Simon Fraser.
281
282         Implement mozilla's animationTime property
283         https://bugs.webkit.org/show_bug.cgi?id=51952
284
285         Tells the page to clear the current animation time after producing a frame.
286
287         * WebProcess/WebPage/WebPage.cpp:
288         (WebKit::WebPage::drawRect):
289         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
290         (WebKit::ChunkedUpdateDrawingArea::display):
291         (WebKit::ChunkedUpdateDrawingArea::setSize):
292         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
293         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
294
295 2011-01-06  Darin Adler  <darin@apple.com>
296
297         Redo the half-done rename from the last check-in.
298         Sorry for the broken build last night.
299
300         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
301         (WebKit::WebBackForwardListProxy::removeItem): Renamed.
302         * WebProcess/WebPage/WebBackForwardListProxy.h: Updated
303         for new name.
304         * WebProcess/WebPage/WebPage.cpp:
305         (WebKit::WebPage::didRemoveBackForwardItem): Updated to
306         use the new name.
307
308 2011-01-06  Maciej Stachowiak  <mjs@apple.com>
309
310         Rubber stamped by Dan Bernstein.
311
312         Fix build for Darin's previous change w/ the obvious renaming.
313
314         * WebProcess/WebPage/WebBackForwardListProxy.h:
315         * WebProcess/WebPage/WebPage.cpp:
316         (WebKit::WebPage::didRemoveBackForwardItem):
317
318 2011-01-05  Darin Adler  <darin@apple.com>
319
320         Reviewed by Geoff Garen.
321
322         Back/Forward entries in WebKit2 leak
323         https://bugs.webkit.org/show_bug.cgi?id=51983
324
325         Besides fixing the leak, this also fixes a problem where
326         all history items were sent over to the UI process, but
327         we wanted to send only back/forward items.
328
329         * UIProcess/WebBackForwardList.cpp:
330         (WebKit::WebBackForwardList::pageClosed): Added.
331         Tells the web process about all the back/forward
332         items being removed.
333         (WebKit::WebBackForwardList::addItem): Ditto.
334         Also removed a redundant call to didChangeBackForwardList.
335         (WebKit::WebBackForwardList::clear): Ditto.
336
337         * UIProcess/WebBackForwardList.h: Added pageClosed.
338
339         * UIProcess/WebPageProxy.cpp:
340         (WebKit::WebPageProxy::close): Added a call to pageClosed.
341         (WebKit::WebPageProxy::backForwardRemovedItem): Added.
342         Sends a message to the web page in the web process.
343
344         * UIProcess/WebPageProxy.h: Added backForwardRemovedItem.
345
346         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
347         (WebKit::updateBackForwardItem): Added an itemID argument,
348         since callers will now be getting it and we don't want to
349         get it twice. Removed the code to generate an ID. Also
350         removed some local variables to make the code a little
351         tighter and clearer.
352         (WebKit::WK2NotifyHistoryItemChanged): Only call
353         updateBackForwardItem for items that already have IDs.
354         We don't want to send cross-process messages for every
355         history item; just the ones that are top level back/forward
356         items.
357         (WebKit::WebBackForwardListProxy::removeItem):
358         Added. For use when the UI process tells us to remove it.
359         (WebKit::WebBackForwardListProxy::addItem): Added code to
360         assign an ID and put this item into the maps. This is called
361         exactly once on each back/forward item.
362
363         * WebProcess/WebPage/WebBackForwardListProxy.h: Added
364         removeItem.
365
366         * WebProcess/WebPage/WebPage.cpp:
367         (WebKit::WebPage::didRemoveBackForwardItem): Added.
368
369         * WebProcess/WebPage/WebPage.h: Added didRemoveBackForwardItem.
370
371         * WebProcess/WebPage/WebPage.messages.in: Added
372         DidRemoveBackForwardItem message.
373
374 2011-01-05  Steve Falkenburg  <sfalken@apple.com>
375
376         Reviewed by Darin Adler.
377
378         Debug and Release builds on Windows clobber each other
379         https://bugs.webkit.org/show_bug.cgi?id=49185
380
381         Changes the structure of WebKitBuild build products directory so we
382         completely separate each build configuration into independent directories.
383         
384         Although we previously had per-configuration directories for obj, this change adds
385         per-configuration directories for bin, lib, obj, and include. Each configuration's
386         build products are stored within a directory inside of WebKitBuild.
387         
388         Most use of $(WebKitOutputDir) in the build files has been replaced by $(ConfigurationBuildDir),
389         defined in common.vsprops to be $(WebKitOutputDir)\$(ConfigurationName).
390
391         * win/WebKit2.make:
392         * win/WebKit2.vcproj:
393         * win/WebKit2Common.vsprops:
394         * win/WebKit2Generated.make:
395         * win/WebKit2GeneratedCommon.vsprops:
396         * win/WebKit2WebProcessPostBuild.cmd:
397         * win/WebKit2WebProcessPreBuild.cmd:
398         * win/WebKitPostBuild.cmd:
399         * win/WebKitPreBuild.cmd:
400
401 2011-01-05  Alexey Proskuryakov  <ap@apple.com>
402
403         Reviewed by Anders Carlsson.
404
405         https://bugs.webkit.org/show_bug.cgi?id=51973
406         Make main frame PDF printing work
407
408         * UIProcess/API/mac/PDFViewController.h:
409         * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewController::makePrintOperation):
410         Ask PDFDocument to create an NSPrintOperation.
411
412         * UIProcess/API/mac/WKView.h:
413         * UIProcess/API/mac/WKView.mm:
414         (-[WKView printOperationWithPrintInfo:forFrame:]): Create a new NSPrintOperation, either
415         from scratch or from a PDF view.
416         (-[WKView canPrintHeadersAndFooters]): Report if the view can be re-paginated to add headers
417         and footers.
418
419 2011-01-05  Anders Carlsson  <andersca@apple.com>
420
421         Reviewed by Sam Weinig.
422
423         <rdar://problem/8750248>
424         Need a way to create a new DownloadProxy from an arbitrary resource request
425
426         <rdar://problem/8750465>
427         Need a way to start a download in WKDownload
428         
429         <rdar://problem/8752204>
430         WK2 Context Menus - "Save linked file" support
431
432         * Shared/ContextMenuState.h: Added.
433         Add a ContextMenuState struct which contains state for context menus.
434
435         * UIProcess/API/C/WKContext.cpp:
436         (WKContextDownloadURLRequest):
437         Call WebContext::download.
438
439         * UIProcess/WebContext.cpp:
440         (WebKit::WebContext::download):
441         Send a DownloadRequest message to the web process.
442
443         * UIProcess/WebPageProxy.cpp:
444         (WebKit::WebPageProxy::showContextMenu):
445         Set the active context menu state.
446
447         (WebKit::WebPageProxy::contextMenuItemSelected):
448         Handle ContextMenuItemTagDownloadImageToDisk and ContextMenuItemTagDownloadLinkToDisk by calling
449         WebContext::Download, passing the respective URLs.
450
451         * UIProcess/WebPageProxy.messages.in:
452         ShowContextMenu now takes state as well.
453
454         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
455         (WebKit::WebContextMenuClient::downloadURL):
456         Assert that this is never reached; downloads are handled in the UI process.
457
458         * WebProcess/WebPage/WebContextMenu.cpp:
459         (WebKit::WebContextMenu::show):
460         Pass the context menu state along when sending the ShowContextMenu message.
461
462         * WebProcess/WebProcess.cpp:
463         (WebKit::WebProcess::downloadRequest):
464         Call the shared DownloadManager.
465
466         * WebProcess/WebProcess.messages.in:
467         Add DownloadRequest message.
468
469         * WebKit2.xcodeproj/project.pbxproj:
470         * win/WebKit2.vcproj:
471         Add ContextMenuState.h.
472
473 2011-01-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
474
475         Unreviewed build fix.
476
477         [Qt] [Symbian] Fix building NPAPI support
478
479         NPEvent is mapped to QAction on Symbian. QAction has no
480         default constructor, so toNP() fails to build. Add a case for
481         Symbian behind the OS(SYMBIAN) guard.
482
483         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
484         (WebKit::toNP):
485
486 2011-01-05  Jeff Miller  <jeffm@apple.com>
487
488         Reviewed by Dan Bernstein.
489
490         Copy WKImageCG.h to include\WebKit2 in build output
491         https://bugs.webkit.org/show_bug.cgi?id=51944
492
493         * win/WebKit2Generated.make:
494         Add xcopy command to copy WKImageCG.h.
495
496 2011-01-05  Brady Eidson  <beidson@apple.com>
497
498         Reviewed by Sam Weinig.
499
500         Part of <rdar://problem/8261624> and https://bugs.webkit.org/show_bug.cgi?id=47355
501         Change WebKit2 session restoring to restore the full back/forward list
502
503         Add a new message to tell the WebProcess to restore a session state:
504         * WebProcess/WebPage/WebPage.cpp:
505         (WebKit::WebPage::restoreSession):
506         * WebProcess/WebPage/WebPage.h:
507         * WebProcess/WebPage/WebPage.messages.in: Add the new message, AND fix the intentional misspellings.
508         
509         Also, Sam sucks.
510
511         Change WebProcess back/forward list item ids to be odd (UIProcess's will be even):
512         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
513         (WebKit::generateHistoryItemID):
514
515         Provide accessors to the entries in the list to pass to the WebProcess:
516         * UIProcess/WebBackForwardList.h:
517         (WebKit::WebBackForwardList::entries):
518         (WebKit::WebBackForwardList::currentIndex):
519
520         Add decoding of the saved back/forward list itmes (we already encode them):
521         * UIProcess/cf/WebBackForwardListCF.cpp:
522         (WebKit::generateWebBackForwardItemID):
523         (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation):
524
525         Instead of loading the current URL, pass the entire last back to the WebProcess:
526         * UIProcess/cf/WebPageProxyCF.cpp:
527         (WebKit::WebPageProxy::restoreFromSessionStateData):
528
529 2011-01-05  Brady Eidson  <beidson@apple.com>
530
531         Reviewed by Darin Adler.
532
533         https://bugs.webkit.org/show_bug.cgi?id=51953
534         Add a "SessionState" object for IPC messaging.
535
536         This object includes all data necessary to restore a session state;
537         For now, this is just the back/forward list to restore.
538
539         * Shared/SessionState.cpp: Added.
540         (WebKit::SessionState::SessionState):
541         (WebKit::SessionState::encode):
542         (WebKit::SessionState::decode):
543         * Shared/SessionState.h: Added.
544         (WebKit::SessionState::list):
545         (WebKit::SessionState::currentIndex):
546
547         * WebKit2.pro:
548         * WebKit2.xcodeproj/project.pbxproj:
549         * win/WebKit2.vcproj:
550
551 2011-01-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
552
553         Unreviewed build fix.
554
555         Include unistd.h for _exit() for non-Windows builds.
556
557         Build break noticed on QtWebkit Symbian builds.
558
559         * Shared/ChildProcess.cpp:
560
561 2011-01-05  Brady Eidson  <beidson@apple.com>
562
563         Reviewed by Darin Adler.
564
565         https://bugs.webkit.org/show_bug.cgi?id=51949
566         Make WebBackForwardListItem shared, and add encoders and decoders
567
568         * Shared/WebBackForwardListItem.cpp: Copied from UIProcess/WebBackForwardListItem.cpp.
569         (WebKit::WebBackForwardListItem::encode):
570         (WebKit::WebBackForwardListItem::decode):
571         * Shared/WebBackForwardListItem.h: Copied from UIProcess/WebBackForwardListItem.h.
572         * UIProcess/WebBackForwardListItem.cpp: Removed.
573         * UIProcess/WebBackForwardListItem.h: Removed.
574
575         * WebKit2.pro:
576         * WebKit2.xcodeproj/project.pbxproj:
577         * win/WebKit2.vcproj:
578
579 2011-01-05  Anders Carlsson  <andersca@apple.com>
580
581         Reviewed by Sam Weinig.
582
583         Handle smart insert/delete
584         https://bugs.webkit.org/show_bug.cgi?id=51946
585
586         * Shared/WebPageCreationParameters.cpp:
587         (WebKit::WebPageCreationParameters::encode):
588         (WebKit::WebPageCreationParameters::decode):
589         * Shared/WebPageCreationParameters.h:
590         Add isSmartInsertDelete enabled.
591
592         * UIProcess/API/mac/WKView.mm:
593         (-[WKView validateUserInterfaceItem:]):
594         Handle toggleSmartInsertDelete:.
595
596         (-[WKView toggleSmartInsertDelete:]):
597         Toggle the smart insert/delete state.
598
599         * UIProcess/TextChecker.h:
600         Add isSmartInsertDeleteEnabled and setSmartInsertDeleteEnabled.
601
602         * UIProcess/WebPageProxy.cpp:
603         (WebKit::WebPageProxy::WebPageProxy):
604         Initialize m_isSmartInsertDeleteEnabled.
605
606         (WebKit::WebPageProxy::contextMenuItemSelected):
607         Handle ContextMenuItemTagSmartCopyPaste.
608
609         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
610         Update the state and send a SetSmartInsertDeleteEnabled message.
611
612         (WebKit::WebPageProxy::creationParameters):
613         Initialize isSmartInsertDeleteEnabled.
614
615         * UIProcess/WebPageProxy.h:
616         (WebKit::WebPageProxy::isSmartInsertDeleteEnabled):
617         Return m_isSmartInsertDeleteEnabled.
618
619         * UIProcess/mac/TextCheckerMac.mm:
620         (WebKit::TextChecker::isSmartInsertDeleteEnabled):
621         (WebKit::TextChecker::setSmartInsertDeleteEnabled):
622         Store and fetch the smart insert delete state.
623
624         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
625         (WebKit::WebEditorClient::smartInsertDeleteEnabled):
626         Call WebPage::isSmartInsertDeleteEnabled.
627
628         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
629         (WebKit::WebEditorClient::toggleSmartInsertDelete):
630         Assert that this is never called.
631
632         * WebProcess/WebPage/WebPage.cpp:
633         (WebKit::WebPage::WebPage):
634         Initialize m_isSmartInsertDeleteEnabled
635
636         * WebProcess/WebPage/WebPage.h:
637         (WebKit::WebPage::isSmartInsertDeleteEnabled):
638         (WebKit::WebPage::setSmartInsertDeleteEnabled):
639         Add getter and setter.
640
641         * WebProcess/WebPage/WebPage.messages.in:
642         Add SetSmartInsertDeleteEnabled message.
643
644 2011-01-05  Anders Carlsson  <andersca@apple.com>
645
646         Fix Windows build.
647         
648         * WebProcess/WebPage/WebPage.cpp:
649
650 2011-01-05  Anders Carlsson  <andersca@apple.com>
651
652         Reviewed by Adele Peterson.
653
654         Implement word transformation
655         https://bugs.webkit.org/show_bug.cgi?id=51943
656
657         * UIProcess/API/mac/WKView.mm:
658         (-[WKView validateUserInterfaceItem:]):
659         Handle the word transformation selectors.
660
661         (-[WKView uppercaseWord:]):
662         (-[WKView lowercaseWord:]):
663         (-[WKView capitalizeWord:]):
664         Call down to the WebPageProxy.
665
666         * UIProcess/WebPageProxy.cpp:
667         (WebKit::WebPageProxy::uppercaseWord):
668         (WebKit::WebPageProxy::lowercaseWord):
669         (WebKit::WebPageProxy::capitalizeWord):
670         Send messages to the WebPage.
671
672         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
673         (WebKit::changeWordCase):
674         Add helper function.
675
676         (WebKit::WebEditorClient::uppercaseWord):
677         (WebKit::WebEditorClient::lowercaseWord):
678         (WebKit::WebEditorClient::capitalizeWord):
679         Call helper function.
680
681         * WebProcess/WebPage/WebPage.cpp:
682         (WebKit::WebPage::changeSpellingToWord):
683         Call replaceSelectionWithText.
684
685         (WebKit::WebPage::uppercaseWord):
686         (WebKit::WebPage::lowercaseWord):
687         (WebKit::WebPage::capitalizeWord):
688         Call the editor functions.
689
690         (WebKit::WebPage::replaceSelectionWithText):
691         New helper function that replaces the selected string with another string.
692
693         * WebProcess/WebPage/WebPage.messages.in:
694         Add new messages.
695
696 2011-01-05  Alexey Proskuryakov  <ap@apple.com>
697
698         Reviewed by Anders Carlsson.
699
700         https://bugs.webkit.org/show_bug.cgi?id=51935
701         Add WebKit2 API for largest frame
702
703         * UIProcess/API/C/WKPage.cpp:
704         (WKPageGetFrameSetLargestFrame):
705         * UIProcess/API/C/WKPage.h:
706
707 2011-01-05  Anders Carlsson  <andersca@apple.com>
708
709         Reviewed by Sam Weinig.
710
711         More work on spelling
712         https://bugs.webkit.org/show_bug.cgi?id=51939
713
714         * UIProcess/API/mac/WKView.mm:
715         (-[WKView validateUserInterfaceItem:]):
716         Handle changeSpelling: as well.
717
718         (-[WKView showGuessPanel:]):
719         Show or hide the guess panel.
720
721         (-[WKView checkSpelling:]):
722         Pass false to advanceToNextMisspelling.
723
724         (-[WKView changeSpelling:]):
725         Call changeSpellingToWord.
726
727         * UIProcess/TextChecker.h:
728         * UIProcess/WebPageProxy.cpp:
729         (WebKit::WebPageProxy::WebPageProxy):
730         Initialize m_pendingLearnOrIgnoreWordMessageCount.
731
732         (WebKit::WebPageProxy::contextMenuItemSelected):
733         Handle smart toggles directly in the UI process, keep track of whether
734         we're asked to learn or ignore a word.
735
736         (WebKit::WebPageProxy::advanceToNextMisspelling):
737         Pass the boolean through.
738
739         (WebKit::WebPageProxy::changeSpellingToWord):
740         Send a ChangeSpellingToWord message.
741
742         (WebKit::WebPageProxy::learnWord):
743         (WebKit::WebPageProxy::ignoreWord):
744         Check that we do have a pending learn or ignore word message. Call through to
745         the text checker.
746
747         (WebKit::WebPageProxy::processDidCrash):
748         Reset the m_pendingLearnOrIgnoreWordMessageCount variable.
749
750         * UIProcess/WebPageProxy.h:
751         * UIProcess/WebPageProxy.messages.in:
752         Add new messages.
753
754         * UIProcess/mac/TextCheckerMac.mm:
755         (WebKit::TextChecker::learnWord):
756         (WebKit::TextChecker::ignoreWord):
757         Implement in terms of NSSpellChecker.
758
759         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
760         (WebKit::WebEditorClient::ignoreWordInSpellDocument):
761         (WebKit::WebEditorClient::learnWord):
762         Send IgnoreWord and LearnWord messages.
763
764         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
765         (WebKit::WebEditorClient::toggleAutomaticQuoteSubstitution):
766         (WebKit::WebEditorClient::toggleAutomaticLinkDetection):
767         (WebKit::WebEditorClient::toggleAutomaticDashSubstitution):
768         (WebKit::WebEditorClient::toggleAutomaticTextReplacement):
769         Add assertions.
770
771         * WebProcess/WebPage/WebPage.cpp:
772         (WebKit::WebPage::advanceToNextMisspelling):
773         Pass the bool along to the Editor.
774
775         (WebKit::WebPage::changeSpellingToWord):
776         Replace the selected text.
777
778         * WebProcess/WebPage/WebPage.messages.in:
779         Add new ChangeSpellingToWord message and add a boolean to AdvanceToNextMisspelling.
780
781 2011-01-05  Anders Carlsson  <andersca@apple.com>
782
783         Reviewed by Dan Bernstein.
784
785         Keep track of active text substitution preferences
786         https://bugs.webkit.org/show_bug.cgi?id=51931
787
788         * Shared/TextCheckerState.h:
789         * UIProcess/API/mac/WKView.mm:
790         (-[WKView validateUserInterfaceItem:]):
791         Handle new selectors, mostly copied from WebKit1 code.
792
793         (-[WKView orderFrontSubstitutionsPanel:]):
794         Open the substitution panel.
795
796         (-[WKView isAutomaticQuoteSubstitutionEnabled]):
797         (-[WKView setAutomaticQuoteSubstitutionEnabled:]):
798         (-[WKView toggleAutomaticQuoteSubstitution:]):
799         (-[WKView isAutomaticDashSubstitutionEnabled]):
800         (-[WKView setAutomaticDashSubstitutionEnabled:]):
801         (-[WKView toggleAutomaticDashSubstitution:]):
802         (-[WKView isAutomaticLinkDetectionEnabled]):
803         (-[WKView setAutomaticLinkDetectionEnabled:]):
804         (-[WKView toggleAutomaticLinkDetection:]):
805         (-[WKView isAutomaticTextReplacementEnabled]):
806         (-[WKView setAutomaticTextReplacementEnabled:]):
807         (-[WKView toggleAutomaticTextReplacement:]):
808         Call the text checker, and update the state in the web process if needed.
809
810         * UIProcess/TextChecker.h:
811         Add new flags.
812
813         * UIProcess/mac/TextCheckerMac.mm:
814         (WebKit::initializeState):
815         Initialize flags from user defaults.
816
817         (WebKit::TextChecker::setAutomaticQuoteSubstitutionEnabled):
818         (WebKit::TextChecker::setAutomaticDashSubstitutionEnabled):
819         (WebKit::TextChecker::setAutomaticLinkDetectionEnabled):
820         (WebKit::TextChecker::setAutomaticTextReplacementEnabled):
821         Update and save the flags.
822
823         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
824         (WebKit::WebEditorClient::isAutomaticQuoteSubstitutionEnabled):
825         (WebKit::WebEditorClient::isAutomaticLinkDetectionEnabled):
826         (WebKit::WebEditorClient::isAutomaticDashSubstitutionEnabled):
827         (WebKit::WebEditorClient::isAutomaticTextReplacementEnabled):
828         Get the text checker state.
829
830 2011-01-05  Dan Bernstein  <mitz@apple.com>
831
832         Rubber-stamped by Darin Adler.
833
834         Cleaned up com.apple.WebProcess.sb
835
836         * WebProcess/com.apple.WebProcess.sb: Moved the closing parentheses of multi-line blocks to
837         their own lines. Changed to use WebKit-standard 4-space indentation.
838
839 2011-01-05  Alexey Proskuryakov  <ap@apple.com>
840
841         Reviewed by Sam Weinig.
842
843         https://bugs.webkit.org/show_bug.cgi?id=51903
844         Tell UI process which subframe is largest
845
846         * UIProcess/WebPageProxy.h:
847         (WebKit::WebPageProxy::frameSetLargestFrame):
848         Remember largest frame in frameset pages.
849
850         * UIProcess/WebPageProxy.cpp:
851         (WebKit::WebPageProxy::frameDidBecomeFrameSet): Reset stored largest frame if main frame
852         changes to a frameset or back.
853         (WebKit::WebPageProxy::frameSetLargestFrameChanged): Store a new largest frame when notified
854         of a change.
855
856         * UIProcess/WebPageProxy.messages.in: Added FrameSetLargestFrameChanged.
857
858         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
859         (WebKit::area): Calculate area of a frame.
860         (WebKit::findLargestFrameInFrameSet): Find largest first-level subframe in a frameset page.
861         (WebKit::WebChromeClient::contentsSizeChanged): Recalculate largest frame, and notify UI
862         process if it changed.
863
864         * WebProcess/WebCoreSupport/WebChromeClient.h: Store the latest largest frame.
865
866         * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::size):
867         * WebProcess/WebPage/WebFrame.h:
868         Expose frame size.
869
870 2011-01-04  Benjamin Poulain  <benjamin.poulain@nokia.com>
871
872         Reviewed by Kenneth Rohde Christiansen.
873
874         [Qt] [WK2] Add support for non-trivial context menu action
875         https://bugs.webkit.org/show_bug.cgi?id=51902
876
877         Implement a call back from the QAction triggered in the UIProcess to the
878         action in WebProcess.
879
880         A few basic actions have been implemented based on this feature.
881
882         * UIProcess/API/qt/qwkpage.cpp:
883         (contextMenuActionForWebAction):
884         (QWKPage::triggerAction):
885         (QWKPage::action):
886         * UIProcess/API/qt/qwkpage.h:
887         * UIProcess/qt/WebContextMenuProxyQt.cpp:
888         (WebKit::webActionForContextMenuAction):
889
890 2011-01-04  Siddharth Mathur  <siddharth.mathur@nokia.com>
891
892         Reviewed by Laszlo Gombos.
893
894         Include unistd.h for sleep() for non-Windows builds.
895
896         * WebProcess/WebProcess.cpp:
897         * WebProcess/qt/WebProcessMainQt.cpp:
898
899 2011-01-04  Brian Weinstein  <bweinstein@apple.com>
900
901         Windows build fix. Change the inline type of consumePermanently.
902
903         * Shared/SandboxExtension.h:
904         (WebKit::SandboxExtension::consumePermanently):
905
906 2011-01-04  Anders Carlsson  <andersca@apple.com>
907
908         Reviewed by Dan Bernstein.
909
910         <rdar://problem/8821203> Sandbox violations trying to access the Safari cache
911
912         * Shared/SandboxExtension.h:
913         (WebKit::SandboxExtension::consumePermanently):
914         New function which consumes a sandbox extension and destroys it, making it impossible
915         to later revoke it.
916
917         * Shared/WebProcessCreationParameters.cpp:
918         (WebKit::WebProcessCreationParameters::encode):
919         (WebKit::WebProcessCreationParameters::decode):
920         Encode and decode the path extension handle.
921
922         * Shared/mac/SandboxExtensionMac.mm:
923         (WebKit::SandboxExtension::createHandle):
924         Standardize the path before creating the handle.
925
926         * UIProcess/mac/WebContextMac.mm:
927         (WebKit::WebContext::platformInitializeWebProcess):
928         Create a sandbox extension for the cache path.
929
930         * WebProcess/mac/WebProcessMac.mm:
931         (WebKit::WebProcess::platformInitializeWebProcess):
932         Consume the sandbox extension.
933
934 2011-01-04  Anders Carlsson  <andersca@apple.com>
935
936         Fix build.
937
938         * UIProcess/mac/TextCheckerMac.mm:
939         (WebKit::TextChecker::getGuessesForWord):
940
941 2011-01-04  Jeff Miller  <jeffm@apple.com>
942
943         Reviewed by Darin Adler.
944
945         Mouse events in WebKit2 on Windows need to know whether the click activated the WebView to match WebKit1 behavior.
946         https://bugs.webkit.org/show_bug.cgi?id=51228
947
948         * Shared/WebEvent.h:
949         (WebKit::WebMouseEvent::didActivateWebView):
950         Add m_didActivateWebView to WebMouseEvent on Windows.
951
952         * Shared/WebEventConversion.cpp:
953         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
954         Propagate whether the click activated the WebView when converting to a PlatformMouseEvent.
955
956         * Shared/WebMouseEvent.cpp:
957         (WebKit::WebMouseEvent::WebMouseEvent):
958         Add m_didActivateWebView to WebMouseEvent on Windows.
959
960         (WebKit::WebMouseEvent::encode):
961         (WebKit::WebMouseEvent::decode):
962         Encode and decode new m_didActivateWebView member variable.
963
964         * Shared/win/WebEventFactory.cpp:
965         (WebKit::WebEventFactory::createWebMouseEvent):
966         * Shared/win/WebEventFactory.h:
967         Add didActivateWebView parameter to createWebMouseEvent().
968
969         * UIProcess/win/WebView.cpp:
970         (WebKit::WebView::wndProc):
971         (WebKit::WebView::WebView):
972         (WebKit::WebView::onMouseEvent):
973         * UIProcess/win/WebView.h:
974         (WebKit::WebView::setWasActivatedByMouseEvent):
975         Keep track of whether the click activated the WebView.
976
977 2011-01-04  Ivan Krstić  <ike@apple.com>
978
979         Reviewed and landed by Anders Carlsson.
980
981         <rdar://problem/8602585>
982         <rdar://problem/8711641>
983
984         * WebProcess/com.apple.WebProcess.sb:
985         Fix a misplaced right parenthesis and add a new system path regex.
986
987 2011-01-04  Anders Carlsson  <andersca@apple.com>
988
989         Reviewed by Sam Weinig.
990
991         More work on spelling and grammar
992         https://bugs.webkit.org/show_bug.cgi?id=51910
993
994         * Scripts/webkit2/messages.py:
995         Add special case for WebCore::TextCheckingResult.
996
997         * Shared/NotImplemented.h:
998         Fix macro so that defining DISABLE_NOT_IMPLEMENTED_WARNINGS to 0 will enable the warnings.
999         
1000         * Shared/WebCoreArgumentCoders.h:
1001         Add argument coders for WebCore::GrammarDetail and WebCore::TextCheckingResult.
1002
1003         * UIProcess/API/mac/WKView.mm:
1004         (-[WKView checkSpelling:]):
1005         Call advanceToNextMisspelling.
1006
1007         * UIProcess/TextChecker.h:
1008         Add new NSSpellChecker wrappers.
1009
1010         * UIProcess/WebPageProxy.cpp:
1011         (WebKit::WebPageProxy::WebPageProxy):
1012         Initialize the new member variables.
1013
1014         (WebKit::WebPageProxy::~WebPageProxy):
1015         Call TextChecker::closeSpellDocumentWithTag.
1016
1017         (WebKit::WebPageProxy::advanceToNextMisspelling):
1018         Send the AdvanceToNextMisspelling message.
1019
1020         (WebKit::WebPageProxy::spellDocumentTag):
1021         Create a spell document tag if necessary.
1022
1023         (WebKit::WebPageProxy::checkTextOfParagraph):
1024         (WebKit::WebPageProxy::updateSpellingUIWithMisspelledWord):
1025         (WebKit::WebPageProxy::getGuessesForWord):
1026         Call the TextChecker.
1027         
1028         * UIProcess/WebPageProxy.messages.in:
1029         Add new messages.
1030
1031         * UIProcess/mac/TextCheckerMac.mm:
1032         (WebKit::TextChecker::uniqueSpellDocumentTag):
1033         (WebKit::TextChecker::closeSpellDocumentWithTag):
1034         (WebKit::TextChecker::checkTextOfParagraph):
1035         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
1036         (WebKit::TextChecker::getGuessesForWord):
1037         Add NSSpellChecker wrappers.
1038
1039         * UIProcess/qt/TextCheckerQt.cpp:
1040         * UIProcess/win/TextCheckerWin.cpp:
1041         Add stubs.
1042
1043         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1044         (WebKit::WebEditorClient::isContinuousSpellCheckingEnabled):
1045         (WebKit::WebEditorClient::isGrammarCheckingEnabled):
1046         Get the text checking state from the web process.
1047
1048         (WebKit::WebEditorClient::updateSpellingUIWithMisspelledWord):
1049         (WebKit::WebEditorClient::getGuessesForWord):
1050         Proxy calls to the UI process.
1051
1052         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1053         (WebKit::WebEditorClient::isAutomaticSpellingCorrectionEnabled):
1054         
1055         (WebKit::WebEditorClient::checkTextOfParagraph):
1056         Proxy calls to the UI process.
1057
1058         * WebProcess/WebPage/WebPage.cpp:
1059         (WebKit::WebPage::advanceToNextMisspelling):
1060         Call the frame.
1061
1062         * WebProcess/WebPage/WebPage.messages.in:
1063         Add AdvanceToNextMisspelling message.
1064
1065         * WebProcess/WebProcess.cpp:
1066         (WebKit::WebProcess::initializeWebProcess):
1067         Set the text checker state.
1068
1069 2011-01-04  Chris Fleizach  <cfleizach@apple.com>
1070
1071         Unreviewed. Build fix.
1072
1073         WK2: Support Accessibility
1074         https://bugs.webkit.org/show_bug.cgi?id=51859
1075
1076         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
1077
1078 2011-01-04  Chris Fleizach  <cfleizach@apple.com>
1079
1080         Unreviewed. Build fix.
1081
1082         WK2: Support Accessibility
1083         https://bugs.webkit.org/show_bug.cgi?id=51859
1084
1085         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
1086         (-[AccessibilityWebPageObject accessibilityAttributeValue:]):
1087
1088 2011-01-04  Chris Fleizach  <cfleizach@apple.com>
1089
1090         Reviewed by Sam Weinig.
1091
1092         WK2: Support Accessibility
1093         https://bugs.webkit.org/show_bug.cgi?id=51859
1094
1095         Implement remote accessibility API to support cross process accessibility
1096         on the Mac platform.
1097
1098         * Shared/WebProcessCreationParameters.cpp:
1099         (WebKit::WebProcessCreationParameters::encode):
1100         (WebKit::WebProcessCreationParameters::decode):
1101         * Shared/WebProcessCreationParameters.h:
1102         * UIProcess/API/mac/PageClientImpl.h:
1103         * UIProcess/API/mac/PageClientImpl.mm:
1104         (WebKit::PageClientImpl::accessibilityChildTokenReceived):
1105         * UIProcess/API/mac/WKView.mm:
1106         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
1107         (-[WKView _updateWindowAndViewFrames]):
1108         (-[WKView _setAccessibilityChildToken:]):
1109         (-[WKView accessibilityIsIgnored]):
1110         (-[WKView accessibilityHitTest:]):
1111         (-[WKView accessibilityAttributeValue:]):
1112         * UIProcess/API/mac/WKViewInternal.h:
1113         * UIProcess/PageClient.h:
1114         * UIProcess/WebContext.cpp:
1115         (WebKit::WebContext::ensureWebProcess):
1116         * UIProcess/WebPageProxy.cpp:
1117         (WebKit::WebPageProxy::windowAndViewFramesChanged):
1118         (WebKit::WebPageProxy::didReceiveAccessibilityPageToken):
1119         (WebKit::WebPageProxy::sendAccessibilityPresenterToken):
1120         * UIProcess/WebPageProxy.h:
1121         * UIProcess/WebPageProxy.messages.in:
1122         * WebKit2.xcodeproj/project.pbxproj:
1123         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1124         (WebKit::WebFrameLoaderClient::accessibilityRemoteObject):
1125         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1126         * WebProcess/WebPage/WebPage.cpp:
1127         (WebKit::WebPage::windowAndViewFramesChanged):
1128         * WebProcess/WebPage/WebPage.h:
1129         (WebKit::WebPage::accessibilityPosition):
1130         * WebProcess/WebPage/WebPage.messages.in:
1131         * WebProcess/WebPage/mac/AccessibilityWebPageObject.h: Added.
1132         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm: Added.
1133         (-[AccessibilityWebPageObject setWebPage:]):
1134         (-[AccessibilityWebPageObject setRemoteParent:]):
1135         (-[AccessibilityWebPageObject dealloc]):
1136         (-[AccessibilityWebPageObject accessibilityIsIgnored]):
1137         (-[AccessibilityWebPageObject accessibilityAttributeNames]):
1138         (-[AccessibilityWebPageObject accessibilityIsAttributeSettable:]):
1139         (-[AccessibilityWebPageObject accessibilitySetValue:forAttribute:]):
1140         (-[AccessibilityWebPageObject accessibilityActionNames]):
1141         (-[AccessibilityWebPageObject accessibilityChildren]):
1142         (-[AccessibilityWebPageObject accessibilityAttributeValue:]):
1143         (-[AccessibilityWebPageObject accessibilityShouldUseUniqueId]):
1144         (-[AccessibilityWebPageObject accessibilityHitTest:]):
1145         (-[AccessibilityWebPageObject accessibilityFocusedUIElement]):
1146         * WebProcess/WebPage/mac/WebPageMac.mm:
1147         (WebKit::WebPage::platformInitialize):
1148         (WebKit::WebPage::sendAccessibilityPresenterToken):
1149         (WebKit::WebPage::accessibilityRemoteObject):
1150         * WebProcess/WebProcess.cpp:
1151         (WebKit::WebProcess::initializeWebProcess):
1152         * WebProcess/WebProcess.h:
1153         (WebKit::WebProcess::presenterApplicationPid):
1154         * WebProcess/mac/WebProcessMainMac.mm:
1155         (WebKit::WebProcessMain):
1156
1157 2011-01-04  Brady Eidson  <beidson@apple.com>
1158
1159         Reviewed by Darin Adler.
1160
1161         Get rid of an extra copy in the back/forward item IPC message by using a DataReference.
1162
1163         * UIProcess/WebBackForwardListItem.cpp:
1164         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1165         (WebKit::WebBackForwardListItem::setBackForwardData):
1166         * UIProcess/WebBackForwardListItem.h:
1167
1168         * UIProcess/WebPageProxy.cpp:
1169         (WebKit::WebPageProxy::dataCallback): Get rid of no-longer-needed check for size 0.
1170
1171         * UIProcess/WebProcessProxy.cpp:
1172         (WebKit::WebProcessProxy::addBackForwardItem):
1173         * UIProcess/WebProcessProxy.h:
1174
1175         * UIProcess/WebProcessProxy.messages.in:
1176
1177         * WebProcess/WebPage/EncoderAdapter.cpp:
1178         (WebKit::EncoderAdapter::data):
1179         * WebProcess/WebPage/EncoderAdapter.h:
1180
1181         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1182
1183 2011-01-04  Brady Eidson  <beidson@apple.com>
1184
1185         Reviewed by Darin Adler.
1186
1187         Store more data per history entry in the session state blob.
1188
1189         * UIProcess/WebBackForwardListItem.cpp:
1190         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1191         * UIProcess/WebBackForwardListItem.h:
1192         (WebKit::WebBackForwardListItem::create):
1193
1194         * UIProcess/WebProcessProxy.cpp:
1195         (WebKit::WebProcessProxy::addBackForwardItem):
1196
1197         * UIProcess/cf/WebBackForwardListCF.cpp:
1198         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
1199
1200         * UIProcess/cf/WebPageProxyCF.cpp:
1201
1202 2011-01-04  Darin Adler  <darin@apple.com>
1203
1204         Reviewed by Brady Eidson.
1205
1206         Add back/forward encoding and decoding to WebKit2
1207         https://bugs.webkit.org/show_bug.cgi?id=51901
1208
1209         * GNUmakefile.am: Added new source files.
1210         * WebKit2.pro: Ditto.
1211         * WebKit2.xcodeproj/project.pbxproj: Ditto.
1212         * win/WebKit2.vcproj: Ditto.
1213
1214         * WebProcess/WebPage/DecoderAdapter.cpp: Added.
1215         * WebProcess/WebPage/DecoderAdapter.h: Added.
1216         * WebProcess/WebPage/EncoderAdapter.cpp: Added.
1217         * WebProcess/WebPage/EncoderAdapter.h: Added.
1218
1219         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1220         (WebKit::updateBackForwardItem): Added code to encode the back/forward
1221         tree and send it along. The code to decode needs to wait on Brady's
1222         current project.
1223
1224 2011-01-04  Anders Carlsson  <andersca@apple.com>
1225
1226         Reviewed by Sam Weinig.
1227
1228         <rdar://problem/8766999> WebKit2: Sandboxing causes certificate error on access to any HTTPS URL
1229
1230         Allow read access to /Library/Preferences/com.apple.security.plist.
1231
1232         * WebProcess/com.apple.WebProcess.sb:
1233
1234 2011-01-04  Anders Carlsson  <andersca@apple.com>
1235
1236         Build fixes.
1237
1238         * UIProcess/qt/TextCheckerQt.cpp:
1239         * UIProcess/win/TextCheckerWin.cpp:
1240
1241 2011-01-04  Anders Carlsson  <andersca@apple.com>
1242
1243         Reviewed by Darin Adler.
1244
1245         Don't use macros for the key names.
1246
1247         * UIProcess/mac/TextCheckerMac.mm:
1248
1249 2011-01-04  Anders Carlsson  <andersca@apple.com>
1250
1251         Reviewed by Sam Weinig.
1252
1253         Send over text checker state to the web process
1254         https://bugs.webkit.org/show_bug.cgi?id=51896
1255
1256         * Platform/CoreIPC/Arguments.h:
1257         Remove 'const' from the argument, this matches all the other Arguments classes.
1258
1259         * Shared/TextCheckerState.h: Added.
1260         New class with text checker state.
1261
1262         * Shared/WebProcessCreationParameters.cpp:
1263         (WebKit::WebProcessCreationParameters::encode):
1264         (WebKit::WebProcessCreationParameters::decode):
1265         * Shared/WebProcessCreationParameters.h:
1266         Add textCheckerState.
1267
1268         * UIProcess/API/mac/WKView.mm:
1269         (-[WKView validateUserInterfaceItem:]):        
1270         (-[WKView toggleContinuousSpellChecking:]):
1271         (-[WKView toggleGrammarChecking:]):
1272         (-[WKView toggleAutomaticSpellingCorrection:]):
1273         Get the needed flags from the text checker state.
1274
1275         * UIProcess/TextChecker.h:
1276         Add state() function, remove getters.
1277
1278         * UIProcess/WebContext.cpp:
1279         (WebKit::WebContext::ensureWebProcess):
1280         Initialize the text checker state.
1281
1282         * UIProcess/WebProcessProxy.cpp:
1283         (WebKit::WebProcessProxy::updateTextCheckerState):
1284         Send the SetTextCheckerState message to the web process.
1285
1286         * UIProcess/mac/TextCheckerMac.mm:
1287         (WebKit::initializeState):
1288         Initialize the state from the user defaults.
1289
1290         (WebKit::TextChecker::state):
1291         Return the state.
1292
1293         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
1294         (WebKit::TextChecker::setGrammarCheckingEnabled):
1295         (WebKit::TextChecker::setAutomaticSpellingCorrectionEnabled):
1296         Make sure to write the new state.
1297         
1298         * UIProcess/qt/TextCheckerQt.cpp:
1299         (WebKit::TextChecker::state):
1300         * UIProcess/win/TextCheckerWin.cpp:
1301         (WebKit::TextChecker::state):
1302         Add stubs.
1303
1304         * WebKit2.xcodeproj/project.pbxproj:
1305         Add TextCheckerState.h.
1306
1307         * WebProcess/WebProcess.cpp:
1308         (WebKit::WebProcess::WebProcess):
1309         Initialize m_textCheckerState.
1310
1311         (WebKit::WebProcess::setTextCheckerState):
1312         Update.
1313
1314         * WebProcess/WebProcess.messages.in:
1315         Add SetTextCheckerState message.
1316
1317         * win/WebKit2.vcproj:
1318         Add TextCheckerState.h.
1319
1320 2011-01-04  Brady Eidson  <beidson@apple.com>
1321
1322         Rubberstamped by Anders Carlsson.
1323
1324         Attach a radar # to this FIXME:
1325         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1326
1327 2011-01-04  Anders Carlsson  <andersca@apple.com>
1328
1329         Reviewed by John Sullivan.
1330
1331         Add more spelling/grammar related methods
1332         https://bugs.webkit.org/show_bug.cgi?id=51886
1333
1334         * UIProcess/API/mac/WKView.mm:
1335         (-[WKView validateUserInterfaceItem:]):
1336         Handle more selectors.
1337
1338         (-[WKView showGuessPanel:]):
1339         Add stub.
1340
1341         (-[WKView checkSpelling:]):
1342         Ditto.
1343
1344         (-[WKView toggleAutomaticSpellingCorrection:]):
1345         Toggle automatic spelling correction.
1346
1347         * UIProcess/TextChecker.h:
1348         Add setAutomaticSpellingCorrectionEnabled and isAutomaticSpellingCorrectionEnabled.
1349
1350         * UIProcess/mac/TextCheckerMac.mm:
1351         (WebKit::TextChecker::setAutomaticSpellingCorrectionEnabled):
1352         (WebKit::TextChecker::isAutomaticSpellingCorrectionEnabled):
1353         Update the toggle.
1354
1355         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1356         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
1357         Add a Radar URL for the localization FIXMEs.
1358
1359 2011-01-04  Brent Fulgham  <bfulgham@webkit.org>
1360
1361         Unreviewed build fix.
1362
1363         * win/WebKit2.vcproj: Correct the missing $(WebKitVSPropsRedirectionDir)
1364         variables that Visual Studio helpfully removes when making changes.
1365
1366 2011-01-04  Brent Fulgham  <bfulgham@webkit.org>
1367
1368         Unreviewed build fix.
1369
1370         * win/WebKit2.vcproj: Disable CG-specific WKImageCG.cpp from
1371         Debug_Cairo_CFLite/Release_Cario_CFLite builds.
1372
1373 2011-01-04  Brady Eidson  <beidson@apple.com>
1374
1375         Reviewed by Darin Adler.
1376
1377         https://bugs.webkit.org/show_bug.cgi?id=51856
1378         Pass encoded back/forward tree data from the WebProcess to the UIProcess
1379
1380         Remove the WKBackForwardListItemCopyOriginalURL API as it's not needed:
1381         * UIProcess/API/C/WKBackForwardListItem.cpp:
1382         * UIProcess/API/C/WKBackForwardListItem.h:
1383         * UIProcess/API/qt/qwkhistory.cpp:
1384         * UIProcess/API/qt/qwkhistory.h:
1385         
1386         * UIProcess/WebBackForwardListItem.cpp:
1387         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1388         * UIProcess/WebBackForwardListItem.h:
1389         (WebKit::WebBackForwardListItem::create):
1390         (WebKit::WebBackForwardListItem::setBackForwardData):
1391         (WebKit::WebBackForwardListItem::backForwardData):
1392         
1393         * UIProcess/WebProcessProxy.cpp:
1394         (WebKit::WebProcessProxy::addBackForwardItem):
1395         * UIProcess/WebProcessProxy.h:
1396         
1397         * UIProcess/WebProcessProxy.messages.in:
1398         
1399         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1400         (WebKit::updateBackForwardItem):
1401
1402 2011-01-04  Balazs Kelemen  <kbalazs@webkit.org>
1403
1404         Reviewed by Kenneth Rohde Christiansen.
1405
1406         [Qt][WK2] Incomplete clean up on termination
1407         https://bugs.webkit.org/show_bug.cgi?id=51474
1408
1409         Do not kill the web process to force it's termination.
1410         Fix object destruction and cleanup logic and make the cleanup more reliable.
1411         Do not try to cleanup on crash because it is not reliable.
1412
1413         * Platform/CoreIPC/qt/ConnectionQt.cpp:
1414         (CoreIPC::Connection::platformInvalidate): Do not delete the socket if we
1415         do not own it. This is the case with a server connection.
1416         * Platform/qt/MappedMemoryPool.cpp:
1417         Turn MappedMemoryPool into a QObject so the CleanupHandler can destruct it
1418         in the same way as the other objects.
1419         (WebKit::MappedMemoryPool::instance):
1420         (WebKit::MappedMemoryPool::~MappedMemoryPool):
1421         * Platform/qt/MappedMemoryPool.h:
1422         (WebKit::MappedMemoryPool::MappedMemoryPool):
1423         * Platform/qt/SharedMemoryQt.cpp:
1424         (WebKit::SharedMemory::create): No need to care about QCoreApplication::aboutToQuit.
1425         It is handled by the CleanupHandler.
1426         (WebKit::SharedMemory::~SharedMemory): Ditto.
1427         * Shared/qt/CleanupHandler.cpp: Renamed from WebKit2/Shared/qt/CrashHandler.cpp.
1428         No longer try to handle crash but just normal termination.
1429         (WebKit::CleanupHandler::CleanupHandler): Connect deleteObjects with QCoreApplication::aboutToQuit.
1430         Ensure appropriate thread affinity.
1431         (WebKit::CleanupHandler::sigTermHandler): Stop the main event loop.
1432         (WebKit::CleanupHandler::deleteObjects): Use deleteLater instead of delete since it is more reliable.
1433         * Shared/qt/CleanupHandler.h: Renamed from WebKit2/Shared/qt/CrashHandler.h.
1434         (WebKit::CleanupHandler::instance):
1435         (WebKit::CleanupHandler::markForCleanup):
1436         (WebKit::CleanupHandler::unmark):
1437         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
1438         Do not kill the web process immidiately but give it a chance to cleanup.
1439         Use QLocalServer::removeServer for assuring that the socket file will be removed.
1440         (WebKit::ProcessLauncherHelper::serverName):
1441         (WebKit::cleanupAtExit): Renamed from cleanupProcesses. Only kill the web process when it times
1442         out terminating. Fixed the bug of changing the list while iterating it over by disconnecting
1443         from the processStateChanged slot.
1444         (WebKit::QtWebProcess::QtWebProcess): Added missing meta type registration of QProcess::ProcessState.
1445         (WebKit::ProcessLauncherHelper::~ProcessLauncherHelper):
1446         (WebKit::ProcessLauncherHelper::ProcessLauncherHelper): No need to add the the instance to the
1447         CleanupHandler because we will remove the socket file in cleanupAtExit.
1448         (WebKit::ProcessLauncherHelper::instance):
1449         (WebKit::ProcessLauncher::terminateProcess):
1450         * WebKit2.pro:
1451
1452 2011-01-04  Benjamin Poulain  <benjamin.poulain@nokia.com>
1453
1454         Reviewed by Kenneth Rohde Christiansen.
1455
1456         [Qt] [WK2] create an initial implementation of the context menu handling for WebKit 2
1457         https://bugs.webkit.org/show_bug.cgi?id=51825
1458
1459         Implement the necessary methods to get a basic context menu working for Qt.
1460
1461         Only 4 basic WebAction have been added on the UIProcess side: back, forward, stop and reload.
1462
1463         * UIProcess/API/qt/qgraphicswkview.cpp:
1464         (QGraphicsWKView::QGraphicsWKView):
1465         (QGraphicsWKView::showContextMenu):
1466         (QGraphicsWKViewPrivate::QGraphicsWKViewPrivate):
1467         * UIProcess/API/qt/qgraphicswkview.h:
1468         * UIProcess/API/qt/qwkpage.cpp:
1469         (QWKPagePrivate::createContextMenuProxy):
1470         * UIProcess/API/qt/qwkpage.h:
1471         * UIProcess/qt/WebContextMenuProxyQt.cpp:
1472         (WebKit::webActionForContextMenuAction):
1473         (WebKit::WebContextMenuProxyQt::WebContextMenuProxyQt):
1474         (WebKit::WebContextMenuProxyQt::create):
1475         (WebKit::WebContextMenuProxyQt::showContextMenu):
1476         (WebKit::WebContextMenuProxyQt::hideContextMenu):
1477         (WebKit::WebContextMenuProxyQt::createContextMenu):
1478         * UIProcess/qt/WebContextMenuProxyQt.h:
1479
1480 2011-01-03  Yi Shen  <yi.4.shen@nokia.com>
1481
1482         Reviewed by Adam Barth.
1483
1484         [Qt] Add SelectAll option to the context menu for the editor
1485         https://bugs.webkit.org/show_bug.cgi?id=50049
1486
1487         Add WebPlatformStrategies::contextMenuItemTagSelectAll for Qt.
1488
1489         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1490         (WebKit::WebPlatformStrategies::contextMenuItemTagSelectAll):
1491         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1492
1493 2011-01-03  Sam Weinig  <sam@webkit.org>
1494
1495         Reviewed by Anders Carlsson.
1496
1497         Ensure that the correct initial focusable area is focused when tabbing
1498         and shift-tabbing into the WKView.
1499
1500         * UIProcess/API/mac/WKView.mm:
1501         (-[WKView becomeFirstResponder]): Use the keyViewSelectionDirection to set
1502         the initial focus.
1503
1504 2011-01-02  Dan Bernstein  <mitz@apple.com>
1505
1506         Rubber-stamped by Simon Fraser.
1507
1508         <rdar://problem/8812159> Update copyright strings
1509
1510         * Info.plist:
1511         * WebProcess/Info.plist:
1512
1513 2011-01-02  Benjamin Poulain  <benjamin.poulain@nokia.com>
1514
1515         Reviewed by Csaba Osztrogonác.
1516
1517         WebKit 2 does not build on 64bits with a recent GCC
1518         https://bugs.webkit.org/show_bug.cgi?id=51754
1519
1520         Change the argument coding for DatabaseDetails to use explicitly the 64 bits type.
1521
1522         * Shared/OriginAndDatabases.h:
1523         * Shared/WebCoreArgumentCoders.h:
1524
1525 2011-01-02  Csaba Osztrogonác  <ossy@webkit.org>
1526
1527         Reviewed by Adam Barth.
1528
1529         Move JavaScriptCore to Source
1530         https://bugs.webkit.org/show_bug.cgi?id=51604
1531
1532         Workaround until moving all sources to Source directory is finished.
1533
1534         * Scripts/generate-forwarding-headers.pl: Add Sources to searching path for JavaScriptCore.
1535
1536 2011-01-01  Adam Barth  <abarth@webkit.org>
1537
1538         Speculative build fix for Qt.  Add some more include paths.
1539
1540         * WebKit2.pro:
1541
1542 2011-01-01  Adam Barth  <abarth@webkit.org>
1543
1544         Reviewed by Eric Seidel.
1545
1546         Move JavaScriptCore to Source
1547         https://bugs.webkit.org/show_bug.cgi?id=51604
1548
1549         * WebKit2.pro:
1550           - Point to JavaScriptCore in its new location.
1551
1552 2010-12-15  Amruth Raj  <amruthraj@motorola.com> and Ravi Kasibhatla  <ravi.kasibhatla@motorola.com>
1553
1554         Reviewed by Martin Robinson.
1555
1556         [GTK] Enable building whatever already exists of WebKit2
1557         https://bugs.webkit.org/show_bug.cgi?id=37369
1558
1559         * GNUmakefile.am: Added. 
1560         * WebKit2Prefix.h: Included WebCore/config.h for GTK port as the first header
1561         file for WebKit2 sources files.
1562         * gtk: Added.
1563         * gtk/webkit2.pc.in: Added.
1564
1565 2010-12-29  Juha Savolainen  <juha.savolainen@weego.fi>
1566
1567         Reviewed by Kenneth Rohde Christiansen.
1568
1569         [Qt] [WK2] Added more webattributes to the qwkpreferences
1570         https://bugs.webkit.org/show_bug.cgi?id=51697
1571
1572         Added PrivateBrowsingEnabled, DeveloperExtrasEnabled, DnsPrefetchEnabled attributes
1573
1574         * UIProcess/API/qt/qwkpreferences.cpp:
1575         (QWKPreferences::testAttribute): 
1576         (QWKPreferences::setAttribute): 
1577         * UIProcess/API/qt/qwkpreferences.h:
1578
1579 2010-12-27  Sam Weinig  <sam@webkit.org>
1580
1581         Reviewed by Anders Carlsson.
1582
1583         WebKit2 snapshots should contain accelerated content
1584         <rdar://problem/8807393>
1585         https://bugs.webkit.org/show_bug.cgi?id=51660
1586
1587         When creating a snapshot, flatten the layer tree for painting so that
1588         accelerated content is included in the snapshot.
1589
1590         * WebProcess/WebPage/WebPage.cpp:
1591         (WebKit::WebPage::snapshotInViewCoordinates):
1592         (WebKit::WebPage::snapshotInDocumentCoordinates):
1593
1594 2010-12-27  Daniel Bates  <dbates@rim.com>
1595
1596         Attempt to fix the WebKit2 Windows build after changeset 74698
1597         <http://trac.webkit.org/changeset/74698> (bug #51656).
1598
1599         Add "..\Shared\API\c\WKImage.h" to WebKit2Generated.make.
1600
1601         * win/WebKit2Generated.make:
1602
1603 2010-12-27  Sam Weinig  <sam@webkit.org>
1604
1605         Reviewed by Anders Carlsson.
1606
1607         WebKit2: Add API for getting snapshots
1608         https://bugs.webkit.org/show_bug.cgi?id=51656
1609
1610         * Shared/API/c/WKBase.h:
1611         * Shared/API/c/WKImage.cpp: Added.
1612         (WKImageGetTypeID):
1613         (WKImageCreate):
1614         (WKImageGetSize):
1615         * Shared/API/c/WKImage.h: Added.
1616         * Shared/WebImage.cpp: Added.
1617         (WebKit::WebImage::create):
1618         (WebKit::WebImage::size):
1619         * Shared/WebImage.h: Added.
1620         (WebKit::WebImage::backingStore):
1621         (WebKit::WebImage::WebImage):
1622         (WebKit::WebImage::type):
1623         Add a general purpose API image class.
1624
1625         * Shared/API/c/cg: Added.
1626         * Shared/API/c/cg/WKImageCG.cpp: Added.
1627         (WKImageCreateCGImage):
1628         * Shared/API/c/cg/WKImageCG.h: Added.
1629         Add function to convert a WKImageRef to a CGImageRef for platforms that use CG.
1630
1631         * Shared/API/c/WKSharedAPICast.h:
1632         (WebKit::toFloatRect):
1633         (WebKit::toIntSize):
1634         (WebKit::toIntPoint):
1635         (WebKit::toIntRect):
1636         (WebKit::toImageOptions):
1637         Make conversion functions that are ambiguous more explicit.
1638
1639         * Shared/APIObject.h:
1640         * Shared/BackingStore.h:
1641         (WebKit::BackingStore::isBackedBySharedMemory):
1642         * Shared/ImageOptions.h: Added.
1643         * Shared/UserMessageCoders.h:
1644         (WebKit::UserMessageEncoder::baseEncode):
1645         (WebKit::UserMessageDecoder::baseDecode):
1646         Allow a WKImageRef to be passed in user messages.  Right now, it only
1647         works if the image is sharable.
1648
1649         * UIProcess/API/C/WKPage.cpp:
1650         (WKPageScaleWebView):
1651         * UIProcess/WebUIClient.cpp:
1652         (WebKit::WebUIClient::windowFrame):
1653         Use the more explicit conversion function name.
1654
1655         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1656         (WKBundlePageCreateSnapshotInViewCoordinates):
1657         (WKBundlePageCreateSnapshotInDocumentCoordinates):
1658         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1659         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1660         (WKBundlePageOverlaySetNeedsDisplay):
1661         * WebProcess/WebPage/WebPage.cpp:
1662         (WebKit::WebPage::snapshotInViewCoordinates):
1663         (WebKit::WebPage::snapshotInDocumentCoordinates):
1664         Add function to take the snapshot.
1665
1666         * WebProcess/WebPage/WebPage.h:
1667         * WebKit2.pro:
1668         * WebKit2.xcodeproj/project.pbxproj:
1669         * win/WebKit2.vcproj:
1670         Add new files.
1671
1672 2010-12-27  Sam Weinig  <sam@webkit.org>
1673
1674         Reviewed by Anders Carlsson.
1675
1676         WebKit2: Add additional API for managing databases
1677         https://bugs.webkit.org/show_bug.cgi?id=51629
1678
1679         - Adds client for the database manager to get notifications
1680           of changes to databases.
1681
1682         * UIProcess/API/C/WKDatabaseManager.cpp:
1683         (WKDatabaseManagerSetClient):
1684         * UIProcess/API/C/WKDatabaseManager.h:
1685         * UIProcess/WebDatabaseManagerProxy.cpp:
1686         (WebKit::WebDatabaseManagerProxy::initializeClient):
1687         (WebKit::WebDatabaseManagerProxy::didModifyOrigin):
1688         (WebKit::WebDatabaseManagerProxy::didModifyDatabase):
1689         * UIProcess/WebDatabaseManagerProxy.h:
1690         * UIProcess/WebDatabaseManagerProxy.messages.in:
1691         * UIProcess/WebDatabaseManagerProxyClient.cpp: Added.
1692         (WebKit::WebDatabaseManagerProxyClient::didModifyOrigin):
1693         (WebKit::WebDatabaseManagerProxyClient::didModifyDatabase):
1694         * UIProcess/WebDatabaseManagerProxyClient.h: Added.
1695         * WebKit2.pro:
1696         * WebKit2.xcodeproj/project.pbxproj:
1697         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1698         (WebKit::WebDatabaseManager::WebDatabaseManager):
1699         (WebKit::WebDatabaseManager::~WebDatabaseManager):
1700         (WebKit::WebDatabaseManager::dispatchDidModifyOrigin):
1701         (WebKit::WebDatabaseManager::dispatchDidModifyDatabase):
1702         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1703         * win/WebKit2.vcproj:
1704
1705 2010-12-27  Sam Weinig  <sam@webkit.org>
1706
1707         Reviewed by Anders Carlsson.
1708
1709         WebKit2: Add additional API for managing databases
1710         https://bugs.webkit.org/show_bug.cgi?id=51629
1711
1712         - Adds WKDatabaseManagerGetDatabasesByOrigin, which asynchronously returns
1713           an array of dictionaries containing details about each origin using 
1714           databases and details about each database. Keys were added for accessing
1715           the data in the dictionaries.
1716         - Adds WKDatabaseManagerDeleteDatabasesWithNameForOrigin to delete a database
1717           with a specific identifier.
1718         - Adds WKDatabaseManagerSetQuotaForOrigin to set the quota for an origin.
1719
1720         * Shared/OriginAndDatabases.cpp: Added.
1721         (WebKit::OriginAndDatabases::encode):
1722         (WebKit::OriginAndDatabases::decode):
1723         * Shared/OriginAndDatabases.h: Added.
1724         * Shared/WebCoreArgumentCoders.h:
1725         * UIProcess/API/C/WKDatabaseManager.cpp:
1726         (WKDatabaseManagerGetOriginKey):
1727         (WKDatabaseManagerGetOriginQuotaKey):
1728         (WKDatabaseManagerGetOriginUsageKey):
1729         (WKDatabaseManagerGetDatabaseDetailsKey):
1730         (WKDatabaseManagerGetDatabaseDetailsNameKey):
1731         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
1732         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
1733         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
1734         (WKDatabaseManagerGetDatabasesByOrigin):
1735         (callGetDatabasesByOriginBlockAndDispose):
1736         (WKDatabaseManagerGetDatabasesByOrigin_b):
1737         (WKDatabaseManagerGetDatabaseOrigins):
1738         (callGetDatabaseOriginsBlockBlockAndDispose):
1739         (WKDatabaseManagerGetDatabaseOrigins_b):
1740         (WKDatabaseManagerDeleteDatabasesWithNameForOrigin):
1741         (WKDatabaseManagerDeleteDatabasesForOrigin):
1742         (WKDatabaseManagerDeleteAllDatabases):
1743         (WKDatabaseManagerSetQuotaForOrigin):
1744         * UIProcess/API/C/WKDatabaseManager.h:
1745         * UIProcess/WebDatabaseManagerProxy.cpp:
1746         (WebKit::WebDatabaseManagerProxy::originKey):
1747         (WebKit::WebDatabaseManagerProxy::originQuotaKey):
1748         (WebKit::WebDatabaseManagerProxy::originUsageKey):
1749         (WebKit::WebDatabaseManagerProxy::databaseDetailsKey):
1750         (WebKit::WebDatabaseManagerProxy::databaseDetailsNameKey):
1751         (WebKit::WebDatabaseManagerProxy::databaseDetailsDisplayNameKey):
1752         (WebKit::WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey):
1753         (WebKit::WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey):
1754         (WebKit::WebDatabaseManagerProxy::invalidate):
1755         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
1756         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
1757         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
1758         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
1759         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
1760         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
1761         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
1762         * UIProcess/WebDatabaseManagerProxy.h:
1763         * UIProcess/WebDatabaseManagerProxy.messages.in:
1764         * WebKit2.pro:
1765         * WebKit2.xcodeproj/project.pbxproj:
1766         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1767         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
1768         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
1769         (WebKit::WebDatabaseManager::setQuotaForOrigin):
1770         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1771         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in:
1772         * win/WebKit2.vcproj:
1773
1774 2010-12-26  Anders Carlsson  <andersca@apple.com>
1775
1776         Reviewed by Dan Bernstein.
1777
1778         Rename DrawingAreaMessage and DrawingAreaLegacyMessage and
1779         DrawingAreaProxyMessage to DrawingAreaProxyLegacyMessage.
1780
1781         * Platform/CoreIPC/MessageID.h:
1782         * Shared/CoreIPCSupport/DrawingAreaMessageKinds.h:
1783         * Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h:
1784         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1785         (WebKit::ChunkedUpdateDrawingAreaProxy::paint):
1786         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
1787         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
1788         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
1789         (WebKit::ChunkedUpdateDrawingAreaProxy::didReceiveMessage):
1790         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
1791         (WebKit::LayerBackedDrawingAreaProxy::sizeDidChange):
1792         (WebKit::LayerBackedDrawingAreaProxy::setPageIsVisible):
1793         (WebKit::LayerBackedDrawingAreaProxy::update):
1794         (WebKit::LayerBackedDrawingAreaProxy::didReceiveMessage):
1795         (WebKit::LayerBackedDrawingAreaProxy::didReceiveSyncMessage):
1796         * UIProcess/TiledDrawingAreaProxy.cpp:
1797         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
1798         (WebKit::TiledDrawingAreaProxy::setPageIsVisible):
1799         (WebKit::TiledDrawingAreaProxy::didReceiveMessage):
1800         (WebKit::TiledDrawingAreaProxy::requestTileUpdate):
1801         (WebKit::TiledDrawingAreaProxy::waitUntilUpdatesComplete):
1802         (WebKit::TiledDrawingAreaProxy::takeSnapshot):
1803         (WebKit::TiledDrawingAreaProxy::removeTile):
1804         * UIProcess/WebPageProxy.cpp:
1805         (WebKit::WebPageProxy::didReceiveMessage):
1806         (WebKit::WebPageProxy::didReceiveSyncMessage):
1807         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1808         (WebKit::ChunkedUpdateDrawingArea::display):
1809         (WebKit::ChunkedUpdateDrawingArea::setSize):
1810         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
1811         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
1812         (WebKit::LayerBackedDrawingArea::setSize):
1813         (WebKit::LayerBackedDrawingArea::didReceiveMessage):
1814         * WebProcess/WebPage/TiledDrawingArea.cpp:
1815         (WebKit::TiledDrawingArea::display):
1816         (WebKit::TiledDrawingArea::setSize):
1817         (WebKit::TiledDrawingArea::updateTile):
1818         (WebKit::TiledDrawingArea::tileUpdateTimerFired):
1819         (WebKit::TiledDrawingArea::didReceiveMessage):
1820         * WebProcess/WebPage/WebPage.cpp:
1821         (WebKit::WebPage::didReceiveMessage):
1822         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
1823         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
1824
1825 2010-12-26  Anders Carlsson  <andersca@apple.com>
1826
1827         Reviewed by Sam Weinig.
1828
1829         Drawing area cleanup. Remove a bunch of redundant functions that just ended
1830         up calling setNeedsDisplay.
1831
1832         * UIProcess/DrawingAreaProxy.h:
1833         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1834         (WebKit::WebChromeClient::invalidateWindow):
1835         (WebKit::WebChromeClient::invalidateContentsAndWindow):
1836         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
1837         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1838         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1839         * WebProcess/WebPage/DrawingArea.h:
1840         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
1841         * WebProcess/WebPage/LayerBackedDrawingArea.h:
1842         * WebProcess/WebPage/TiledDrawingArea.cpp:
1843         * WebProcess/WebPage/TiledDrawingArea.h:
1844
1845 2010-12-25  Sam Weinig  <sam@webkit.org>
1846
1847         Reviewed by Dan Bernstein.
1848
1849         Fill in some more preferences for WebKit2
1850         https://bugs.webkit.org/show_bug.cgi?id=51610
1851
1852         * Shared/WebPreferencesStore.h:
1853         * UIProcess/API/C/WKPreferences.cpp:
1854         (WKPreferencesSetAuthorAndUserStylesEnabled):
1855         (WKPreferencesGetAuthorAndUserStylesEnabled):
1856         (WKPreferencesSetWebArchiveDebugModeEnabled):
1857         (WKPreferencesGetWebArchiveDebugModeEnabled):
1858         (WKPreferencesSetLocalFileContentSniffingEnabled):
1859         (WKPreferencesGetLocalFileContentSniffingEnabled):
1860         (WKPreferencesSetPageCacheEnabled):
1861         (WKPreferencesGetPageCacheEnabled):
1862         (WKPreferencesSetPaginateDuringLayoutEnabled):
1863         (WKPreferencesGetPaginateDuringLayoutEnabled):
1864         (WKPreferencesSetDOMPasteAllowedEnabled):
1865         (WKPreferencesGetDOMPasteAllowedEnabled):
1866         * UIProcess/API/C/WKPreferences.h:
1867         * UIProcess/API/C/WKPreferencesPrivate.h:
1868         * WebProcess/WebPage/WebPage.cpp:
1869         (WebKit::WebPage::updatePreferences):
1870         Pipe through some more preferences.
1871
1872 2010-12-24  Dan Bernstein  <mitz@apple.com>
1873
1874         Reviewed by Alexey Proskuryakov.
1875
1876         REGRESSION (r74648): XHR layout test failures
1877         https://bugs.webkit.org/show_bug.cgi?id=51603
1878
1879         Reverted r74648.
1880
1881         * UIProcess/WebPageProxy.cpp:
1882         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
1883         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1884         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
1885         * WebProcess/mac/WebProcessMainMac.mm:
1886         (WebKit::WebProcessMain):
1887
1888 2010-12-24  Simon Fraser  <simon.fraser@apple.com>
1889
1890         Fix the Qt build after r74650.
1891
1892         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1893
1894 2010-12-24  Benjamin Poulain  <ikipou@gmail.com>
1895
1896         Reviewed by Darin Adler.
1897
1898         [Qt] [WK2] WebKit 2 does not build on mac, missing reference to RetainPtr
1899         https://bugs.webkit.org/show_bug.cgi?id=51598
1900
1901         Fix the build, add the missing header.
1902
1903         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1904
1905 2010-12-24  Dan Bernstein  <mitz@apple.com>
1906
1907         Reviewed by Anders Carlsson.
1908
1909         <rdar://problem/8758386> The web process uses its own credential storage
1910         https://bugs.webkit.org/show_bug.cgi?id=51599
1911
1912         * UIProcess/WebPageProxy.cpp:
1913         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Try to answer the challenge using
1914         the UI process’s credential storage first.
1915         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1916         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): Prevent the web process from using
1917         its own credential storage.
1918         * WebProcess/mac/WebProcessMainMac.mm:
1919         (WebKit::WebProcessMain): Ditto.
1920
1921 2010-12-23  Dan Bernstein  <mitz@apple.com>
1922
1923         Reviewed by Sam Weinig.
1924
1925         Make dragging work again after r74591.
1926
1927         * UIProcess/WebPageProxy.cpp:
1928         (WebKit::WebPageProxy::didReceiveEvent): Fixed a typo.
1929
1930 2010-12-23  Jessie Berlin  <jberlin@apple.com>
1931
1932         Reviewed by Sam Weinig.
1933
1934         Need WebKit2 API to create a SecurityOrigin from protocol, host, and port
1935         https://bugs.webkit.org/show_bug.cgi?id=51563
1936
1937         Add WKSecurityOriginCreate(WKStringRef protocol, WKStringRef host, int port).
1938
1939         * Shared/API/c/WKSecurityOrigin.cpp:
1940         (WKSecurityOriginCreateFromIdentifier):
1941         Renamed so as not to clash with the new WKSecurityOriginCreate.
1942         (WKSecurityOriginCreate):
1943         * Shared/API/c/WKSecurityOrigin.h:
1944         * Shared/WebSecurityOrigin.h:
1945         (WebKit::WebSecurityOrigin::create):
1946
1947 2010-12-23  Anders Carlsson  <andersca@apple.com>
1948
1949         Reviewed by Simon Fraser.
1950
1951         Ensure that we are not getting too many mouse move events
1952         https://bugs.webkit.org/show_bug.cgi?id=51568
1953         <rdar://problem/7881470>
1954         <rdar://problem/8735512>
1955
1956         Implement throttling of mouse move events.
1957
1958         * UIProcess/WebPageProxy.cpp:
1959         (WebKit::WebPageProxy::WebPageProxy):
1960         Initialize m_processingMouseMoveEvent to false.
1961
1962         (WebKit::WebPageProxy::handleMouseEvent):
1963         If we're already processing a mouse move events, just update 
1964         m_nextMouseMoveEvent and return.
1965  
1966         (WebKit::WebPageProxy::didReceiveEvent):
1967         If we received a mouse move event, send the next mouse move event if there is one.
1968
1969 2010-12-23  Brian Weinstein  <bweinstein@apple.com>
1970
1971         Reviewed by Anders Carlsson.
1972
1973         Assertion when loading www.yahoo.com in WebKit2 under decodeResourceRequest
1974         https://bugs.webkit.org/show_bug.cgi?id=51562
1975         
1976         Don't assert that our data reference isn't empty when we try to get the data from it.
1977         If it is empty, just return 0.
1978         
1979         All callers are safe with this function returning 0.
1980
1981         * Platform/CoreIPC/DataReference.h:
1982         (CoreIPC::DataReference::data): Change the assert to an early return.
1983         * Shared/cf/ArgumentCodersCF.cpp:
1984         (CoreIPC::decode): Add an assert, and remove a ternarny operator because the function now does
1985             this for us (if the data is empty, return 0).
1986
1987 2010-12-23  Sam Weinig  <sam@webkit.org>
1988
1989         Fix incorrect assertion causing all pages with subframes to crash.
1990
1991         * UIProcess/WebFrameProxy.cpp:
1992         (WebKit::WebFrameProxy::appendChild):
1993
1994 2010-12-23  Anders Carlsson  <andersca@apple.com>
1995
1996         Reviewed by Darin Adler.
1997
1998         Clean up the selection handling code
1999         https://bugs.webkit.org/show_bug.cgi?id=51550
2000
2001         * Shared/SelectionState.h: Added.
2002         Add SelectionState class which hold information about the current selection.
2003
2004         * UIProcess/API/mac/PageClientImpl.h:
2005         * UIProcess/API/mac/PageClientImpl.mm:
2006         Remove selectionChanged function.
2007
2008         * UIProcess/API/mac/WKView.mm:
2009         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2010         Remove all the selection related state; it lives in the WebPageProxy object now.
2011         
2012         (-[WKView insertText:]):
2013         (-[WKView selectedRange]):
2014         (-[WKView hasMarkedText]):
2015         Get the selection information from the WebPageProxy.
2016
2017         * UIProcess/API/mac/WKViewInternal.h:
2018         Remove _selectionChanged declaration.
2019
2020         * UIProcess/PageClient.h:
2021         Remove selectionChanged functions.
2022
2023         * UIProcess/WebPageProxy.cpp:
2024         (WebKit::WebPageProxy::selectionStateChanged):
2025         Update the selection state.
2026
2027         * UIProcess/WebPageProxy.h:
2028         (WebKit::WebPageProxy::selectionState):
2029         Return the selection state.
2030
2031         * UIProcess/WebPageProxy.messages.in:
2032         Add SelectionStateChanged message.
2033
2034         * UIProcess/win/WebView.cpp:
2035         (WebKit::WebView::WebView):
2036         Remove all the selection related state; it lives in the WebPageProxy object now.
2037
2038         (WebKit::WebView::compositionSelectionChanged):
2039         (WebKit::WebView::onIMEComposition):
2040         (WebKit::WebView::onIMEEndComposition):
2041         (WebKit::WebView::onIMERequestCharPosition):
2042         (WebKit::WebView::onIMERequest):
2043         Get the selection information from the WebPageProxy.
2044         
2045         * WebKit2.xcodeproj/project.pbxproj:
2046         Add SelectionState.h
2047
2048         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2049         (WebKit::WebEditorClient::respondToChangedSelection):
2050         Send a SelectionStateChanged message with the updated state.
2051
2052         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2053         Remove mac specific code.
2054
2055         * WebProcess/WebPage/WebPage.cpp:
2056         (WebKit::WebPage::getLocationAndLengthFromRange):
2057         Rename this function from convertRangeToPlatformRange and move it out of WebPageMac.mm
2058
2059         * WebProcess/WebPage/mac/WebPageMac.mm:
2060         (WebKit::WebPage::getMarkedRange):
2061         (WebKit::WebPage::characterIndexForPoint):
2062         Call getLocationAndLengthFromRange.
2063
2064         * win/WebKit2.vcproj:
2065         Add SelectionState.h
2066
2067 2010-12-23  Darin Adler  <darin@apple.com>
2068
2069         Reviewed by Sam Weinig.
2070
2071         WKView should not try to do asynchronous validation for selectors that are not editor commands
2072         https://bugs.webkit.org/show_bug.cgi?id=51555
2073
2074         * UIProcess/API/mac/WKView.mm:
2075         (-[WKView validateUserInterfaceItem:]): Removed the special case for startSpeaking.
2076         Added call to commandIsSupportedFromMenuOrKeyBinding so we only try to do validation
2077         for commands that are supported. Tweaked comments and added some bug numbers.
2078         (-[WKView _setUserInterfaceItemState:enabled:state:]): Tweaked comment and added
2079         bug number.
2080
2081 2010-12-23  Sam Weinig  <sam@webkit.org>
2082
2083         Reviewed by Anders Carlsson.
2084
2085         <rdar://problem/8799032>
2086         REGRESSION(r74436) Crash opening many pages with WebKit2
2087
2088         * Shared/cf/ArgumentCodersCF.cpp:
2089         (CoreIPC::decode):
2090         Fix paste-o. Decode into a CFDataRef not a CFDictionaryRef
2091         when decoding CFDataRefs.
2092
2093 2010-12-22  Sam Weinig  <sam@webkit.org>
2094
2095         Reviewed by Darin Adler.
2096
2097         WebKit2 needs to mirror the frame tree in the UIProcess
2098         https://bugs.webkit.org/show_bug.cgi?id=51546
2099
2100         * UIProcess/API/C/WKFrame.cpp:
2101         (WKFrameCopyChildFrames):
2102         * UIProcess/API/C/WKFrame.h:
2103         Add API to get the child frames of a frame.
2104
2105         * UIProcess/WebFrameProxy.cpp:
2106         (WebKit::WebFrameProxy::WebFrameProxy):
2107         (WebKit::WebFrameProxy::disconnect):
2108         (WebKit::WebFrameProxy::appendChild):
2109         (WebKit::WebFrameProxy::removeChild):
2110         (WebKit::WebFrameProxy::isDescendantOf):
2111         (WebKit::WebFrameProxy::dumpFrameTree):
2112         (WebKit::WebFrameProxy::didRemoveFromHierarchy):
2113         (WebKit::WebFrameProxy::childFrames):
2114         * UIProcess/WebFrameProxy.h:
2115         (WebKit::WebFrameProxy::parentFrame): Add getter.
2116         (WebKit::WebFrameProxy::nextSibling): Add getter.
2117         (WebKit::WebFrameProxy::previousSibling): Add getter.
2118         (WebKit::WebFrameProxy::firstChild): Add getter.
2119         (WebKit::WebFrameProxy::lastChild): Add getter.
2120         Make frames keep track of their subframes.
2121
2122         * UIProcess/WebPageProxy.cpp:
2123         (WebKit::WebPageProxy::didCreateSubframe):
2124         Use the now passed parentID to insert the frame into the hierarchy
2125
2126         (WebKit::WebPageProxy::didSaveFrameToPageCache):
2127         When a frame is added to the page cache, remove it from the hierarchy.
2128
2129         (WebKit::WebPageProxy::didRestoreFrameFromPageCache):
2130         When a frame is restored from the page cache, add it back to the hierarchy.
2131
2132         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
2133         Detached frames should also be removed from the hierarchy.
2134
2135         * UIProcess/WebPageProxy.h:
2136         Add new declarations for didSaveFrameToPageCache and didRestoreFrameFromPageCache.
2137
2138         * UIProcess/WebPageProxy.messages.in:
2139         Add messages for DidSaveFrameToPageCache and DidRestoreFrameFromPageCache.
2140
2141         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2142         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): 
2143         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
2144         Remove notImplemented, there is no work we need to do here.
2145
2146         (WebKit::WebFrameLoaderClient::didSaveToPageCache): 
2147         (WebKit::WebFrameLoaderClient::didRestoreFromPageCache):
2148         Send message to UIProcess to indicate this happened.
2149         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2150
2151         * WebProcess/WebPage/WebFrame.cpp:
2152         (WebKit::WebFrame::createSubframe):
2153         Send parent frameID in addition to our own in the message to UIProcess.
2154
2155 2010-12-23  Anders Carlsson  <andersca@apple.com>
2156
2157         Reviewed by Sam Weinig.
2158
2159         New popup windows open disproportionately big
2160         https://bugs.webkit.org/show_bug.cgi?id=51547
2161         <rdar://problem/8637029>
2162
2163         * UIProcess/WebPageProxy.cpp:
2164         (WebKit::WebPageProxy::createNewPage):
2165         Pass the correct size back to the UI process.
2166
2167         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2168         (WebKit::WebChromeClient::pageRect):
2169         Implement this and return the size of the page.
2170
2171 2010-12-23  Anders Carlsson  <andersca@apple.com>
2172
2173         Reviewed by John Sullivan.
2174
2175         Nothing happens clicking "launch live player" on live.cnn.com
2176         https://bugs.webkit.org/show_bug.cgi?id=51540
2177         <rdar://problem/8791086>
2178
2179         Implement NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState.
2180
2181         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2182         (WebKit::NPN_PushPopupsEnabledState):
2183         Call NetscapePlugin::pushPopupsEnabledState.
2184
2185         (WebKit::NPN_PopPopupsEnabledState):
2186         Call NetscapePlugin::popPopupsEnabledState.
2187
2188         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2189         (WebKit::NetscapePlugin::pushPopupsEnabledState):
2190         Append the boolean to the vector.
2191
2192         (WebKit::NetscapePlugin::popPopupsEnabledState):
2193         Remove the last boolean from the vector.
2194
2195         (WebKit::NetscapePlugin::allowPopups):
2196         Return the last boolean from the vector.
2197
2198         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2199         * WebProcess/Plugins/PluginView.cpp:
2200         (WebKit::PluginView::performJavaScriptURLRequest):
2201         Update the "allowPopupsFromPlugin" state.
2202
2203 2010-12-22  Anders Carlsson  <andersca@apple.com>
2204
2205         Reviewed by Sam Weinig.
2206
2207         Webkit2: WebProcess crashes when Private browsing is turned on on yahoo.com
2208         https://bugs.webkit.org/show_bug.cgi?id=51516
2209         <rdar://problem/8766995>
2210
2211         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2212         (WebKit::NetscapePlugin::NPP_SetValue):
2213         Add a null check for NPP_SetValue.
2214
2215 2010-12-22  Anders Carlsson  <andersca@apple.com>
2216
2217         Reviewed by Sam Weinig.
2218
2219         REGRESSION (WK2): Plugins swallow CMD-W, CMD-Q, and probably other shortcuts
2220         https://bugs.webkit.org/show_bug.cgi?id=51515
2221         <rdar://problem/8740926>
2222
2223         Always return false for keyboard events where the command key is down.
2224
2225         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2226         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
2227
2228 2010-12-22  Sam Weinig  <sam@webkit.org>
2229
2230         Reviewed by Darin Adler.
2231
2232         WebProcess should be terminated if invalid frameIDs are
2233         passed to the UIProcess.
2234         https://bugs.webkit.org/show_bug.cgi?id=51508
2235
2236         - Introduce a mechanism to mark a messages as invalid due to
2237           reasons other than in ability to decode the message, eg. an
2238           invalid frameID is passed in a message.
2239
2240         * Platform/CoreIPC/Connection.cpp:
2241         (CoreIPC::Connection::Connection):
2242         (CoreIPC::Connection::markCurrentlyDispatchedMessageAsInvalid): Sets
2243         the m_didReceiveInvalidMessage bit so that it can be picked up in 
2244         (CoreIPC::Connection::dispatchMessages): Check for m_didReceiveInvalidMessage in
2245         addition to tainted arguments.
2246         * Platform/CoreIPC/Connection.h:
2247         Add base macro for others to extend, that calls markCurrentlyDispatchedMessageAsInvalid()
2248         ASSERTs, and returns.
2249
2250         * UIProcess/WebPageProxy.cpp:
2251         Add Message checks for all WebFrameProxy's gotten from frameIDs passed
2252         over the wire.
2253         * UIProcess/WebProcessProxy.cpp:
2254         (WebKit::isGoodMapKey):
2255         Checks that the key can be inserted safely into a map (eg. not the empty or deleted value).
2256
2257         (WebKit::WebProcessProxy::webFrame):
2258         Return null for bad keys (eg. 0 or -1).
2259
2260         (WebKit::WebProcessProxy::canCreateFrame):
2261         Added. Checks that the ID is good and not in the map yet. Used
2262         as a consistency check before creating frames.
2263
2264         (WebKit::WebProcessProxy::frameCreated): 
2265         ASSERT that the key is good, in addition to not in the map yet.
2266
2267         (WebKit::WebProcessProxy::didDestroyFrame):
2268         ASSERT that the key is good.
2269
2270         * UIProcess/WebProcessProxy.h:
2271         Move WebFrameProxy HashMap type into a typedef.
2272
2273 2010-12-22  Darin Adler  <darin@apple.com>
2274
2275         Reviewed by Anders Carlsson.
2276
2277         WebKit2 needs a way to return the main resource data
2278         https://bugs.webkit.org/show_bug.cgi?id=51510
2279
2280         * UIProcess/API/C/WKFrame.cpp:
2281         (WKFrameGetMainResourceData): Added.
2282         (callGetMainResourceDataBlockAndDispose): Added.
2283         (WKFrameGetMainResourceData_b): Added.
2284         * UIProcess/API/C/WKFrame.h: Added WKFrameGetMainResourceData.
2285
2286         * UIProcess/WebFrameProxy.cpp:
2287         (WebKit::WebFrameProxy::getMainResourceData): Added.
2288         * UIProcess/WebFrameProxy.h: Ditto.
2289
2290         * UIProcess/WebPageProxy.cpp:
2291         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Added.
2292         (WebKit::WebPageProxy::dataCallback): Replaced the individual callbacks
2293         with just these two.
2294         (WebKit::WebPageProxy::stringCallback): Ditto.
2295         * UIProcess/WebPageProxy.h: Ditto.
2296         * UIProcess/WebPageProxy.messages.in: Ditto.
2297
2298         * WebProcess/WebPage/WebPage.cpp:
2299         (WebKit::WebPage::runJavaScriptInMainFrame): Send the string callback
2300         message instead of a specific one.
2301         (WebKit::WebPage::getContentsAsString): Ditto.
2302         (WebKit::WebPage::getRenderTreeExternalRepresentation): Ditto.
2303         (WebKit::WebPage::getSelectionOrContentsAsString): Ditto.
2304         (WebKit::WebPage::getSourceForFrame): Ditto.
2305         (WebKit::WebPage::getMainResourceDataOfFrame): Added.
2306         (WebKit::WebPage::getWebArchiveOfFrame): Send the data callback message
2307         instead of a specific one.
2308         * WebProcess/WebPage/WebPage.h: Added getMainResourceDataOfFrame.
2309         * WebProcess/WebPage/WebPage.messages.in: Ditto.
2310
2311 2010-12-22  Darin Adler  <darin@apple.com>
2312
2313         * WebProcess/WebPage/WebPage.cpp: Add #if to try to fix non-Mac builds.
2314
2315 2010-12-22  Darin Adler  <darin@apple.com>
2316
2317         Reviewed by Anders Carlsson.
2318
2319         Make Speech menu items work in WebKit2
2320         https://bugs.webkit.org/show_bug.cgi?id=51504
2321
2322         * UIProcess/API/C/WKFrame.cpp:
2323         (WKFrameGetWebArchive): Updated to use new-named typedef.
2324         * UIProcess/API/C/WKPage.cpp:
2325         (WKPageRunJavaScriptInMainFrame): Ditto.
2326         (WKPageRenderTreeExternalRepresentation): Ditto.
2327         (WKPageGetSourceForFrame): Ditto.
2328         (WKPageGetContentsAsString): Ditto.
2329
2330         * UIProcess/API/mac/WKView.mm:
2331         (menuItem): Added. Helper function to make it easy to call menu item
2332         functions on arbitrary user interface items.
2333         (toolbarItem): Ditto.
2334         (-[WKView validateUserInterfaceItem:]): Added validation for startSpeaking
2335         and stopSpeaking commands. Reworked the code to fix a bug where
2336         toggleContinuousSpellChecking would always be enabled even when it should
2337         be disabled. Reworked the asynchronous validation code so it works for
2338         items other than menu items and can also handle more than one item for the
2339         same command. Added some comments.
2340         (speakString): Added. Helper function to be used as a callback when we
2341         get the selection or contents to speak.
2342         (-[WKView startSpeaking:]): Added. Uses getSelectionOrContentsAsString.
2343         (-[WKView stopSpeaking:]): Added.
2344         (-[WKView _setUserInterfaceItemState:enabled:state:]): Reworked to work
2345         with the changes to validateUserInterfaceItem above.
2346
2347         * UIProcess/WebFrameProxy.cpp:
2348         (WebKit::WebFrameProxy::isDisplayingMarkupDocument): Added a FIXME about
2349         a problem I noticed.
2350         (WebKit::WebFrameProxy::didCommitLoad): Tweaked argument name.
2351         (WebKit::WebFrameProxy::getWebArchive): Changed to use new-named typedef.
2352         * UIProcess/WebFrameProxy.h: Changed WebArchiveCallback to DataCallaback.
2353
2354         * UIProcess/WebPageProxy.cpp:
2355         (WebKit::WebPageProxy::close): Invalidate the two callback maps since
2356         we only have two now.
2357         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Changed to use merged
2358         maps and typedefs so we don't need a separate callback map for each function.
2359         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): Ditto.
2360         (WebKit::WebPageProxy::getSourceForFrame): Ditto.
2361         (WebKit::WebPageProxy::getContentsAsString): Ditto.
2362         (WebKit::WebPageProxy::getSelectionOrContentsAsString): Added.
2363         (WebKit::WebPageProxy::getWebArchiveOfFrame): Ditto.
2364         (WebKit::WebPageProxy::didGetContentsAsString): Ditto.
2365         (WebKit::WebPageProxy::didGetSelectionOrContentsAsString): Ditto.
2366         (WebKit::WebPageProxy::didRunJavaScriptInMainFrame): Ditto.
2367         (WebKit::WebPageProxy::didGetRenderTreeExternalRepresentation): Ditto.
2368         (WebKit::WebPageProxy::didGetSourceForFrame): Ditto.
2369         (WebKit::WebPageProxy::didGetWebArchiveOfFrame): Ditto.
2370         (WebKit::WebPageProxy::processDidCrash): Ditto.
2371
2372         * UIProcess/WebPageProxy.h: Updated for changes above.
2373
2374         * UIProcess/WebPageProxy.messages.in: Added DidGetSelectionOrContentsAsString,
2375         GetIsSpeaking, Speak, and StopSpeaking.
2376
2377         * UIProcess/mac/WebPageProxyMac.mm:
2378         (WebKit::WebPageProxy::getIsSpeaking): Added.
2379         (WebKit::WebPageProxy::speak): Added.
2380         (WebKit::WebPageProxy::stopSpeaking): Added.
2381
2382         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2383         (WebKit::WebContextMenuClient::isSpeaking): Call WebPage instead of doing
2384         the work directly, so it can run in the UI process.
2385         (WebKit::WebContextMenuClient::speak): Ditto.
2386         (WebKit::WebContextMenuClient::stopSpeaking): Ditto.
2387         (WebKit::WebContextMenuClient::searchWithSpotlight): Added FIXME comment and
2388         changed code to avoid a C-style cast.
2389
2390         * WebProcess/WebPage/WebFrame.cpp:
2391         (WebKit::WebFrame::selectionAsString): Added.
2392         * WebProcess/WebPage/WebFrame.h: Ditto.
2393
2394         * WebProcess/WebPage/WebPage.cpp:
2395         (WebKit::WebPage::changeAcceleratedCompositingMode): Use sendSync in the
2396         modern way instead of explicitly calling WebProcess.
2397         (WebKit::WebPage::getSelectionOrContentsAsString): Added.
2398         (WebKit::WebPage::isSpeaking): Added.
2399         (WebKit::WebPage::speak): Added.
2400         (WebKit::WebPage::stopSpeaking): Added.
2401         * WebProcess/WebPage/WebPage.h: Added functions.
2402
2403         * WebProcess/WebPage/WebPage.messages.in: Added GetSelectionOrContentsAsString.
2404
2405 2010-12-22  Anders Carlsson  <andersca@apple.com>
2406
2407         Fix build.
2408
2409         * Platform/mac/MachUtilities.cpp:
2410
2411 2010-12-22  Anders Carlsson  <andersca@apple.com>
2412
2413         Reviewed by Darin Adler.
2414
2415         Detect WebProcess crashes sooner, without waiting for ReportCrash to finish
2416         https://bugs.webkit.org/show_bug.cgi?id=51505
2417
2418         * Platform/CoreIPC/CoreIPCMessageKinds.h:
2419         Add SetExceptionPort.
2420
2421         * Platform/CoreIPC/mac/ConnectionMac.cpp:
2422         (CoreIPC::Connection::platformInvalidate):
2423         If we have an exception port, unregister it.
2424
2425         (CoreIPC::Connection::platformInitialize):
2426         Set m_exceptionPort to null.
2427
2428         (CoreIPC::Connection::open):
2429         If we have an exception port, register an event handler for it and send it over
2430         to the other side.
2431
2432         (CoreIPC::Connection::receiveSourceEventHandler):
2433         Handle the SetExceptionPort message.
2434
2435         (CoreIPC::Connection::exceptionSourceEventHandler):
2436         Receive the message, forward it to the real exception handler and call connectionDidClose.
2437
2438         (CoreIPC::Connection::setShouldCloseConnectionOnMachExceptions):
2439         Create an exception port.
2440
2441         * Platform/mac/MachUtilities.cpp:
2442         (machExceptionPort):
2443         (setMachExceptionPort):
2444         * Platform/mac/MachUtilities.h:
2445         Add helper functions for getting and setting the mach exception port.
2446
2447         * UIProcess/WebProcessProxy.cpp:
2448         (WebKit::WebProcessProxy::didFinishLaunching):
2449         Call setShouldCloseConnectionOnMachExceptions on Mac.
2450
2451 2010-12-22  Anders Carlsson  <andersca@apple.com>
2452
2453         Reviewed by Sam Weinig.
2454
2455         Move Mach message receiving code out into a new function
2456         https://bugs.webkit.org/show_bug.cgi?id=51502
2457
2458         * Platform/CoreIPC/mac/ConnectionMac.cpp:
2459         (CoreIPC::readFromMachPort):
2460         (CoreIPC::Connection::receiveSourceEventHandler):
2461
2462 2010-12-22  Jeff Miller  <jeffm@apple.com>
2463
2464         Reviewed by Sam Weinig.
2465
2466         InjectedBundle methods should  use the relative URL constructor for KURL instead of the ParsedURLStringTag version
2467         https://bugs.webkit.org/show_bug.cgi?id=51491
2468         
2469         The url passed to various InjectedBundle methods is not from KURL::string(), i.e. it has not already been parsed by KURL,
2470         so we have to use the relative URL constructor for KURL instead of the ParsedURLStringTag version.
2471
2472         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2473         (WebKit::InjectedBundle::addUserScript):
2474         (WebKit::InjectedBundle::addUserStyleSheet):
2475         (WebKit::InjectedBundle::removeUserScript):
2476         (WebKit::InjectedBundle::removeUserStyleSheet):
2477
2478 2010-12-22  Darin Adler  <darin@apple.com>
2479
2480         Reviewed by Sam Weinig.
2481
2482         Move more of WebPageProxy::didCommitLoadForFrame into WebFrameProxy::didCommitLoad.
2483
2484         * UIProcess/WebFrameProxy.cpp:
2485         (WebKit::WebFrameProxy::didCommitLoad): Added type and certificate info arguments,
2486         and set m_MIMEType, m_isFrameSet, and m_certificateInfo.
2487         * UIProcess/WebFrameProxy.h: Removed setMIMEType and setCertificateInfo and added
2488         arguments to didCommitLoad.
2489         * UIProcess/WebPageProxy.cpp:
2490         (WebKit::WebPageProxy::didCommitLoadForFrame): Removed code that is now inside the
2491         WebFrameProxy::didCommitLoad function.
2492
2493 2010-12-21  Darin Adler  <darin@apple.com>
2494
2495         Reviewed by Brady Eidson and Sam Weinig.
2496
2497         Add a way to get a web archive in WebKit2
2498         https://bugs.webkit.org/show_bug.cgi?id=51437
2499
2500         * UIProcess/API/C/WKFrame.cpp:
2501         (WKFrameGetWebArchive): Added.
2502         (callGetWebArchiveBlockAndDispose): Added.
2503         (WKFrameGetWebArchive_b): Added.
2504         * UIProcess/API/C/WKFrame.h: Added functions above.
2505         * UIProcess/WebPageProxy.cpp:
2506         (WebKit::WebPageProxy::close): Clear out m_webArchiveCallbacks.
2507         (WebKit::WebPageProxy::getWebArchiveOfFrame): Added.
2508         (WebKit::WebPageProxy::didGetWebArchiveOfFrame): Added.
2509         (WebKit::WebPageProxy::processDidCrash): Clear out m_webArchiveCallbacks.
2510         * UIProcess/WebPageProxy.h: Added functions above.
2511         * UIProcess/WebPageProxy.messages.in: Added DidGetWebArchiveOfFrame.
2512         * WebProcess/WebPage/WebPage.cpp:
2513         (WebKit::WebPage::getWebArchiveOfFrame): Added.
2514         * WebProcess/WebPage/WebPage.h: Added function above.
2515         * WebProcess/WebPage/WebPage.messages.in: Added GetWebArchiveOfFrame.
2516
2517 2010-12-21  Siddharth Mathur  <siddharth.mathur@nokia.com>
2518
2519         Reviewed by Laszlo Gombos.
2520
2521         [Qt] [WK2] Guard gcc-specific syntax
2522
2523         * WebKit2.pro: Non-gcc based compliers choke on the "-include" 
2524         syntax for preinclude, make sure it has guard around it.
2525
2526 2010-12-21  Anders Carlsson  <andersca@apple.com>
2527
2528         Reviewed by Darin Adler.
2529
2530         Can't stop QT music on santastreefarm.com
2531         https://bugs.webkit.org/show_bug.cgi?id=51438
2532         <rdar://problem/8741152>
2533
2534         Implement NPN_ConvertPoint.
2535
2536         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2537         (WebKit::NPN_ConvertPoint):
2538         Call NetscapePlugin::convertPoint.
2539
2540         (WebKit::initializeBrowserFuncs):
2541         Only initialize NPN_ConvertPoint and NPN_PopUpContextMenu on Mac.
2542
2543         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2544         (WebKit::NetscapePlugin::convertPoint):
2545         Implement conversion routines.
2546
2547         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
2548         Keep track of the window and view frames, they are needed to do coordinate conversion.
2549
2550 2010-12-21  Sam Weinig  <weinig@apple.com>
2551
2552         Reviewed by Anders Carlsson.
2553
2554         Implement encoding/decoding of ResourceRequest and 
2555         ResourceResponse for Windows/CFNetwork.
2556
2557         * Shared/win/WebCoreArgumentCodersWin.cpp:
2558         (CoreIPC::encodeResourceRequest):
2559         (CoreIPC::decodeResourceRequest):
2560         (CoreIPC::encodeResourceResponse):
2561         (CoreIPC::decodeResourceResponse):
2562         * win/WebKit2.vcproj:
2563         * win/WebKit2Common.vsprops:
2564
2565 2010-12-21  Darin Adler  <darin@apple.com>
2566
2567         Reviewed by Sam Weinig.
2568
2569         Mac WebKit delivers an extra didCommit when loading web archives
2570         https://bugs.webkit.org/show_bug.cgi?id=51419
2571
2572         * UIProcess/WebFrameProxy.cpp:
2573         (WebKit::WebFrameProxy::didStartProvisionalLoad): Added assertions so we catch
2574         inconsistencies here instead of at the application level. Later, we will have
2575         to decide what to do in cases these assertions fail. The right policy is probably
2576         to consider it a web process failure and do whatever we do for those.
2577         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): Ditto.
2578         (WebKit::WebFrameProxy::didFailProvisionalLoad): Ditto.
2579         (WebKit::WebFrameProxy::didCommitLoad): Ditto.
2580         (WebKit::WebFrameProxy::didFinishLoad): Ditto.
2581         (WebKit::WebFrameProxy::didFailLoad): Ditto.
2582
2583 2010-12-21  Anders Carlsson  <andersca@apple.com>
2584
2585         Fix Snow Leopard build.
2586
2587         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2588         (WebKit::NPN_GetValue):
2589
2590 2010-12-21  Anders Carlsson  <andersca@apple.com>
2591
2592         Reviewed by Dan Bernstein.
2593
2594         Fix crash when a Carbon plug-in fails to initialize correctly
2595         https://bugs.webkit.org/show_bug.cgi?id=51415
2596
2597         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2598         (WebKit::NPN_GetValue):
2599         Don't claim to support the QuickDraw event model.
2600
2601         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2602         (WebKit::NetscapePlugin::platformDestroy):
2603         Only try to remove the window from the map if it's not null.
2604
2605 2010-12-21  Anders Carlsson  <andersca@apple.com>
2606
2607         Reviewed by Darin Adler.
2608
2609         Add ArgumentCoder support for CFDataRef
2610         https://bugs.webkit.org/show_bug.cgi?id=51412
2611
2612         * Shared/cf/ArgumentCodersCF.cpp:
2613         (CoreIPC::typeFromCFTypeRef):
2614         (CoreIPC::encode):
2615         (CoreIPC::decode):
2616         * Shared/cf/ArgumentCodersCF.h:
2617
2618 2010-12-21  Anders Carlsson  <andersca@apple.com>
2619
2620         Reviewed by John Sullivan.
2621
2622         Clicking missing plug-in text does not show a sheet
2623         https://bugs.webkit.org/show_bug.cgi?id=51403
2624
2625         * UIProcess/API/C/WKPage.h:
2626         Add missingPluginButtonClicked to WKPageUIClient.
2627
2628         * UIProcess/WebPageProxy.cpp:        
2629         (WebKit::WebPageProxy::missingPluginButtonClicked):
2630         Call the WebUIClient member function.
2631
2632         * UIProcess/WebPageProxy.messages.in:
2633         Add MissingPluginButtonClicked message.
2634
2635         * UIProcess/WebUIClient.cpp:
2636         (WebKit::WebUIClient::missingPluginButtonClicked):
2637         Call the WKPageUIClient callback.
2638
2639         * UIProcess/WebUIClient.h:
2640         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2641         (WebKit::WebChromeClient::shouldMissingPluginMessageBeButton):
2642         Always return true for now.
2643
2644         (WebKit::WebChromeClient::missingPluginButtonClicked):
2645         Send a MissingPluginButtonClicked message.
2646
2647 2010-12-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2648
2649         Reviewed by Andreas Kling.
2650
2651         [Qt] Set BUILDING_QT__ consistently
2652         https://bugs.webkit.org/show_bug.cgi?id=51341
2653
2654         * WebKit2.pro: Remove the definition of BUILDING_QT__ as it
2655         is already defined in WebKit.pri.
2656
2657 2010-12-20  Sam Weinig  <sam@webkit.org>
2658
2659         Reviewed by Anders Carlsson.
2660
2661         WebKit2: Add resource load client API
2662         https://bugs.webkit.org/show_bug.cgi?id=51370
2663
2664         This just pipes through the basic resource load client data.
2665
2666         * UIProcess/API/C/WKPage.cpp:
2667         (WKPageSetPageResourceLoadClient):
2668         * UIProcess/API/C/WKPage.h:
2669         * UIProcess/WebPageProxy.cpp:
2670         (WebKit::WebPageProxy::initializeResourceLoadClient):
2671         (WebKit::WebPageProxy::didInitiateLoadForResource):
2672         (WebKit::WebPageProxy::didSendRequestForResource):
2673         (WebKit::WebPageProxy::didReceiveResponseForResource):
2674         (WebKit::WebPageProxy::didReceiveContentLengthForResource):
2675         (WebKit::WebPageProxy::didFinishLoadForResource):
2676         (WebKit::WebPageProxy::didFailLoadForResource):
2677         * UIProcess/WebPageProxy.h:
2678         * UIProcess/WebPageProxy.messages.in:
2679         * UIProcess/WebResourceLoadClient.cpp: Added.
2680         (WebKit::WebResourceLoadClient::didInitiateLoadForResource):
2681         (WebKit::WebResourceLoadClient::didSendRequestForResource):
2682         (WebKit::WebResourceLoadClient::didReceiveResponseForResource):
2683         (WebKit::WebResourceLoadClient::didReceiveContentLengthForResource):
2684         (WebKit::WebResourceLoadClient::didFinishLoadForResource):
2685         (WebKit::WebResourceLoadClient::didFailLoadForResource):
2686         * UIProcess/WebResourceLoadClient.h: Added.
2687         * WebKit2.pro:
2688         * WebKit2.xcodeproj/project.pbxproj:
2689         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2690         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
2691         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
2692         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
2693         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
2694         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
2695         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
2696         * win/WebKit2.vcproj:
2697
2698 2010-12-20  Anders Carlsson  <andersca@apple.com>
2699
2700         Reviewed by Sam Weinig.
2701
2702         Add a TextChecker class, hook up spelling and grammar toggling
2703         https://bugs.webkit.org/show_bug.cgi?id=51363
2704
2705         * UIProcess/API/mac/WKView.mm:
2706         (-[WKView validateUserInterfaceItem:]):
2707         (-[WKView toggleContinuousSpellChecking:]):
2708         (-[WKView toggleGrammarChecking:]):
2709         * UIProcess/TextChecker.h: Added.
2710         * UIProcess/WebPageProxy.cpp:
2711         (WebKit::WebPageProxy::unmarkAllMisspellings):
2712         (WebKit::WebPageProxy::unmarkAllBadGrammar):
2713         * UIProcess/WebPageProxy.h:
2714         * UIProcess/mac/TextCheckerMac.mm: Added.
2715         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
2716         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
2717         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
2718         (WebKit::TextChecker::isGrammarCheckingEnabled):
2719         (WebKit::TextChecker::setGrammarCheckingEnabled):
2720         * UIProcess/qt/TextCheckerQt.cpp: Added.
2721         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
2722         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
2723         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
2724         (WebKit::TextChecker::isGrammarCheckingEnabled):
2725         (WebKit::TextChecker::setGrammarCheckingEnabled):
2726         * UIProcess/win/TextCheckerWin.cpp: Added.
2727         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
2728         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
2729         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
2730         (WebKit::TextChecker::isGrammarCheckingEnabled):
2731         (WebKit::TextChecker::setGrammarCheckingEnabled):
2732         * WebKit2.pro:
2733         * WebKit2.xcodeproj/project.pbxproj:
2734         * WebProcess/WebPage/WebPage.cpp:
2735         (WebKit::WebPage::unmarkAllMisspellings):
2736         (WebKit::WebPage::unmarkAllBadGrammar):
2737         * WebProcess/WebPage/WebPage.h:
2738         * WebProcess/WebPage/WebPage.messages.in:
2739         * win/WebKit2.vcproj:
2740
2741 2010-12-20  Anders Carlsson  <andersca@apple.com>
2742
2743         Reviewed by Sam Weinig.
2744
2745         Flash plug-in does not work on YouTube video page when accelerated compositing is disabled
2746         https://bugs.webkit.org/show_bug.cgi?id=51348
2747         <rdar://problem/8787667>
2748
2749         * Platform/CoreIPC/HandleMessage.h:
2750         (CoreIPC::callMemberFunction):
2751         Add new overload.
2752
2753         * PluginProcess/PluginControllerProxy.cpp:
2754         (WebKit::PluginControllerProxy::create):
2755         (WebKit::PluginControllerProxy::PluginControllerProxy):
2756         These now take an additional isAcceleratedCompositingEnabled parameter.
2757
2758         (WebKit::PluginControllerProxy::isAcceleratedCompositingEnabled):
2759         Return m_isAcceleratedCompositingEnabled.
2760
2761         * PluginProcess/PluginControllerProxy.h:
2762         * PluginProcess/WebProcessConnection.cpp:
2763         (WebKit::WebProcessConnection::createPlugin):
2764         This now takes an additional isAcceleratedCompositingEnabled parameter.
2765
2766         * PluginProcess/WebProcessConnection.messages.in:
2767         Add isAcceleratedCompositingEnabled parameter to the CreatePlugin message.
2768
2769         * WebProcess/Plugins/PluginProxy.cpp:
2770         (WebKit::PluginProxy::initialize):
2771         Pass isAcceleratedCompositingEnabled when sending the CreatePlugin message.
2772
2773 2010-12-20  Anders Carlsson  <andersca@apple.com>
2774
2775         Unreviewed, rolling out r74345.
2776         http://trac.webkit.org/changeset/74345
2777         https://bugs.webkit.org/show_bug.cgi?id=51115
2778
2779         Not the correct fix.
2780
2781         * Platform/CoreIPC/Connection.h:
2782         * Platform/CoreIPC/qt/ConnectionQt.cpp:
2783         (CoreIPC::Connection::open):
2784
2785 2010-12-20  Balazs Kelemen  <kbalazs@webkit.org>
2786
2787         Reviewed by Kenneth Rohde Christiansen.
2788
2789         [Qt][WK2] Crash in web process after the connection had been closed
2790         https://bugs.webkit.org/show_bug.cgi?id=51115
2791
2792         Do not call connectionDidClose with a connection that has been explicitly
2793         invalidated on the listener thread.
2794         * Platform/CoreIPC/Connection.h:
2795         * Platform/CoreIPC/qt/ConnectionQt.cpp:
2796         (CoreIPC::Connection::disconnectHandler): Added.
2797         (CoreIPC::Connection::open):
2798
2799 2010-12-19  Dan Bernstein  <mitz@apple.com>
2800
2801         Reviewed by Sam Weinig.
2802
2803         Improve the fix for <rdar://problem/8769525>.
2804
2805         * UIProcess/API/mac/WKView.mm:
2806         (-[WKView performKeyEquivalent:]): Do not retain the view. Doing so is necessary in
2807         -[WebHTMLView performKeyEquivalent:], which this method was based upon, but not here, because
2808         there is no way for the web process to cause the WKView to be released while it is handling
2809         the event.
2810
2811 2010-12-19  Dan Bernstein  <mitz@apple.com>
2812
2813         Reviewed by Sam Weinig.
2814
2815         <rdar://problem/8769525> WKView leak when performing key equivalents
2816         https://bugs.webkit.org/show_bug.cgi?id=51315
2817
2818         * UIProcess/API/mac/WKView.mm:
2819         (-[WKView performKeyEquivalent:]): Use a RetainPtr to ensure that the view is released in the
2820         early return code path.
2821
2822 2010-12-19  Benjamin Poulain  <benjamin.poulain@nokia.com>
2823
2824         Reviewed by Kenneth Rohde Christiansen.
2825
2826         [Qt] [WK2] QWKPagePrivate::paint() does not need to save the graphics context
2827         https://bugs.webkit.org/show_bug.cgi?id=51300
2828
2829         Remove the unnecessary save() and restore() on the QPainter.
2830
2831         * UIProcess/API/qt/qwkpage.cpp:
2832         (QWKPagePrivate::paint):
2833
2834 2010-12-19  Kenneth Rohde Christiansen  <kenneth@webkit.org>
2835
2836         Reviewed by Andreas Kling.
2837
2838         [Qt] [WK2] Client are expected to render their own background for WebPages
2839         https://bugs.webkit.org/show_bug.cgi?id=51296
2840
2841         Remove the rendering of the checkerboard from the tiled DrawingAreaProxy
2842
2843         * UIProcess/TiledDrawingAreaProxy.cpp:
2844         (WebKit::TiledDrawingAreaProxy::paint):
2845         * UIProcess/TiledDrawingAreaTile.h:
2846         * UIProcess/qt/TiledDrawingAreaTileQt.cpp:
2847
2848 2010-12-19  Benjamin Poulain  <benjamin.poulain@nokia.com>
2849
2850         Reviewed by Kenneth Rohde Christiansen.
2851
2852         [Qt] [WK2] Client are expected to render their own background for WebPages
2853         https://bugs.webkit.org/show_bug.cgi?id=51296
2854
2855         Do not render a white background before rendering the page with DrawingAreaProxy.
2856
2857         * UIProcess/API/qt/qwkpage.cpp:
2858         (QWKPagePrivate::paint):
2859
2860 2010-12-17  Darin Adler  <darin@apple.com>
2861
2862         Reviewed by Dan Bernstein.
2863
2864         Window title for image documents shows corrupted characters instead of multiplication sign when using WebKit2
2865         https://bugs.webkit.org/show_bug.cgi?id=43505
2866
2867         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Changed UI_STRING macros to return
2868         WebCore::String objects instead of C strings.
2869         (WebKit::formatLocalizedString): Added. Uses the Core Foundation string formatting function for
2870         reasons explained in the comment.
2871         (WebKit::WebPlatformStrategies::multipleFileUploadText): Use formatLocalizedString instead of
2872         String::format.
2873         (WebKit::WebPlatformStrategies::imageTitle): Ditto.
2874         (WebKit::WebPlatformStrategies::localizedMediaTimeDescription): Ditto.
2875
2876 2010-12-17  Anders Carlsson  <andersca@apple.com>
2877
2878         Reviewed by Sam Weinig.
2879
2880         Resizing a WKView while loading a page can leave the page at a size that doesn't match the window
2881         https://bugs.webkit.org/show_bug.cgi?id=51282
2882         <rdar://problem/8133142>
2883
2884         Fix a race condition in waitForMessage. If we time out on the wait condition, we would keep the
2885         m_waitForMessageMutex mutex unlocked for a brief period of time before taking the lock again and
2886         then removing the messageID/destinationID pair from the hash map. Under some circumstances, the
2887         connection queue would update the hash map right before we removed it, leading to a lost message.
2888         
2889         * Platform/CoreIPC/Connection.cpp:
2890         (CoreIPC::Connection::waitForMessage):
2891
2892 2010-12-17  Anders Carlsson  <andersca@apple.com>
2893
2894         Reviewed by Simon Fraser.
2895
2896         Clean up ChunkedUpdateDrawingAreaProxy
2897         https://bugs.webkit.org/show_bug.cgi?id=51277
2898
2899         Get rid of m_lastSetViewSize since it was always equal to m_size.
2900
2901         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2902         (WebKit::ChunkedUpdateDrawingAreaProxy::sizeDidChange):
2903         Call sendSetSize().
2904
2905         (WebKit::ChunkedUpdateDrawingAreaProxy::didSetSize):
2906         Call sendSetSize if the size differs.
2907
2908         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
2909         Move code from sizeDidChange over here.
2910
2911         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
2912         * UIProcess/DrawingAreaProxy.cpp:
2913         (WebKit::DrawingAreaProxy::setSize):
2914         Add back the early return if the sizes are equal.
2915
2916 2010-12-17  Brent Fulgham  <bfulgham@webkit.org>
2917
2918         Unreviewed build fix.
2919
2920         * WebProcess/WebPage/win/WebPageWin.cpp:
2921         (WebKit::WebPage::canHandleRequest): Provide alternative for
2922         non-CFNetwork implementation.
2923
2924 2010-12-17  Ada Chan  <adachan@apple.com>
2925
2926         Reviewed by Anders Carlsson.
2927
2928         Implement WKView::setInitialFocus().
2929         https://bugs.webkit.org/show_bug.cgi?id=51274
2930
2931         * UIProcess/API/C/win/WKView.cpp:
2932         (WKViewSetInitialFocus):
2933         * UIProcess/API/C/win/WKView.h:
2934         * UIProcess/WebPageProxy.cpp:
2935         (WebKit::WebPageProxy::setInitialFocus): Send message to the Web Process to set
2936         initial focus.
2937         * UIProcess/WebPageProxy.h:
2938         * UIProcess/win/WebView.cpp:
2939         (WebKit::WebView::setInitialFocus):
2940         * UIProcess/win/WebView.h:
2941         * WebProcess/WebPage/WebPage.cpp:
2942         (WebKit::WebPage::setInitialFocus): Set the focused node to null initially.  Then
2943         ask FocusController to set the initial focus based on the focus direction.
2944         * WebProcess/WebPage/WebPage.h:
2945         * WebProcess/WebPage/WebPage.messages.in: Add a new message for SetInitialFocus.
2946
2947 2010-12-17  Anders Carlsson  <andersca@apple.com>
2948
2949         Reviewed by Sam Weinig.
2950
2951         Remove a check that probably uncovered a resizing bug.
2952
2953         * UIProcess/DrawingAreaProxy.cpp:
2954         (WebKit::DrawingAreaProxy::setSize):
2955
2956 2010-12-17  Brian Weinstein  <bweinstein@apple.com>
2957
2958         Qt build fix.
2959
2960         * UIProcess/qt/WebPopupMenuProxyQt.h:
2961
2962 2010-12-17  Brian Weinstein  <bweinstein@apple.com>
2963
2964         Reviewed by Anders Carlsson.
2965
2966         Text area does not update when you arrow through a <select> in WebKit2
2967         https://bugs.webkit.org/show_bug.cgi?id=51269
2968         <rdar://problem/8612853>
2969         
2970         Patch by Sam Weinig.
2971         
2972         Insteaed of keeping track of the selected index of a <select> just in the UI process, we
2973         need to pass this information along to the web process so that the web process can draw
2974         the correct text in the text field at the top of the select, when the selection changes (via
2975         the arrows or other typing while the select is opened).
2976         
2977         When the selected item in a popup changes, the UI process sends a message to the web process, telling
2978         it about the new selected index. The web process gets this message, and then sets the text that
2979         is visible in the select element.
2980
2981         * UIProcess/API/mac/PageClientImpl.h: CreatePopupMenuProxy now takes a WebPageProxy.
2982         * UIProcess/API/mac/PageClientImpl.mm:
2983         (WebKit::PageClientImpl::createPopupMenuProxy): Pass the WebPageProxy to create.
2984         * UIProcess/API/qt/qwkpage.cpp:
2985         (QWKPagePrivate::createPopupMenuProxy):
2986         * UIProcess/API/qt/qwkpage_p.h: CreatePopupMenuProxy now takes a WebPageProxy.
2987         * UIProcess/PageClient.h: CreatePopupMenuProxy now takes a WebPageProxy.
2988         * UIProcess/WebPageProxy.cpp:
2989         (WebKit::WebPageProxy::valueChangedForPopupMenu): Send that the selected index changed to the 
2990             web process.selected
2991         (WebKit::WebPageProxy::setTextFromItemForPopupMenu): Send that we should update the text for the
2992             active popup menu (with the index of the item to show).
2993         (WebKit::WebPageProxy::showPopupMenu): Pass the WebPageProxy to createPopupMenuProxy.
2994         * UIProcess/WebPageProxy.h:
2995         * UIProcess/WebPopupMenuProxy.h: Add a client who has virtual functions for the state changing of the
2996             popup menu. ShowPopupMenu doesn't take a new selected index anymore, that is handled by the client,
2997             and calling down to the web process.
2998         (WebKit::WebPopupMenuProxy::Client::~Client):
2999         (WebKit::WebPopupMenuProxy::WebPopupMenuProxy): Initialize the client.
3000         * UIProcess/mac/WebPopupMenuProxyMac.h:
3001         (WebKit::WebPopupMenuProxyMac::create): Takes a WebPopupMenuProxy::Client, and passes it to the constructor.
3002         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3003         (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac): Update what's initialized by the constructor.
3004         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Call through to the web process that the value changed.
3005         * UIProcess/qt/WebPopupMenuProxyQt.cpp:
3006         (WebKit::WebPopupMenuProxyQt::WebPopupMenuProxyQt): Update what's initialized by the constructor.
3007         * UIProcess/win/WebPopupMenuProxyWin.cpp:
3008         (WebKit::WebPopupMenuProxyWin::WebPopupMenuProxyWin): Ditto.
3009         (WebKit::WebPopupMenuProxyWin::showPopupMenu): Call through to the web process that the value changed.
3010         (WebKit::WebPopupMenuProxyWin::setFocusedIndex): Resolve a FIXME to set the text of the popup menu.
3011         * UIProcess/win/WebPopupMenuProxyWin.h:
3012         (WebKit::WebPopupMenuProxyWin::create): Take in a WebPopupMenuProxy::client, and pass it to the constructor.
3013         * UIProcess/win/WebView.cpp:
3014         (WebKit::WebView::createPopupMenuProxy): Pass the WebPageProxy to create.
3015         * UIProcess/win/WebView.h:
3016         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
3017         (WebKit::WebPopupMenu::setTextForIndex): Call through to setTextFromItem to set the select text.
3018         * WebProcess/WebCoreSupport/WebPopupMenu.h:
3019         * WebProcess/WebPage/WebPage.cpp: Call through to setTextForIndex on the active popup menu.
3020         (WebKit::WebPage::setTextForActivePopupMenu):
3021         * WebProcess/WebPage/WebPage.h:
3022         * WebProcess/WebPage/WebPage.messages.in: Add a new message.
3023
3024 2010-12-17  Anders Carlsson  <andersca@apple.com>
3025
3026         Reviewed by Sam Weinig.
3027
3028         DrawingAreaProxy::setSize shouldn't be a virtual member function
3029         https://bugs.webkit.org/show_bug.cgi?id=51275
3030
3031         Add a pure virtual sizeDidChange member function to DrawingAreaProxy, and only
3032         call it if the size changes.
3033
3034         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
3035         (WebKit::ChunkedUpdateDrawingAreaProxy::sizeDidChange):
3036         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
3037         * UIProcess/DrawingAreaProxy.cpp:
3038         (WebKit::DrawingAreaProxy::setSize):
3039         * UIProcess/DrawingAreaProxy.h:
3040         (WebKit::DrawingAreaProxy::size):
3041         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
3042         (WebKit::LayerBackedDrawingAreaProxy::sizeDidChange):
3043         * UIProcess/LayerBackedDrawingAreaProxy.h:
3044         * UIProcess/TiledDrawingAreaProxy.cpp:
3045         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
3046         * UIProcess/TiledDrawingAreaProxy.h:
3047
3048 2010-12-17  Anders Carlsson  <andersca@apple.com>
3049
3050         Reviewed by Sam Weinig.
3051
3052         Add a WebPageProxy parameter to the DrawingAreaProxy constructor
3053         https://bugs.webkit.org/show_bug.cgi?id=51271
3054
3055         * UIProcess/API/mac/WKView.mm:
3056         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
3057         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::]):
3058         * UIProcess/API/qt/qgraphicswkview.cpp:
3059         (QGraphicsWKView::QGraphicsWKView):
3060         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
3061         (WebKit::ChunkedUpdateDrawingAreaProxy::create):
3062         (WebKit::ChunkedUpdateDrawingAreaProxy::ChunkedUpdateDrawingAreaProxy):
3063         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
3064         * UIProcess/DrawingAreaProxy.cpp:
3065         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
3066         * UIProcess/DrawingAreaProxy.h:
3067         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
3068         (WebKit::LayerBackedDrawingAreaProxy::create):
3069         (WebKit::LayerBackedDrawingAreaProxy::LayerBackedDrawingAreaProxy):
3070         * UIProcess/LayerBackedDrawingAreaProxy.h:
3071         * UIProcess/TiledDrawingAreaProxy.cpp:
3072         (WebKit::TiledDrawingAreaProxy::create):
3073         (WebKit::TiledDrawingAreaProxy::TiledDrawingAreaProxy):
3074         * UIProcess/TiledDrawingAreaProxy.h:
3075         * UIProcess/win/WebView.cpp:
3076         (WebKit::WebView::WebView):
3077         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
3078
3079 2010-12-17  Dan Bernstein  <mitz@apple.com>
3080
3081         Reviewed by Darin Adler.
3082
3083         Add API for "Always Use the Complex Text Code Path"
3084         https://bugs.webkit.org/show_bug.cgi?id=51265
3085
3086         * Shared/WebProcessCreationParameters.cpp:
3087         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Initialize shouldAlwaysUseComplexTextCodePath.
3088         (WebKit::WebProcessCreationParameters::encode): Encode shouldAlwaysUseComplexTextCodePath.
3089         (WebKit::WebProcessCreationParameters::decode): Decode shouldAlwaysUseComplexTextCodePath.
3090         * Shared/WebProcessCreationParameters.h:
3091         * UIProcess/API/C/WKContext.cpp: 
3092         (_WKContextSetAlwaysUsesComplexTextCodePath): Added.
3093         * UIProcess/API/C/WKContextPrivate.h:
3094         * UIProcess/WebContext.cpp:
3095         (WebKit::WebContext::WebContext): Initialize m_alwaysUsesComplexTextCodePath.
3096         (WebKit::WebContext::ensureWebProcess): Set shouldAlwaysUseComplexTextCodePath in the creation parameters.
3097         (WebKit::WebContext::setAlwaysUsesComplexTextCodePath): Added. Sets m_alwaysUsesComplexTextCodePath and
3098         sends a message to the WebProcess.
3099         * UIProcess/WebContext.h:
3100         * WebProcess/WebProcess.cpp:
3101         (WebKit::WebProcess::initializeWebProcess): Call setAlwaysUsesComplexTextCodePath() based on the creation
3102         parameters.
3103         (WebKit::WebProcess::setAlwaysUsesComplexTextCodePath): Added.
3104         * WebProcess/WebProcess.h:
3105         * WebProcess/WebProcess.messages.in: Added SetAlwaysUsesComplexTextCodePath.
3106
3107 2010-12-17  Sam Weinig  <sam@webkit.org>
3108
3109         Reviewed by Darin Adler.
3110
3111         WebKit2: Implement a title attribute per frame
3112         https://bugs.webkit.org/show_bug.cgi?id=51266
3113
3114         Cache the title of each frame on the WebFrameProxy. Removes
3115         the WebPageProxy's cache of the main frame title to just
3116         access the main frame.
3117
3118         We clear the cached title on new committed loads and on failures
3119         to load.
3120
3121         * UIProcess/API/C/WKFrame.cpp:
3122         (WKFrameCopyTitle):
3123         * UIProcess/API/C/WKFrame.h:
3124         * UIProcess/WebFrameProxy.cpp:
3125         (WebKit::WebFrameProxy::didCommitLoad):
3126         (WebKit::WebFrameProxy::didFailLoad):
3127         (WebKit::WebFrameProxy::didChangeTitle):
3128         * UIProcess/WebFrameProxy.h:
3129         (WebKit::WebFrameProxy::title):
3130         * UIProcess/WebPageProxy.cpp:
3131         (WebKit::WebPageProxy::close):
3132         (WebKit::WebPageProxy::pageTitle):
3133         (WebKit::WebPageProxy::didReceiveTitleForFrame):
3134         (WebKit::WebPageProxy::processDidCrash):
3135         * UIProcess/WebPageProxy.h:
3136
3137 2010-12-16  Darin Adler  <darin@apple.com>
3138
3139         Reviewed by Maciej Stachowiak.
3140
3141         Add text encoding menu API for WebKit2
3142         https://bugs.webkit.org/show_bug.cgi?id=51226
3143
3144         * UIProcess/API/C/WKPage.cpp:
3145         (WKPageSupportsTextEncoding): Added.
3146         (WKPageCopyCustomTextEncodingName): Added.
3147         (WKPageSetCustomTextEncodingName): Added.
3148         * UIProcess/API/C/WKPage.h: Added the functions above.
3149
3150         * UIProcess/WebPageProxy.cpp:
3151         (WebKit::WebPageProxy::WebPageProxy): Initialize
3152         m_mainFrameHasCustomRepresentation to false.
3153         (WebKit::WebPageProxy::supportsTextEncoding): Added.
3154         (WebKit::WebPageProxy::setCustomTextEncodingName): Added.
3155         (WebKit::WebPageProxy::didCommitLoadForFrame): Set
3156         m_mainFrameHasCustomRepresentation.
3157
3158         * UIProcess/WebPageProxy.h: Added supportsTextEncoding,
3159         setCustomTextEncodingName, customTextEncodingName, and
3160         m_mainFrameHasCustomRepresentation.
3161
3162         * UIProcess/WebPageProxy.messages.in: Tweaked formatting
3163         (added a blank line).
3164
3165         * WebProcess/WebPage/WebPage.cpp:
3166         (WebKit::WebPage::setCustomTextEncodingName): Added.
3167         * WebProcess/WebPage/WebPage.h: Added setCustomTextEncodingName.
3168
3169         * WebProcess/WebPage/WebPage.messages.in: Added the
3170         SetCustomTextEncodingName message. Tweaked formatting of the
3171         dummy message.
3172
3173 2010-12-17  Sheriff Bot  <webkit.review.bot@gmail.com>
3174
3175         Unreviewed, rolling out r74201.
3176         http://trac.webkit.org/changeset/74201
3177         https://bugs.webkit.org/show_bug.cgi?id=51248
3178
3179         It broke ~6000 layout tests (Requested by Ossy_ on #webkit).
3180
3181         * UIProcess/API/qt/qgraphicswkview.cpp:
3182         (QGraphicsWKView::setGeometry):
3183         (QGraphicsWKView::itemChange):
3184
3185 2010-12-16  Sam Weinig  <sam@webkit.org>
3186
3187         Reviewed by Darin Adler.
3188
3189         Add svn:eol-style native to the message.in files as a favor to Darin Adler.
3190
3191         * PluginProcess/PluginControllerProxy.messages.in: Added property svn:eol-style.
3192         * PluginProcess/PluginProcess.messages.in: Added property svn:eol-style.
3193         * PluginProcess/WebProcessConnection.messages.in: Added property svn:eol-style.
3194         * Shared/Plugins/NPObjectMessageReceiver.messages.in: Added property svn:eol-style.
3195         * UIProcess/Downloads/DownloadProxy.messages.in: Added property svn:eol-style.
3196         * UIProcess/Plugins/PluginProcessProxy.messages.in: Added property svn:eol-style.
3197         * UIProcess/WebContext.messages.in: Added property svn:eol-style.
3198         * UIProcess/WebDatabaseManagerProxy.messages.in: Added property svn:eol-style.
3199         * UIProcess/WebInspectorProxy.messages.in: Added property svn:eol-style.
3200         * UIProcess/WebPageProxy.messages.in: Added property svn:eol-style.
3201         * UIProcess/WebProcessProxy.messages.in: Added property svn:eol-style.
3202         * WebProcess/Authentication/AuthenticationManager.messages.in: Added property svn:eol-style.
3203         * WebProcess/Plugins/PluginProxy.messages.in: Added property svn:eol-style.
3204         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in: Added property svn:eol-style.
3205         * WebProcess/WebPage/WebInspector.messages.in: Added property svn:eol-style.
3206         * WebProcess/WebPage/WebPage.messages.in: Added property svn:eol-style.
3207         * WebProcess/WebProcess.messages.in: Added property svn:eol-style.
3208
3209 2010-12-16  Sam Weinig  <sam@webkit.org>
3210
3211         Reviewed by Anders Carlsson.
3212
3213         Move NSURLCache initialization from the ProcessLauncherMac to the centralized
3214         WebContext initialize WebProcess mechanism.
3215
3216         * Shared/WebProcessCreationParameters.cpp:
3217         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
3218         (WebKit::WebProcessCreationParameters::encode):
3219         (WebKit::WebProcessCreationParameters::decode):
3220         * Shared/WebProcessCreationParameters.h:
3221         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3222         (WebKit::ProcessLauncher::launchProcess):
3223         * UIProcess/mac/WebContextMac.mm:
3224         (WebKit::WebContext::platformInitializeWebProcess):
3225         * WebProcess/WebProcess.cpp:
3226         (WebKit::WebProcess::initializeWebProcess):
3227         * WebProcess/mac/WebProcessMac.mm:
3228         (WebKit::WebProcess::platformInitializeWebProcess):
3229         * WebProcess/mac/WebProcessMainMac.mm:
3230         (WebKit::WebProcessMain):
3231         * WebProcess/win/WebProcessWin.cpp:
3232         (WebKit::WebProcess::platformInitializeWebProcess):
3233         (WebKit::WebProcess::setShouldPaintNativeControls):
3234
3235 2010-12-16  Anders Carlsson  <andersca@apple.com>
3236
3237         Reviewed by Dan Bernstein.
3238
3239         Defer getting a PluginProcessConnection object until the plug-in is initialized
3240         https://bugs.webkit.org/show_bug.cgi?id=51207
3241         <rdar://problem/8731306>
3242
3243         Before this change, we would pass the PluginProcessConnection to the PluginProxy constructor, but not
3244         call PluginProcessConnection::addPluginProxy (which associates the plug-in proxy with the connection)
3245         until the plug-in is initialized.
3246
3247         This could lead to a PluginProxy holding a reference to a PluginProcessConnection when the PluginProxyConnection
3248         itself did not know anything about the PluginProxy. This would happen when a page with plug-ins is opened in a background
3249         tab, with the plug-ins not yet initialized.
3250
3251         Because of this, we could end up in a weird state, where the PluginProcessConnection would think that there are no
3252         more plug-ins alive, and invalidate (and null out) the underlying CoreIPC connection, which would lead to crashes
3253         when trying to send messages to the connection during later initialization.
3254
3255         The fix is to pass the plug-in path to the PluginProxy constructor, and get the connection from PluginProxy::initialize.
3256         
3257         PluginProcessConnection object 
3258         * WebProcess/Plugins/PluginProxy.cpp:
3259         (WebKit::PluginProxy::create):
3260         (WebKit::PluginProxy::PluginProxy):
3261         (WebKit::PluginProxy::initialize):
3262         * WebProcess/Plugins/PluginProxy.h:
3263         * WebProcess/WebPage/WebPage.cpp:
3264         (WebKit::WebPage::createPlugin):
3265
3266 2010-12-16  Enrica Casucci  <enrica@apple.com>
3267
3268         Reviewed by Maciej Stachowiak.
3269
3270         WebKit2: Cannot copy two successive selections using cmd-c
3271         <rdar://problem/8680309> 
3272         https://bugs.webkit.org/show_bug.cgi?id=51203
3273         
3274         The previous implementation assumed a call sequence from AppKit that
3275         was not always happening.
3276         When the user clicks on the pulldown menu, AppKit sends validateUserInterfaceItem
3277         calls for each element that needs validation and we used to count the number of
3278         validation requests being sent to the web process.
3279         All these calls are made before we have the chance to get one reply from the WebProcess.
3280         We also delayed the menu update until we had received all the replies to the validation requests.
3281         At that point we called update on the menu to trigger the validation one more time with
3282         the data retrived from the WebProcess.
3283         When the user simply presses cmd-c, only one call to vaidateUserInterfaceItem is made
3284         and the menu update triggered the validation of all the menu entries causing the internal
3285         state to be out of sync.
3286         The new implementation is very simple: for each validation request from AppKit we send
3287         a request to the WebProcess and we cache a reference to the menu item being validated.
3288         When the WebProcess replies, we retrieve the menu item from our cache and update its state.
3289         
3290         * UIProcess/API/mac/WKView.mm:
3291         (-[WKView initWithFrame:contextRef:pageGroupRef:]): Removed initialization of deleted memebers.
3292         (-[WKView validateUserInterfaceItem:]): Request validation to the WebProcess and return YES to 
3293         allow AppKit to do the keyBinding processing.
3294         (-[WKView _setUserInterfaceItemState:enabled:state:]): Called when the WebProcess replies to the
3295         validation request to check/uncheck and enable/disable the menu item.
3296
3297 2010-12-16  Anders Carlsson  <andersca@apple.com>
3298
3299         Reviewed by Oliver Hunt.
3300
3301         Don't try to call plug-in member functions if the plug-in hasn't been initialized
3302         https://bugs.webkit.org/show_bug.cgi?id=51205
3303         <rdar://problem/8730204>
3304
3305         Make sure that all PluginView functions that can be called while a plug-in has not been
3306         initialized (if the plug-in page is in a background tab for example) have an additional
3307         check for m_isInitialized.
3308
3309         * WebProcess/Plugins/PluginView.cpp:
3310         (WebKit::PluginView::setWindowIsFocused):
3311         (WebKit::PluginView::windowAndViewFramesChanged):
3312         (WebKit::PluginView::platformLayer):
3313         (WebKit::PluginView::scriptObject):
3314         (WebKit::PluginView::privateBrowsingStateChanged):
3315         (WebKit::PluginView::handleEvent):
3316         (WebKit::PluginView::viewGeometryDidChange):
3317         (WebKit::PluginView::setFocus):
3318
3319 2010-12-16  Anders Carlsson  <andersca@apple.com>
3320
3321         Reviewed by John Sullivan.
3322
3323         Add a bunch of m_isStarted assertions to plug-in code.
3324
3325         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3326         (WebKit::NetscapePlugin::frameDidFinishLoading):
3327         (WebKit::NetscapePlugin::frameDidFail):
3328         (WebKit::NetscapePlugin::didEvaluateJavaScript):
3329         (WebKit::NetscapePlugin::streamDidReceiveResponse):
3330         (WebKit::NetscapePlugin::streamDidReceiveData):
3331         (WebKit::NetscapePlugin::streamDidFinishLoading):
3332         (WebKit::NetscapePlugin::streamDidFail):
3333         (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
3334         (WebKit::NetscapePlugin::manualStreamDidReceiveData):
3335         (WebKit::NetscapePlugin::manualStreamDidFinishLoading):
3336         (WebKit::NetscapePlugin::manualStreamDidFail):
3337         (WebKit::NetscapePlugin::handleMouseEvent):
3338         (WebKit::NetscapePlugin::handleWheelEvent):
3339         (WebKit::NetscapePlugin::handleMouseEnterEvent):
3340         (WebKit::NetscapePlugin::handleMouseLeaveEvent):
3341         (WebKit::NetscapePlugin::handleKeyboardEvent):
3342         (WebKit::NetscapePlugin::setFocus):
3343         (WebKit::NetscapePlugin::pluginScriptableNPObject):
3344         (WebKit::NetscapePlugin::privateBrowsingStateChanged):
3345
3346 2010-12-16  Anders Carlsson  <andersca@apple.com>
3347
3348         Reviewed by Darin Adler.
3349
3350         Save the manual plug-in stream data and redeliver it when the plug-in is initialized
3351         https://bugs.webkit.org/show_bug.cgi?id=51201
3352
3353         * WebProcess/Plugins/PluginView.cpp:
3354         (WebKit::PluginView::PluginView):
3355         Initialize m_manualStreamState.
3356
3357         (WebKit::PluginView::manualLoadDidReceiveResponse):
3358         If the plug-in hasn't been initialized, store the response.
3359
3360         (WebKit::PluginView::manualLoadDidReceiveData):
3361         If the plug-in hasn't been initialized, store the data.
3362         
3363         (WebKit::PluginView::manualLoadDidFinishLoading):
3364         If the plug-in hasn't been initialized, update the state.
3365
3366         (WebKit::PluginView::manualLoadDidFail):
3367         If the plug-in hasn't been initialized, store the error and update the state.
3368         
3369         (WebKit::PluginView::initializePlugin):
3370         Call redeliverManualStream.
3371
3372         (WebKit::PluginView::redeliverManualStream):
3373         Redeliver the manual stream to the plug-in.
3374
3375         * WebProcess/Plugins/PluginView.h:
3376
3377 2010-12-16  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
3378
3379         Reviewed by Andreas Kling.
3380
3381         [Qt] Turn off drawing area updates if the item is not visible
3382
3383         The updates are controlled by the QGraphicsItem::visible property.
3384
3385         * UIProcess/API/qt/qgraphicswkview.cpp:
3386         (QGraphicsWKViewPrivate::updateViewportSize):
3387         (QGraphicsWKView::setGeometry):
3388         (QGraphicsWKView::itemChange):
3389
3390 2010-12-15  Dan Bernstein  <mitz@apple.com>
3391
3392         Reviewed by Sam Weinig.
3393
3394         <rdar://problem/8731320> WebProcess’s CFNetwork cache is in ~/Library/Caches/com.apple.WebProcess
3395
3396         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3397         (WebKit::ProcessLauncher::launchProcess): Get the location, disk capacity and memory capacity
3398         of the UI process’s NSURLCache and pass them to the WebProcess.
3399         * WebProcess/mac/WebProcessMainMac.mm:
3400         (WebKit::WebProcessMain): If an NSURLCache location was passed on the command line, set the
3401         shared NSURLCache to that path and use the specified capacities as initial values.
3402
3403 2010-12-15  Dan Bernstein  <mitz@apple.com>
3404
3405         Reviewed by Sam “I blame andersca” Weinig.
3406
3407         Allow responses to be cached by the NSURLCache.
3408
3409         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3410         (WebKit::WebFrameLoaderClient::willCacheResponse): Changed to return the response instead of 0.
3411
3412 2010-12-14  Enrica Casucci  <enrica@apple.com>
3413
3414         Reviewed by Adam Roben.
3415
3416         Add IME support to WebKit2 on Windows
3417         https://bugs.webkit.org/show_bug.cgi?id=51049
3418         The implementation is very close to the one in WebKit.
3419         The main change is the addition of handlers for WM_IME_STARTCOMPOSITION,
3420         WM_IME_REQUEST, WM_IME_COMPOSITION, WM_IME_ENDCOMPOSITION,
3421         WM_IME_SELECT, WM_IME_SETCONTEXT and a number of new messages
3422         between the UI process and the WebProcess to send/retrieve
3423         the data being handled by the messages listed above.
3424
3425         * UIProcess/PageClient.h: Added compositionSelectionChanged for Windows platform.
3426         * UIProcess/WebPageProxy.cpp:
3427         The following methods send synchronous messages to the WebProcess.
3428         (WebKit::WebPageProxy::firstRectForCharacterInSelectedRange): Retrieves the rectangle to position
3429         the cnadidates window.
3430         (WebKit::WebPageProxy::getSelectedText): Retrieves the currently selected text.
3431         The following methods send asynchronous messages to the WebProcess.
3432         (WebKit::WebPageProxy::confirmComposition):
3433         (WebKit::WebPageProxy::setComposition):
3434         (WebKit::WebPageProxy::didChangeSelection): Name changed.
3435         (WebKit::WebPageProxy::didChangeCompositionSelection): Called when there is a change
3436         in the composition selection.
3437         * UIProcess/WebPageProxy.messages.in: Added messages corresponding to the methods above.
3438         * UIProcess/win/WebView.cpp:
3439         (WebKit::WebView::wndProc): Added handling of messages for IME.
3440         The following are the handlers for the window message being sent during composition.
3441         (WebKit::WebView::onIMEComposition):
3442         (WebKit::WebView::onIMEEndComposition):
3443         (WebKit::WebView::onIMERequestCharPosition):
3444         (WebKit::WebView::onIMERequestReconvertString):
3445         (WebKit::WebView::onIMERequest):
3446         (WebKit::WebView::onIMESelect):
3447         (WebKit::WebView::onIMESetContext):
3448         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3449         (WebKit::WebEditorClient::respondToChangedSelection): Added notification
3450         of composition selection changed for Windows.
3451         * WebProcess/WebPage/win/WebPageWin.cpp:
3452         The following are the WebProcess counterparts of the new messages.
3453         (WebKit::WebPage::confirmComposition):
3454         (WebKit::WebPage::setComposition):
3455         (WebKit::WebPage::firstRectForCharacterInSelectedRange):
3456         (WebKit::WebPage::getSelectedText):
3457
3458 2010-12-15  Sam Weinig  <sam@webkit.org>
3459
3460         Reviewed by Brady Eidson.
3461
3462         Loading webkit.org over and over is slower in WebKit2 than WebKit1, looks like page is not cached
3463         <rdar://problem/8774683>
3464         https://bugs.webkit.org/show_bug.cgi?id=51143
3465
3466         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3467         (WebKit::WebFrameLoaderClient::canCachePage): Return true as long as we
3468         are not a custom representation (eg. a PDF).
3469         (WebKit::WebFrameLoaderClient::shouldCacheResponse): Always return true.
3470         * WebProcess/WebPage/WebPage.cpp:
3471         (WebKit::WebPage::updatePreferences): Enable the page cache.
3472
3473 2010-12-15  Simon Fraser  <simon.fraser@apple.com>
3474
3475         Reviewed by Adele Peterson.
3476
3477         WebKit2 in compositing mode no longer has font smoothing
3478         https://bugs.webkit.org/show_bug.cgi?id=50733
3479         
3480         Tell the root GraphicsLayer that its contents are opaque
3481         if the WebPage draws its background, and that background
3482         is not transparent.
3483         
3484         The GraphicsLayer then uses the 'contentsOpaque' setting to
3485         determine whether to use font smoothing.
3486         
3487         Add pageBackgroundTransparencyChanged() to DrawingArea
3488         so that the WebPage can inform the DrawingArea when the
3489         background transparency changes.
3490
3491         * WebProcess/WebPage/DrawingArea.h:
3492         (WebKit::DrawingArea::pageBackgroundTransparencyChanged):
3493         (WebKit::DrawingArea::onPageClose):
3494         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3495         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
3496         (WebKit::LayerBackedDrawingArea::pageBackgroundTransparencyChanged):
3497         * WebProcess/WebPage/LayerBackedDrawingArea.h:
3498         * WebProcess/WebPage/WebPage.cpp:
3499         (WebKit::WebPage::setDrawsBackground):
3500         (WebKit::WebPage::setDrawsTransparentBackground):
3501
3502 2010-12-15  Anders Carlsson  <andersca@apple.com>
3503
3504         Reviewed by Sam Weinig.
3505
3506         Fix assertion in plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html test
3507         https://bugs.webkit.org/show_bug.cgi?id=51136
3508
3509         Ensure that a plug-in that has explicitly cancelled the manual stream won't get any more callbacks.
3510
3511         * PluginProcess/PluginControllerProxy.cpp:
3512         (WebKit::PluginControllerProxy::PluginControllerProxy):
3513         (WebKit::PluginControllerProxy::cancelManualStreamLoad):
3514         (WebKit::PluginControllerProxy::manualStreamDidReceiveResponse):
3515         (WebKit::PluginControllerProxy::manualStreamDidReceiveData):
3516         (WebKit::PluginControllerProxy::manualStreamDidFinishLoading):
3517         (WebKit::PluginControllerProxy::manualStreamDidFail):
3518         * PluginProcess/PluginControllerProxy.h:
3519
3520 2010-12-15  Brian Weinstein  <bweinstein@apple.com>
3521
3522         Windows Build Fix. A .h file was added to the vcproj twice, but not its corresponding cpp file.
3523
3524         * win/WebKit2.vcproj:
3525
3526 2010-12-15  Sam Weinig  <sam@webkit.org>
3527
3528         Reviewed by Anders Carlsson.
3529
3530         WebKit2: Can't add files to an <input type=file>
3531         https://bugs.webkit.org/show_bug.cgi?id=51087
3532
3533         * Scripts/webkit2/messages.py:
3534         Adds new types.
3535
3536         * Shared/API/c/WKBase.h:
3537         Adds WKOpenPanelParametersRef and WKOpenPanelResultListenerRef.
3538
3539         * Shared/APIObject.h:
3540         Adds TypeOpenPanelParameters and TypeOpenPanelResultListener.
3541
3542         * Shared/WebOpenPanelParameters.cpp: Added.
3543         (WebKit::WebOpenPanelParameters::create):
3544         (WebKit::WebOpenPanelParameters::WebOpenPanelParameters):
3545         (WebKit::WebOpenPanelParameters::~WebOpenPanelParameters):
3546         (WebKit::WebOpenPanelParameters::Data::encode):
3547         (WebKit::WebOpenPanelParameters::Data::decode):
3548         * Shared/WebOpenPanelParameters.h: Added.
3549         (WebKit::WebOpenPanelParameters::allowMultipleFiles):
3550         (WebKit::WebOpenPanelParameters::type):
3551         Class representing options one can pass to open panel.
3552
3553         * UIProcess/API/C/WKAPICast.h:
3554         Add casts for WebOpenPanelParameters and WebOpenPanelResultListenerProxy.
3555
3556         * UIProcess/API/C/WKOpenPanelParameters.cpp: Added.
3557         (WKOpenPanelParametersGetTypeID):
3558         (WKOpenPanelParametersGetAllowsMultipleFiles):
3559         * UIProcess/API/C/WKOpenPanelParameters.h: Added.
3560         * UIProcess/API/C/WKOpenPanelResultListener.cpp: Added.
3561         (WKOpenPanelResultListenerGetTypeID):
3562         (WKOpenPanelResultListenerChooseFiles):
3563         (WKOpenPanelResultListenerCancel):
3564         * UIProcess/API/C/WKOpenPanelResultListener.h: Added.
3565         Add API wrappers.
3566
3567         * UIProcess/API/C/WKPage.h:
3568         Add new UI callback, WKPageRunOpenPanelCallback.
3569
3570         * UIProcess/API/C/WebKit2.h:
3571         Add includes for new API headers.
3572
3573         * UIProcess/API/qt/qwkpage.cpp:
3574         (QWKPage::QWKPage):
3575         Stub out the runOpenPanel callback.
3576
3577         * UIProcess/WebOpenPanelResultListenerProxy.cpp: Added.
3578         (WebKit::WebOpenPanelResultListenerProxy::WebOpenPanelResultListenerProxy):
3579         (WebKit::WebOpenPanelResultListenerProxy::~WebOpenPanelResultListenerProxy):
3580         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
3581         (WebKit::WebOpenPanelResultListenerProxy::cancel):
3582         (WebKit::WebOpenPanelResultListenerProxy::invalidate):
3583         * UIProcess/WebOpenPanelResultListenerProxy.h: Added.
3584         (WebKit::WebOpenPanelResultListenerProxy::create):
3585         (WebKit::WebOpenPanelResultListenerProxy::type):
3586         Adds the listener used to choose files for <input type=file>
3587
3588         * UIProcess/WebPageProxy.cpp:
3589         (WebKit::WebPageProxy::runOpenPanel):
3590         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
3591         (WebKit::WebPageProxy::didCancelForOpenPanel):
3592         * UIProcess/WebPageProxy.h:
3593         * UIProcess/WebPageProxy.messages.in:
3594         * UIProcess/WebUIClient.cpp:
3595         (WebKit::WebUIClient::runOpenPanel):
3596         * UIProcess/WebUIClient.h:
3597         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3598         (WebKit::WebChromeClient::runOpenPanel):
3599         * WebProcess/WebPage/WebOpenPanelResultListener.cpp: Added.
3600         (WebKit::WebOpenPanelResultListener::create):
3601         (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):
3602         (WebKit::WebOpenPanelResultListener::~WebOpenPanelResultListener):
3603         (WebKit::WebOpenPanelResultListener::didChooseFiles):
3604         * WebProcess/WebPage/WebOpenPanelResultListener.h: Added.
3605         (WebKit::WebOpenPanelResultListener::disconnectFromPage):
3606         * WebProcess/WebPage/WebPage.cpp:
3607         (WebKit::WebPage::close):
3608         (WebKit::WebPage::setActiveOpenPanelResultListener):
3609         (WebKit::WebPage::didChooseFilesForOpenPanel):
3610         (WebKit::WebPage::didCancelForOpenPanel):
3611         * WebProcess/WebPage/WebPage.h:
3612         (WebKit::WebPage::activeOpenPanelResultListener):
3613         * WebProcess/WebPage/WebPage.messages.in: