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