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