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