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