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