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