Choose the compiler based on the Xcode version for Snow Leopard debug builds.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-04-26  Dan Bernstein  <mitz@apple.com>
2
3         Reviewed by Mark Rowe.
4
5         Choose the compiler based on the Xcode version for Snow Leopard debug builds.
6
7         * Configurations/Base.xcconfig:
8         * Configurations/CompilerVersion.xcconfig: Added.
9
10 2011-04-26  Balazs Kelemen  <kbalazs@webkit.org>
11
12         Unreviewed build fix.
13
14         * Platform/Region.cpp: Need to include stdio.h for printf
15         (at least in my Qt-Linux environment).
16
17 2011-04-26  Mihai Parparita  <mihaip@chromium.org>
18
19         Reviewed by Adam Barth.
20
21         Turn off make built-in implicit rules for derived sources makefile
22         https://bugs.webkit.org/show_bug.cgi?id=59418
23
24         We don't use any of make's built-in implicit rules, turning them off
25         speeds up parsing of the makefile.
26
27         * WebKit2.xcodeproj/project.pbxproj:
28
29 2011-04-26  Carlos Garcia Campos  <cgarcia@igalia.com>
30
31         Unreviewed. Fix WebKit2 GTK build after r84785.
32
33         * UIProcess/gtk/WebInspectorGtk.cpp:
34         (WebKit::WebInspectorProxy::platformAttach):
35         (WebKit::WebInspectorProxy::platformDetach):
36         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
37
38 2011-04-26  Carlos Garcia Campos  <cgarcia@igalia.com>
39
40         Unreviewed. Fix WebKit2 GTK build after r84886
41
42         * Platform/gtk/RunLoopGtk.cpp: Include WorkItem.h
43
44 2011-04-25  Adam Barth  <abarth@webkit.org>
45
46         Reviewed by David Levin.
47
48         WebKit2 should play nice with strict OwnPtrs
49         https://bugs.webkit.org/show_bug.cgi?id=59426
50
51         * Platform/CoreIPC/Connection.cpp:
52         (CoreIPC::Connection::waitForMessage):
53             - Lack of OwnPtr in HashMap is sad face.  This code becomes very
54               pretty if we could use OwnPtr in HashMap...
55         * Platform/RunLoop.cpp:
56         (RunLoop::performWork):
57         (RunLoop::scheduleWork):
58         * Platform/RunLoop.h:
59         * Platform/mac/WorkQueueMac.cpp:
60         (WorkQueue::executeWorkItem):
61         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
62         (WebKit::NetscapePluginStream::deliverData):
63
64 2011-04-25  Brian Weinstein  <bweinstein@apple.com>
65
66         Reviewed by Adam Roben.
67
68         WebKit2: Should be able to inspect Web Inspector in Debug Builds
69         https://bugs.webkit.org/show_bug.cgi?id=59378
70
71         * UIProcess/WebInspectorProxy.cpp:
72         (WebKit::createInspectorPageGroup): Creates an inspector page group and enables
73             developer extras in a debug build.
74         (WebKit::WebInspectorProxy::inspectorPageGroup): Calls createInspectorPageGroup.
75
76 2011-04-25  Brian Weinstein  <bweinstein@apple.com>
77
78         Reviewed by Timothy Hatcher.
79
80         WebKit2: Web Inspector's style sidebar fails to display when inspecting element
81         https://bugs.webkit.org/show_bug.cgi?id=58071
82         <rdar://problem/9243093>
83         
84         When creating our WebKit2 inspector views, we were creating them on both Mac and Windows
85         with the empty rect for their initial size. Before we sized them correctly, the inspector
86         was calling window.innerWidth on them, which returned 0, making the sidebar take up 0 pixels.
87
88         * UIProcess/mac/WebInspectorProxyMac.mm:
89         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Create the window with the initial window width
90             and height.
91         * UIProcess/win/WebInspectorProxyWin.cpp:
92         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Ditto.
93
94 2011-04-25  Brian Weinstein  <bweinstein@apple.com>
95
96         Reviewed by Adam Roben.
97
98         Windows part of - WebKit2: Support docked mode for Web Inspector
99         https://bugs.webkit.org/show_bug.cgi?id=59134
100         <rdar://problem/8739005>
101         
102         Implement attaching and detaching of the Web Inspector on Windows,
103         and also support setAttachedWindowHeight when the user changes the height
104         of the docked inspector.
105         
106         This patch doesn't remember whether the user prefers attached or detached, and
107         doesn't remember the user's preferred docked height, but that will be a separate
108         bug.
109         
110         * UIProcess/WebInspectorProxy.cpp:
111         (WebKit::WebInspectorProxy::attach): Set the attached flag and call platform-specific code.
112         (WebKit::WebInspectorProxy::detach): Ditto.
113         (WebKit::WebInspectorProxy::setAttachedWindowHeight): Call platform-specific code.
114         (WebKit::WebInspectorProxy::didClose): Set m_isVisible before calling platformClose. platformClose
115             calls detach if the inspector was docked, and detach needs to know whether or not the window is
116             visible.
117         * UIProcess/WebInspectorProxy.h:
118         * UIProcess/WebInspectorProxy.messages.in: Add new messages.
119         * UIProcess/WebPageProxy.h:
120         (WebKit::WebPageProxy::pageClient): Add a getter for the page client.
121         * UIProcess/win/WebInspectorProxyWin.cpp:
122         (WebKit::WebInspectorProxy::windowReceivedMessage): Relay WM_WINDOWPOSCHANGING messages from the inspected
123             web view to the WebInspectorProxy.
124         (WebKit::WebInspectorProxy::onWebViewWindowPosChangingEvent): Resize the inspected web view to behave well
125             with the docked inspector.
126         (WebKit::WebInspectorProxy::platformClose): If we are attached, detach before destroying.
127         (WebKit::WebInspectorProxy::platformAttach): Set the inspector's host window to be the inspected web view's parent
128             window, so the inspected web view and the inspector are siblings.
129         (WebKit::WebInspectorProxy::platformDetach): Set the inspector's host window to be the standalone inspector window.
130         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight): Size the views.
131         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
132         * WebProcess/WebCoreSupport/WebInspectorClient.h:
133         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
134         (WebKit::WebInspectorFrontendClient::attachWindow): Call WebInspector::attach.
135         (WebKit::WebInspectorFrontendClient::closeWindow): Add a call to the InspectorController to disconnect the inspector frontend
136             from the inspector backend. Without this line, when we close the attached inspector, it won't re-open, because the
137             inspector controller still thinks there is a frontend. This matches WebKit1's behavior, although it seems like this is
138             something WebCore should handle.
139         (WebKit::WebInspectorFrontendClient::detachWindow): Call WebInspector::detach.
140         (WebKit::WebInspectorFrontendClient::setAttachedWindowHeight): Call WebInspector::setAttachedWindowHeight.
141         * UIProcess/DrawingAreaProxyImpl.cpp:
142         (WebKit::DrawingAreaImpl::sendUpdateBackingStoreState): Add an early return if the WebPageProxy's viewSize is empty. 
143             This can be needed if the inspector takes up the whole view, and it is useful to prevent a possible synchronous message
144             from the UIProcess -> WebProcess to update a backing store that isn't visible in the first place.
145         * WebProcess/WebPage/WebInspector.cpp:
146         (WebKit::WebInspector::attach): Send a message to the UIProcess.
147         (WebKit::WebInspector::detach): Ditto.
148         (WebKit::WebInspector::setAttachedWindowHeight): Ditto.
149         * WebProcess/WebPage/WebInspector.h: Remove some dead code.
150
151 2011-04-25  Brian Weinstein  <bweinstein@apple.com>
152
153         Reviewed by Alice Liu.
154
155         WebKit2: Web Inspector: Support highlighting page elements
156         https://bugs.webkit.org/show_bug.cgi?id=59263
157         <rdar://problem/8767659>
158
159         Support highlighting of page elements for the inspector in WebKit2 by
160         having the WebInspectorClient be a PageOverlay Client and be responsible
161         for calling InspectorController::drawNodeHighlight.
162
163         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
164         (WebKit::WebInspectorClient::highlight): Create our overlay if it hasn't been created,
165             or call setNeedsDisplay if it has.
166         (WebKit::WebInspectorClient::hideHighlight): Uninstall the page overlay if it exists.
167         (WebKit::WebInspectorClient::pageOverlayDestroyed):
168         (WebKit::WebInspectorClient::willMoveToWebPage): If it's being destroyed (moving to a null
169             WebPage), clear the member variable.
170         (WebKit::WebInspectorClient::didMoveToWebPage):
171         (WebKit::WebInspectorClient::drawRect): Call InspectorController::drawNodeHighlight.
172         (WebKit::WebInspectorClient::mouseEvent):
173         * WebProcess/WebCoreSupport/WebInspectorClient.h:
174         (WebKit::WebInspectorClient::WebInspectorClient): Add a new member variable.
175
176 2011-04-25  Jon Lee  <jonlee@apple.com>
177
178         Reviewed by Maciej Stachowiak.
179
180         Overlay scroller hard to see on pages with dark background (59183)
181         https://bugs.webkit.org/show_bug.cgi?id=59183
182         <rdar://problem/8975367>
183
184         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
185         (InitWebCoreSystemInterface): adding method to allow changing style
186         * WebProcess/WebPage/WebFrame.cpp:
187         (WebKit::WebFrame::getDocumentBackgroundColor): refactoring to use common code for retrieving background color
188
189 2011-04-24  Dan Bernstein  <mitz@apple.com>
190
191         Reviewed by Maciej Stachowiak.
192
193         <rdar://problem/9329741> Reproducible crash in WebChromeClient::invalidateContentsAndWindow() on simonscat.com
194         https://bugs.webkit.org/show_bug.cgi?id=59299
195
196         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
197         (WebKit::WebChromeClient::invalidateContentsAndWindow): Null-check the document.
198         (WebKit::WebChromeClient::invalidateContentsForSlowScroll): Ditto.
199
200 2011-04-23  Sheriff Bot  <webkit.review.bot@gmail.com>
201
202         Unreviewed, rolling out r84740.
203         http://trac.webkit.org/changeset/84740
204         https://bugs.webkit.org/show_bug.cgi?id=59290
205
206         change breaks apple internal builds and is incorrect
207         (Requested by smfr on #webkit).
208
209         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
210         (InitWebCoreSystemInterface):
211
212 2011-04-22  Jon Lee  <jonlee@apple.com>
213
214         Reviewed by Beth Dakin.
215
216         Overlay scroller hard to see on pages with dark background (59183)
217         https://bugs.webkit.org/show_bug.cgi?id=59183
218         <rdar://problem/8975367>
219         
220         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
221         (InitWebCoreSystemInterface): adding method to allow changing style
222
223 2011-04-22  Brian Weinstein  <bweinstein@apple.com>
224
225         Reviewed by Sam Weinig.
226
227         WebKit2: Stop responsiveness timer before calling runOpenPanel
228         https://bugs.webkit.org/show_bug.cgi?id=59268
229         <rdar://problem/9327944>
230
231         * UIProcess/WebPageProxy.cpp:
232         (WebKit::WebPageProxy::runOpenPanel): Stop the timer before calling WebUIClient::runOpenPanel,
233             because runOpenPanel can spin a nested run loop.
234
235 2011-04-22  Chang Shu  <cshu@webkit.org>
236
237         Reviewed by Kenneth Rohde Christiansen.
238
239         WebKitTestRunner needs layoutTestController.setFrameFlatteningEnabled
240         https://bugs.webkit.org/show_bug.cgi?id=42536
241
242         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
243         (WKBundleSetFrameFlatteningEnabled):
244         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
245         * WebProcess/InjectedBundle/InjectedBundle.cpp:
246         (WebKit::InjectedBundle::setFrameFlatteningEnabled):
247         * WebProcess/InjectedBundle/InjectedBundle.h:
248
249 2011-04-22  Alejandro G. Castro  <alex@igalia.com> and Martin Robinson  <mrobinson@igalia.com>
250
251         Reviewed by Xan Lopez.
252
253         [GTK] Use the libWebCore.a convenience library when compiling WebKit2
254         https://bugs.webkit.org/show_bug.cgi?id=59258
255
256         * GNUmakefile.am: Remove the libWebKit2 convenience library and use the
257         libWebCore convenience library when compiling WebKit2. Not only does this
258         maintain the CPPFLAGS isolation, it prevents double-compilation of WebCore
259         in some cases.
260
261 2011-04-19  Jer Noble  <jer.noble@apple.com>
262
263         Reviewed by Daniel Bates.
264
265         Full Screen from within an <iframe> does not cause <iframe> to resize.
266         https://bugs.webkit.org/show_bug.cgi?id=58638
267
268         Tests: fullscreen/full-screen-frameset-allowed.html
269                fullscreen/full-screen-frameset-not-allowed.html
270
271         * UIProcess/mac/WKFullScreenWindowController.mm:
272         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Cancel the background animation
273             if the full screen animation finishes first.
274         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
275         (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): m_fullScreenRootLayer was uninitialized.
276
277 2011-04-22  Sam Weinig  <sam@webkit.org>
278
279         Reviewed by Brian Weinstein.
280
281         WebKit2: Implement JavaScript unresponsiveness callback
282         https://bugs.webkit.org/show_bug.cgi?id=59248
283
284         Add support for suspending JavaScript in response to a callback.
285
286         * UIProcess/API/C/WKPage.h:
287         * UIProcess/API/qt/qwkpage.cpp:
288         (QWKPage::QWKPage):
289         * UIProcess/WebPageProxy.cpp:
290         (WebKit::WebPageProxy::shouldInterruptJavaScript):
291         * UIProcess/WebPageProxy.h:
292         * UIProcess/WebPageProxy.messages.in:
293         * UIProcess/WebUIClient.cpp:
294         (WebKit::WebUIClient::shouldInterruptJavaScript):
295         * UIProcess/WebUIClient.h:
296         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
297         (WebKit::WebChromeClient::shouldInterruptJavaScript):
298
299 2011-04-22  Dan Bernstein  <mitz@apple.com>
300
301         Reviewed by Sam Weinig.
302
303         Paint the bounding rect of the dirty region instead of individual rectangles when the region
304         covers at least 3/4 of its bounds.
305
306         * WebProcess/WebPage/DrawingAreaImpl.cpp:
307         (WebKit::shouldPaintBoundsRect): Use floating point math so that the logic that was supposed to
308         achieve this actually works.
309
310 2011-04-22  Jer Noble  <jer.noble@apple.com>
311
312         Reviewed by Maciej Stachowiak.
313
314         Crash at WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation + 79
315         https://bugs.webkit.org/show_bug.cgi?id=59225
316
317         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
318         (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Guard against 
319             m_fullScreenRootLayer being NULL.
320         (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.
321
322 2011-04-22  Jer Noble  <jer.noble@apple.com>
323
324         Reviewed by Maciej Stachowiak.
325
326         Allow MediaPlayerPrivateAVFoundation to be disabled via a preference.
327         https://bugs.webkit.org/show_bug.cgi?id=59179
328
329         Add API to allow the WebCore Settings preference to be called from the UIProcess.
330
331         * Shared/WebPreferencesStore.h: Added new preference definition macro.
332         * UIProcess/API/C/WKPreferences.cpp:
333         (WKPreferencesSetAVFoundationEnabled): Added.
334         (WKPreferencesGetAVFoundationEnabled): Added.
335         * UIProcess/API/C/WKPreferences.h:
336         * WebProcess/WebPage/WebPage.cpp:
337         (WebKit::WebPage::updatePreferences): Pass new preference along to WebCore
338             Settings.
339
340 2011-04-22  Brian Weinstein  <bweinstein@apple.com>
341
342         Reviewed by Sam Weinig.
343
344         WebKit2: Stop Responsiveness Timer when WebPageProxy closes or WebProcess crashes
345         https://bugs.webkit.org/show_bug.cgi?id=59210
346
347         * UIProcess/WebPageProxy.cpp:
348         (WebKit::WebPageProxy::close): Stop the responsiveness timer.
349         (WebKit::WebPageProxy::processDidCrash): Ditto.
350
351 2011-04-21  Adam Roben  <aroben@apple.com>
352
353         Give windowless plugins' context menus an owner window in the same thread as the plugin
354
355         In some cases, plugins pass the WKView's HWND to the ::TrackPopupMenu API. ::TrackPopupMenu
356         fails in this case because the WKView's HWND is owned by another process/thread. We work
357         around this by hooking the ::TrackPopupMenu API and providing our own window that's in the
358         same thread as the plugin instead.
359
360         I couldn't figure out how to write a test for this. :-(
361
362         Fixes <http://webkit.org/b/51063> <rdar://problem/8769281> REGRESSION (WebKit2): No context
363         menu appears when right-clicking on windowless Flash plugin
364
365         Reviewed by Brian Weinstein, and looked at suspiciously by Jeff Miller.
366
367         * Platform/Module.h: Added installIATHook on Windows.
368
369         * Platform/win/ModuleWin.cpp:
370         (WebKit::overwriteReadOnlyMemory): New helper function. Basically a wrapper around memcpy,
371         but uses ::VirtualProtect to allow writing to otherwise-read-only memory.
372         (WebKit::findFunctionPointerAddress): New helper function. The first overload iterates over
373         the imported modules and functions looking for the given one. If found, returns the address
374         of the function pointer that is used when calling that function. The second overload calls
375         the first, first passing it an enumerator for the image's imported modules, then passing it
376         an iterator for the image's delay-loaded modules.
377         (WebKit::Module::installIATHook): Added. Finds the address of the function pointer that's
378         used when code in this module calls the given function, then overwrites the function pointer
379         with the passed-in one. Future calls to the given function made by code in this module
380         should then end up calling to the passed-in function instead of the original one.
381
382         * Shared/Plugins/Netscape/NetscapePluginModule.h:
383         (WebKit::NetscapePluginModule::module): Added this simple getter.
384
385         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Added some new Windows-only members.
386
387         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
388         (WebKit::CurrentPluginSetter::CurrentPluginSetter):
389         (WebKit::CurrentPluginSetter::~CurrentPluginSetter):
390         This RAII class sets/unsets the currentPlugin global.
391
392         (WebKit::registerPluginView): Changed to use instanceHandle() instead of the mysterious
393         gInstance.
394         (WebKit::NetscapePlugin::platformPostInitialize): For windowless plugins, hook the
395         ::TrackPopupMenu API and create a window to be used as the owner for context menus created
396         by this plugin. (Also changed the ::CreateWindowExW call for windowed plugins to pass an
397         instance handle so that the window will be associated with WebKit.dll instead of
398         WebKit2WebProcess.exe. This should have no visible effect, but is more correct.)
399         (WebKit::NetscapePlugin::platformDestroy): For windowless plugins, destroy the context menu
400         owner window we created above.
401
402         (WebKit::NetscapePlugin::platformPaint):
403         (WebKit::NetscapePlugin::platformHandleMouseEvent):
404         (WebKit::NetscapePlugin::platformHandleWheelEvent):
405         (WebKit::NetscapePlugin::platformSetFocus):
406         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
407         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
408         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
409         Set ourselves as the current plugin.
410
411         (WebKit::NetscapePlugin::hookedTrackPopupMenu): Added. This is the function that actually
412         gets called when windowless plugins call ::TrackPopupMenu. If the passed-in owner window is
413         owned by the current thread, we have nothing to do; ::TrackPopupMenu should work just fine.
414         Otherwise, we use the current plugin's context menu owner window as the context menu's
415         owner. We also set focus to the new owner window because otherwise weird behavior results
416         (e.g., it's possible to scroll the WKView while the context menu is up).
417
418 2011-04-21  Adam Roben  <aroben@apple.com>
419
420         Use WebCore's do-nothing window class instead of creating our own
421
422         Fixes <http://webkit.org/b/59102> WebKit has too many dummy window classes
423
424         Reviewed by Anders Carlsson.
425
426         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
427         (WebKit::createDummyWindow): Less code!
428
429 2011-04-22  Balazs Kelemen  <kbalazs@webkit.org>
430
431         Reviewed by Kenneth Rohde Christiansen.
432
433         [Qt][WK2] Cannot play flash with NSPluginWrapper
434         https://bugs.webkit.org/show_bug.cgi?id=59125
435
436         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
437         (WebKit::NPN_GetValue): Handle the case when we have been
438         called with a null plugin instance.
439
440 2011-04-22  Andreas Kling  <andreas.kling@nokia.com>
441
442         Reviewed by Sam Weinig.
443
444         [Qt][WK2] Implement DrawingAreaImpl for Qt.
445         https://bugs.webkit.org/show_bug.cgi?id=59171
446
447         * WebKit2.pro: Build files necessary for DrawingAreaImpl.
448         * DerivedSources.pro: Build message receivers for DrawingArea and DrawingAreaProxy.
449
450         * Shared/qt/LayerTreeContextQt.cpp:
451         (WebKit::LayerTreeContext::LayerTreeContext): Stub.
452         (WebKit::LayerTreeContext::~LayerTreeContext): Stub.
453         (WebKit::LayerTreeContext::encode): Stub.
454         (WebKit::LayerTreeContext::decode): Stub.
455         (WebKit::LayerTreeContext::isEmpty): Stub.
456         (WebKit::operator==): Stub.
457
458         * Shared/qt/ShareableBitmapQt.cpp:
459         (WebKit::ShareableBitmap::paint): Don't translate the painter to accomodate the
460         source rect. The rect is already adjusted at the call site.
461
462         * UIProcess/API/qt/qgraphicswkview.h: Add "Impl" to QGraphicsWKView::BackingStoreType.
463
464         * UIProcess/API/qt/qwkpage.cpp:
465         (QWKPagePrivate::createDrawingAreaProxy): Create DrawingAreaProxyImpl if requested.
466         (QWKPagePrivate::paint): Call the correct paint() method for DrawingAreaProxyImpl,
467         since this drawing area will simple ASSERT_NOT_REACHED() in the "normal" paint().
468
469         * WebProcess/WebPage/DrawingArea.cpp:
470         (WebKit::DrawingArea::create): Allow creation of DrawingAreaImpl for Qt.
471
472         * UIProcess/BackingStore.h: Add Qt-specific types and backing store.
473
474         * UIProcess/qt/BackingStoreQt.cpp:
475         (WebKit::BackingStore::paint): Implemented.
476         (WebKit::BackingStore::incorporateUpdate): Implemented.
477         (WebKit::BackingStore::scroll): Implemented using QPixmap::scroll().
478
479         * UIProcess/DrawingAreaProxy.h: Enable drawing area message receivers for Qt.
480         * UIProcess/WebPageProxy.cpp:
481         (WebKit::WebPageProxy::didReceiveMessage): Ditto.
482         * WebProcess/WebPage/DrawingArea.h: Ditto.
483         * WebProcess/WebPage/WebPage.cpp:
484         (WebKit::WebPage::didReceiveMessage): Ditto.
485
486 2011-04-22  Jon Honeycutt  <jhoneycutt@apple.com>
487
488         WinCairo build fix. Unreviewed.
489
490         * WebProcess/Downloads/curl/DownloadCurl.cpp:
491         (WebKit::Download::useCredential):
492         Stubbed.
493         (WebKit::Download::continueWithoutCredential):
494         Stubbed.
495         (WebKit::Download::cancelAuthenticationChallenge):
496         Stubbed.
497
498 2011-04-21  Jon Honeycutt  <jhoneycutt@apple.com>
499
500         Need to support authentication for downloads in WebKit2 on Windows
501         https://bugs.webkit.org/show_bug.cgi?id=59175
502         <rdar://problem/9206151>
503         <rdar://problem/8958280>
504
505         Reviewed by Maciej Stachowiak.
506
507         * WebProcess/Downloads/Download.cpp:
508         Include DownloadAuthenticationClient.h.
509
510         * WebProcess/Downloads/Download.h:
511         Declare a function to get or create the authentication client, a member
512         var to hold it, and functions that the client can call to use a
513         credential, continue without a credential, or cancel an auth challenge.
514
515         * WebProcess/Downloads/DownloadAuthenticationClient.cpp: Added.
516         (WebKit::DownloadAuthenticationClient::DownloadAuthenticationClient):
517         (WebKit::DownloadAuthenticationClient::receivedCredential):
518         Tell the Download to use the credential.
519         (WebKit::DownloadAuthenticationClient::receivedRequestToContinueWithoutCredential):
520         Tell the Download to continue with credentials.
521         (WebKit::DownloadAuthenticationClient::receivedCancellation):
522         Tell the Download to cancel the challenge.
523
524         * WebProcess/Downloads/DownloadAuthenticationClient.h: Added.
525         (WebKit::DownloadAuthenticationClient::create):
526         Return a new DownloadAuthenticationClient.
527         (WebKit::DownloadAuthenticationClient::detach):
528         Clear the Download.
529         (WebKit::DownloadAuthenticationClient::refAuthenticationClient):
530         (WebKit::DownloadAuthenticationClient::derefAuthenticationClient):
531
532         * WebProcess/Downloads/cfnet/DownloadCFNet.cpp:
533         (WebKit::Download::useCredential):
534         Create a CFURLCredentialRef from the WebCore credential, and tell
535         CFNetwork to use it for the auth challenge.
536         (WebKit::Download::continueWithoutCredential):
537         Call CFURLDownloadUseCredential with a null credential.
538         (WebKit::Download::cancelAuthenticationChallenge):
539         Cancel the download, and clear m_download.
540         (WebKit::Download::authenticationClient):
541         Create if needed and return a DownloadAuthenticationClient.
542         (WebKit::Download::platformInvalidate):
543         Detach the DownloadAuthenticationClient.
544         (WebKit::didReceiveAuthenticationChallengeCallback):
545         Call Download::didReceiveAuthenticationChallenge(), passing a
546         WebCore::AuthenticationChallenge with our DownloadAuthenticationClient.
547         (WebKit::Download::receivedCredential):
548         Get the client from the auth challenge, and call through to it.
549         (WebKit::Download::receivedRequestToContinueWithoutCredential):
550         Ditto.
551         (WebKit::Download::receivedCancellation):
552         Ditto.
553
554         * win/WebKit2.vcproj:
555         Add new files to project.
556
557 2011-04-21  Alexey Proskuryakov  <ap@apple.com>
558
559         Reviewed by Maciej Stachowiak.
560
561         Minimize synchronous calls during loading
562         https://bugs.webkit.org/show_bug.cgi?id=59169
563
564         <rdar://problem/9320128> REGRESSION(r84526): WK2 windows unresponsive
565
566         * UIProcess/API/mac/WKView.mm:
567         (-[WKView resignFirstResponder]):
568         (-[WKView _resetTextInputState]):
569         Made _resetTextInputState deal with client side state only, letting Editor composition be
570         discarded more discriminately.
571
572 2011-04-21  Maciej Stachowiak  <mjs@apple.com>
573
574         Reviewed by Adam Roben.
575
576         Add a feature define to allow <details> and <summary> to be disabled
577         https://bugs.webkit.org/show_bug.cgi?id=59118
578         <rdar://problem/9257045>
579
580         * Configurations/FeatureDefines.xcconfig:
581
582 2011-04-21  Ivan Krstić  <ike@apple.com>
583
584         Reviewed by Maciej Stachowiak.
585
586         <rdar://problem/9311103>
587
588         Remove unnecessary QTKitServer and Apple Events permissions
589         from the WebProcess sandbox.
590
591         * WebProcess/com.apple.WebProcess.sb:
592
593 2011-04-21  Ivan Krstić  <ike@apple.com>
594
595         Reviewed by Maciej Stachowiak.
596
597         <rdar://problem/9033535>
598
599         Mute sandbox violations when attempting to read a temporary
600         CFNetwork keychain.
601
602         * WebProcess/com.apple.WebProcess.sb:
603
604 2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
605
606         Reviewed by Sam Weinig.
607
608         Add Frame* to the argument lists of canCopyCut and canPaste
609         https://bugs.webkit.org/show_bug.cgi?id=59153
610
611         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
612         (WebKit::WebEditorClient::canCopyCut):
613         (WebKit::WebEditorClient::canPaste):
614         * WebProcess/WebCoreSupport/WebEditorClient.h:
615
616 2011-04-21  Ivan Krstić  <ike@apple.com>
617
618         Reviewed by Maciej Stachowiak.
619
620         <rdar://problem/8774116>
621
622         The WebProcess sandbox should only allow access to the
623         parts of the Darwin cache directory needed by the Security
624         framework.
625
626         * WebProcess/com.apple.WebProcess.sb:
627
628 2011-04-21  Ivan Krstić  <ike@apple.com>
629
630         Reviewed by Maciej Stachowiak.
631
632         <rdar://problem/9311053>
633
634         The WebProcess sandbox should not allow opening arbitrary
635         IOKit user clients. Restrict to a whitelist required for normal
636         WebProcess operation, including sound and accelerated graphics.
637
638         * WebProcess/com.apple.WebProcess.sb:
639
640 2011-04-21  Ivan Krstić  <ike@apple.com>
641
642         Reviewed by Maciej Stachowiak.
643
644         <rdar://problem/9311037>
645
646         The WebProcess sandbox should not allow modification of the
647         CoreAudio component cache.
648
649         * WebProcess/com.apple.WebProcess.sb:
650
651 2011-04-21  Ivan Krstić  <ike@apple.com>
652
653         Reviewed by Maciej Stachowiak.
654
655         <rdar://problem/9263428>
656
657         The WebProcess sandbox should only allow outbound networking
658         to remote destinations and local kernel controls.
659
660         * WebProcess/com.apple.WebProcess.sb:
661
662 2011-04-21  Sheriff Bot  <webkit.review.bot@gmail.com>
663
664         Unreviewed, rolling out r82052.
665         http://trac.webkit.org/changeset/82052
666         https://bugs.webkit.org/show_bug.cgi?id=59135
667
668         New full screen api should be opt-in, not opt-out. (Requested
669         by jernoble on #webkit).
670
671         * Shared/WebPreferencesStore.h:
672
673 2011-04-21  Beth Dakin  <bdakin@apple.com>
674
675         Reviewed by Dan Bernstein.
676
677         https://bugs.webkit.org/show_bug.cgi?id=59048
678         Need to track whether overlay scrollbar is currently visible and in lower-
679         righthand corner
680         -and corresponding-
681         <rdar://problem/9211232>
682
683         WebPageProxy now stores an IntRect of the scroller thumb set by WebCore through 
684         the client.
685
686         _windowResizeMouseLocationIsInVisibleScrollerThumb tests if the parameter point is 
687         inside the cached scroller thumb rect.
688         * UIProcess/API/mac/WKView.mm:
689         (-[WKView _windowResizeMouseLocationIsInVisibleScrollerThumb:]):
690
691         Client work to cache the rect.
692         * UIProcess/WebPageProxy.cpp:
693         (WebKit::WebPageProxy::WebPageProxy):
694         (WebKit::WebPageProxy::close):
695         (WebKit::WebPageProxy::processDidCrash):
696         (WebKit::WebPageProxy::notifyScrollerThumbIsVisibleInRect):
697         * UIProcess/WebPageProxy.h:
698         (WebKit::WebPageProxy::visibleScrollerThumbRect):
699         * UIProcess/WebPageProxy.messages.in:
700         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
701         (WebKit::WebChromeClient::notifyScrollerThumbIsVisibleInRect):
702         * WebProcess/WebCoreSupport/WebChromeClient.h:
703
704         New WebSystemInterface is needed by WebCore for this.
705         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
706         (InitWebCoreSystemInterface):
707
708 2011-04-21  Andreas Kling  <andreas.kling@nokia.com>
709
710         Reviewed by Kenneth Rohde Christiansen.
711
712         [Qt][WK2] Emit QWKPage::urlChanged() when navigating within the same document.
713         https://bugs.webkit.org/show_bug.cgi?id=59044
714
715         Hook up the didSameDocumentNavigationForFrame callback to QWKPage::urlChanged().
716
717         * UIProcess/API/qt/ClientImpl.cpp:
718         (qt_wk_didSameDocumentNavigationForFrame):
719         * UIProcess/API/qt/ClientImpl.h:
720         * UIProcess/API/qt/qwkpage.cpp:
721         (QWKPage::QWKPage):
722
723 2011-04-20  Alexey Proskuryakov  <ap@apple.com>
724
725         Reviewed by Maciej Stachowiak.
726
727         WebKit2: Unconfirmed inline input session persists after reload
728         https://bugs.webkit.org/show_bug.cgi?id=59054
729         <rdar://problem/9291086>
730
731         Makes the inline input get properly confirmed or discarded when changing selection,
732         navigating to another page, focusing another view in the window, or after a web process
733         crash.
734
735         * Shared/EditorState.h: (WebKit::EditorState::EditorState):
736         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState):
737         Added a variable that Editor sets while processing input method calls. We don't want
738         selection changes caused by -setMarkedText: discard the composition!
739         
740         * UIProcess/PageClient.h:
741         * UIProcess/API/mac/PageClientImpl.h:
742         * UIProcess/API/mac/PageClientImpl.mm:
743         (WebKit::PageClientImpl::updateTextInputState):
744         (WebKit::PageClientImpl::resetTextInputState):
745         Extended updateSecureInputState() to potentially confirm the current inline input session.
746         Added resetTextInputState, which is to be called when we get out of the current web page.
747
748         * UIProcess/API/mac/WKView.mm:
749         (-[WKView resignFirstResponder]): Just call _resetTextInputState instead of dealing with
750         input state here.
751         (-[WKView _updateSecureInputState]): Use _isFocused to make the code simpler.
752         (-[WKView _updateTextInputStateIncludingSecureInputState:]): Confirm the current inline
753         input session if selection changed for any other reason but an input method changing the
754         composition. We will want to do other work here, like dismissing a dictionary pop-up,
755         updating a font panel etc.
756         (-[WKView _resetTextInputState]): Added. We don't want secure text input persist after
757         navigations, crashes an such, and we also don't want input methods to remember inline input
758         state. Relying on selection changed notifications is fragile and insufficient.
759
760         * UIProcess/API/mac/WKViewInternal.h: Added internal functions to keep the build unbroken.
761
762         * UIProcess/WebPageProxy.cpp:
763         (WebKit::WebPageProxy::didCommitLoadForFrame): This is the best chance we have to reset input
764         state for a new page. This doesn't work well for cached page loads, but WK1 is quite broken
765         in that case, too.
766         (WebKit::WebPageProxy::editorStateChanged): Moved some logic up to the client, since the
767         function now does much more than before.
768
769         * UIProcess/WebPageProxy.h:
770         * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::confirmCompositionWithoutDisturbingSelection):
771         * WebProcess/WebPage/WebPage.h:
772         * WebProcess/WebPage/WebPage.messages.in:
773         * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::confirmCompositionWithoutDisturbingSelection):
774         Added confirmCompositionWithoutDisturbingSelection(). When we confirm the composition due
775         to selection change, we obvisouly don't want the selection to move back.
776
777 2011-04-21  Sam Weinig  <sam@webkit.org>
778
779         Reviewed by Simon Fraser.
780
781         Remove warnings from DrawingAreaImpl and related classes
782         https://bugs.webkit.org/show_bug.cgi?id=59120
783
784         DrawingAreaImpl is mature enough for others to adopt. Remove warnings.
785
786         * UIProcess/BackingStore.cpp:
787         * UIProcess/DrawingAreaProxyImpl.cpp:
788         * WebProcess/WebPage/DrawingAreaImpl.cpp:
789         * WebProcess/WebPage/LayerTreeHost.cpp:
790
791 2011-04-21  Sam Weinig  <sam@webkit.org>
792
793         Reviewed by Simon Fraser.
794
795         Deploy GraphicsContextStateSaver in WebKit2
796         https://bugs.webkit.org/show_bug.cgi?id=59116
797
798         * UIProcess/FindIndicator.cpp:
799         (WebKit::FindIndicator::draw):
800         * WebProcess/Plugins/PluginView.cpp:
801         (WebKit::PluginView::paint):
802         * WebProcess/WebPage/FindController.cpp:
803         (WebKit::FindController::drawRect):
804         * WebProcess/WebPage/PageOverlay.cpp:
805         (WebKit::PageOverlay::drawRect):
806         * WebProcess/WebPage/WebPage.cpp:
807         (WebKit::WebPage::drawRect):
808         (WebKit::WebPage::drawPageOverlay):
809
810 2011-04-21  Jessie Berlin  <jberlin@apple.com>
811
812         Reviewed by Sam Weinig.
813
814         WebKit2: Need a way to get a snapshot of the visible contents of a page from the UI Process.
815         https://bugs.webkit.org/show_bug.cgi?id=59035
816
817         Added a sync call from the UI Process to the Web Process with comments saying that it should
818         be removed as soon as possible.
819
820         * UIProcess/API/C/WKPage.cpp:
821         (WKPageVisibleContentsSnapshot):
822         * UIProcess/API/C/WKPagePrivate.h:
823
824         * UIProcess/WebPageProxy.cpp:
825         (WebKit::WebPageProxy::createSnapshotOfVisibleContent):
826         * UIProcess/WebPageProxy.h:
827
828         * WebProcess/WebPage/WebPage.cpp:
829         (WebKit::WebPage::createSnapshotOfVisibleContent):
830         Ask the FrameView for the visibleContentRect, and call scaledSnapshotInDocumentCoordinates
831         with a scale factor of 1 (which preserves the current scaling of the page - e.g. if the
832         page is already zoomed then the snapshot will reflect the zoomed content).
833         * WebProcess/WebPage/WebPage.h:
834         * WebProcess/WebPage/WebPage.messages.in:
835
836 2011-04-20  Dominic Cooney  <dominicc@chromium.org>
837
838         Reviewed by Dimitri Glazkov.
839
840         layoutTestController can create and destroy shadow DOM
841         https://bugs.webkit.org/show_bug.cgi?id=59058
842
843         Support for new methods in WK2 WebKitTestRunner.
844
845         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
846         (WKBundleNodeHandleCopyElementEnsureShadowRoot):
847         (WKBundleNodeHandleRemoveShadowRoot):
848         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
849         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
850         (WebKit::InjectedBundleNodeHandle::elementShadowRoot):
851         (WebKit::InjectedBundleNodeHandle::elementEnsureShadowRoot):
852         (WebKit::InjectedBundleNodeHandle::elementRemoveShadowRoot):
853         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
854
855 2011-04-20  Anders Carlsson  <andersca@apple.com>
856
857         Reviewed by Sam Weinig.
858
859         Don't discard backing stores for hung web processes
860         https://bugs.webkit.org/show_bug.cgi?id=59039
861         <rdar://problem/9237090>
862
863         * UIProcess/WebPageProxy.cpp:
864         (WebKit::WebPageProxy::viewStateDidChange):
865         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
866         (WebKit::WebPageProxy::processDidBecomeResponsive):
867         Call updateBackingStoreDiscardableState.
868
869         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
870         Never mark the backing store as discardable if the web process is hung
871
872 2011-04-20  Maciej Stachowiak  <mjs@apple.com>
873
874         Reviewed by Sam Weinig.
875
876         Reproducible crash under WebPageProxy::didReceiveEvent
877         https://bugs.webkit.org/show_bug.cgi?id=59036
878         <rdar://problem/9252083>
879
880         * UIProcess/API/mac/WKView.mm:
881         (-[WKView _resendKeyDownEvent:]): Protect against self-destruction
882         when re-dispatching the event.        
883         * UIProcess/WebProcessProxy.cpp:
884         (WebKit::WebProcessProxy::createWebPage): Fixed a type mismatch
885         I noticed while debugging.
886
887 2011-04-20  Timothy Hatcher  <timothy@apple.com>
888
889         Make the Web Insepctor come to the front when a breakpoint is hit.
890
891         <https://webkit.org/b/57480> REGRESSION (WebKit2): Inspector doesn't come to the front when a breakpoint is hit in the debugger
892         <rdar://problem/9209472>
893
894         Reviewed by Adam Roben.
895
896         * UIProcess/WebInspectorProxy.cpp:
897         (WebKit::WebInspectorProxy::bringToFront): Added. Call platformBringToFront.
898         * UIProcess/WebInspectorProxy.h:
899         * UIProcess/WebInspectorProxy.messages.in: Added BringToFront.
900         * UIProcess/mac/WebInspectorProxyMac.mm:
901         (WebKit::WebInspectorProxy::platformBringToFront): Added. Call orderFront:.
902         * UIProcess/win/WebInspectorProxyWin.cpp:
903         (WebKit::WebInspectorProxy::platformBringToFront): Added. Call ShowWindow.
904         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
905         (WebKit::WebInspectorFrontendClient::bringToFront): Call WebInspector::bringToFront.
906         * WebProcess/WebPage/WebInspector.cpp:
907         (WebKit::WebInspector::bringToFront): Added. Send WebInspectorProxy::BringToFront message.
908         * WebProcess/WebPage/WebInspector.h: Added bringToFront.
909
910 2011-04-20  Chris Marrin  <cmarrin@apple.com>
911
912         Reviewed by Adam Roben.
913
914         REGRESSION (WebKit2): CSS animations on pages that use accelerated compositing stop after switching tabs
915         https://bugs.webkit.org/show_bug.cgi?id=57868
916         
917         Subclassed setRootCompositingLayer so it can call ensureAnimationsSubmitted on Win.
918
919         * WebProcess/WebPage/ca/LayerTreeHostCA.h:
920             Make setRootCompositingLayer protected so it can be called from subclass
921         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
922             Override setRootCompositingLayer to add call to root layer's
923             PlatformCALayer::ensureAnimationsSubmitted method
924         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h:
925
926 2011-04-18  Eric Carlson  <eric.carlson@apple.com>
927
928         Reviewed by Dan Bernstein.
929
930         Adopt QTKit API for listing and deleting file in its media cache.
931         <rdar://problem/9130029> 
932
933         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
934         (InitWebCoreSystemInterface): Initialize new functions.
935
936 2011-04-20  Alejandro G. Castro  <alex@igalia.com>
937
938         Fixed GTK+ compilation after r84206.
939
940         * GNUmakefile.am:
941
942 2011-04-20  Adam Roben  <aroben@apple.com>
943
944         Remove some unnecessary VS junk related to NativeWebMouseEventWin.cpp
945
946         * win/WebKit2.vcproj:
947
948 2011-04-20  Balazs Kelemen  <kbalazs@webkit.org>
949
950         Reviewed by Csaba Osztrogonác.
951
952         [Qt] Cleanup includepath adjustment for generated files
953         https://bugs.webkit.org/show_bug.cgi?id=58869
954
955         * WebKit2.pri: Add the directory of generated files to the include
956         path with absolute path to make it valid in the final build step.
957
958 2011-04-19  Anders Carlsson  <andersca@apple.com>
959
960         Reviewed by Sam Weinig.
961
962         UI process thinks the page is unresponsive when a plug-in is showing a context menu
963         https://bugs.webkit.org/show_bug.cgi?id=58943
964         <rdar://problem/9299901>
965
966         Change the HandleMouseEvent message to have a delayed reply and make the PluginControllerProxy
967         respond to it immediately, before even passing the event to the plug-in. Since it doesn't matter
968         for mouse events whether the plug-in handled them or not we can do this.
969
970         Another solution could have been to make handleMouseEvent an asynchronous message, but that could
971         mess up the message ordering so this seemed like the least intrusive change.
972
973         * PluginProcess/PluginControllerProxy.cpp:
974         (WebKit::PluginControllerProxy::handleMouseEvent):
975         * PluginProcess/PluginControllerProxy.h:
976         * PluginProcess/PluginControllerProxy.messages.in:
977
978 2011-04-19  Anders Carlsson  <andersca@apple.com>
979
980         Reviewed by Dan Bernstein.
981
982         Terminate hung plug-in processes after 45 seconds
983         https://bugs.webkit.org/show_bug.cgi?id=58932
984         <rdar://problem/8083219>
985
986         * UIProcess/Plugins/PluginProcessManager.cpp:
987         (WebKit::PluginProcessManager::pluginSyncMessageSendTimedOut):
988         Find the plug-in process proxy and terminate it.
989
990         (WebKit::PluginProcessManager::pluginProcessWithPath):
991         Add new helper function.
992
993         (WebKit::PluginProcessManager::getOrCreatePluginProcess):
994         Call pluginProcessWithPath.
995
996         * UIProcess/Plugins/PluginProcessProxy.cpp:
997         (WebKit::PluginProcessProxy::terminate):
998         Terminate the process.
999
1000         * UIProcess/Plugins/PluginProcessProxy.h:
1001         * UIProcess/WebProcessProxy.cpp:
1002         (WebKit::WebProcessProxy::pluginSyncMessageSendTimedOut):
1003         Call PluginProcessManager::pluginSyncMessageSendTimedOut.
1004
1005         * UIProcess/WebProcessProxy.h:
1006         * UIProcess/WebProcessProxy.messages.in:
1007         Add PluginSyncMessageSendTimedOut message.
1008
1009         * WebProcess/Plugins/PluginProcessConnection.cpp:
1010         (WebKit::defaultSyncMessageTimeout):
1011         (WebKit::PluginProcessConnection::PluginProcessConnection):
1012         Set a sync message timeout on the plug-in process connection.
1013
1014         (WebKit::PluginProcessConnection::syncMessageSendTimedOut):
1015         Send a message to the web process proxy.
1016
1017 2011-04-19  Alexey Proskuryakov  <ap@apple.com>
1018
1019         Reviewed by Adele Peterson.
1020
1021         WebKit2: Merge SelectionState and TextInputState
1022         https://bugs.webkit.org/show_bug.cgi?id=58919
1023
1024         Combined TextInputState and EditorState in one structure, which is updated whenever we get
1025         a chance to. There is no sense to keep possibly stale SelectionState data when we have already
1026         requested the most recent data synchronously.
1027
1028         This also simplifies the code, as we don't need to pass the state around in a separate variable.
1029
1030         * GNUmakefile.am:
1031         * Scripts/webkit2/messages.py:
1032         * Shared/EditorState.h: Copied from Source/WebKit2/Shared/SelectionState.h.
1033         (WebKit::EditorState::EditorState):
1034         * Shared/SelectionState.h: Removed.
1035         * Shared/mac/TextInputState.h: Removed.
1036         * UIProcess/API/mac/PageClientImpl.h:
1037         * UIProcess/API/mac/PageClientImpl.mm:
1038         (WebKit::PageClientImpl::interpretKeyEvent):
1039         * UIProcess/API/mac/WKView.mm:
1040         (-[WKView validRequestorForSendType:returnType:]):
1041         (-[WKView validateUserInterfaceItem:]):
1042         (-[WKView shouldDelayWindowOrderingForEvent:]):
1043         (-[WKView doCommandBySelector:]):
1044         (-[WKView insertText:replacementRange:]):
1045         (-[WKView _handleStyleKeyEquivalent:]):
1046         (-[WKView _executeSavedKeypressCommands]):
1047         (-[WKView inputContext]):
1048         (-[WKView hasMarkedText]):
1049         (-[WKView unmarkText]):
1050         (-[WKView setMarkedText:selectedRange:replacementRange:]):
1051         (-[WKView attributedSubstringForProposedRange:actualRange:]):
1052         (-[WKView _interpretKeyEvent:savingCommandsTo:WebCore::]):
1053         (-[WKView _updateSecureInputState]):
1054         * UIProcess/API/mac/WKViewInternal.h:
1055         * UIProcess/PageClient.h:
1056         * UIProcess/WebPageProxy.cpp:
1057         (WebKit::WebPageProxy::editorStateChanged):
1058         * UIProcess/WebPageProxy.h:
1059         (WebKit::WebPageProxy::editorState):
1060         (WebKit::WebPageProxy::hasSelectedRange):
1061         (WebKit::WebPageProxy::isContentEditable):
1062         * UIProcess/WebPageProxy.messages.in:
1063         * UIProcess/mac/WebPageProxyMac.mm:
1064         (WebKit::WebPageProxy::setComposition):
1065         (WebKit::WebPageProxy::confirmComposition):
1066         (WebKit::WebPageProxy::insertText):
1067         (WebKit::WebPageProxy::executeKeypressCommands):
1068         (WebKit::WebPageProxy::writeSelectionToPasteboard):
1069         (WebKit::WebPageProxy::readSelectionFromPasteboard):
1070         (WebKit::WebPageProxy::interpretQueuedKeyEvent):
1071         * UIProcess/win/WebView.cpp:
1072         (WebKit::WebView::compositionSelectionChanged):
1073         (WebKit::WebView::onIMEComposition):
1074         (WebKit::WebView::onIMEEndComposition):
1075         (WebKit::WebView::onIMERequestCharPosition):
1076         (WebKit::WebView::onIMERequest):
1077         * WebKit2.xcodeproj/project.pbxproj:
1078         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1079         (WebKit::WebEditorClient::respondToChangedSelection):
1080         * WebProcess/WebPage/WebPage.cpp:
1081         (WebKit::WebPage::editorState):
1082         * WebProcess/WebPage/WebPage.h:
1083         * WebProcess/WebPage/WebPage.messages.in:
1084         * WebProcess/WebPage/mac/WebPageMac.mm:
1085         (WebKit::WebPage::handleEditingKeyboardEvent):
1086         (WebKit::WebPage::setComposition):
1087         (WebKit::WebPage::confirmComposition):
1088         (WebKit::WebPage::insertText):
1089         (WebKit::WebPage::executeKeypressCommands):
1090         * win/WebKit2.vcproj:
1091
1092 2011-04-19  Alexey Proskuryakov  <ap@apple.com>
1093
1094         Reviewed by Timothy Hatcher.
1095
1096         100% reproducible crash when right-clicking any element in Web Inspector on any page
1097         https://bugs.webkit.org/show_bug.cgi?id=58822
1098
1099         Web Inspector changes selection from JavaScript, and checks in UI process are insufficient
1100         when selection is changing asynchronously.
1101
1102         * WebProcess/WebPage/mac/WebPageMac.mm:
1103         (WebKit::WebPage::writeSelectionToPasteboard): Check that there is a selection, matching WK1
1104         and UI process side. Perhaps the check should really be in WebCore, but for now, it's a
1105         WebKit responsibility.
1106         (WebKit::WebPage::readSelectionFromPasteboard): Same check, for no other reason but consistency.
1107
1108 2011-04-19  Anders Carlsson  <andersca@apple.com>
1109
1110         Reviewed by Sam Weinig.
1111
1112         Add syncMessageSendTimedOut CoreIPC Connection::Client member function
1113         https://bugs.webkit.org/show_bug.cgi?id=58928
1114
1115         * Platform/CoreIPC/Connection.cpp:
1116         (CoreIPC::Connection::waitForSyncReply):
1117         Call syncMessageSendTimedOut.
1118
1119         * Platform/CoreIPC/Connection.h:
1120         Add syncMessageSendTimedOut to Connection::Client.
1121
1122         * PluginProcess/PluginProcess.cpp:
1123         * PluginProcess/PluginProcess.h:
1124         * PluginProcess/WebProcessConnection.cpp:
1125         * PluginProcess/WebProcessConnection.h:
1126         * UIProcess/Plugins/PluginProcessProxy.cpp:
1127         * UIProcess/Plugins/PluginProcessProxy.h:
1128         * UIProcess/WebProcessProxy.cpp:
1129         * UIProcess/WebProcessProxy.h:
1130         * WebProcess/Plugins/PluginProcessConnection.cpp:
1131         * WebProcess/Plugins/PluginProcessConnection.h:
1132         * WebProcess/WebProcess.cpp:
1133         * WebProcess/WebProcess.h:
1134         Add syncMessageSendTimedOut stubs.
1135
1136 2011-04-19  Anders Carlsson  <andersca@apple.com>
1137
1138         Reviewed by Alexey Proskuryakov.
1139
1140         Replace the didFailToSendSyncMessage Connection::Client function with a flag
1141         https://bugs.webkit.org/show_bug.cgi?id=58923
1142
1143         * Platform/CoreIPC/Connection.cpp:
1144         (CoreIPC::Connection::Connection):
1145         Initialize m_shouldExitOnSyncMessageSendFailure to false.
1146
1147         (CoreIPC::Connection::setShouldExitOnSyncMessageSendFailure):
1148         Set m_didCloseOnConnectionWorkQueueCallback.
1149
1150         (CoreIPC::Connection::sendSyncMessage):
1151         Call didFailToSendSyncMessage if we fail to send the sync message for some reason.
1152
1153         (CoreIPC::Connection::didFailToSendSyncMessage):
1154         if m_shouldExitOnSyncMessageSendFailure is true, exit.
1155
1156         * Platform/CoreIPC/Connection.h:
1157         Remove didFailToSendSyncMessage from Connection::Client.
1158
1159         * PluginProcess/PluginProcess.cpp:
1160         * PluginProcess/PluginProcess.h:
1161         Remove didFailToSendSyncMessage.
1162
1163         * WebProcess/WebProcess.cpp:
1164         (WebKit::WebProcess::initialize):
1165         * WebProcess/WebProcess.h:
1166         Remove didFailToSendSyncMessage. Call setShouldExitOnSyncMessageSendFailure on our
1167         UI process connection.
1168
1169 2011-04-19  Anders Carlsson  <andersca@apple.com>
1170
1171         Reviewed by Sam Weinig.
1172
1173         Add a way to set the default sync message timeout for a CoreIPC connection
1174         https://bugs.webkit.org/show_bug.cgi?id=58908
1175
1176         * Platform/CoreIPC/Connection.cpp:
1177         (CoreIPC::Connection::Connection):
1178         Initialize m_defaultSyncMessageTimeout.
1179
1180         (CoreIPC::Connection::setDefaultSyncMessageTimeout):
1181         Set the m_defaultSyncMessageTimeout member variable.
1182
1183         (CoreIPC::Connection::waitForSyncReply):
1184         Handle the timeout being one of our two special magic values.
1185
1186         * Platform/CoreIPC/Connection.h:
1187         Add a DefaultTimeout constant and change the NoTimeout constant to be -1.
1188
1189 2011-04-19  Vsevolod Vlasov  <vsevik@chromium.org>
1190
1191         Reviewed by Pavel Feldman.
1192
1193         Web Inspector: Rename lengthReceived to encodedDataLength/dataLength
1194         https://bugs.webkit.org/show_bug.cgi?id=58883
1195
1196         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1197         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
1198         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1199
1200 2011-04-19  Andreas Kling  <andreas.kling@nokia.com>
1201
1202         Reviewed by Antonio Gomes.
1203
1204         WebKit2: Typo fix in WebPopupMenu::Type.
1205         https://bugs.webkit.org/show_bug.cgi?id=58891
1206
1207         Fixed a typo, Seperator -> Separator.
1208         Also removed m_ prefix on an argument variable name.
1209
1210         * Shared/WebPopupItem.h:
1211         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1212         (WebKit::WebPopupMenuProxyMac::populate):
1213         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1214         (WebKit::WebPopupMenu::populateItems):
1215
1216 2011-04-19  Jon Honeycutt  <jhoneycutt@apple.com>
1217
1218         WKContextDownloadURLRequest() should return a WKDownloadRef
1219         https://bugs.webkit.org/show_bug.cgi?id=58867
1220         Part of <rdar://problem/8931717>
1221
1222         Reviewed by Steve Falkenburg.
1223
1224         * UIProcess/API/C/WKContext.cpp:
1225         (WKContextDownloadURLRequest):
1226         Return the result of calling WebContext::download().
1227
1228         * UIProcess/API/C/WKContext.h:
1229         Updated return type of WKContextDownloadURLRequest().
1230
1231         * UIProcess/WebContext.cpp:
1232         (WebKit::WebContext::download):
1233         Return the DownloadProxy returned by createDownloadProxy().
1234         (WebKit::WebContext::createDownloadProxy):
1235         Return the DownloadProxy.
1236
1237         * UIProcess/WebContext.h:
1238         Changed return type of download() and createDownloadProxy().
1239
1240         * UIProcess/WebPageProxy.cpp:
1241         (WebKit::WebPageProxy::receivedPolicyDecision):
1242         Call the DownloadProxy's downloadID() function to get the ID.
1243
1244 2011-04-18  Jia Pu  <jpu@apple.com>
1245
1246         Reviewed by Mark Rowe.
1247
1248         WebKit needs to stop importing <AppKit/NSTextChecker.h>
1249         https://bugs.webkit.org/show_bug.cgi?id=58798
1250         <rdar://problem/9294938>
1251
1252         Use public header <AppKit/NSSpellChecker.h> instead.
1253
1254         * UIProcess/mac/CorrectionPanel.h:
1255         * UIProcess/mac/CorrectionPanel.mm:
1256         (correctionIndicatorType):
1257         (WebKit::CorrectionPanel::show):
1258         (WebKit::CorrectionPanel::dismissInternal):
1259         (WebKit::CorrectionPanel::handleAcceptedReplacement):
1260         * UIProcess/mac/TextCheckerMac.mm:
1261         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1262
1263 2011-04-05  Jer Noble  <jer.noble@apple.com>
1264
1265         Reviewed by Sam Weinig.
1266
1267         WebKit2: WKTR should support WebKit2 full screen APIs
1268         https://bugs.webkit.org/show_bug.cgi?id=56318
1269
1270         Add a new WKBundlePage API for Full Screen events, and move some of the implementation
1271         of WebFullScreenManager into the new InjectedBundlePageFullScreenClient class, so that
1272         the default behavior can be overridden by a WKBundlePageFullScreenClient.
1273
1274         * WebKit2.xcodeproj/project.pbxproj:
1275         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1276         (WebKit::WebFullScreenManager::supportsFullScreen): Moved contents into InjectedBundlePageFullScreenClient.
1277         (WebKit::WebFullScreenManager::enterFullScreenForElement): Ditto.
1278         (WebKit::WebFullScreenManager::exitFullScreenForElement): Ditto.
1279         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1280         (WKBundlePageSetFullScreenClient): Added.
1281         (WKBundlePageWillEnterFullScreenForElement): Added.
1282         (WKBundlePageDidEnterFullScreenForElement): Added.
1283         (WKBundlePageWillExitFullScreenForElement): Added.
1284         (WKBundlePageDidExitFullScreenForElement): Added.
1285         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1286         * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp: Added.
1287         (WebKit::InjectedBundlePageFullScreenClient::supportsFullScreen): Added. 
1288         (WebKit::InjectedBundlePageFullScreenClient::enterFullScreenForElement): Added.
1289         (WebKit::InjectedBundlePageFullScreenClient::exitFullScreenForElement): Added.
1290         * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h: Added.
1291         * WebProcess/WebPage/WebPage.cpp:
1292         (WebKit::WebPage::initializeInjectedBundleFullScreenClient): Added.
1293         * WebProcess/WebPage/WebPage.h:
1294         (WebKit::WebPage::injectedBundleFullScreenClient): Added.
1295
1296 2011-04-18  Alexey Proskuryakov  <ap@apple.com>
1297
1298         Reviewed by Maciej Stachowiak.
1299
1300         Re-add a null check lost in r83081
1301         https://bugs.webkit.org/show_bug.cgi?id=58846
1302
1303         * WebProcess/WebPage/mac/WebPageMac.mm:
1304         (WebKit::WebPage::getSelectedRange):
1305
1306 2011-04-18  Andreas Kling  <kling@webkit.org>
1307
1308         Reviewed by Kenneth Rohde Christiansen.
1309
1310         [Qt][WK2] Clean up tool-tip/status-bar confusion.
1311         https://bugs.webkit.org/show_bug.cgi?id=58844
1312
1313         Tool-tips were incorrectly hooked up to the status bar text.
1314         Chrome::setStatusbarText() now correctly causes the QWKPage::statusBarMessage() signal.
1315
1316         New API:
1317         - QWKPage::toolTipChanged(const QString& toolTip) [signal]
1318
1319         QGraphicsWKView will automatically listen for this and set its own toolTip().
1320
1321         * UIProcess/API/qt/ClientImpl.cpp:
1322         (qt_wk_setStatusText):
1323         * UIProcess/API/qt/ClientImpl.h:
1324         * UIProcess/API/qt/qgraphicswkview.cpp:
1325         (QGraphicsWKView::QGraphicsWKView):
1326         (QGraphicsWKViewPrivate::onToolTipChanged):
1327         * UIProcess/API/qt/qgraphicswkview.h:
1328         * UIProcess/API/qt/qwkpage.cpp:
1329         (QWKPagePrivate::toolTipChanged):
1330         (QWKPage::QWKPage):
1331         * UIProcess/API/qt/qwkpage.h:
1332
1333 2011-04-18  Maciej Stachowiak  <mjs@apple.com>
1334
1335         Reviewed by Dan Bernstein.
1336
1337         sandbox violation for ~/Library/Dictionaries
1338         https://bugs.webkit.org/show_bug.cgi?id=58841
1339         <rdar://problem/9294770>
1340
1341         * WebProcess/com.apple.WebProcess.sb: Add to sandbox profile.
1342         No obvious harm from allowing this, though it's not 100% clear
1343         why it's needed.
1344
1345 2011-04-18  Anders Carlsson  <andersca@apple.com>
1346
1347         Try to fix the Windows build.
1348
1349         * Scripts/webkit2/messages.py:
1350
1351 2011-04-18  Anders Carlsson  <andersca@apple.com>
1352
1353         Reviewed by Dan Bernstein.
1354
1355         Get rid of WebProcessProxyLegacyMessage
1356         https://bugs.webkit.org/show_bug.cgi?id=58825
1357
1358         * GNUmakefile.am:
1359         * Platform/CoreIPC/MessageID.h:
1360         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h: Removed.
1361         * UIProcess/WebProcessProxy.cpp:
1362         * WebKit2.xcodeproj/project.pbxproj:
1363         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1364         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1365         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1366         * WebProcess/WebPage/WebPage.cpp:
1367         * win/WebKit2.vcproj:
1368
1369 2011-04-18  Anders Carlsson  <andersca@apple.com>
1370
1371         Fix build.
1372
1373         * UIProcess/Plugins/PluginInfoStore.h:
1374
1375 2011-04-18  Anders Carlsson  <andersca@apple.com>
1376
1377         Reviewed by Sam Weinig.
1378
1379         Use the message generator for the GetPluginProcessConnection message
1380         https://bugs.webkit.org/show_bug.cgi?id=58815
1381
1382         * Platform/CoreIPC/HandleMessage.h:
1383         (CoreIPC::callMemberFunction):
1384         (CoreIPC::handleMessageDelayed):
1385         Add helper functions.
1386
1387         * UIProcess/Plugins/PluginInfoStore.h:
1388         Mark class noncopyable.
1389
1390         * UIProcess/Plugins/PluginProcessManager.cpp:
1391         (WebKit::PluginProcessManager::getPluginProcessConnection):
1392         This now takes a delayed reply.
1393
1394         * UIProcess/Plugins/PluginProcessProxy.cpp:
1395         (WebKit::PluginProcessProxy::getPluginProcessConnection):
1396         This now takes a delayed reply.
1397
1398         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
1399         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
1400         Call DelayedReply::send.
1401
1402         * UIProcess/WebProcessProxy.cpp:
1403         (WebKit::WebProcessProxy::getPluginProcessConnection):
1404         This now takes a delayed reply.
1405         
1406         (WebKit::WebProcessProxy::didReceiveSyncMessage):
1407         No need to handle this message here.
1408
1409         * UIProcess/WebProcessProxy.messages.in:
1410         Add GetPluginProcessConnection message.
1411
1412         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1413         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1414         Don't use deprecatedSendSync.
1415
1416 2011-04-18  Anders Carlsson  <andersca@apple.com>
1417
1418         Reviewed by Adam Roben.
1419
1420         Finish implementing delayed sync replies in the CoreIPC message generator
1421         https://bugs.webkit.org/show_bug.cgi?id=58814
1422
1423         Put the DelayedReply function definitions in the .cpp file and fix bugs found by
1424         actually trying to compile the generated files.
1425
1426         * Scripts/webkit2/messages.py:
1427         * Scripts/webkit2/messages_unittest.py:
1428
1429 2011-04-18  Anders Carlsson  <andersca@apple.com>
1430
1431         Reviewed by Adam Roben.
1432
1433         Reproducible crash in Find on Page, on pages that use accelerated compositing
1434         https://bugs.webkit.org/show_bug.cgi?id=58793
1435         <rdar://problem/9295870>
1436
1437         Move the call to PageOverlay::setNeedsDisplay() back to WebPage::installPageOverlay;
1438         it needs to be called after we've told the drawing area that a page overlay has been installed.
1439
1440         * WebProcess/WebPage/PageOverlay.cpp:
1441         (WebKit::PageOverlay::setPage):
1442         * WebProcess/WebPage/WebPage.cpp:
1443         (WebKit::WebPage::installPageOverlay):
1444
1445 2011-04-18  Jeff Miller  <jeffm@apple.com>
1446
1447         Reviewed by Timothy Hatcher.
1448
1449         WKFrameLoadState should be a uint32_t to match our API conventions
1450         https://bugs.webkit.org/show_bug.cgi?id=58785
1451
1452         * UIProcess/API/C/WKFrame.h: typedef WKFrameLoadState as a uint32_t and define its values as an anonymous enum.
1453
1454 2011-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1455
1456         Unreviewed. Fix WebKit2 GTK build after 84017.
1457
1458         * GNUmakefile.am:
1459         * Shared/NativeWebMouseEvent.h:
1460         (WebKit::NativeWebMouseEvent::nativeEvent):
1461         * Shared/gtk/NativeWebMouseEventGtk.cpp: Copied from Source/WebKit2/Shared/NativeWebMouseEvent.h.
1462         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
1463         * UIProcess/gtk/WebView.cpp:
1464         (WebKit::WebView::handleMouseEvent):
1465
1466 2011-04-17  David Kilzer  <ddkilzer@apple.com>
1467
1468         <http://webkit.org/b/58463> Switch HTTP pipelining from user default to private setting
1469         <rdar://problem/9268729>
1470
1471         Reviewed by Dan Bernstein.
1472
1473         This replaces support for the WebKitEnableHTTPPipelining user
1474         default with methods on the WebCore::ResourceRequest class in
1475         WebCore, the WebView class in WebKit1, and the WebContext class
1476         in WebKit2.  It also removes support for the
1477         WebKitForceHTTPPipeliningPriorityHigh user default which was not
1478         needed.
1479
1480         * UIProcess/API/C/WKContext.cpp:
1481         (_WKContextSetHTTPPipeliningEnabled): Added.
1482         * UIProcess/API/C/WKContextPrivate.h:
1483         (_WKContextSetHTTPPipeliningEnabled): Added declaration.
1484         * UIProcess/WebContext.cpp:
1485         (WebKit::WebContext::setHTTPPipeliningEnabled): Added.
1486         (WebKit::WebContext::httpPipeliningEnabled): Added.
1487         * UIProcess/WebContext.h:
1488         (WebKit::WebContext::setHTTPPipeliningEnabled): Added declaration.
1489         (WebKit::WebContext::httpPipeliningEnabled): Added declaration.
1490
1491 2011-04-17  Sam Weinig  <sam@webkit.org>
1492
1493         Reviewed by Geoffrey Garen.
1494
1495         Make more strings in WebKit2 localizable
1496         https://bugs.webkit.org/show_bug.cgi?id=58757
1497
1498         * UIProcess/API/mac/PDFViewController.mm:
1499         (-[WKPDFView menuForEvent:]):
1500         * UIProcess/API/mac/PageClientImpl.mm:
1501         (WebKit::PageClientImpl::setViewportArguments):
1502         (WebKit::PageClientImpl::registerEditCommand):
1503         * UIProcess/WebEditCommandProxy.cpp:
1504         (WebKit::WebEditCommandProxy::nameForEditAction):
1505         * UIProcess/WebEditCommandProxy.h:
1506         Use WebCore's localization macro to make more strings localizable.
1507
1508 2011-04-17  Patrick Gansterer  <paroga@webkit.org>
1509
1510         Reviewed by Adam Barth.
1511
1512         Rename PLATFORM(CA) to USE(CA)
1513         https://bugs.webkit.org/show_bug.cgi?id=58742
1514
1515         * WebProcess/WebPage/LayerTreeHost.cpp:
1516         * WebProcess/WebPage/win/LayerTreeHostWin.cpp:
1517         (WebKit::LayerTreeHost::supportsAcceleratedCompositing):
1518
1519 2011-04-17  Patrick Gansterer  <paroga@webkit.org>
1520
1521         Reviewed by Adam Barth.
1522
1523         Rename PLATFORM(CG) to USE(CG)
1524         https://bugs.webkit.org/show_bug.cgi?id=58729
1525
1526         * Shared/ShareableBitmap.h:
1527         * Shared/WebCoreArgumentCoders.cpp:
1528         * Shared/WebCoreArgumentCoders.h:
1529         * Shared/WebGraphicsContext.cpp:
1530         (WebKit::WebGraphicsContext::WebGraphicsContext):
1531         * Shared/WebGraphicsContext.h:
1532         * Shared/win/PlatformCertificateInfo.cpp:
1533         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
1534         * UIProcess/win/WebView.cpp:
1535         (WebKit::WebView::setFindIndicator):
1536         * WebProcess/WebPage/WebPage.cpp:
1537         (WebKit::WebPage::drawRectToPDF):
1538         (WebKit::WebPage::drawPagesToPDF):
1539         * WebProcess/WebPage/win/WebPageWin.cpp:
1540         (WebKit::WebPage::platformPreferencesDidChange):
1541         * config.h:
1542
1543 2011-04-16  Anders Carlsson  <andersca@apple.com>
1544
1545         Reviewed by Sam Weinig.
1546
1547         Crash when NPP_Write returns -1 when writing the manual stream
1548         https://bugs.webkit.org/show_bug.cgi?id=58735
1549         <rdar://problem/9124993>
1550
1551         If NPP_Write returns -1 we must cancel the stream.
1552
1553         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
1554         (WebKit::NetscapePluginStream::deliverDataToPlugin):
1555
1556 2011-04-16  Sam Weinig  <sam@webkit.org>
1557
1558         Reviewed by Simon Fraser.
1559
1560         Pages in the PageCache don't have the correct visited link coloring after being restored
1561         https://bugs.webkit.org/show_bug.cgi?id=58721
1562
1563         * WebProcess/WebProcess.cpp:
1564         (WebKit::WebProcess::visitedLinkStateChanged):
1565         (WebKit::WebProcess::allVisitedLinkStateChanged):
1566         Mark all pages in the page cache as needing visited link style recalc
1567         whenever visited link information changes.
1568
1569 2011-04-15  Daniel Bates  <dbates@webkit.org>
1570
1571         Attempt to fix the Qt Linux Release build after changeset 84064 <http://trac.webkit.org/changeset/84064>
1572         (https://bugs.webkit.org/show_bug.cgi?id=58686).
1573
1574         * UIProcess/API/qt/qwkpage_p.h: Remove takeFocus().
1575
1576 2011-04-15  Shishir Agrawal  <shishir@chromium.org>
1577
1578         Reviewed by James Robinson.
1579
1580         Add a flag to guard Page Visibility API changes.
1581         https://bugs.webkit.org/show_bug.cgi?id=58464
1582
1583         * Configurations/FeatureDefines.xcconfig:
1584
1585 2011-04-15  Jeff Miller  <jeffm@apple.com>
1586
1587         Reviewed by Sam Weinig.
1588
1589         Add takeFocus callback to WKPageUIClient
1590         https://bugs.webkit.org/show_bug.cgi?id=58686
1591
1592         On Windows, we need to handle moving focus out of the web view in the client, so add a takeFocus callback to WKPageUIClient
1593         and stop handling taking focus in the framework in WKView.mm on the Mac.
1594
1595         * UIProcess/API/C/WKPage.h: Added WKFocusDirection enum and takeFocus to WKPageUIClient.
1596         * UIProcess/API/mac/PageClientImpl.h: Removed takeFocus().
1597         * UIProcess/API/mac/PageClientImpl.mm: Removed takeFocus().
1598         * UIProcess/API/mac/WKView.mm: Removed _takeFocus().
1599         * UIProcess/API/mac/WKViewInternal.h: Removed _takeFocus().
1600         * UIProcess/API/qt/ClientImpl.cpp:
1601         (qt_wk_takeFocus): Added.
1602         * UIProcess/API/qt/ClientImpl.h: Added qt_wk_takeFocus.
1603         * UIProcess/API/qt/qwkpage.cpp: Remove takeFocus().
1604         (QWKPage::QWKPage): Added takeFocus() callback.
1605         * UIProcess/PageClient.h: Removed takeFocus().
1606         * UIProcess/WebPageProxy.cpp:
1607         (WebKit::WebPageProxy::takeFocus): Call m_uiClient to take focus.
1608         * UIProcess/WebPageProxy.h: Pass FocusDirection as a uint32_t to takeFocus().
1609         * UIProcess/WebPageProxy.messages.in: Pass FocusDirection as a uint32_t in TakeFocus message.
1610         * UIProcess/WebUIClient.cpp:
1611         (WebKit::WebUIClient::takeFocus): Added.
1612         * UIProcess/WebUIClient.h: Added takeFocus().
1613         * UIProcess/win/WebView.cpp: Removed takeFocus(), which was never implemented on Windows.
1614         * UIProcess/win/WebView.h: Removed takeFocus().
1615         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1616         (WebKit::WebChromeClient::takeFocus): Pass FocusDirection as a uint32_t in TakeFocus message.
1617
1618 2011-04-15  Alexey Proskuryakov  <ap@apple.com>
1619
1620         Reviewed by Sam Weinig.
1621
1622         WebKit2: Stop using deprecated NSInputManager
1623         https://bugs.webkit.org/show_bug.cgi?id=58709
1624
1625         Changed all mouse related functions to give NSInputContext a chance to handle the event,
1626         added logging. Removed -rightMouseMoved: method, which was added by accident.
1627
1628         * UIProcess/API/mac/WKView.mm:
1629         (-[WKView mouseMoved:]):
1630         (-[WKView mouseDown:]):
1631         (-[WKView mouseUp:]):
1632         (-[WKView mouseDragged:]):
1633
1634 2011-04-15  Jon Honeycutt  <jhoneycutt@apple.com>
1635
1636         Potential crash getting a JS wrapper.
1637
1638         <rdar://problem/8988741>
1639
1640         Reviewed by Brian Weinstein.
1641
1642         * WebProcess/WebPage/WebFrame.cpp:
1643         (WebKit::WebFrame::jsWrapperForWorld):
1644         Ensure that we have a valid m_coreFrame, because it can be cleared by
1645         invalidate().
1646
1647 2011-04-08  Luiz Agostini  <luiz.agostini@openbossa.org>
1648
1649         Reviewed by Kenneth Rohde Christiansen.
1650
1651         [Qt] QWebPage MIME type handling inconsistency with other web browsers
1652         https://bugs.webkit.org/show_bug.cgi?id=46968
1653
1654         Implementing mime type sniffing based on
1655         http://tools.ietf.org/html/draft-abarth-mime-sniff-06.
1656
1657         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp:
1658         (WebCore::WebFrameNetworkingContext::WebFrameNetworkingContext):
1659         (WebCore::WebFrameNetworkingContext::MIMESniffingEnabled):
1660         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h:
1661
1662 2011-04-15  Oliver Hunt  <oliver@apple.com>
1663
1664         GC allocate Structure
1665         https://bugs.webkit.org/show_bug.cgi?id=58483
1666
1667         Rolling r83894 r83827 r83810 r83809 r83808 back in with
1668         a workaround for the gcc bug seen by the gtk bots
1669
1670         * WebProcess/Plugins/Netscape/JSNPMethod.h:
1671         (WebKit::JSNPMethod::createStructure):
1672         * WebProcess/Plugins/Netscape/JSNPObject.h:
1673         (WebKit::JSNPObject::createStructure):
1674
1675 2011-04-15  Anders Carlsson  <andersca@apple.com>
1676
1677         Reviewed by Sam Weinig.
1678
1679         Add API to get the bundle page overlay fade in fraction.
1680
1681         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1682         (WKBundlePageOverlayFractionFadedIn):
1683         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
1684
1685 2011-04-15  Anders Carlsson  <andersca@apple.com>
1686
1687         Reviewed by Dan Bernstein.
1688
1689         Fade the find page overlay
1690         https://bugs.webkit.org/show_bug.cgi?id=58697
1691
1692         * WebProcess/WebPage/FindController.cpp:
1693         Make the color components floats.
1694
1695         (WebKit::overlayBackgroundColor):
1696         (WebKit::holeShadowColor):
1697         (WebKit::holeFillColor):
1698         Add helper functions for returning the colors given the fraction faded in.
1699
1700         (WebKit::FindController::drawRect):
1701         Use the new helper functions.
1702
1703         * WebProcess/WebPage/WebPage.cpp:
1704         (WebKit::WebPage::installPageOverlay):
1705         Start the fade animation unless we're replacing an already existing page overlay
1706         with another.
1707
1708 2011-04-15  Anders Carlsson  <andersca@apple.com>
1709
1710         Fix Windows build.
1711
1712         * WebProcess/WebPage/PageOverlay.cpp:
1713         (WebKit::PageOverlay::fadeAnimationTimerFired):
1714
1715 2011-04-15  Anders Carlsson  <andersca@apple.com>
1716
1717         Reviewed by Sam Weinig.
1718
1719         Add the ability for PageOverlays to fade in and out
1720         https://bugs.webkit.org/show_bug.cgi?id=58694
1721
1722         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1723         (WKBundlePageUninstallPageOverlay):
1724         WebPage::uninstallPageOverlay now takes a boolean. Default to false for now.
1725
1726         * WebProcess/WebPage/FindController.cpp:
1727         (WebKit::FindController::findString):
1728         Pass false to uninstallPageOverlay.
1729
1730         (WebKit::FindController::hideFindUI):
1731         Pass true to uninstallPageOverlay.
1732         
1733         * WebProcess/WebPage/PageOverlay.cpp:
1734         (WebKit::PageOverlay::PageOverlay):
1735         Initialize new member variables.
1736
1737         (WebKit::PageOverlay::bounds):
1738         Get rid of an unnecessary webPage() getter.
1739
1740         (WebKit::PageOverlay::setPage):
1741         Stop the animation timer.
1742
1743         (WebKit::PageOverlay::startFadeInAnimation):
1744         Update m_fractionFadedIn and call startFadeAnimation.
1745
1746         (WebKit::PageOverlay::startFadeOutAnimation):
1747         Ditto.
1748         
1749         (WebKit::PageOverlay::startFadeAnimation):
1750         Initialize m_fadeAnimationStartTime and start the fade animation timer.
1751
1752         (WebKit::PageOverlay::fadeAnimationTimerFired):
1753         Update m_fractionFadedIn and call setNeedsDisplay().
1754
1755         * WebProcess/WebPage/PageOverlay.h:
1756         * WebProcess/WebPage/WebPage.cpp:
1757         (WebKit::WebPage::uninstallPageOverlay):
1758         If fadeOut is true, tell the page overlay to start the fade out animation.
1759         When the fade animation is complete, the page overlay will uninstall itself.
1760
1761 2011-04-15  Brian Weinstein  <bweinstein@apple.com>
1762
1763         Reviewed by Adam Roben.
1764
1765         Views should be made visible before painting in WM_PRINTCLIENT messages
1766         https://bugs.webkit.org/show_bug.cgi?id=58676
1767         <rdar://problem/9279211>
1768
1769         * UIProcess/win/WebView.cpp:
1770         (WebKit::WebView::onPrintClientEvent): If our view isn't currently visible set it to visible
1771             before painting, then reset it back to not visible after painting.
1772         (WebKit::WebView::onShowWindowEvent): Call setIsVisible instead of duplicating logic.
1773         (WebKit::WebView::setIsVisible): Set the m_isVisible flag and call viewStateDidChange.
1774         * UIProcess/win/WebView.h:
1775
1776 2011-04-15  Jon Lee  <jonlee@apple.com>
1777
1778         Reviewed by Anders Carlsson.
1779
1780         onClick does not function with <select> elements in WebKit2
1781         https://bugs.webkit.org/show_bug.cgi?id=57904
1782         <rdar://problem/9217757>
1783
1784         Reviewed by Anders Carlsson.
1785
1786         * Shared/NativeWebMouseEvent.h: Copied from Source/WebKit2/UIProcess/WebPopupMenuProxy.h.
1787         (WebKit::NativeWebMouseEvent::nativeEvent):
1788         * Shared/mac/NativeWebMouseEventMac.mm: Added.
1789         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
1790         * Shared/qt/NativeWebMouseEventQt.cpp: Copied from Source/WebKit2/UIProcess/WebPopupMenuProxy.h.
1791         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
1792         * Shared/win/NativeWebMouseEventWin.cpp: Copied from Source/WebKit2/UIProcess/WebPopupMenuProxy.h.
1793         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
1794         * UIProcess/API/mac/WKView.mm:
1795         (-[WKView mouseMoved:]):
1796         (-[WKView _mouseHandler:]): Pre-compiler mouse handler calls need to use the new NativeWebMouseEvent class
1797         * UIProcess/API/qt/qwkpage.cpp:
1798         (QWKPagePrivate::mouseMoveEvent):
1799         (QWKPagePrivate::mousePressEvent):
1800         (QWKPagePrivate::mouseReleaseEvent):
1801         (QWKPagePrivate::mouseDoubleClickEvent):
1802         * UIProcess/WebPageProxy.cpp:
1803         (WebKit::WebPageProxy::handleMouseEvent): keep track of mouse down event in order to be able to send a fake mouse up event on the select element
1804         (WebKit::WebPageProxy::currentMouseDownEvent): for access by the popup menu proxy to dispatch the fake mouse up event
1805         (WebKit::WebPageProxy::didReceiveEvent): clear out the cached mouse down event
1806         (WebKit::WebPageProxy::processDidCrash): clear out the cached events since we assume that didReceiveEvent did not called prior to the crash
1807         * UIProcess/WebPageProxy.h:
1808         * UIProcess/WebPopupMenuProxy.h:
1809         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1810         (WebKit::WebPopupMenuProxyMac::showPopupMenu): after notifying the popup menu client that the value changed, fake mouse up and mouse move events are posted
1811         * UIProcess/win/WebPopupMenuProxyWin.cpp:
1812         (WebKit::WebPopupMenuProxyWin::showPopupMenu): after notifying the popup menu client that the value changed, fake mouse up and mouse move events are posted
1813         * UIProcess/win/WebView.cpp:
1814         (WebKit::WebView::onMouseEvent):
1815         * WebKit2.pro:
1816         * WebKit2.xcodeproj/project.pbxproj:
1817         * win/WebKit2.vcproj:
1818
1819 2011-04-15  Alexey Proskuryakov  <ap@apple.com>
1820
1821         Qt build fix.
1822
1823         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::selectionStateChanged): Wrap the variable
1824         in PLATFORM(MAC), too, as it's unused on other platforms.
1825
1826 2011-04-15  Brady Eidson  <beidson@apple.com>
1827
1828         Reviewed by Dan Bernstein.
1829
1830         <rdar://problem/9287880> and https://bugs.webkit.org/show_bug.cgi?id=58596
1831         WK2: Past searches not remembered for <input type=search results="5" autosave="foo">
1832
1833         Add SaveRecentSearches and LoadRecentSearches messages:
1834         * UIProcess/WebPageProxy.messages.in:
1835         * UIProcess/WebPageProxy.h:
1836
1837         Message up to the UIProcess for the save/load operations:
1838         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
1839         (WebKit::WebSearchPopupMenu::saveRecentSearches):
1840         (WebKit::WebSearchPopupMenu::loadRecentSearches):
1841         * WebProcess/WebCoreSupport/WebPopupMenu.h:
1842         (WebKit::WebPopupMenu::page):
1843
1844         Save the values to disk CFPreference-style:
1845         * UIProcess/cf/WebPageProxyCF.cpp:
1846         (WebKit::autosaveKey):
1847         (WebKit::WebPageProxy::saveRecentSearches):
1848         (WebKit::WebPageProxy::loadRecentSearches):
1849
1850         Stubbed out for non-CF platforms:
1851         * UIProcess/gtk/WebPageProxyGtk.cpp:
1852         (WebKit::WebPageProxy::saveRecentSearches):
1853         (WebKit::WebPageProxy::loadRecentSearches):
1854         * UIProcess/qt/WebPageProxyQt.cpp:
1855         (WebKit::WebPageProxy::saveRecentSearches):
1856         (WebKit::WebPageProxy::loadRecentSearches):
1857
1858 2011-04-14  Alexey Proskuryakov  <ap@apple.com>
1859
1860         Reviewed by Dan Bernstein.
1861
1862         WebKit2: Password field input does not switch to ASCII-compatible source
1863         https://bugs.webkit.org/show_bug.cgi?id=58583
1864         <rdar://problem/9059651>
1865
1866         The implementation is more modern than what we have in WK1. Instead of returning a null
1867         input context (as in non-editable content), we now set page context's properties.
1868
1869         * UIProcess/PageClient.h:
1870         * UIProcess/API/mac/PageClientImpl.h:
1871         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::updateSecureInputState):
1872         Forward updateSecureInputState() call from WebPageProxy to WKView.
1873
1874         * UIProcess/API/mac/WKView.mm:
1875         (-[WKView dealloc]): ASSERT that we didn't somehow leave secure input events enabled.
1876         (-[WKView becomeFirstResponder]): Update secure event mode.
1877         (-[WKView resignFirstResponder]): Disable secure event mode.
1878         (-[WKView setMarkedText:selectedRange:replacementRange:]): Prevent most advanced editing
1879         behaviors in password fields, matching NSSecureTextInputField.
1880         (-[WKView attributedSubstringForProposedRange:actualRange:]): Disable TSM Document Access
1881         in password fields. There is also a check in web process, but it doest't hurt to check twice.
1882         (-[WKView _windowDidBecomeKey:]): Call _updateSecureInputState.
1883         (-[WKView _windowDidResignKey:]): Call _updateSecureInputState.
1884         (-[WKView _updateSecureInputState]): Update secure event mode and allowed input sources.
1885
1886         * UIProcess/API/mac/WKViewInternal.h: Added _updateSecureInputState.
1887
1888         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::selectionStateChanged): Update secure
1889         input state when going in or out a password field.
1890
1891 2011-04-14  Jer Noble  <jer.noble@apple.com>
1892
1893         Reviewed by Eric Carlson.
1894
1895         REGRESSION: Rendering in <video> element appears to render quickly to catch up if it has been playing in a background tab
1896         https://bugs.webkit.org/show_bug.cgi?id=58637
1897
1898         Notify AVFoundation that no one will be rendering when the view or window moves off screen.
1899
1900         * UIProcess/API/mac/PageClientImpl.mm:
1901         (WebKit::PageClientImpl::isViewVisible): Return false if the view's window is not visible.
1902         * UIProcess/API/mac/WKView.mm:
1903         (-[WKView addWindowObserversForWindow:]): Observe orderOut and orderIn events.
1904         (-[WKView removeWindowObservers]): Ditto.
1905         (-[WKView _windowDidOrderOffScreen:]): Added.
1906         (-[WKView _windowDidOrderOnScreen:]): Added.
1907         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1908         (WebKit::DrawingAreaImpl::suspendPainting): Call LayerTreeHost::pauseRendering.
1909         (WebKit::DrawingAreaImpl::resumePainting): Call LayerTreeHost::resumeRendering.
1910         * WebProcess/WebPage/LayerTreeHost.h:
1911         (WebKit::LayerTreeHost::pauseRendering): Added stub.
1912         (WebKit::LayerTreeHost::resumeRendering): Added stub.
1913         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
1914         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
1915         (WebKit::LayerTreeHostCAMac::pauseRendering): Added. Post a notification with our
1916             intention to stop rendering.
1917         (WebKit::LayerTreeHostCAMac::resumeRendering): Added. Post a notification with our
1918             intention to start rendering.
1919
1920 2011-04-15  Jessie Berlin  <jberlin@apple.com>
1921
1922         Reviewed by Sam Weinig.
1923
1924         WebKit2: Need a way to keep the WebProcess alive for testing purposes.
1925         https://bugs.webkit.org/show_bug.cgi?id=58592
1926
1927         * UIProcess/API/C/WKContext.cpp:
1928         (WKContextDisableProcessTermination):
1929         (WKContextEnableProcessTermination):
1930         * UIProcess/API/C/WKContextPrivate.h:
1931
1932         * UIProcess/WebContext.cpp:
1933         (WebKit::WebContext::WebContext):
1934         Initialize m_processTerminationEnabled to true.
1935         (WebKit::WebContext::enableProcessTermination):
1936         Set m_processTerminationEnabled to true, and try to terminate the web process.
1937         (WebKit::WebContext::shouldTerminate):
1938         If !m_processTerminationEnabled, return false.
1939         * UIProcess/WebContext.h:
1940         (WebKit::WebContext::disableProcessTermination):
1941         Set m_processTerminationEnabled to false;
1942
1943 2011-04-15  Nancy Piedra  <nancy.piedra@nokia.com>
1944
1945         Reviewed by Laszlo Gombos.
1946
1947         [Qt][Symbian] Need to export ViewportAttributes class
1948         https://bugs.webkit.org/show_bug.cgi?id=58651
1949
1950         On Symbian, if the ViewportAttributes class is not exported we get
1951         linking errors.
1952
1953         Since this is a compilation issue, no new tests added.
1954
1955         * UIProcess/API/qt/qwkpage.h:
1956
1957 2011-04-15  Anna Cavender  <annacc@chromium.org>
1958
1959         Reviewed by Eric Carlson.
1960
1961         Renaming TRACK feature define to VIDEO_TRACK
1962         https://bugs.webkit.org/show_bug.cgi?id=53556
1963
1964         * Configurations/FeatureDefines.xcconfig:
1965
1966 2011-04-14  Anders Carlsson  <andersca@apple.com>
1967
1968         Reviewed by Sam Weinig.
1969
1970         Select All context menu item doesn't work in Flash
1971         https://bugs.webkit.org/show_bug.cgi?id=58615
1972         <rdar://problem/9225761>
1973
1974         In some cases, -[NSWindow isKeyWindow] will return false even if
1975         a window is the key window, so we have to compare our window
1976         against -[NSApplication keyWindow].
1977
1978         * UIProcess/API/mac/PageClientImpl.mm:
1979         (WebKit::PageClientImpl::isViewWindowActive):
1980
1981 2011-04-14  Sam Weinig  <sam@webkit.org>
1982
1983         Reviewed by Anders Carlsson.
1984
1985         Add CFPreference based backend for WebKit2 preferences
1986         https://bugs.webkit.org/show_bug.cgi?id=58605
1987
1988         * UIProcess/cf/WebPreferencesCF.cpp:
1989         (WebKit::cfStringFromWebCoreString):
1990         (WebKit::makeKey):
1991         (WebKit::setStringValueIfInUserDefaults):
1992         (WebKit::setBoolValueIfInUserDefaults):
1993         (WebKit::setUInt32ValueIfInUserDefaults):
1994         (WebKit::setDoubleValueIfInUserDefaults):
1995         (WebKit::WebPreferences::platformInitializeStore):
1996         (WebKit::WebPreferences::platformUpdateStringValueForKey):
1997         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
1998         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
1999         (WebKit::WebPreferences::platformUpdateDoubleValueForKey):
2000         Implement platform functions using CFPreferences API.
2001
2002 2011-04-14  Brady Eidson  <beidson@apple.com>
2003
2004         Reviewed by Sam Weinig.
2005
2006         <rdar://problem/8665102> and https://bugs.webkit.org/show_bug.cgi?id=58595
2007         Menu is not displayed for <input type=search results="5">
2008
2009         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
2010         (WebKit::WebSearchPopupMenu::enabled): Return true, like all good search popup menus should.
2011
2012         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
2013         (WebKit::WebPopupMenu::setUpPlatformData): Remember the shouldPopOver-ness.
2014
2015         * Shared/PlatformPopupMenuData.cpp:
2016         (WebKit::PlatformPopupMenuData::encode): Remember the shouldPopOver-ness.
2017         (WebKit::PlatformPopupMenuData::decode): Remember the shouldPopOver-ness.
2018         * Shared/PlatformPopupMenuData.h:
2019
2020         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2021         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Use the shouldPopOver-ness to adjust display position.
2022
2023 2011-04-14  Anders Carlsson  <andersca@apple.com>
2024
2025         Reviewed by Dan Bernstein.
2026
2027         Crash in NetscapePluginModule::tryGetSitesWithData when NPP_GetSitesWithData returns null
2028         https://bugs.webkit.org/show_bug.cgi?id=58578
2029         <rdar://problem/9275201>
2030
2031         It's OK for NPP_GetSitesWithData to return null.
2032
2033         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2034         (WebKit::NetscapePluginModule::tryGetSitesWithData):
2035
2036 2011-04-14  Sam Weinig  <sam@webkit.org>
2037
2038         Reviewed by Anders Carlsson.
2039
2040         Make creating WebPreferences lazy
2041         https://bugs.webkit.org/show_bug.cgi?id=58570
2042
2043         * UIProcess/WebPageGroup.cpp:
2044         (WebKit::WebPageGroup::WebPageGroup):
2045         (WebKit::WebPageGroup::~WebPageGroup):
2046         (WebKit::WebPageGroup::setPreferences):
2047         (WebKit::WebPageGroup::preferences):
2048         * UIProcess/WebPageGroup.h:
2049         Don't create the WebPreference object until it is requested.
2050
2051 2011-04-14  Pratik Solanki  <psolanki@apple.com>
2052
2053         Reviewed by David Kilzer.
2054
2055         Set minimum priority for fast lane connections
2056         https://bugs.webkit.org/show_bug.cgi?id=58353
2057
2058         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2059         (InitWebCoreSystemInterface): Support for new WKSI method WKSetHTTPPipeliningMinimumFastLanePriority.
2060
2061 2011-04-14  Anders Carlsson  <andersca@apple.com>
2062
2063         Clang warning fixes.
2064
2065         * UIProcess/API/mac/PageClientImpl.h:
2066         * UIProcess/mac/TextCheckerMac.mm:
2067         * WebProcess/Downloads/mac/DownloadMac.mm:
2068
2069 2011-04-14  Jessie Berlin  <jberlin@apple.com>
2070
2071         Reviewed by Timothy Hatcher.
2072
2073         WebKit2: Add an option for a PageGroup to be invisible to the History Client.
2074         https://bugs.webkit.org/show_bug.cgi?id=58547
2075
2076         * Shared/WebPageGroupData.cpp:
2077         (WebKit::WebPageGroupData::encode):
2078         (WebKit::WebPageGroupData::decode):
2079         * Shared/WebPageGroupData.h:
2080
2081         * UIProcess/WebInspectorProxy.cpp:
2082         (WebKit::WebInspectorProxy::inspectorPageGroup):
2083         The Web Inspector should not be visible to the History Client, because its HTML-based nature
2084         should not be exposed through the API.
2085
2086         * UIProcess/WebPageGroup.cpp:
2087         (WebKit::WebPageGroup::create):
2088         (WebKit::WebPageGroup::WebPageGroup):
2089         * UIProcess/WebPageGroup.h:
2090
2091         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2092         (WebKit::WebFrameLoaderClient::updateGlobalHistory):
2093         Do not send the message to the WebContent for the history client.
2094         (WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
2095         Ditto.
2096         (WebKit::WebFrameLoaderClient::setTitle):
2097         Ditto.
2098
2099         * WebProcess/WebPage/WebPageGroupProxy.h:
2100         (WebKit::WebPageGroupProxy::isVisibleToHistoryClient):
2101
2102 2011-04-14  Balazs Kelemen  <kbalazs@webkit.org>
2103
2104         Reviewed by Andreas Kling.
2105
2106         [Qt][WK2] Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1
2107         https://bugs.webkit.org/show_bug.cgi?id=55719
2108
2109         Guard functionality related to complex text and implementations
2110         that rely on MachPort with PLATFORM(MAC).
2111         Based on Oleg Romashin's patch.
2112
2113         * PluginProcess/PluginControllerProxy.cpp:
2114         * PluginProcess/PluginControllerProxy.messages.in:
2115         * PluginProcess/PluginProcess.cpp:
2116         (WebKit::PluginProcess::createWebProcessConnection):
2117         * PluginProcess/WebProcessConnection.cpp:
2118         (WebKit::WebProcessConnection::createPlugin):
2119         * Shared/Plugins/PluginProcessCreationParameters.cpp:
2120         (WebKit::PluginProcessCreationParameters::decode): Fix bad C++ that
2121         does not compile with gcc-linux.
2122         * UIProcess/Plugins/PluginProcessProxy.cpp:
2123         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
2124         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
2125         * UIProcess/Plugins/PluginProcessProxy.h:
2126         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2127         * WebKit2.pro: Move implementation that does not need external
2128         visibility from WebKit2API.pri. Adding the headers as well.
2129         * WebKit2API.pri:
2130         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2131         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2132         * WebProcess/WebPage/WebPage.cpp:
2133
2134 2011-04-13  James Robinson  <jamesr@chromium.org>
2135
2136         Reviewed by Simon Fraser.
2137
2138         Allow setting composited backing stores for scrollbars and scroll corners
2139         https://bugs.webkit.org/show_bug.cgi?id=57202
2140
2141         Update WebPopupMenuProxyWin to reflect ScrollableArea interface changes.
2142
2143         * UIProcess/win/WebPopupMenuProxyWin.h:
2144         (WebKit::WebPopupMenuProxyWin::invalidateScrollCornerRect):
2145         (WebKit::WebPopupMenuProxyWin::scrollCornerPresent):
2146         (WebKit::WebPopupMenuProxyWin::scrollCornerRect):
2147
2148 2011-04-13  Jon Lee  <jonlee@apple.com>
2149
2150         Reviewed by Maciej Stachowiak.
2151
2152         REGRESSION(r81880): Paste menu is disabled for many edit fields (yahoo and google search, yahoo mail msg, forms, etc)
2153         https://bugs.webkit.org/show_bug.cgi?id=58284
2154         <rdar://problem/9246149>
2155
2156         * WebProcess/WebPage/WebPage.cpp:
2157         (WebKit::WebPage::setFocused): Check for whether we are not supposed to be focused AND whether our platform behavior dictates to clear out the selection
2158
2159 2011-04-13  Dan Bernstein  <mitz@apple.com>
2160
2161         Reviewed by Sam Weinig.
2162
2163         Fixed a bug where WKView changed the cursor when the mouse was moving over other views.
2164
2165         * UIProcess/API/mac/WKView.mm:
2166         (-[WKView mouseMoved:]): If getting this message because this view is the first responder,
2167         ignore it unless it is inside the visible rect.
2168
2169 2011-04-13  Enrica Casucci  <enrica@apple.com>
2170
2171         Reviewed by Dan Bernstein.
2172
2173         Should not rely on WKEditableLinkBehavior being in synch
2174         with WebCore::EditableLinkBehavior.
2175         https://bugs.webkit.org/show_bug.cgi?id=58473
2176
2177         Adding conversion routines.
2178
2179         * UIProcess/API/C/WKAPICast.h:
2180         (WebKit::toAPI):
2181         (WebKit::toEditableLinkBehavior):
2182         * UIProcess/API/C/WKPreferences.cpp:
2183         (WKPreferencesSetEditableLinkBehavior):
2184         (WKPreferencesGetEditableLinkBehavior):
2185
2186 2011-04-13  Anders Carlsson  <andersca@apple.com>
2187
2188         Reviewed by Dan Bernstein.
2189
2190         After closing the last window, re-opening my last visited website is over 2X slower
2191         https://bugs.webkit.org/show_bug.cgi?id=58488
2192         <rdar://problem/9233518>
2193
2194         Give the web process a 60 second termination timeout.
2195
2196         * WebProcess/WebProcess.cpp:
2197         (WebKit::WebProcess::WebProcess):
2198
2199 2011-04-13  Anders Carlsson  <andersca@apple.com>
2200
2201         Reviewed by Adam Roben.
2202
2203         Convert WebProcess over to using disableTermination/enableTermination
2204         https://bugs.webkit.org/show_bug.cgi?id=58485
2205
2206         * PluginProcess/PluginProcess.cpp:
2207         (WebKit::PluginProcess::getSitesWithData):
2208         (WebKit::PluginProcess::clearSiteData):
2209         Use the LocalTerminationDisabler RAII class.
2210
2211         * Shared/ChildProcess.h:
2212         (WebKit::ChildProcess::LocalTerminationDisabler::LocalTerminationDisabler):
2213         (WebKit::ChildProcess::LocalTerminationDisabler::~LocalTerminationDisabler):
2214         Add RAII class for calling disableTermination/enableTermination.
2215
2216         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
2217         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
2218         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
2219         (WebKit::WebApplicationCacheManager::deleteAllEntries):
2220         Use the LocalTerminationDisabler RAII class.
2221
2222         * WebProcess/Cookies/WebCookieManager.cpp:
2223         (WebKit::WebCookieManager::getHostnamesWithCookies):
2224         (WebKit::WebCookieManager::deleteCookiesForHostname):
2225         (WebKit::WebCookieManager::deleteAllCookies):
2226         (WebKit::WebCookieManager::startObservingCookieChanges):
2227         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
2228         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
2229         Use the LocalTerminationDisabler RAII class.
2230
2231         * WebProcess/Downloads/Download.cpp:
2232         (WebKit::Download::Download):
2233         Call disableTermination().
2234
2235         (WebKit::Download::~Download):
2236         Call enableTermination().
2237
2238         * WebProcess/Downloads/DownloadManager.cpp:
2239         (WebKit::DownloadManager::downloadFinished):
2240         Remove call to terminateIfPossible.
2241
2242         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
2243         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2244         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2245         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2246         Use the LocalTerminationDisabler RAII class.
2247         
2248         * WebProcess/MediaCache/WebMediaCacheManager.cpp:
2249         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache):
2250         (WebKit::WebMediaCacheManager::clearCacheForHostname):
2251         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames):
2252         Use the LocalTerminationDisabler RAII class.
2253         
2254         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2255         (WebKit::WebResourceCacheManager::getCacheOrigins):
2256         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
2257         (WebKit::WebResourceCacheManager::clearCacheForAllOrigins):
2258         Use the LocalTerminationDisabler RAII class.
2259         
2260         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2261         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
2262         (WebKit::WebDatabaseManager::getDatabaseOrigins):
2263         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
2264         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
2265         (WebKit::WebDatabaseManager::deleteAllDatabases):
2266         (WebKit::WebDatabaseManager::setQuotaForOrigin):
2267         Use the LocalTerminationDisabler RAII class.
2268         
2269         * WebProcess/WebProcess.cpp:
2270         (WebKit::WebProcess::createWebPage):
2271         Call disableTermination().
2272
2273         (WebKit::WebProcess::removeWebPage):
2274         Call enableTermination().
2275
2276         (WebKit::WebProcess::shouldTerminate):
2277         Move logic from terminateIfPossible over here.
2278
2279         (WebKit::WebProcess::terminate):
2280         Move logic from terminateIfPossible over here.
2281
2282         (WebKit::WebProcess::getSitesWithPluginData):
2283         (WebKit::WebProcess::clearPluginSiteData):
2284         Use the LocalTerminationDisabler RAII class.
2285
2286         * WebProcess/WebProcess.h:
2287         Publically inherit from ChildProcess, LocalTerminationDisabler needs to be accessible
2288         from the WebProcess class.
2289
2290 2011-04-13  Steve Falkenburg  <sfalken@apple.com>
2291
2292         Reviewed by Adam Roben.
2293
2294         Follow-up to: WebKit2 will load two copies of the same plugin, but should not
2295         https://bugs.webkit.org/show_bug.cgi?id=49075
2296         
2297         Use pathGetFileName instead of Win32 PathFindFileNameW.
2298
2299         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
2300         (WebKit::PluginInfoStore::shouldUsePlugin):
2301
2302 2011-04-13  Sam Weinig  <sam@webkit.org>
2303
2304         Reviewed by Gavin Barraclough.
2305
2306         WebKit2 doesn't keep overlay scrollers shown while scroll gesture held
2307         <rdar://problem/9260518>
2308
2309         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2310         (InitWebCoreSystemInterface):
2311         Initialize new WKSI functions.
2312
2313 2011-04-13  Steve Falkenburg  <sfalken@apple.com>
2314
2315         Reviewed by Oliver Hunt.
2316
2317         WebKit2 will load two copies of the same plugin, but should not
2318         https://bugs.webkit.org/show_bug.cgi?id=49075
2319         <rdar://problem/8635947>
2320
2321         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
2322         (WebKit::PluginInfoStore::shouldUsePlugin): Don't use a plug-in if we've already allowed a plug-in with the same filename.
2323
2324 2011-04-13  Timothy Hatcher  <timothy@apple.com>
2325
2326         Hide the dictionary panel when navigating or crashing.
2327
2328         <rdar://problem/9261202>
2329
2330         Reviewed by Sam Weinig.
2331
2332         * UIProcess/API/mac/PageClientImpl.h:
2333         * UIProcess/API/mac/PageClientImpl.mm:
2334         (WebKit::PageClientImpl::dismissDictionaryLookupPanel): Added. Call WKHideWordDefinitionWindow.
2335         * UIProcess/PageClient.h:
2336         * UIProcess/WebPageProxy.cpp:
2337         (WebKit::WebPageProxy::didCommitLoadForFrame): Call PageClient::dismissDictionaryLookupPanel.
2338         (WebKit::WebPageProxy::processDidCrash): Call dismissCorrectionPanel and PageClient::dismissDictionaryLookupPanel.
2339
2340 2011-04-13  Anders Carlsson  <andersca@apple.com>
2341
2342         Reviewed by Adam Roben.
2343
2344         Add support for disabling/enabling termination to ChildProcess
2345         https://bugs.webkit.org/show_bug.cgi?id=58476
2346
2347         Add ChildProcess::disableTermination and ChildProcess::enableTermination and convert
2348         the PluginProcess class over to using them.
2349
2350         * PluginProcess/PluginProcess.cpp:
2351         (WebKit::PluginProcess::PluginProcess):
2352         The child process now takes a terminationTimeout argument. Get rid of the shutdown timer.
2353
2354         (WebKit::PluginProcess::removeWebProcessConnection):
2355         Call enableTermination().
2356
2357         (WebKit::PluginProcess::shouldTerminate):
2358         Always return true.
2359
2360         (WebKit::PluginProcess::createWebProcessConnection):
2361         Call disableTermination().
2362
2363         (WebKit::PluginProcess::getSitesWithData):
2364         Call disableTermination()/enableTermination().
2365
2366         (WebKit::PluginProcess::clearSiteData):
2367         Ditto.
2368
2369         * Shared/ChildProcess.cpp:
2370         (WebKit::ChildProcess::disableTermination):
2371         Increment the counter and stop the timer.
2372
2373         (WebKit::ChildProcess::enableTermination):
2374         Decrement the counter; if it's zero, start the timer.
2375
2376         (WebKit::ChildProcess::terminationTimerFired):
2377         Call shouldTerminate(). If it returns true, call terminate().
2378
2379         (WebKit::ChildProcess::terminate):
2380         Call RunLoop::quit().
2381
2382         * WebProcess/WebProcess.cpp:
2383         (WebKit::WebProcess::WebProcess):
2384         Just initialize the termination timeout to 0 for now.
2385
2386         (WebKit::WebProcess::shouldTerminate):
2387         Always return true; this isn't used yet.
2388
2389         * WebProcess/WebProcess.h:
2390
2391 2011-04-13  Enrica Casucci  <enrica@apple.com>
2392
2393         Reviewed by Dan Bernstein.
2394
2395         REGRESSION: Links are clickable when a contentEditable is set to true.
2396         https://bugs.webkit.org/show_bug.cgi?id=58473
2397         <rdar://problem/9256793>
2398         
2399         Added support for editable link behavior property.
2400
2401         * Shared/WebPreferencesStore.cpp:
2402         * Shared/WebPreferencesStore.h:
2403         * UIProcess/API/C/WKPreferences.cpp:
2404         (WKPreferencesSetEditableLinkBehavior):
2405         (WKPreferencesGetEditableLinkBehavior):
2406         * UIProcess/API/C/WKPreferencesPrivate.h:
2407         * WebProcess/WebPage/WebPage.cpp:
2408         (WebKit::WebPage::updatePreferences):
2409
2410 2011-04-12  Alexey Proskuryakov  <ap@apple.com>
2411
2412         Reviewed by Oliver Hunt.
2413
2414         REGRESSION (WebKit2): Input methods are active in non-editable content
2415         https://bugs.webkit.org/show_bug.cgi?id=58404
2416         <rdar://problem/9275940>
2417
2418         * UIProcess/API/mac/WKView.mm:
2419         (-[WKView insertText:]): Re-add the old variant of this function, because it's not only part
2420         of deprecated NSTextInput protocol, but it's also part of NSResponder, and it's called when
2421         the input context in nil.
2422         (-[WKView inputContext]): Return nil when not in editable content.
2423
2424 2011-04-12  Brady Eidson  <beidson@apple.com>
2425
2426         Reviewed by Maciej Stachowiak.
2427
2428         <rdar://problem/9029193> and https://bugs.webkit.org/show_bug.cgi?id=58406
2429         Bringing up the context menu on a link might also follow the link.
2430
2431         This patch adds a flag that is set just before the WebProcess tells the UIProcess to show a context menu.
2432
2433         As long as this flag is set, the WebProcess will ignore any other mouse events that might have queued up
2434         by the time the UIProcess gets around to showing the menu.
2435
2436         After the UIProcess is done showing the menu, it messages back telling the WebProcess to clear the flag
2437         and resume normal MouseEvent handling.
2438
2439         * UIProcess/WebPageProxy.cpp:
2440         (WebKit::WebPageProxy::showContextMenu): No matter what internalShowContextMenu does, always notify
2441           the WebProcess that any context menu is now hidden.
2442         (WebKit::WebPageProxy::internalShowContextMenu):
2443         * UIProcess/WebPageProxy.h:
2444
2445         * WebProcess/WebPage/WebContextMenu.cpp:
2446         (WebKit::WebContextMenu::show): Since we're telling the UIProcess to show the menu, tell the WebPage a
2447           context menu is showing so it will stop handling mouse events.
2448
2449         * WebProcess/WebPage/WebPage.cpp:
2450         (WebKit::WebPage::WebPage):
2451         (WebKit::WebPage::mouseEvent): Don't try to handle mouse events if a context menu is flagged as showing.
2452
2453         Add accessors to twiddle the "context menu showing" flag:
2454         * WebProcess/WebPage/WebPage.h:
2455         (WebKit::WebPage::contextMenuShowing):
2456         (WebKit::WebPage::contextMenuHidden):
2457         * WebProcess/WebPage/WebPage.messages.in: Add the ContextMenuHidden message.
2458
2459 2011-04-12  Sam Weinig  <sam@webkit.org>
2460
2461         Reviewed by Maciej Stachowiak.
2462
2463         Quarantine related sandbox denial when downloading files
2464         <rdar://problem/9203736>
2465
2466         * WebProcess/com.apple.WebProcess.sb:
2467
2468 2011-04-12  Sam Weinig  <sam@webkit.org>
2469
2470         Reviewed by Anders Carlsson.
2471
2472         Sandbox violations dragging an image to the desktop.
2473         <rdar://problem/9261834>
2474
2475         * WebProcess/com.apple.WebProcess.sb:
2476
2477 2011-04-12  Sam Weinig  <sam@webkit.org>
2478
2479         Reviewed by Cameron Zwarich.
2480
2481         Sandbox violations trying to access ~/Library/Keyboard Layouts and ~/Library/Input Methods
2482         <rdar://problem/8973159> 
2483
2484         * WebProcess/com.apple.WebProcess.sb:
2485
2486 2011-04-12  Enrica Casucci  <enrica@apple.com>
2487
2488         Reviewed by Alexey Proskuryakov and Sam Weinig.
2489
2490         Implement non-activating clicks to allow dragging out of a background window.
2491         https://bugs.webkit.org/show_bug.cgi?id=55053
2492         <rdar://problem/9042197>
2493
2494         Added methods to WKView to support non activating click. Unfortunately both
2495         methods require a synchronous call to the WebProcess to decide what to do.
2496         acceptFirstMouse is called only if shouldDelayWindowOrderingForEvent returns
2497         true. In order to minimize the number of synchronous calls, we send the request
2498         only if our window is not the key window.
2499
2500         * UIProcess/API/mac/WKView.mm:
2501         (-[WKView acceptsFirstMouse:]):
2502         (-[WKView shouldDelayWindowOrderingForEvent:]):
2503         * UIProcess/WebPageProxy.h:
2504         * UIProcess/mac/WebPageProxyMac.mm:
2505         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
2506         (WebKit::WebPageProxy::acceptsFirstMouse):
2507         * WebProcess/WebPage/WebPage.h:
2508         * WebProcess/WebPage/WebPage.messages.in:
2509         * WebProcess/WebPage/mac/WebPageMac.mm:
2510         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
2511         (WebKit::WebPage::acceptsFirstMouse):
2512
2513 2011-04-12  Alexey Proskuryakov  <ap@apple.com>
2514
2515         Reviewed by Oliver Hunt.
2516
2517         Crash when serializing a null AttributedString
2518         https://bugs.webkit.org/show_bug.cgi?id=58393
2519         <rdar://problem/9275326>
2520
2521         * Shared/mac/AttributedString.mm:
2522         (WebKit::AttributedString::encode):
2523         (WebKit::AttributedString::decode):
2524         Prefix the serialized value with an isNull tag.
2525
2526 2011-04-12  Enrica Casucci  <enrica@apple.com>
2527
2528         Reviewed by Alexey Proskuryakov.
2529
2530         Infinite recursion in WebHTMLView executeSavedKeypressCommands.
2531         https://bugs.webkit.org/show_bug.cgi?id=58382
2532         <rdar://problem/9239370>
2533
2534         Execution of some editing commands could trigger a call to selectedRange that
2535         internally calls executeSavedKeypressCommands creating an infinite recursion.
2536
2537         * UIProcess/API/mac/WKView.mm:
2538         (-[WKView _executeSavedKeypressCommands]): Added flag to avoid recursion.
2539         (-[WKView _interpretKeyEvent:withCachedTextInputState:savingCommandsTo:WebCore::]):
2540         Added flag initialization.
2541
2542 2011-04-12  Chris Marrin  <cmarrin@apple.com>
2543
2544         Reviewed by Simon Fraser.
2545
2546         Page tears and stutters in WebKit2 when page is > 2048 pixels wide
2547         https://bugs.webkit.org/show_bug.cgi?id=58330
2548
2549         Turn off tiling for nonCompositedContentLayer to avoid tearing when
2550         scrolling very wide (> 2048) windows.
2551
2552         * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
2553         (WebKit::LayerTreeHostCA::initialize):
2554
2555 2011-04-12  Anders Carlsson  <andersca@apple.com>
2556
2557         Reviewed by Adam Roben.
2558
2559         Assertion in DrawingAreaImpl::resumePainting() (m_isPaintingSuspended) when clicking a link at twitter.com
2560         https://bugs.webkit.org/show_bug.cgi?id=58377
2561         <rdar://problem/8976531>
2562
2563         Remove the assertion.
2564
2565         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2566         (WebKit::DrawingAreaImpl::resumePainting):
2567
2568 2011-04-11  Stephanie Lewis  <slewis@apple.com>
2569
2570         Reviewed by Oliver Hunt.
2571
2572         https://bugs.webkit.org/show_bug.cgi?id=58280
2573         <rdar://problem/9252824> javascript in an inconsistent state due to serialization returning an un-handled exception
2574         Change use of SerializedScriptValue::Create to use the same api as the rest of WebKit2.  This has the benefit
2575         of handling any exceptions so Javascript is not in an inconsistent state.
2576
2577         * Shared/API/c/WKSerializedScriptValue.h: fix a typo
2578         * WebProcess/WebPage/WebPage.cpp:
2579         (WebKit::WebPage::runJavaScriptInMainFrame):
2580
2581 2011-04-12  Jeff Miller  <jeffm@apple.com>
2582
2583         Reviewed by Adam Roben.
2584
2585         WebKit2: Pressing Tab in Web Inspector's console does not cycle through completion options
2586         https://bugs.webkit.org/show_bug.cgi?id=56020
2587
2588         Safari was always calling TranslateMessage() on key events since it has no way to know whether
2589         WebKit handled the event without a PageUIClient (which Safari only installs on pages inside
2590         a Safari window), which was generating a WM_CHAR message containing the tab in this case.  The fix
2591         is for Safari to never call TranslateMessage() on key events outside of a Safari window, but this
2592         means the WebPageProxy needs to do this for unhandled key events if there is no didNotHandleKeyEvent
2593         callback in the PageUIClient.
2594
2595         * UIProcess/WebPageProxy.cpp:
2596         (WebKit::WebPageProxy::didReceiveEvent): Call TranslateMessage() on Windows for unhandled key events that can't be handled by the PageUIClient.
2597         * UIProcess/WebUIClient.cpp:
2598         (WebKit::WebUIClient::canNotHandleKeyEvent): Added.
2599         * UIProcess/WebUIClient.h: Added canNotHandleKeyEvent().
2600
2601 2011-04-12  Alice Liu  <alice.liu@apple.com>
2602
2603         Reviewed by Sam Weinig.
2604
2605         https://bugs.webkit.org/show_bug.cgi?id=58292
2606         Provide new setting to allow site icon loading despite disabling automatic image loading in general.
2607
2608         * Shared/WebPreferencesStore.h: Add macro for setting default value.
2609         * UIProcess/API/C/WKPreferences.cpp:
2610         (WKPreferencesSetLoadsSiteIconsIgnoringImageLoadingPreference): Added setter.
2611         (WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference): Added getter.
2612         * UIProcess/API/C/WKPreferences.h:
2613         * WebProcess/WebPage/WebPage.cpp:
2614         (WebKit::WebPage::updatePreferences): Add to list of WebCore settings that get propagated to WebKit preferences.
2615
2616 2011-04-12  Jessie Berlin  <jberlin@apple.com>
2617
2618         Reviewed by Anders Carlsson.
2619
2620         WebKit2: Spelling and Grammar Checking: Make sure to remove the markings from the document
2621         when spelling and/or grammar checking is disabled.
2622         https://bugs.webkit.org/show_bug.cgi?id=58350
2623
2624         * UIProcess/API/mac/WKView.mm:
2625         (-[WKView toggleContinuousSpellChecking:]):
2626         Move the call to unmark the errors to the WebProcess.
2627         (-[WKView setGrammarCheckingEnabled:]):
2628         Ditto.
2629         (-[WKView toggleGrammarChecking:]):
2630         Ditto.
2631
2632         * UIProcess/WebPageProxy.cpp:
2633         Remove unused functions.
2634         * UIProcess/WebPageProxy.h:
2635         Ditto.
2636         * WebProcess/WebPage/WebPage.messages.in:
2637         Ditto.
2638         * WebProcess/WebPage/WebPage.h:
2639
2640         * WebProcess/WebProcess.cpp:
2641         (WebKit::WebProcess::setTextCheckerState):
2642         If grammar or spelling checking is disabled, unmark all the pages.
2643         Doing it here allows makes it possible to unmark all pages in a cross-platform way that is
2644         triggered both by selecting the the context menu items and by any other methods of updating
2645         the enabled / disabled state.
2646
2647 2011-04-12  Anders Carlsson  <andersca@apple.com>
2648
2649         Reviewed by Sam Weinig.
2650
2651         Cisco Meeting Center will not download or launch from Safari
2652         https://bugs.webkit.org/show_bug.cgi?id=58366
2653         <rdar://problem/8987139>
2654
2655         It's OK if a plug-in has less (or more) MIME type descriptions than actual MIME types.
2656         
2657         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2658         (WebKit::getPluginInfoFromCarbonResources):
2659
2660 2011-04-12  Anders Carlsson  <andersca@apple.com>
2661
2662         Reviewed by Sam Weinig.
2663
2664         Call PluginControllerProxy::platformGeometryDidChange before Plugin::geometryDidChange
2665         https://bugs.webkit.org/show_bug.cgi?id=58361
2666
2667         Since Plugin::geometryDidChange ends up calling plug-in code it can resize the plug-in which causes
2668         platformGeometryDidChange to be called with the wrong rect.
2669
2670         * PluginProcess/PluginControllerProxy.cpp:
2671         (WebKit::PluginControllerProxy::geometryDidChange):
2672         Call platformGeometryDidChange.
2673
2674         * PluginProcess/PluginControllerProxy.h:
2675         * PluginProcess/mac/PluginControllerProxyMac.mm:
2676         (WebKit::PluginControllerProxy::platformGeometryDidChange):
2677         Remove the parameters to platformGeometryDidChange and just use m_frameRect instead.
2678
2679 2011-04-12  Anders Carlsson  <andersca@apple.com>
2680
2681         Reviewed by Sam Weinig.
2682
2683         Move three Mac specific functions to PluginControllerProxyMac.mm.
2684         
2685 2011-04-12  Anders Carlsson  <andersca@apple.com>
2686
2687         Reviewed by Sam Weinig.
2688
2689         Cache the window and plug-in element NPObjects
2690         https://bugs.webkit.org/show_bug.cgi?id=58355
2691
2692         * PluginProcess/PluginControllerProxy.cpp:
2693         (WebKit::PluginControllerProxy::PluginControllerProxy):
2694         (WebKit::PluginControllerProxy::~PluginControllerProxy):
2695         (WebKit::PluginControllerProxy::windowScriptNPObject):
2696         (WebKit::PluginControllerProxy::pluginElementNPObject):
2697         * PluginProcess/PluginControllerProxy.h:
2698
2699 2011-04-12  Alejandro G. Castro  <alex@igalia.com>
2700
2701         Fixed GTK compilation after r83454.
2702
2703         * UIProcess/gtk/WebView.cpp:
2704         (WebKit::WebView::findStringInCustomRepresentation):
2705         (WebKit::WebView::countStringMatchesInCustomRepresentation):
2706         * UIProcess/gtk/WebView.h:
2707
2708 2011-04-11  Daniel Bates  <dbates@webkit.org>
2709
2710         Attempt to fix the Qt Linux Release build after changeset 83550 <http://trac.webkit.org/changeset/83550>
2711         (https://bugs.webkit.org/show_bug.cgi?id=54159).
2712
2713         * WebKit2API.pri: Append UIProcess/API/C/WKResourceCacheManager.cpp to the list WEBKIT2_API_SOURCES.
2714
2715 2011-04-11  Sam Weinig  <sam@webkit.org>
2716
2717         Reviewed by Anders Carlsson.
2718
2719         Move focus management out of WebKit via  the UIClient
2720         <rdar://problem/8784068>
2721         https://bugs.webkit.org/show_bug.cgi?id=58278
2722
2723         * UIProcess/API/C/WKPage.h:
2724         * UIProcess/API/mac/PageClientImpl.h:
2725         * UIProcess/API/mac/PageClientImpl.mm:
2726         * UIProcess/API/qt/qwkpage.cpp:
2727         (QWKPage::QWKPage):
2728         * UIProcess/API/qt/qwkpage_p.h:
2729         * UIProcess/PageClient.h:
2730         * UIProcess/WebPageProxy.cpp:
2731         (WebKit::WebPageProxy::setFocus):
2732         * UIProcess/WebUIClient.cpp:
2733         (WebKit::WebUIClient::focus):
2734         (WebKit::WebUIClient::unfocus):
2735         * UIProcess/WebUIClient.h:
2736         * UIProcess/gtk/WebView.cpp:
2737         * UIProcess/gtk/WebView.h:
2738         * UIProcess/win/WebView.h:
2739         Remove PageClient::setFocus() in favor of WebUIClient::focus and WebUIClient::unfocus. 
2740
2741 2011-04-11  Alexey Proskuryakov  <ap@apple.com>
2742
2743         Reviewed by Maciej Stachowiak.
2744
2745         WebKit2: Cannot use Ctrl-Delete as a custom keyboard shortcut
2746         https://bugs.webkit.org/show_bug.cgi?id=58265
2747         <rdar://problem/9221468>
2748
2749         * WebProcess/WebPage/WebPage.cpp:
2750         (WebKit::WebPage::keyEvent): Added a comment explaining that doing work after DOM event
2751         dispatch isn't great.
2752         * WebProcess/WebPage/mac/WebPageMac.mm:
2753         (WebKit::WebPage::performNonEditingBehaviorForSelector): Added a comment explaining how this
2754         might be moved down to WebCore.
2755         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): This is now empty, since both Space
2756         and Backspace behaviors are implemented in WebCore.
2757
2758 2011-04-11  Anders Carlsson  <andersca@apple.com>
2759
2760         Try to fix the Windows build.
2761
2762         * UIProcess/win/WebInspectorProxyWin.cpp:
2763         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2764
2765 2011-04-11  Alexey Proskuryakov  <ap@apple.com>
2766
2767         Reviewed by Dan Bernstein.
2768
2769         REGRESSION (r83081): Esc key no longer removes current Kotoeri text operation
2770         https://bugs.webkit.org/show_bug.cgi?id=58274
2771         <rdar://problem/9263683>
2772
2773         * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::getMarkedRange): Wrap the returned
2774         temporary in RefPtr.
2775
2776 2011-04-11  Anders Carlsson  <andersca@apple.com>
2777
2778         Reviewed by Sam Weinig.
2779
2780         Remove m_urlAtProcessExit from WebPageProxy
2781         https://bugs.webkit.org/show_bug.cgi?id=58275
2782
2783         Get rid of m_urlAtProcessExit and replace some zeros with nullptrs.
2784
2785         * UIProcess/WebPageProxy.cpp:
2786         (WebKit::WebPageProxy::processDidCrash):
2787         * UIProcess/WebPageProxy.h:
2788
2789 2011-04-11  Anders Carlsson  <andersca@apple.com>
2790
2791         Reviewed by Adam Roben.
2792
2793         Remove the WebContext member variable from WebPageProxy
2794         https://bugs.webkit.org/show_bug.cgi?id=58271
2795         <rdar://problem/9148125>
2796
2797         * UIProcess/API/C/WKPage.cpp:
2798         (WKPageGetContext):
2799         * UIProcess/WebPageProxy.cpp:
2800         (WebKit::WebPageProxy::create):
2801         (WebKit::WebPageProxy::WebPageProxy):
2802         (WebKit::WebPageProxy::process):
2803         (WebKit::WebPageProxy::reattachToWebProcess):
2804         (WebKit::WebPageProxy::canShowMIMEType):
2805         (WebKit::WebPageProxy::receivedPolicyDecision):
2806         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2807         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2808         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2809         (WebKit::WebPageProxy::didCommitLoadForFrame):
2810         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2811         (WebKit::WebPageProxy::didFinishLoadForFrame):
2812         (WebKit::WebPageProxy::didFailLoadForFrame):
2813         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2814         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2815         (WebKit::WebPageProxy::didFirstLayoutForFrame):
2816         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2817         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
2818         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2819         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2820         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2821         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2822         (WebKit::WebPageProxy::decidePolicyForResponse):
2823         (WebKit::WebPageProxy::unableToImplementPolicy):
2824         (WebKit::WebPageProxy::willSubmitForm):
2825         (WebKit::WebPageProxy::mouseDidMoveOverElement):
2826         (WebKit::WebPageProxy::showContextMenu):
2827         (WebKit::WebPageProxy::contextMenuItemSelected):
2828         * UIProcess/WebPageProxy.h:
2829         * UIProcess/WebProcessProxy.cpp:
2830         (WebKit::WebProcessProxy::createWebPage):
2831         * UIProcess/mac/WebInspectorProxyMac.mm:
2832         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2833
2834 2011-04-11  Eric Carlson  <eric.carlson@apple.com>
2835
2836         Reviewed by Adam Roben.
2837
2838         Ignore context change callbacks when not on the main thread
2839         https://bugs.webkit.org/show_bug.cgi?id=58256
2840         <rdar://problem/9266090>
2841
2842         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
2843         (WebKit::LayerTreeHostCAWin::contextDidChangeCallback): Do nothing when not called
2844             on the main thread. This should only happen when no changes have actually 
2845             been committed to the context, eg. when a video frame has been added to an image
2846             queue, so return without triggering animations etc.
2847
2848 2011-04-11  Anders Carlsson  <andersca@apple.com>
2849
2850         Reviewed by Sam Weinig.
2851
2852         First step towards simplifying WebPageProxy/WebProcessProxy/WebContext ownership
2853         https://bugs.webkit.org/show_bug.cgi?id=58266
2854         <rdar://problem/9148125>
2855
2856         With this patch, the WKView holds a strong reference to a WebPageProxy. The 
2857         WebPageProxy in turn holds a strong reference to its WebProcessProxy. Finally,
2858         The WebProcessProxy holds a strong reference to its WebContext.
2859
2860         The WebContext holds a strong reference to the running WebProcessProxy which results
2861         in a reference cycle that's broken when the web process exits.
2862
2863         The reason for is to avoid crashes where WebPageProxy::process() returns null if the web process
2864         has crashed but has not yet been relaunched.
2865
2866         * UIProcess/WebContext.cpp:
2867         (WebKit::WebContext::disconnectProcess):
2868         Add comment.
2869
2870         (WebKit::WebContext::createWebPage):
2871         Return a PassRefPtr.
2872
2873         (WebKit::WebContext::relaunchProcessIfNecessary):
2874         Change this to return a WebPageProxy.
2875
2876         * UIProcess/WebPageProxy.cpp:
2877         (WebKit::WebPageProxy::create):
2878         This now takes a PassRefPtr<WebProcessProxy>.
2879
2880         (WebKit::WebPageProxy::WebPageProxy):
2881         Ditto.
2882
2883         (WebKit::WebPageProxy::~WebPageProxy):
2884         Call close() if necessary.
2885
2886         (WebKit::WebPageProxy::reattachToWebProcess):
2887         Replace the current process with the new process.
2888
2889         * UIProcess/WebProcessProxy.cpp:
2890         (WebKit::WebProcessProxy::create):
2891         Take a PassRefPtr<WebContext>.
2892         
2893         (WebKit::WebProcessProxy::WebProcessProxy):
2894         Ditto.
2895
2896         (WebKit::WebProcessProxy::webPage):
2897         Remove .get() now that the page map uses weak references.
2898
2899         (WebKit::WebProcessProxy::createWebPage):
2900         This now returns the created web page proxy.
2901
2902 2011-04-11  Adam Roben  <aroben@apple.com>
2903
2904         Dispatch sent messages to windows owned by the web process when waiting a sync CoreIPC reply
2905
2906         On Windows, windowed plugins' HWNDs are created as children of the WKView's window. This
2907         creates a cross-process window hierarchy, which in turn attaches the input states of the UI
2908         process's and web process's main threads (as if ::AttachThreadInput has been called). Having
2909         the input states attached means that changes to the input state (e.g., changing the focus
2910         window) can result in synchronous window messages being sent between the processes. This can
2911         result in deadlocks if the UI process changes the input state while handling a synchronous
2912         CoreIPC message from the web process. Since the web process isn't running its message loop
2913         while waiting for the reply, it never processes the messages Windows is sending it from the
2914         UI process.
2915
2916         The solution taken in this patch is to continue to dispatch sent (not posted) messages to
2917         windows created by the web process while waiting for a sync CoreIPC reply. Someday we can
2918         hopefully reduce the number of cases in which the UI process modifies the thread's input
2919         state while handling a synchronous message; see the bug for details.
2920
2921         Fixes <http://webkit.org/b/58239> <rdar://problem/8769302> REGRESSION (WebKit2): Deadlock
2922         clicking Flash plugin
2923
2924         Reviewed by Anders Carlsson.
2925
2926         * Platform/CoreIPC/BinarySemaphore.h:
2927         (CoreIPC::BinarySemaphore::event): Added. Simple getter to expose the underlying event
2928         HANDLE.
2929
2930         * Platform/CoreIPC/Connection.cpp:
2931         (CoreIPC::Connection::SyncMessageState::waitWhileDispatchingSentMessages): New Windows-only
2932         function that is used instead of wait() so that sent messages will continue to be
2933         dispatched.
2934         (CoreIPC::Connection::waitForSyncReply): Use waitWhileDispatchingSentMessages instead of
2935         wait on Windows. Our Client gives us the set of windows that need to have windows delivered
2936         to them.
2937
2938         * Platform/CoreIPC/Connection.h: Added new
2939         windowsToReceiveSentMessagesWhileWaitingForSyncReply function to Client.
2940
2941         * Platform/RunLoop.h: Added new dispatchSentMessagesUntil function to be used while waiting
2942         for a sync CoreIPC reply.
2943
2944         * Platform/win/RunLoopWin.cpp:
2945         (RunLoop::dispatchSentMessagesUntil): Added. If we have no windows to dispatch messages to,
2946         then just wait on the semaphore. Otherwise spin a ::MsgWaitForMultipleObjectsEx loop to
2947         detect when the semaphore is signaled, the timeout elapses, or sent messages are available,
2948         and handle each case appropriately.
2949
2950         * UIProcess/WebProcessProxy.h: Added new CoreIPC::Connection::Client function.
2951
2952         * UIProcess/win/WebProcessProxyWin.cpp: Added.
2953         (WebKit::WebProcessProxy::windowsToReceiveSentMessagesWhileWaitingForSyncReply): Just return
2954         an empty Vector. The web process never modifies the thread's input state while responding to
2955         a synchronous message, so we don't have anything to worry about here.
2956
2957         * WebProcess/WebProcess.h: Added new CoreIPC::Connection::Client function.
2958
2959         * WebProcess/win/WebProcessWin.cpp:
2960         (WebKit::addWindowToVectorIfOwnedByCurrentThread): New helper function to be called by
2961         ::EnumThreadWindows/::EnumChildWindows. Does what it says.
2962         (WebKit::WebProcess::windowsToReceiveSentMessagesWhileWaitingForSyncReply): Added. Returns
2963         all top-level windows created by this thread, descendants of those windows created by this
2964         thread, and descendants of WKViews' windows created by this thread.
2965
2966         * win/WebKit2.vcproj: Added WebProcessProxyWin.cpp.
2967
2968 2011-04-11  Jessie Berlin  <jberlin@apple.com>
2969
2970         Reviewed by Anders Carlsson.
2971
2972         WebKit2: Implement TextChecker on Windows
2973         https://bugs.webkit.org/show_bug.cgi?id=57862
2974
2975         Part 7: Implement getGuessesForWord, learnWord, and ignoreWord.
2976
2977         * UIProcess/API/C/win/WKTextChecker.cpp:
2978         (WKTextCheckerChangeSpellingToWord):
2979         * UIProcess/API/C/win/WKTextChecker.h:
2980
2981         * UIProcess/WebPageProxy.cpp:
2982         (WebKit::WebPageProxy::changeSpellingToWord):
2983         Make this function const since it does not modify the WebPageProxy and making it const
2984         allows WebTextChecker::changeSpellingToWord to take a const WebPageProxy.
2985         (WebKit::WebPageProxy::learnWord):
2986         * UIProcess/WebPageProxy.h:
2987
2988         * UIProcess/TextChecker.h:
2989         * UIProcess/win/TextCheckerWin.cpp:
2990         (WebKit::TextChecker::getGuessesForWord):
2991         Ask the TextCheckerClient for the guesses.
2992         (WebKit::TextChecker::learnWord):
2993         Tell the TextCheckerClient.
2994         (WebKit::TextChecker::ignoreWord):
2995         Ditto.
2996         * UIProcess/gtk/TextCheckerGtk.cpp:
2997         (WebKit::TextChecker::learnWord):
2998         Add an unused param that is necessary for Windows.
2999         * UIProcess/mac/TextCheckerMac.mm:
3000         (WebKit::TextChecker::learnWord):
3001         Ditto.
3002         * UIProcess/qt/TextCheckerQt.cpp:
3003         (WebKit::TextChecker::learnWord):
3004         Ditto.
3005
3006         * UIProcess/win/WebTextChecker.cpp:
3007         (WebKit::WebTextChecker::changeSpellingToWord):
3008         Tell the page.
3009         * UIProcess/win/WebTextChecker.h:
3010
3011         * UIProcess/win/WebTextCheckerClient.cpp:
3012         (WebKit::WebTextCheckerClient::guessesForWord):
3013         (WebKit::WebTextCheckerClient::learnWord):
3014         (WebKit::WebTextCheckerClient::ignoreWord):
3015         * UIProcess/win/WebTextCheckerClient.h:
3016
3017 2011-04-11  Anders Carlsson  <andersca@apple.com>
3018
3019         Reviewed by Sam Weinig.
3020
3021         Remove unused WebProcessProxy functions
3022         https://bugs.webkit.org/show_bug.cgi?id=58262
3023
3024         * UIProcess/WebProcessProxy.cpp:
3025         * UIProcess/WebProcessProxy.h:
3026
3027 2011-04-11  Anders Carlsson  <andersca@apple.com>
3028
3029         Reviewed by Sam Weinig.
3030
3031         Crash in WebPageProxy::countStringMatches
3032         https://bugs.webkit.org/show_bug.cgi?id=58255
3033         <rdar://problem/9243837>
3034
3035         * UIProcess/WebPageProxy.cpp:
3036         (WebKit::WebPageProxy::countStringMatches):
3037         Return early if the page is not valid.
3038
3039 2011-04-11  Sam Weinig  <sam@webkit.org>
3040
3041         Reviewed by Anders Carlsson.
3042
3043         WebKit2: links don’t update to look visited
3044         <rdar://problem/8806254>
3045         https://bugs.webkit.org/show_bug.cgi?id=58252
3046
3047         * WebProcess/WebProcess.cpp:
3048         (WebKit::WebProcess::visitedLinkStateChanged):
3049         (WebKit::WebProcess::allVisitedLinkStateChanged):
3050         * WebProcess/WebProcess.h:
3051         Remove use of vestigial sharedPageGroup and instead iterate set of
3052         page groups in use by the process.
3053
3054 2011-04-11  Brian Weinstein  <bweinstein@apple.com>
3055
3056         Reviewed by Adam Roben.
3057
3058         WebKit2: Windows 7 Gestures Window Bounce shouldn't require a sync message
3059         https://bugs.webkit.org/show_bug.cgi?id=58167
3060         <rdar://problem/9259813>
3061         
3062         Instead of making GestureDidScroll sync, have WebPageWin call from WebProcess ->
3063         UIProcess when the gesture causes the page to scroll to the beginning or the
3064         end of the document.
3065
3066         * UIProcess/PageClient.h:
3067         * UIProcess/WebPageProxy.cpp:
3068         (WebKit::WebPageProxy::gestureDidScroll): Not a sync message anymore.
3069         (WebKit::WebPageProxy::setGestureScrollingLimitReached): Tell the page client that the gesture
3070             scrolling limnit was reached.
3071         * UIProcess/WebPageProxy.h:
3072         * UIProcess/WebPageProxy.messages.in: Add a new message.
3073         * UIProcess/win/WebView.cpp:
3074         (WebKit::WebView::WebView): Initialize new variable.
3075         (WebKit::WebView::onGesture): Use the state of the member variable, not the response from
3076             the sync message.
3077         * UIProcess/win/WebView.h:
3078         (WebKit::WebView::setGestureScrollingLimitReached):
3079         * WebProcess/WebPage/WebPage.h:
3080         * WebProcess/WebPage/WebPage.messages.in:
3081         * WebProcess/WebPage/win/WebPageWin.cpp:
3082         (WebKit::scrollbarAtTopOfBottomOrDocument): Returns whether or not the scrollbar is at the
3083             top or bottom of the document.
3084         (WebKit::WebPage::gestureDidScroll): Track whether or not we started at the beginning
3085             or end of the document, and whether or not we ended at the beginning or end of the document,
3086             and send a message if the value changed.
3087
3088 2011-04-04  Jer Noble  <jer.noble@apple.com>
3089
3090         Reviewed by Maciej Stachowiak.
3091
3092         WK2: PDF: Find in page
3093         https://bugs.webkit.org/show_bug.cgi?id=57765
3094
3095         Support searching text within PDF documents.  Find requests must be routed from the
3096         WebPageProxy, through the PageClient, and to the WKView, where they can be passed to 
3097         the PDFViewController.
3098
3099         * UIProcess/API/mac/PDFViewController.h:
3100         * UIProcess/API/mac/PDFViewController.mm:
3101         (_PDFSelectionsAreEqual): Copied from WebPDFView.
3102         (-[WKPDFView _nextMatchFor:direction:caseSensitive:wrap:fromSelection:startInSelection:]): Copied from WebPDFView.
3103         (-[WKPDFView _countMatches:caseSensitive:]): Added.
3104         (WebKit::PDFViewController::findString): Added.
3105         (WebKit::PDFViewController::countStringMatches): Added.
3106         * UIProcess/PageClient.h:
3107         * UIProcess/API/mac/PageClientImpl.h:
3108         * UIProcess/API/mac/PageClientImpl.mm:
3109         (WebKit::PageClientImpl::findStringInCustomRepresentation): Added.
3110         (WebKit::PageClientImpl::countStringMatchesInCustomRepresentation): Added.
3111         * UIProcess/API/mac/WKViewInternal.h:
3112         * UIProcess/API/mac/WKView.mm:
3113         (-[WKView _findStringInCustomRepresentation:withFindOptions:maxMatchCount:]): Added.
3114         (-[WKView _countStringMatchesInCustomRepresentation:withFindOptions:maxMatchCount:]): Added.
3115         * UIProcess/WebPageProxy.h: Moved a number of find-related functions from private: to public: so
3116             they could be called from PDFViewController.
3117         * UIProcess/WebPageProxy.cpp:
3118         (WebKit::WebPageProxy::findString): Added. 
3119         (WebKit::WebPageProxy::countStringMatches): Added.
3120         * UIProcess/win/WebView.cpp:
3121         (WebKit::WebView::findStringInCustomRepresentation): Added stub.
3122         (WebKit::WebView::countStringMatchesInCustomRepresentation): Ditto.
3123         * UIProcess/win/WebView.h:
3124         * UIProcess/API/qt/qwkpage_p.h:
3125         (QWKPagePrivate::findStringInCustomRepresentation): Added stub.
3126         (QWKPagePrivate::countStringMatchesInCustomRepresentation): Added stub.
3127
3128 2011-04-11  Jessie Berlin  <jberlin@apple.com>
3129
3130         Reviewed by Anders Carlsson.
3131
3132         WebKit2: Implement TextChecker on Windows
3133         https://bugs.webkit.org/show_bug.cgi?id=57862
3134
3135         Part 6: Update the Spelling UI with the spelling and grammar mistakes.
3136
3137         * UIProcess/API/C/win/WKAPICastWin.h:
3138         (WebKit::toAPI):
3139         Make it possible to go from a WebCore::GrammarDetail to a WebGrammarDetail.
3140  
3141         * UIProcess/API/C/win/WKGrammarDetail.cpp:
3142         (WKGrammarDetailCreate):
3143         (WKGrammarDetailGetLocation):
3144         (WKGrammarDetailGetLength):
3145         (WKGrammarDetailCopyGuesses):
3146         (WKGrammarDetailCopyUserDescription):
3147         * UIProcess/API/C/win/WKGrammarDetail.h:
3148
3149         * UIProcess/API/C/win/WKTextChecker.cpp:
3150         (WKTextCheckerCheckSpelling):
3151         Tell the WebTextChecker.
3152         * UIProcess/API/C/win/WKTextChecker.h:
3153
3154         * UIProcess/WebPageProxy.cpp:
3155         (WebKit::WebPageProxy::contextMenuItemSelected):
3156         If the show/hide spelling UI is selected and the spelling UI is not showing, make sure to
3157         advance to the next misspelling (in this case, the first).
3158         This behavior matches that in WebCore and WKView.mm.
3159         (WebKit::WebPageProxy::advanceToNextMisspelling):
3160         Make this function const since it does not modify the WebPageProxy and making it const
3161         allows WebTextChecker::checkSpelling to take a const WebPageProxy.
3162         (WebKit::WebPageProxy::spellDocumentTag):
3163         (WebKit::WebPageProxy::updateSpellingUIWithMisspelledWord):
3164         (WebKit::WebPageProxy::updateSpellingUIWithGrammarString):
3165         * UIProcess/WebPageProxy.h:
3166
3167         * UIProcess/TextChecker.h:
3168         * UIProcess/win/TextCheckerWin.cpp:
3169         (WebKit::TextChecker::uniqueSpellDocumentTag):
3170         Tell the TextCheckerClient which WebPageProxy this tag is for.
3171         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3172         Tell the TextCheckerClient.
3173         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3174         Ditto.
3175         * UIProcess/mac/TextCheckerMac.mm:
3176         (WebKit::TextChecker::uniqueSpellDocumentTag):
3177         Add the new argument that is unused by this port.
3178         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3179         Ditto.
3180         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3181         Ditto.
3182         * UIProcess/gtk/TextCheckerGtk.cpp:
3183         (WebKit::TextChecker::uniqueSpellDocumentTag):
3184         Ditto.
3185         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3186         Ditto.
3187         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3188         Ditto.
3189         * UIProcess/qt/TextCheckerQt.cpp:
3190         (WebKit::TextChecker::uniqueSpellDocumentTag):
3191         Ditto.
3192         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3193         Ditto.
3194         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3195         Ditto.
3196
3197         * UIProcess/win/WebGrammarDetail.cpp:
3198         (WebKit::WebGrammarDetail::create):
3199         (WebKit::WebGrammarDetail::WebGrammarDetail):
3200         (WebKit::WebGrammarDetail::guesses):
3201         * UIProcess/win/WebGrammarDetail.h:
3202         (WebKit::WebGrammarDetail::location):
3203         (WebKit::WebGrammarDetail::length):
3204         (WebKit::WebGrammarDetail::userDescription):
3205
3206         * UIProcess/win/WebTextChecker.cpp:
3207         (WebKit::WebTextChecker::checkSpelling):
3208         Tell the page to advance to the next misspelling. This matches the WK1 WebView.cpp logic.
3209
3210         * UIProcess/win/WebTextChecker.h:
3211         * UIProcess/win/WebTextCheckerClient.cpp:
3212         (WebKit::WebTextCheckerClient::uniqueSpellDocumentTag):
3213         (WebKit::WebTextCheckerClient::toggleSpellingUIIsShowing):
3214         (WebKit::WebTextCheckerClient::updateSpellingUIWithMisspelledWord):
3215         (WebKit::WebTextCheckerClient::updateSpellingUIWithGrammarString):
3216         * UIProcess/win/WebTextCheckerClient.h:
3217
3218 2011-04-10  Maciej Stachowiak  <mjs@apple.com>
3219
3220         Not reviewed.
3221
3222         Remove extra inadvertantly commiteed changes from last change.
3223
3224         * WebProcess/com.apple.WebProcess.sb:
3225
3226 2011-04-10  Maciej Stachowiak  <mjs@apple.com>
3227
3228         Reviewed by Dan Bernstein.
3229
3230         REGRESSION: WebProcess spews sandboxing violations for outbound network traffic
3231         https://bugs.webkit.org/show_bug.cgi?id=58215
3232         <rdar://problem/9251695>
3233         
3234         * WebProcess/com.apple.WebProcess.sb: Restore some previously removed rules.
3235
3236 2011-04-10  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
3237
3238         Reviewed by Eric Seidel.
3239
3240         Require no undefined symbols during compilation.
3241
3242         [Qt] [WK2] WebKitTestRunner, QtWebProcess and WTRInjectBundle should fail to compile when there's undefined symbols
3243         https://bugs.webkit.org/show_bug.cgi?id=54896
3244         
3245         Add -Wl,--no-undefined to catch missing symbols early.
3246
3247         * WebProcess.pro:
3248
3249 2011-04-09  Geoffrey Garen  <ggaren@apple.com>
3250
3251         Not reviewed.
3252         
3253         Try recommitting some things svn left out of my last commit.
3254
3255         * WebProcess/Plugins/Netscape/NPJSObject.h:
3256
3257 2011-04-09  Geoffrey Garen  <ggaren@apple.com>
3258
3259         Not reviewed.
3260         
3261         Try recommitting some things svn left out of my last commit.
3262
3263         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3264         (WebKit::NPRuntimeObjectMap::evaluate):
3265
3266 2011-04-08  Alexey Proskuryakov  <ap@apple.com>
3267
3268         Reviewed by Darin Adler.
3269
3270         WebKit2: Safari doesn't respect cmd-arrows (and variations) as custom keyboard shortcuts
3271         https://bugs.webkit.org/show_bug.cgi?id=58175
3272         <rdar://problem/9060555>
3273
3274         The problem is that command handling should be different for events that come as keyDown:
3275         and those that come as performKeyEquivalent:. WebKit1 only tries custom "key bindings"
3276         when handling a keyDown:, letting a performKeyEquivalent: run through the whole responder
3277         chain first.
3278
3279         This would be very difficult to implement in WebKit2 because of how it re-sends the same
3280         event after web process handling. Luckily, we can both fix the bug and make the behavior
3281         more robust by not hardcoding key combinations.
3282
3283         * WebProcess/WebPage/WebPage.h: Edit performNonEditingBehaviorForSelector.
3284         * WebProcess/WebPage/mac/WebPageMac.mm:
3285         (WebKit::WebPage::executeKeypressCommandsInternal): When executing commands, also try
3286         executing editor commands in their non-editing meaning, which is usually scrolling.
3287         (WebKit::WebPage::performNonEditingBehaviorForSelector): Naive implementation with a chain
3288         of ifs, which is hopefully ok performance-wise for a dozen check.
3289         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Only kept two commands here that I
3290         couldn't easily move.
3291
3292 2011-04-08  Jessie Berlin  <jberlin@apple.com>
3293
3294         Reviewed by Anders Carlsson.
3295
3296         WebKit2: Show the substitutions panel on Mac and make sure the menu items titles are
3297         updated correctly.
3298         https://bugs.webkit.org/show_bug.cgi?id=58179
3299
3300         * UIProcess/API/mac/WKView.mm:
3301         (-[WKView validateUserInterfaceItem:]):
3302         The title of the context menu item should be opposite of whether or not the spelling panel
3303         is visible.
3304
3305         * UIProcess/WebPageProxy.cpp:
3306         (WebKit::WebPageProxy::contextMenuItemSelected):
3307         If the "Show/Hide" Substitutions item is selected, call toggleSubstitutionsPanelIsShowing.
3308         (WebKit::WebPageProxy::substitutionsPanelIsShowing):
3309         Ask the TextChecker.
3310         * UIProcess/WebPageProxy.h:
3311         * UIProcess/WebPageProxy.messages.in:
3312
3313         * UIProcess/TextChecker.h:
3314         * UIProcess/mac/TextCheckerMac.mm:
3315         (WebKit::TextChecker::substitutionsPanelIsShowing):
3316         As the shared NSSpellChecker if the substitutionsPanel is visible.
3317         (WebKit::TextChecker::toggleSubstitutionsPanelIsShowing):
3318         Order the substitutionsPanel out or front (copied from WKView.mm).
3319
3320         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3321         (WebKit::WebEditorClient::substitutionsPanelIsShowing):
3322         Send a sync message to the UI process to find out.
3323         It needs to be sync because the editor code relies on the value returned.
3324
3325 2011-04-08  Dan Bernstein  <mitz@apple.com>
3326
3327         Reviewed by Adele Peterson.
3328
3329         Fixed a bug where right-to-left frames incorrectly reported that they were pinned to the left
3330         when they were actually not.
3331
3332         * WebProcess/WebPage/WebPage.cpp:
3333         (WebKit::WebPage::didChangeScrollOffsetForMainFrame): Do not assume that the minimum scroll offset
3334         is zero, because it is not.
3335
3336 2011-04-08  Anders Carlsson  <andersca@apple.com>
3337
3338         Fix the Windows build.
3339
3340         * UIProcess/win/WebView.cpp:
3341         (WebKit::WebView::Drop):
3342
3343 2011-04-08  Jessie Berlin  <jberlin@apple.com>
3344
3345         Reviewed by Anders Carlsson.
3346
3347         WebKit2: Implement TextChecker on Windows
3348         https://bugs.webkit.org/show_bug.cgi?id=57862
3349
3350         Part 5: Implement the code show and hide the Spelling UI via the context menu item (both
3351         Windows and Mac).
3352
3353         * UIProcess/API/C/win/WKTextChecker.h:
3354         Add the new WKTextCheckerClient funtions.
3355
3356         * UIProcess/API/mac/WKView.mm:
3357         (-[WKView validateUserInterfaceItem:]):
3358         The title of the context menu item should be opposite of whether or not the spelling panel
3359         is visible.
3360
3361         * UIProcess/WebPageProxy.cpp:
3362         (WebKit::WebPageProxy::contextMenuItemSelected):
3363         If the "Show/Hide Spelling and Grammar" item is selected, call toggleSpellingUIIsShowing.
3364         (WebKit::WebPageProxy::spellingUIIsShowing):
3365         Call through to TextChecker.
3366         * UIProcess/WebPageProxy.h:
3367         * UIProcess/WebPageProxy.messages.in:
3368
3369         * UIProcess/TextChecker.h:
3370        * UIProcess/win/TextCheckerWin.cpp:
3371         (WebKit::TextChecker::spellingUIIsShowing):
3372         Call the TextCheckerClient.
3373         (WebKit::TextChecker::toggleSpellingUIIsShowing):
3374         Ditto.
3375         * UIProcess/mac/TextCheckerMac.mm:
3376         (WebKit::TextChecker::spellingUIIsShowing):
3377         Ask the shared NSSpellChecker if the spellingPanel is visible.
3378         (WebKit::TextChecker::toggleSpellingUIIsShowing):
3379         Order the spellingPanel out or front (copied from WKView.mm).
3380         * UIProcess/qt/TextCheckerQt.cpp:
3381         (WebKit::TextChecker::spellingUIIsShowing):
3382         Call notImplemented.
3383         (WebKit::TextChecker::toggleSpellingUIIsShowing):
3384         Ditto.
3385         * UIProcess/gtk/TextCheckerGtk.cpp:
3386         (WebKit::TextChecker::spellingUIIsShowing):
3387         Ditto.
3388         (WebKit::TextChecker::toggleSpellingUIIsShowing):
3389         Ditto.
3390  
3391         * UIProcess/win/WebTextCheckerClient.cpp:
3392         (WebKit::WebTextCheckerClient::spellingUIIsShowing):
3393         Call the client.
3394         (WebKit::WebTextCheckerClient::toggleSpellingUIIsShowing):
3395         Ditto.
3396         * UIProcess/win/WebTextCheckerClient.h:
3397
3398         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3399         (WebKit::WebEditorClient::spellingUIIsShowing):
3400         Send a sync message to the UI process to find out.
3401         It needs to be sync because the Editor code relies on the value returned.
3402
3403 2011-04-08  Anders Carlsson  <andersca@apple.com>
3404
3405         Reviewed by Dan Bernstein.
3406
3407         Sandboxing doesn't work if a local file is dropped on the content area
3408         https://bugs.webkit.org/show_bug.cgi?id=58177
3409         <rdar://problem/9019253>
3410
3411         When performing a drag and the dragging pasteboard contains a local file, create a
3412         sandbox extension and pass it along. If we end up loading the file, the sandbox extension
3413         tracker will consume the extension.
3414
3415         * UIProcess/API/mac/WKView.mm:
3416         (maybeCreateSandboxExtensionFromPasteboard):
3417         Add helper function.
3418
3419         (-[WKView performDragOperation:]):
3420         Create a sandbox extension handle and pass it to performDrag.
3421
3422         * UIProcess/WebPageProxy.cpp:
3423         (WebKit::WebPageProxy::dragEntered):
3424         (WebKit::WebPageProxy::dragUpdated):
3425         (WebKit::WebPageProxy::dragExited):
3426         Pass an empty sandbox extension handle to performDragControllerAction.
3427
3428         (WebKit::WebPageProxy::performDrag):
3429         Pass the sandbox extension handle along to performDragControllerAction.
3430
3431         (WebKit::WebPageProxy::performDragControllerAction):
3432         Send along the sandbox extension handle.
3433
3434         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3435         (WebKit::WebDragClient::willPerformDragDestinationAction):
3436         If the destination action is a load action, call WebPage::willPerformLoadDragDestinationAction.
3437
3438         * WebProcess/WebPage/WebPage.cpp:
3439         (WebKit::WebPage::performDragControllerAction):
3440         Create a sandbox extension.
3441
3442         (WebKit::WebPage::willPerformLoadDragDestinationAction):
3443         If we have a sandbox extension, pass it along to the sandbox extension tracker.
3444
3445         (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction):
3446         Call setPendingProvisionalSandboxExtension.
3447
3448         (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
3449         Call setPendingProvisionalSandboxExtension.
3450
3451         (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension):
3452         Factor code from beginLoad out into a separate function.
3453
3454         * WebProcess/WebPage/WebPage.messages.in:
3455         PerformDragControllerAction now takes a sandbox extension handle.
3456
3457 2011-04-08  Alice Liu  <alice.liu@apple.com>
3458
3459         Reviewed by Adam Roben.
3460
3461         https://bugs.webkit.org/show_bug.cgi?id=58151
3462         Crash after closing a Webview, in WebKit!WebCore::WindowMessageBroadcaster::SubclassedWndProc
3463
3464         * UIProcess/win/WebView.cpp:
3465         (WebKit::WebView::close):
3466         Resolve a difference between old WebKit WebView and WebKit2 WebView by destroying and clearing
3467         out WebKit2 WebView's HWND when closing. Not doing so was causing the WebView to remain in the
3468         list of WindowMessageBroadcaster listeners, and after closing the WebView, WindowMessageBroadcaster
3469         would message a dead WebView and crash.
3470
3471 2011-04-08  Anders Carlsson  <andersca@apple.com>
3472
3473         Reviewed by Adam Roben.
3474
3475         Make the drag operations be different functions
3476         https://bugs.webkit.org/show_bug.cgi?id=58169
3477
3478         Since we want performDrag to take a sandbox extension, separate the four
3479         drag operations out into different functions. No functionality change.
3480
3481         * UIProcess/API/mac/WKView.mm:
3482         (-[WKView draggingEntered:]):
3483         (-[WKView draggingUpdated:]):
3484         (-[WKView draggingExited:]):
3485         (-[WKView performDragOperation:]):
3486         * UIProcess/WebPageProxy.cpp:
3487         (WebKit::WebPageProxy::dragEntered):
3488         (WebKit::WebPageProxy::dragUpdated):
3489         (WebKit::WebPageProxy::dragExited):
3490         (WebKit::WebPageProxy::performDrag):
3491         * UIProcess/WebPageProxy.h:
3492         * UIProcess/win/WebView.cpp:
3493         (WebKit::WebView::DragEnter):
3494         (WebKit::WebView::DragOver):
3495         (WebKit::WebView::DragLeave):
3496         (WebKit::WebView::Drop):
3497
3498 2011-04-08  Anders Carlsson  <andersca@apple.com>
3499
3500         Reviewed by Adam Roben.
3501
3502         Parse 'DispatchOnConnectionQueue' in messages.in files
3503         https://bugs.webkit.org/show_bug.cgi?id=58168
3504
3505         Handle parsing multiple, space-separated attributes in .messages.in files. Keep track of
3506         'DispatchOnConnectionQueue' and rename 'delayed' to 'Delayed'.
3507
3508         * Scripts/webkit2/messages.py:
3509         * Scripts/webkit2/messages_unittest.py: